问:
How to transform data by pandas after loading them by make_csv_dataset or TextLineDataset
I'm training a model for a recommender system. The total number of the dataset is around 100 million samples and each sample is composed of an user id, an item id, and ~100 user features and 3 item features. Before merging the tables into the final dataset, the data are in 3 tables. The 1st table is the pairs of the users and the items, which has the columns:

```<code>user_id | item_id | label
</code>```

where label is whether the user purchased the item. The length of the 1st table is ~ 100M.
The 2nd and the 3rd table are the features of the users/items, like

```<code>id | feature_1 | ... | feature_n
</code>```

and the length of the user/item tables are 300k & 20k respectively.

Due to the limited memory capacity of my machine, I can't merge all the data into a giant table before training, which would produce a table of size ~ 100M x 100. Therefore, I want to merge only the necessary data as input to the model for each batch.

So far I see that make_csv_dataset or TextLineDataset provide the interface to read data from the disk by batch. For example, by make_csv_dataset:

```<code>ds_train = tf.data.experimental.make_csv_dataset(
    'path_to_data/pairs_train.csv',
    batch_size=32,
)
</code>```

I can write a function transform_pair_data, which transforms the output of next(ds_train.as_numpy_iterator()) as input for the model:

```<code>def transform_pair_data(raw_data):
    df = pd.DataFrame(raw_data, columns=raw_data.keys())
    df = df.merge(
        df_user_features,
        on='user_id',
        how='inner'
    ).merge(
        df_item_features,
        on='item_id',
        how='inner'
    )
    return df.to_numpy()
</code>```

However, if I run ds_train.map(transform_pair_data), I get the error:

```<code>...
NotImplementedError: Cannot convert a symbolic tf.Tensor (args_2:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported.
</code>```

How can I transform data by pandas after loading them by make_csv_dataset or TextLineDataset? Is it related to the version of tensorflow or numpy or something?

My package versions:

tensorflow-gpu            2.10.1

numpy                     1.21.6

Body:
I'm training a model for a recommender system. The total number of the dataset is around 100 million samples and each sample is composed of an user id, an item id, and ~100 user features and 3 item features. Before merging the tables into the final dataset, the data are in 3 tables. The 1st table is the pairs of the users and the items, which has the columns:

user_id | item_id | label

where label is whether the user purchased the item. The length of the 1st table is ~ 100M.
The 2nd and the 3rd table are the features of the users/items, like

id | feature_1 | ... | feature_n

and the length of the user/item tables are 300k & 20k respectively.

Due to the limited memory capacity of my machine, I can't merge all the data into a giant table before training, which would produce a table of size ~ 100M x 100. Therefore, I want to merge only the necessary data as input to the model for each batch.

So far I see that make_csv_dataset or TextLineDataset provide the interface to read data from the disk by batch. For example, by make_csv_dataset:

ds_train = tf.data.experimental.make_csv_dataset(
    'path_to_data/pairs_train.csv',
    batch_size=32,
)

I can write a function transform_pair_data, which transforms the output of next(ds_train.as_numpy_iterator()) as input for the model:

def transform_pair_data(raw_data):
    df = pd.DataFrame(raw_data, columns=raw_data.keys())
    df = df.merge(
        df_user_features,
        on='user_id',
        how='inner'
    ).merge(
        df_item_features,
        on='item_id',
        how='inner'
    )
    return df.to_numpy()

However, if I run ds_train.map(transform_pair_data), I get the error:

...
NotImplementedError: Cannot convert a symbolic tf.Tensor (args_2:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported.

How can I transform data by pandas after loading them by make_csv_dataset or TextLineDataset? Is it related to the version of tensorflow or numpy or something?

My package versions:

tensorflow-gpu            2.10.1

numpy                     1.21.6


来源: stackexchange

问:
Kotlin elvis operator vs "... == true" boolean expression check preformance
Assume we have nullable val a: Boolean?.

In code we want to assign value of a to another non-nullable variable val b: Boolean.

If a is true then we want b also to be true

If a is false or null the we want b to be false.

We can do this in 2 ways:

b = a ?: false

or

b = a == true

Which of the following approaches is better in terms of performance?

ContentLicense: CC BY-SA 4.0


问:
js file(hosted) loaded through script tag in index.html is not downloaded by app
We have an ionic ios app written using Angular and one of the script file is loaded by mentioning in index.html.
The script file is hosted and the ios app has been able to load the script file so far without issue

Code snippet:

```<code><script src="/bi/assets/js/embed-api/v1/embed-api.min.js" type="text/javascript" de></script>
</code>```

Strangely now the ios app doesn't load/download the script. I tried to include the domain name also in src like this and then the app magically loads:

```<code><script src="https://www.xyz123.com/bi/assets/js/embed-api/v1/embed-api.min.js" type="text/javascript" de></script>
</code>```

I am confused by this as to why a completely normal script loading would behave strange. Any theories for this behaviour is welcome

Body:
We have an ionic ios app written using Angular and one of the script file is loaded by mentioning in index.html.
The script file is hosted and the ios app has been able to load the script file so far without issue

Code snippet:

Strangely now the ios app doesn't load/download the script. I tried to include the domain name also in src like this and then the app magically loads:

I am confused by this as to why a completely normal script loading would behave strange. Any theories for this behaviour is welcome


问:
EntityListener saving null value in subclass
I have a Customer entity class and a CorporateCustomer entity class, CorporateCustomer extends Customer and Customer extends AuditEntity and AuditEntity extends BaseEntity. Both AuditEntity and BaseEntity have EntityListener and implemented prePersist value.

CorporateCustomer Entity

```<code>@Data
@Entity
@Table(name = "t_cust_corp")
@Where(clause = "sts_cd not in ('D', 'I')")
@TypeDef(typeClass = JsonBinaryType.class, name = "jsonb")
public class CorporateCustomer extends Customer {

    @Column(name = "cust_id")
    private UUID custId;

    @Type(type = "jsonb")
    @Column(columnDefinition = "jsonb", name = "obligor_dtl")
    private Serializable obligorDetail;
}
</code>```

Customer Entity

```<code>@Data
@Entity
@Table(name = "t_customer")
@Where(clause = "sts_cd not in ('D','I')")
@Inheritance(strategy = InheritanceType.JOINED)
public class Customer extends BaseEntity {
    @Column(name = "cif_no")
    private String cifNo;

    @Column(name = "cust_name")
    private String customerName;

    @Column(name = "mt_cust_typ_cd")
    private String customerTypeCd;

    @Column(name = "mt_cust_id_typ_cd")
    private String customerIdTypeCd;

    @Column(name = "cust_id_no")
    private String customerIdNo;
}
</code>```

BaseEntity (Library Generated)

```<code>@Generated
protected BaseEntity(final BaseEntity.BaseEntityBuilder<?, ?> b) {
    this.id = b.id;
    this.statusCode = b.statusCode;
    this.version = b.version;
    this.createdBy = b.createdBy;
    this.createdTime = b.createdTime;
    this.lastUpdatedBy = b.lastUpdatedBy;
    this.lastUpdatedTime = b.lastUpdatedTime;
}
</code>```

BaseEntityListener (part of codes)

```<code>@PrePersist
public void prePersist(BaseEntity baseEntity) {
    log.trace("prePersist baseEntity:" + baseEntity);
    baseEntity.setCreatedBy(requestSynchronizationManager.getUserIdForAudit());
    baseEntity.setCreatedTime(OffsetDateTime.now());
    baseEntity.setVersion(0);
    if (baseEntity.getStatusCode() == null) {
        baseEntity.setStatusCode(StatusCode.INACTIVE);
    }

}
</code>```

AuditEntity

```<code>@Data
@SuperBuilder
@MappedSuperclass
@NoArgsConstructor
@AllArgsConstructor
@EntityListeners({AuditEntityListener.class})
public abstract class AuditEntity extends BaseEntity {

    private static final long serialVersionUID = 1778847390000617814L;
    @Column(name = "crt_by_usr_nm", updatable = false)
    private String createdByUsername;

    @Column(name = "upd_by_usr_nm", insertable = false)
    private String updatedByUsername;

}
</code>```

AuditEntityListener (part of codes)

```<code>@Slf4j
@Component
public class AuditEntityListener {

    @PrePersist
    public void prePersist(AuditEntity auditEntity) {
        log.trace("prePersist auditEntity:" + auditEntity);
        auditEntity.setCreatedByUsername(requestSynchronizationManager.getLegalName());
    }
}
</code>```

During save Customer only, it works as charm, but if save CorporateCustomer, I got the error my BaseEntity property is null (hit null-constraint). Sts_cd should be automatically setValue during @prePersist. Below is the error,

```<code>Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "sts_cd" violates not-null constraint
  Detail: Failing row contains (0f0a348f-8ae2-493e-905e-20a82e87a4ae, 6eeadc61-ba2d-4ca3-9e09-2730d061ff82, {"rmNameCd": "01", "gamUnitCd": "EB", "lamUnitCd": "EB", "rmName..., [{"custCompany": "ABC Company", "extRatingKMV": 10, "lastApprove..., {"primarySectorCd": "C", "primaryIndustryCd": "46221", "primaryR..., null, null, null, null, null, null, null, 0).
</code>```

I debugged the code, the BaseEntityListener actually get triggered when creating new record using JPA saveAndFlush, but turn out hit this error. Anyone has idea on this?

Body:
I have a Customer entity class and a CorporateCustomer entity class, CorporateCustomer extends Customer and Customer extends AuditEntity and AuditEntity extends BaseEntity. Both AuditEntity and BaseEntity have EntityListener and implemented prePersist value.

CorporateCustomer Entity

@Data
@Entity
@Table(name = "t_cust_corp")
@Where(clause = "sts_cd not in ('D', 'I')")
@TypeDef(typeClass = JsonBinaryType.class, name = "jsonb")
public class CorporateCustomer extends Customer {

    @Column(name = "cust_id")
    private UUID custId;

    @Type(type = "jsonb")
    @Column(columnDefinition = "jsonb", name = "obligor_dtl")
    private Serializable obligorDetail;
}

Customer Entity

@Data
@Entity
@Table(name = "t_customer")
@Where(clause = "sts_cd not in ('D','I')")
@Inheritance(strategy = InheritanceType.JOINED)
public class Customer extends BaseEntity {
    @Column(name = "cif_no")
    private String cifNo;

    @Column(name = "cust_name")
    private String customerName;

    @Column(name = "mt_cust_typ_cd")
    private String customerTypeCd;

    @Column(name = "mt_cust_id_typ_cd")
    private String customerIdTypeCd;

    @Column(name = "cust_id_no")
    private String customerIdNo;
}

BaseEntity (Library Generated)

@Generated
protected BaseEntity(final BaseEntity.BaseEntityBuilder<?, ?> b) {
    this.id = b.id;
    this.statusCode = b.statusCode;
    this.version = b.version;
    this.createdBy = b.createdBy;
    this.createdTime = b.createdTime;
    this.lastUpdatedBy = b.lastUpdatedBy;
    this.lastUpdatedTime = b.lastUpdatedTime;
}

BaseEntityListener (part of codes)

@PrePersist
public void prePersist(BaseEntity baseEntity) {
    log.trace("prePersist baseEntity:" + baseEntity);
    baseEntity.setCreatedBy(requestSynchronizationManager.getUserIdForAudit());
    baseEntity.setCreatedTime(OffsetDateTime.now());
    baseEntity.setVersion(0);
    if (baseEntity.getStatusCode() == null) {
        baseEntity.setStatusCode(StatusCode.INACTIVE);
    }

}

AuditEntity

@Data
@SuperBuilder
@MappedSuperclass
@NoArgsConstructor
@AllArgsConstructor
@EntityListeners({AuditEntityListener.class})
public abstract class AuditEntity extends BaseEntity {

    private static final long serialVersionUID = 1778847390000617814L;
    @Column(name = "crt_by_usr_nm", updatable = false)
    private String createdByUsername;

    @Column(name = "upd_by_usr_nm", insertable = false)
    private String updatedByUsername;

}

AuditEntityListener (part of codes)

@Slf4j
@Component
public class AuditEntityListener {

    @PrePersist
    public void prePersist(AuditEntity auditEntity) {
        log.trace("prePersist auditEntity:" + auditEntity);
        auditEntity.setCreatedByUsername(requestSynchronizationManager.getLegalName());
    }
}

During save Customer only, it works as charm, but if save CorporateCustomer, I got the error my BaseEntity property is null (hit null-constraint). Sts_cd should be automatically setValue during @prePersist. Below is the error,

Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "sts_cd" violates not-null constraint
  Detail: Failing row contains (0f0a348f-8ae2-493e-905e-20a82e87a4ae, 6eeadc61-ba2d-4ca3-9e09-2730d061ff82, {"rmNameCd": "01", "gamUnitCd": "EB", "lamUnitCd": "EB", "rmName..., [{"custCompany": "ABC Company", "extRatingKMV": 10, "lastApprove..., {"primarySectorCd": "C", "primaryIndustryCd": "46221", "primaryR..., null, null, null, null, null, null, null, 0).

I debugged the code, the BaseEntityListener actually get triggered when creating new record using JPA saveAndFlush, but turn out hit this error. Anyone has idea on this?


问:
Travelerwp theme user booking failed
I am facing issue that makes the website nearly counted to be not working as a travel booking app, while using travelerwp theme. This theme is great for me when I compared to other such themes in the category. All features work well, unless in my site. When normal user logged in and try to create booking, the booking had been submitted well but successful page following it showed booking with Free sub total. And in the booking history weren't seen any booking recorded.

User create booking with according price

user create booking

booking form submitted successfully

booking detail error and booking email notification was not sent

When user not logged in the booking processes run completely well

Title: Travelerwp theme user booking failed


问:
Flutter markdown editor with mention dropdown support on web
I have actually spent a lot of time looking for a solution for this. Stackoverflow is my last resort. Before I dive in I would like to describe my requirements.

My requirements,

I need an editor like slack that automatically converts markdown to relevant TextStyle or html. For example if I type, ## Hello and press enter. it is styled as H2 styled text.

Moreover, I also need to show a dropdown whenever I press @ or # to select from a list of options.

In short, I need something like quip, slite or medium.

I was hoping that this will be easy in flutter, given half of these features are already there in Google's Gmail and other apps by google by havent yet found a single library that meets these requirements.

What I have already tried?

Quil: I found out by flutter_quill but for that I have to stick to a toolbar on the top. And no mentions support.

Zefyr and html_editor: I have tried these, but they are very buggy and slow. Moreover, they have very limited documentations.

Custom Flutter: Medium-like Text Editor. This is the most promising solution but it is lacking one essential feature of text editor. The article proposes that I divide the entire input field into multiple text fields which I can control using state. But this has one big problem that is, what if I want to select the entire body of text. Any hacks on this will be well appreciated.

If you have any questions and if the question isn't clear enough, please free to comment down below.


问:
Unable to get response from end url using XMLHTTP GET request in Excel VBA
I'm trying to retrieve a table from web using excel vba xmlhttp GET method.
When I send the end url(ie Url_Sub2), after sending the referrer url(ie Url_Main), an error output is displayed HTTP Status 405. Kindly help.

```<code>Option Explicit
Dim xmlhttp As New MSXML2.XMLHTTP60,html As New HTMLDocument
Dim sResp$, Url_Main$, Url_Sub1$, Url_Sub2$

Sub FetchHistoricalDataWorking()

    'URL
        Url_Main$ = "https://www1.nseindia.com/products/content/equities/equities/eq_security.htm"

        Url_Sub1$ = "https://www1.nseindia.com/marketinfo/sym_map/symbolCount.jsp?symbol=LUPIN"
        Url_Sub2$ = "https://www1.nseindia.com/products/dynaContent/common/productsSymbolMapping.jsp?symbol=LUPIN&segmentLink=3&symbolCount=2&series=ALL&dateRange=3month&fromDate=&toDate=&dataType=PRICEVOLUMEDELIVERABLE"

    'XML Link
        With xmlhttp
            .Open "GET", Url_Main$, False '/products/content/equities/equities/eq_security.htm"
            .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
            .setRequestHeader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
            .setRequestHeader "Accept-Encoding", "gzip, deflate, br"
            .setRequestHeader "Accept-Language", "en-IN,en-US;q=0.9,en;q=0.8"
            .setRequestHeader "Cache-Control", "no-cache"
            .setRequestHeader "Connection", "keep-alive"
            .setRequestHeader "Host", "www1.nseindia.com"
            .send
            While .readyState < 4: DoEvents: Wend

            .Open "GET", Url_Sub1$, False
            .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
            .setRequestHeader "Referer", Url_Main$
            .setRequestHeader "Accept", "*/*"
            .setRequestHeader "Accept-Encoding", "gzip, deflate, br"
            .setRequestHeader "Accept-Language", "en-IN,en-US;q=0.9,en;q=0.8"
            .setRequestHeader "Cache-Control", "no-cache"
            .setRequestHeader "Connection", "keep-alive"
            .setRequestHeader "Host", "www1.nseindia.com"
            .send
            While .readyState < 4: DoEvents: Wend

            .Open "GET", Url_Sub2$, False
            .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
            .setRequestHeader "Referer", Url_Main$
            .setRequestHeader "Accept", "*/*"
            .setRequestHeader "Accept-Encoding", "gzip, deflate, br"
            .setRequestHeader "Accept-Language", "en-IN,en-US;q=0.9,en;q=0.8"
            .setRequestHeader "Cache-Control", "no-cache"
            .setRequestHeader "Connection", "keep-alive"
            .setRequestHeader "Host", "www1.nseindia.com"
            .send
            While .readyState < 4: DoEvents: Wend

            sResp = .responseText
            Debug.Print sResp
        End With

        html.body.innerHTML = sResp
    '       Debug.Print oHttp.readyState & oHttp.Status

End Sub
</code>```

Body:
I'm trying to retrieve a table from web using excel vba xmlhttp GET method.
When I send the end url(ie Url_Sub2), after sending the referrer url(ie Url_Main), an error output is displayed HTTP Status 405. Kindly help.

Option Explicit
Dim xmlhttp As New MSXML2.XMLHTTP60,html As New HTMLDocument
Dim sResp$, Url_Main$, Url_Sub1$, Url_Sub2$

Sub FetchHistoricalDataWorking()

    'URL
        Url_Main$ = "https://www1.nseindia.com/products/content/equities/equities/eq_security.htm"

        Url_Sub1$ = "https://www1.nseindia.com/marketinfo/sym_map/symbolCount.jsp?symbol=LUPIN"
        Url_Sub2$ = "https://www1.nseindia.com/products/dynaContent/common/productsSymbolMapping.jsp?symbol=LUPIN&segmentLink=3&symbolCount=2&series=ALL&dateRange=3month&fromDate=&toDate=&dataType=PRICEVOLUMEDELIVERABLE"

    'XML Link
        With xmlhttp
            .Open "GET", Url_Main$, False '/products/content/equities/equities/eq_security.htm"
            .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
            .setRequestHeader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
            .setRequestHeader "Accept-Encoding", "gzip, deflate, br"
            .setRequestHeader "Accept-Language", "en-IN,en-US;q=0.9,en;q=0.8"
            .setRequestHeader "Cache-Control", "no-cache"
            .setRequestHeader "Connection", "keep-alive"
            .setRequestHeader "Host", "www1.nseindia.com"
            .send
            While .readyState < 4: DoEvents: Wend

            .Open "GET", Url_Sub1$, False
            .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
            .setRequestHeader "Referer", Url_Main$
            .setRequestHeader "Accept", "*/*"
            .setRequestHeader "Accept-Encoding", "gzip, deflate, br"
            .setRequestHeader "Accept-Language", "en-IN,en-US;q=0.9,en;q=0.8"
            .setRequestHeader "Cache-Control", "no-cache"
            .setRequestHeader "Connection", "keep-alive"
            .setRequestHeader "Host", "www1.nseindia.com"
            .send
            While .readyState < 4: DoEvents: Wend

            .Open "GET", Url_Sub2$, False
            .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
            .setRequestHeader "Referer", Url_Main$
            .setRequestHeader "Accept", "*/*"
            .setRequestHeader "Accept-Encoding", "gzip, deflate, br"
            .setRequestHeader "Accept-Language", "en-IN,en-US;q=0.9,en;q=0.8"
            .setRequestHeader "Cache-Control", "no-cache"
            .setRequestHeader "Connection", "keep-alive"
            .setRequestHeader "Host", "www1.nseindia.com"
            .send
            While .readyState < 4: DoEvents: Wend

            sResp = .responseText
            Debug.Print sResp
        End With

        html.body.innerHTML = sResp
    '       Debug.Print oHttp.readyState & oHttp.Status

End Sub


问:
How to enable per-path level api-key auth for all version when deploying multiple versions to same configuration in Google Clould Endpoint
I deployed 2 versions of openapi.yaml file to Google Cloud Endpoint using the Cloud Endpoint's versioning feature(i.e gcloud endpoints services deploy openapi_v1.yaml openapi_v2.yaml). Each version of the yaml file contains a version number and basepath different from the other, one endpoint that use api-key authentication, and definition for api-key authentication tag. After deployed to Endpoint, the configuration shows both yaml file, however deploying an api to Cloud Run ESPv2  using this configuration will only have api-key authentication turned on for the newer version.

Does anyone know if this is a known bug, or there is something else I need to do to enable authentication for all versions?

The .yaml file looks like the following. The two versions I used to test on are identical except version and bathpath:

```<code>swagger: "2.0"
info:
  description: "This API is used to connect 3rd-party ids to a common user identity"
  version: "1.0"
  title: "****"
host: "uie-dot-user-id-exchange.appspot.com"
basePath: "/v1"

...

- "https"
x-google-allow: all

paths:

  ...

  /ids/search:
    get:
      operationId: "id_search"
      produces:
      - "application/json"
      security:
      - api_key: []
      tags:
      - "Ids"
      summary: "Privileged endpoint. Provide any id (3rd party or otherwise) and get a hash of all ids associated with it."
      parameters:
      - in: "query"
        name: "id_type"
        description: "Type of id to search"
        required: true
        type: string
      - in: "query"
        name: "id_value"
        description: "Value of id to search"
        required: true
        type: string
      responses:
        200:
          description: "AssociatedIdsHash"
          schema:
            $ref: '#/definitions/AssociatedIdsHash'
        400:
          description: "Bad request. Requires both id_type and id_value query parameters."
        401:
          description: "Unauthorized. Please provide a valid api-key in the \"api-key\" header."
        404:
          description: "Not found - no entry found for key provided"

...

################ SECURITY DEFINITIONS ################
securityDefinitions:
  # This section configures basic authentication with an API key.
  api_key:
    type: "apiKey"
    name: "key"
    in: "query"
</code>```

I tried to make the api-key work in v1 and v2 but it only works in version 2.

Body:
I deployed 2 versions of openapi.yaml file to Google Cloud Endpoint using the Cloud Endpoint's versioning feature(i.e gcloud endpoints services deploy openapi_v1.yaml openapi_v2.yaml). Each version of the yaml file contains a version number and basepath different from the other, one endpoint that use api-key authentication, and definition for api-key authentication tag. After deployed to Endpoint, the configuration shows both yaml file, however deploying an api to Cloud Run ESPv2  using this configuration will only have api-key authentication turned on for the newer version.

Does anyone know if this is a known bug, or there is something else I need to do to enable authentication for all versions?

The .yaml file looks like the following. The two versions I used to test on are identical except version and bathpath:

swagger: "2.0"
info:
  description: "This API is used to connect 3rd-party ids to a common user identity"
  version: "1.0"
  title: "****"
host: "uie-dot-user-id-exchange.appspot.com"
basePath: "/v1"

...

- "https"
x-google-allow: all

paths:

  ...

  /ids/search:
    get:
      operationId: "id_search"
      produces:
      - "application/json"
      security:
      - api_key: []
      tags:
      - "Ids"
      summary: "Privileged endpoint. Provide any id (3rd party or otherwise) and get a hash of all ids associated with it."
      parameters:
      - in: "query"
        name: "id_type"
        description: "Type of id to search"
        required: true
        type: string
      - in: "query"
        name: "id_value"
        description: "Value of id to search"
        required: true
        type: string
      responses:
        200:
          description: "AssociatedIdsHash"
          schema:
            $ref: '#/definitions/AssociatedIdsHash'
        400:
          description: "Bad request. Requires both id_type and id_value query parameters."
        401:
          description: "Unauthorized. Please provide a valid api-key in the \"api-key\" header."
        404:
          description: "Not found - no entry found for key provided"

...

################ SECURITY DEFINITIONS ################
securityDefinitions:
  # This section configures basic authentication with an API key.
  api_key:
    type: "apiKey"
    name: "key"
    in: "query"

I tried to make the api-key work in v1 and v2 but it only works in version 2.


问:
Different output each time I am running the code
Following is my code:

import math
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt

#Input
c = 1500
rho= 1000
S= 0.07
mu =0.001
R0 =0.00001
PA=5
ω =100000
PO=1
PGO=1
Pa=1
A= (ω*R0/c)
B=Pa*(10**5)/(rho*(ω**2)*(R0**2))
C=(2*S)/(rho*(ω**2)*(R0**3))
D=(4*mu)/(rho*ω*(R0**2))

#Model Definition
def f(X, T):
    β = X[0]
    z = X[1]
    dβdT = z
    dzdT = (1/(β-(A*β*z)+(A*D)))*((-1.5*z**2)+(0.5*A*z**3)+(B*PGO/(β**3))-(C/β)-(D*z/β)-(B*PO)+(B*PA*math.sin(T))+
                              (A*B*PGO*z/(β**3))-(A*C*z/β)-(A*D*(z**2)/β)-(A*B*PO*z)+(A*B*PA*z*math.sin(T))-
                              (3*A*B*PGO*z/(β**3))+(A*C*z/β)+(A*D*(z**2)/β)+(A*B*PA*β*math.cos(T)))
    return [dβdT, dzdT]

#Initial Boundary Condition
X0 = [1, 0]

#Time Interval
T = np.linspace(0, 14, 250)

sol = odeint(f, X0, T)
β = sol[:,0]
z = sol[:,1]

t= (T/ω)*(10**6)   #micro seconds
R= β*R0*(10**6)    #micro meters
V= z*R0*ω

plt.plot(t,R)
plt.xlabel('t')
plt.legend('R')
```

Output 1:

Output 2:

Output 3:

I am running the following code in Anaconda Spyder, but each time the output graph is different and each time the graph is the same up to 60 microseconds in the x axis. After this point, the output of the graph is different is each run. The expected outcome is a repeating curve every time as up to 60 microseconds.

Body:
Following is my code:

import math
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt

#Input
c = 1500
rho= 1000
S= 0.07
mu =0.001
R0 =0.00001
PA=5
ω =100000
PO=1
PGO=1
Pa=1
A= (ω*R0/c)
B=Pa*(10**5)/(rho*(ω**2)*(R0**2))
C=(2*S)/(rho*(ω**2)*(R0**3))
D=(4*mu)/(rho*ω*(R0**2))

#Model Definition
def f(X, T):
    β = X[0]
    z = X[1]
    dβdT = z
    dzdT = (1/(β-(A*β*z)+(A*D)))*((-1.5*z**2)+(0.5*A*z**3)+(B*PGO/(β**3))-(C/β)-(D*z/β)-(B*PO)+(B*PA*math.sin(T))+
                              (A*B*PGO*z/(β**3))-(A*C*z/β)-(A*D*(z**2)/β)-(A*B*PO*z)+(A*B*PA*z*math.sin(T))-
                              (3*A*B*PGO*z/(β**3))+(A*C*z/β)+(A*D*(z**2)/β)+(A*B*PA*β*math.cos(T)))
    return [dβdT, dzdT]

#Initial Boundary Condition
X0 = [1, 0]

#Time Interval
T = np.linspace(0, 14, 250)

sol = odeint(f, X0, T)
β = sol[:,0]
z = sol[:,1]

t= (T/ω)*(10**6)   #micro seconds
R= β*R0*(10**6)    #micro meters
V= z*R0*ω

plt.plot(t,R)
plt.xlabel('t')
plt.legend('R')

Output 1:

Output 2:

Output 3:

I am running the following code in Anaconda Spyder, but each time the output graph is different and each time the graph is the same up to 60 microseconds in the x axis. After this point, the output of the graph is different is each run. The expected outcome is a repeating curve every time as up to 60 microseconds.


问:
PyQt5 custom widget split backghround?
I have had this happening multiple times. When I create a custom widget with an image in it all child widgets get seperated. How do I prevent that?

Full code that has the same outcome:

```<code>from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import sys

class CustomWidget(QWidget):
    def __init__(self):
        super(CustomWidget, self).__init__()
        self.layout = QHBoxLayout()
        self.setLayout(self.layout)

        self.setStyleSheet(r'QWidget {background-color:#353634;}')

        self.name_label = QLabel('name')
        self.qty_label = QLabel('999')
        self.image_pix = QPixmap(IMAGEPATH)
        self.image_pix = self.image_pix.scaled(48, 48)
        self.icon = QLabel()
        self.icon.setPixmap(self.image_pix)

        self.layout.addWidget(self.icon)
        self.layout.addWidget(self.name_label)
        self.layout.addWidget(self.qty_label)

class MainWindow(QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.width, self.height = 425,350
        self.resize(self.width, self.height)

        custom_widget = CustomWidget()
        self.setCentralWidget(custom_widget)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    win = MainWindow()
    win.show()
    app.exec()
    app.quit()
</code>```

Title: PyQt5 custom widget split backghround?

Body:
I have had this happening multiple times. When I create a custom widget with an image in it all child widgets get seperated. How do I prevent that?

Full code that has the same outcome:

from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import sys

class CustomWidget(QWidget):
    def __init__(self):
        super(CustomWidget, self).__init__()
        self.layout = QHBoxLayout()
        self.setLayout(self.layout)

        self.setStyleSheet(r'QWidget {background-color:#353634;}')

        self.name_label = QLabel('name')
        self.qty_label = QLabel('999')
        self.image_pix = QPixmap(IMAGEPATH)
        self.image_pix = self.image_pix.scaled(48, 48)
        self.icon = QLabel()
        self.icon.setPixmap(self.image_pix)

        self.layout.addWidget(self.icon)
        self.layout.addWidget(self.name_label)
        self.layout.addWidget(self.qty_label)

class MainWindow(QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.width, self.height = 425,350
        self.resize(self.width, self.height)

        custom_widget = CustomWidget()
        self.setCentralWidget(custom_widget)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    win = MainWindow()
    win.show()
    app.exec()
    app.quit()


问:
I am converting PDF to html using gufy/pdf-to-html package on GitHub . But it showing error that: Undefined array key "pages"
the controller code is below

```<code>public function generate(Request $req)
    {
        Config::set('pdftohtml.bin', 'C:/poppler-0.37/bin/pdftohtml.exe');
        Config::set('pdfinfo.bin', 'C:/poppler-0.37/bin/pdfinfo.exe');
        $pdf = new Pdf('document.pdf');
        $pdfDom = $pdf->getDom(['ignoreImages' => true]);
        $html = $pdf->html();
        $total_pages = $pdf->getPages();
        $html->goToPage(1);
        $paragraphs = $html->find('body > p');
</code>```

}

any help would be appreciated.

Body:
the controller code is below

public function generate(Request $req)
    {
        Config::set('pdftohtml.bin', 'C:/poppler-0.37/bin/pdftohtml.exe');
        Config::set('pdfinfo.bin', 'C:/poppler-0.37/bin/pdfinfo.exe');
        $pdf = new Pdf('document.pdf');
        $pdfDom = $pdf->getDom(['ignoreImages' => true]);
        $html = $pdf->html();
        $total_pages = $pdf->getPages();
        $html->goToPage(1);
        $paragraphs = $html->find('body > p');

}

any help would be appreciated.


问:
Laravel Eloquent query on first relation of one to many
I have Two Tables A and B
A can have more than B
the relation between them is that B has A_id
columns in B have A_id and date
I have a filter with status (status alpha = first B of A date is less than 30 days,beta = first B of A date is less than 60)
when trying to get the status I want to query on the first row in B which has A_id

```<code>public function alpha(){
    return $this->hasOne("App/B")->where('date','<',now()->subMonth(1)->toDateString())->where('date','>',now()->subMonth(2)->toDateString());
}
public function beta(){
    return $this->hasOne("App/B")->where('date','<',now()->subMonth(2)->toDateString());
}
</code>```

This seems to get the job done but failed in specific situation
imagine table B has two rows

id = 1 A_id=1 and date is 45 days old

id =2 A_id=1 and date is 70 days old

This should be an alpha since I'm only interested in the First date
but the query I've written returns on both alpha and beta
how can I fix my query to only check the first occurrence only
mind that I can't loop over A's after getting them since I'm using pagination

Body:
I have Two Tables A and B
A can have more than B
the relation between them is that B has A_id
columns in B have A_id and date
I have a filter with status (status alpha = first B of A date is less than 30 days,beta = first B of A date is less than 60)
when trying to get the status I want to query on the first row in B which has A_id

public function alpha(){
    return $this->hasOne("App/B")->where('date','<',now()->subMonth(1)->toDateString())->where('date','>',now()->subMonth(2)->toDateString());
}
public function beta(){
    return $this->hasOne("App/B")->where('date','<',now()->subMonth(2)->toDateString());
}

This seems to get the job done but failed in specific situation
imagine table B has two rows

id = 1 A_id=1 and date is 45 days old

id =2 A_id=1 and date is 70 days old

This should be an alpha since I'm only interested in the First date
but the query I've written returns on both alpha and beta
how can I fix my query to only check the first occurrence only
mind that I can't loop over A's after getting them since I'm using pagination


问:
How do I downgrade my ethers.js version from 5.7.2 to 5.6.1?
I'm building an NFT Marketplace demo. Whenever I try to click on 'Create an NFT' button, an Unhandled

```<code>Runtime Error pops up -

TypeError: Cannot read properties of undefined (reading 'length').
Call Stack
toUtf8Bytes
node_modules\@ethersproject\strings\lib.esm\utf8.js (176:20)
StringCoder.encode
node_modules\@ethersproject\abi\lib.esm\coders\string.js (12:47)
eval
node_modules\@ethersproject\abi\lib.esm\coders\array.js (49:0)
Array.forEach
<anonymous>
pack
node_modules\@ethersproject\abi\lib.esm\coders\array.js (43:0)
TupleCoder.encode
node_modules\@ethersproject\abi\lib.esm\coders\tuple.js (51:19)
AbiCoder.encode
node_modules\@ethersproject\abi\lib.esm\abi-coder.js (86:0)
Interface._encodeParams
node_modules\@ethersproject\abi\lib.esm\interface.js (253:0)
Interface.encodeFunctionData
node_modules\@ethersproject\abi\lib.esm\interface.js (295:0)
eval
node_modules\@ethersproject\contracts\lib.esm\index.js (125:0)
Generator.next
<anonymous>
fulfilled
node_modules\@ethersproject\contracts\lib.esm\index.js (5:42)

</code>```

`
I tried to resolve it by two methods suggested online -

Make changes to Infura 'projectId' and 'projectSecret' in .env file and change the 'createitem' function in 'create-nft.js' as well.

Downgrade the ethers.js from current version to 5.6.1, as all the later versions cause problems with Hardhat. But I don't how to downgrade ethers.js and can't find a link where it is stated clearly how to do it.

Body:
I'm building an NFT Marketplace demo. Whenever I try to click on 'Create an NFT' button, an Unhandled

Runtime Error pops up -

TypeError: Cannot read properties of undefined (reading 'length').
Call Stack
toUtf8Bytes
node_modules\@ethersproject\strings\lib.esm\utf8.js (176:20)
StringCoder.encode
node_modules\@ethersproject\abi\lib.esm\coders\string.js (12:47)
eval
node_modules\@ethersproject\abi\lib.esm\coders\array.js (49:0)
Array.forEach
<anonymous>
pack
node_modules\@ethersproject\abi\lib.esm\coders\array.js (43:0)
TupleCoder.encode
node_modules\@ethersproject\abi\lib.esm\coders\tuple.js (51:19)
AbiCoder.encode
node_modules\@ethersproject\abi\lib.esm\abi-coder.js (86:0)
Interface._encodeParams
node_modules\@ethersproject\abi\lib.esm\interface.js (253:0)
Interface.encodeFunctionData
node_modules\@ethersproject\abi\lib.esm\interface.js (295:0)
eval
node_modules\@ethersproject\contracts\lib.esm\index.js (125:0)
Generator.next
<anonymous>
fulfilled
node_modules\@ethersproject\contracts\lib.esm\index.js (5:42)

`
I tried to resolve it by two methods suggested online -

Make changes to Infura 'projectId' and 'projectSecret' in .env file and change the 'createitem' function in 'create-nft.js' as well.

Downgrade the ethers.js from current version to 5.6.1, as all the later versions cause problems with Hardhat. But I don't how to downgrade ethers.js and can't find a link where it is stated clearly how to do it.


问:
setting cookies with react-cookies to be read by DRF API
I want to set/remove a cookie on react web app when client switches between modes. I want the cookie to be sent with every request to the API which is using django rest framework, and use the value of the cookie to determine the kind of response. The web app and API are in different domains. I'm using react-cookie library to set the cookie which works fine on localhost but having issues setting it in other domains and will only let me use current domain for the cookie.

```<code>
setCookie('is_test',true,{domain:document.domain.match(/.[^.]*\.[^.]*$/)?.[0]||document.domain,path:'/'})}

</code>```

Thats the code I'm using to set the cookie, the regex is something I found to remove the subdomain (ex. www.testdomain.com converts to .testdomain.com) if there is any or just set the domain if its something like localhost

but when it is deployed to the actual domain the cookie doesn't get set. Also will the backend API read the cookie if the domain is set with the client domain or does it need to be the server domain that is used for the request. It doesn't let me use other domains outside of the current(client) domain

Body:
I want to set/remove a cookie on react web app when client switches between modes. I want the cookie to be sent with every request to the API which is using django rest framework, and use the value of the cookie to determine the kind of response. The web app and API are in different domains. I'm using react-cookie library to set the cookie which works fine on localhost but having issues setting it in other domains and will only let me use current domain for the cookie.

setCookie('is_test',true,{domain:document.domain.match(/.[^.]*\.[^.]*$/)?.[0]||document.domain,path:'/'})}

Thats the code I'm using to set the cookie, the regex is something I found to remove the subdomain (ex. www.testdomain.com converts to .testdomain.com) if there is any or just set the domain if its something like localhost

but when it is deployed to the actual domain the cookie doesn't get set. Also will the backend API read the cookie if the domain is set with the client domain or does it need to be the server domain that is used for the request. It doesn't let me use other domains outside of the current(client) domain


问:
Building package against older Rcpp version
I'm writing an R package for simulations using Rcpp. Rcpp project setup has added my Rcpp version as dependendy Rcpp (>= 1.0.9)

A project partner who is trying to run the simulations has Rcpp version 1.0.8. I did not see anything in the release notes of Rcpp 1.0.9 that would suggest, that the package wouldn't build on version 1.0.8 but I would want to try to build it before changing the dependency.

Would the following work to test this:

install Rcpp 1.0.8 from the CRAN archive to a local library

add the local library as first entry to library paths with .libPaths

call devtools::build


问:
seize and release transporters in any logic
[Model]
https://i.stack.imgur.com/xRIhB.jpg

I am trying to model a batches loaded  by 2 cranes (service block) on a transporters fleet. then transporters move to unloading area by another 2 cranes (for now represented in flow chat as a delay2 block ).

the problem i am facing with transporters i want them to have a first stop (delay 1) before they(loaded) carried the batch and move according to the path. i tried to model the first stop by a seize transporter ( destination to delay node), delay , after they stop, they carry on to their agent location ( batch) to be loaded i represent that by another seize( destination is agent) , move by  and release transporter after second delay.

i got a miss behavior after transporters been delayed and released in first delay ,as they didn't see the agents and carry on on their path ( some times they go to load and some time they don't).


问:
Postfunction enforce 3 transitions back to back , 2nd transition is not working
I am trying to write some postfunction to execute some transitions back to back. I get the following error message when I click on the menu item for executing the 3 transitions back to back.

I am supposed to transition from open to fixed, then from fixed to tested and from tested to completed. The first transition works as expected but the second one is not working, I don't really know why, I have tried printing the list of error or warning messages but they are both empty. Anyone knows what the problem is?

Here is my code:

```<code>package CombineTransitions

import com.atlassian.jira.issue.Issue;

import org.apache.log4j.Logger

import com.atlassian.jira.bc.issue.IssueService

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.issue.Issue;

import CombineTransitions.Configuration_CombineTransitions

import com.atlassian.jira.bc.issue.IssueService.IssueResult

import com.atlassian.jira.bc.issue.IssueService.TransitionValidationResult

def log1 = Logger.getLogger("atlassian-jira.log")

def combineTransitionsHashMap= Configuration_CombineTransitions.getCombineTransitionsHashMap()

def issueStatusTypeId = combineTransitionsHashMap["issueStatusTypeId"] as String;

def transitionFromOpentoFixed = combineTransitionsHashMap["transitionFromOpentoFixed"] as Integer;

def transitionFromFixedToTested = combineTransitionsHashMap["transitionFromFixedToTested"] as Integer;

def transitionFromTestedToCompleted = combineTransitionsHashMap["transitionFromTestedToCompleted"] as Integer;

def fixedStatusName = combineTransitionsHashMap["fixedStatusName"] as String;

def testedStatusName = combineTransitionsHashMap["testedStatusName"] as String;

def completedStatusName = combineTransitionsHashMap["completedStatusName"] as String;

def fixedStatusId = combineTransitionsHashMap["fixedStatusId"] as String;

def testedStatusId = combineTransitionsHashMap["testedStatusId"] as String;

def completedStatusId = combineTransitionsHashMap["completedStatusId"] as String;

if (issue.getStatus().getSimpleStatus().getId().equals(issueStatusTypeId)) {

        def ok = false

         ok=performTransition(transitionFromOpentoFixed, fixedStatusName, fixedStatusId);

         log.warn("MOUNA first boolean "+ok +" "+fixedStatusName)

   if(ok){

         ok= performTransition(transitionFromFixedToTested, testedStatusName, testedStatusId);

         log.warn("MOUNA second boolean "+ok +" "+testedStatusName)

         if(ok){

          ok= performTransition(transitionFromTestedToCompleted, completedStatusName, completedStatusId);

          log.warn("MOUNA third boolean "+ok +" "+completedStatusName)

         }

  }

}

def  performTransition(int transitionToBeDone, String destinationStatus, String statusId ) {

  log.warn("MOUNA  ORIGINAL STATUS "+ issue.getStatus()  + "DEST STATUS "+ destinationStatus)

  issue = ComponentAccessor.getIssueManager().getIssueObject(issue.id)

  def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

  String issueKey = issue.getKey()

  IssueService issueService = ComponentAccessor.getIssueService()

  def issueInputParameters = issueService.newIssueInputParameters()

  issueInputParameters.setComment("Transitioning issue from status "+ issue.getStatus().getName()+" to status "+ destinationStatus );

  TransitionValidationResult transitionValidationResult = issueService.validateTransition(currentUser, issue.id, transitionToBeDone, issueInputParameters)

  log.warn("MOUNA transitionValidationResult: "+transitionValidationResult + " actionID "+transitionValidationResult.getActionId()+"   transitionValidationResult.getAdditionInputs()   "+transitionValidationResult.getAdditionInputs()+" transitionValidationResult.getFieldValuesHolder().toString() "+

  transitionValidationResult.getFieldValuesHolder().toString()  )

  if (transitionValidationResult.isValid()) {

    IssueResult transitionResult = issueService.transition(currentUser, transitionValidationResult)

    issue.setStatusId(statusId)

    log.warn("MOUNA  STATUS "+ transitionResult.getIssue().getStatus().getName())

    return true

}else{

    log.warn("MOUNA 2 getErrorCollection() "+transitionValidationResult.getErrorCollection() )

    log.warn("MOUNA 3 getWarningCollection() "+transitionValidationResult.getWarningCollection().getWarnings().toString() )

  //  log.warn("MOUNA 4 "+issue.getStatus().getName() +" transitionToBeDone "+ transitionToBeDone +" destinationStatus "+destinationStatus)

    return false

}

}
</code>```

This is my log file where I am printing some values for debugging:

```<code>2022-12-22 10:32:27,239+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA second boolean false Tested
2022-12-22 10:32:27,239+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA 3 getWarningCollection() []
2022-12-22 10:32:27,239+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA 2 getErrorCollection() Errors: {}
2022-12-22 10:32:27,239+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA transitionValidationResult: com.atlassian.jira.bc.issue.IssueService$TransitionValidationResult@5325f11e actionID 111 transitionValidationResult.getAdditionInputs() null transitionValidationResult.getFieldValuesHolder().toString() [formToken:null]
2022-12-22 10:32:27,223+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA ORIGINAL STATUS IssueConstantImpl[[GenericEntity:Status][sequence,8][statuscategory,4][name,Fixed][iconurl,/images/icons/status_fixed-sag.gif][description,][id,10001]]DEST STATUS Tested
2022-12-22 10:32:27,223+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA first boolean true Fixed
2022-12-22 10:32:27,223+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA STATUS Open
2022-12-22 10:32:26,457+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA transitionValidationResult: com.atlassian.jira.bc.issue.IssueService$TransitionValidationResult@294cb9b9 actionID 71 transitionValidationResult.getAdditionInputs() [commentProperty:null, originalAssigneeId:JIRAUSER59200, comment:Transitioning issue from status Open to status Fixed, roleLevel:null, commentLevel:null, userKey:JIRAUSER59200] transitionValidationResult.getFieldValuesHolder().toString() [fixVersions:[], customfield_10298:CustomFieldParams: Readme Text. Params: {null=[]}., customfield_10002:CustomFieldParams: QA/QE Owner. Params: {null=[]}., customfield_10211:CustomFieldParams: Phase Missed. Params: {null=[]}., customfield_10531:CustomFieldParams: Fix Build. Params: {null=[]}., customfield_10215:CustomFieldParams: Test Steps. Params: {null=[]}., customfield_10217:CustomFieldParams: Source Control Ref.. Params: {null=[]}., formToken:null, customfield_10219:CustomFieldParams: Solution Description. Params: {null=[bm]}., customfield_19380:CustomFieldParams: Related Product Standard. Params: {null=[]}., comment:[levelPresent:true, comment:Transitioning issue from status Open to status Fixed, groupLevel:null, roleLevel:null], worklog:com.atlassian.jira.issue.fields.WorklogSystemField$WorklogValue$Builder$1@3ea48487, assignee:mouh]
2022-12-22 10:32:26,426+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA ORIGINAL STATUS IssueConstantImpl[[GenericEntity:Status][sequence,4][statuscategory,4][name,Open][iconurl,/images/icons/statuses/open.png][description,null][id,1]]DEST STATUS Fixed
</code>```

Body:
I am trying to write some postfunction to execute some transitions back to back. I get the following error message when I click on the menu item for executing the 3 transitions back to back.

I am supposed to transition from open to fixed, then from fixed to tested and from tested to completed. The first transition works as expected but the second one is not working, I don't really know why, I have tried printing the list of error or warning messages but they are both empty. Anyone knows what the problem is?

Here is my code:

package CombineTransitions

import com.atlassian.jira.issue.Issue;

import org.apache.log4j.Logger

import com.atlassian.jira.bc.issue.IssueService

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.issue.Issue;

import CombineTransitions.Configuration_CombineTransitions

import com.atlassian.jira.bc.issue.IssueService.IssueResult

import com.atlassian.jira.bc.issue.IssueService.TransitionValidationResult

def log1 = Logger.getLogger("atlassian-jira.log")

def combineTransitionsHashMap= Configuration_CombineTransitions.getCombineTransitionsHashMap()

def issueStatusTypeId = combineTransitionsHashMap["issueStatusTypeId"] as String;

def transitionFromOpentoFixed = combineTransitionsHashMap["transitionFromOpentoFixed"] as Integer;

def transitionFromFixedToTested = combineTransitionsHashMap["transitionFromFixedToTested"] as Integer;

def transitionFromTestedToCompleted = combineTransitionsHashMap["transitionFromTestedToCompleted"] as Integer;

def fixedStatusName = combineTransitionsHashMap["fixedStatusName"] as String;

def testedStatusName = combineTransitionsHashMap["testedStatusName"] as String;

def completedStatusName = combineTransitionsHashMap["completedStatusName"] as String;

def fixedStatusId = combineTransitionsHashMap["fixedStatusId"] as String;

def testedStatusId = combineTransitionsHashMap["testedStatusId"] as String;

def completedStatusId = combineTransitionsHashMap["completedStatusId"] as String;

if (issue.getStatus().getSimpleStatus().getId().equals(issueStatusTypeId)) {

        def ok = false

         ok=performTransition(transitionFromOpentoFixed, fixedStatusName, fixedStatusId);

         log.warn("MOUNA first boolean "+ok +" "+fixedStatusName)

   if(ok){

         ok= performTransition(transitionFromFixedToTested, testedStatusName, testedStatusId);

         log.warn("MOUNA second boolean "+ok +" "+testedStatusName)

         if(ok){

          ok= performTransition(transitionFromTestedToCompleted, completedStatusName, completedStatusId);

          log.warn("MOUNA third boolean "+ok +" "+completedStatusName)

         }

  }

}

def  performTransition(int transitionToBeDone, String destinationStatus, String statusId ) {

  log.warn("MOUNA  ORIGINAL STATUS "+ issue.getStatus()  + "DEST STATUS "+ destinationStatus)

  issue = ComponentAccessor.getIssueManager().getIssueObject(issue.id)

  def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

  String issueKey = issue.getKey()

  IssueService issueService = ComponentAccessor.getIssueService()

  def issueInputParameters = issueService.newIssueInputParameters()

  issueInputParameters.setComment("Transitioning issue from status "+ issue.getStatus().getName()+" to status "+ destinationStatus );

  TransitionValidationResult transitionValidationResult = issueService.validateTransition(currentUser, issue.id, transitionToBeDone, issueInputParameters)

  log.warn("MOUNA transitionValidationResult: "+transitionValidationResult + " actionID "+transitionValidationResult.getActionId()+"   transitionValidationResult.getAdditionInputs()   "+transitionValidationResult.getAdditionInputs()+" transitionValidationResult.getFieldValuesHolder().toString() "+

  transitionValidationResult.getFieldValuesHolder().toString()  )

  if (transitionValidationResult.isValid()) {

    IssueResult transitionResult = issueService.transition(currentUser, transitionValidationResult)

    issue.setStatusId(statusId)

    log.warn("MOUNA  STATUS "+ transitionResult.getIssue().getStatus().getName())

    return true

}else{

    log.warn("MOUNA 2 getErrorCollection() "+transitionValidationResult.getErrorCollection() )

    log.warn("MOUNA 3 getWarningCollection() "+transitionValidationResult.getWarningCollection().getWarnings().toString() )

  //  log.warn("MOUNA 4 "+issue.getStatus().getName() +" transitionToBeDone "+ transitionToBeDone +" destinationStatus "+destinationStatus)

    return false

}

}

This is my log file where I am printing some values for debugging:

2022-12-22 10:32:27,239+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA second boolean false Tested
2022-12-22 10:32:27,239+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA 3 getWarningCollection() []
2022-12-22 10:32:27,239+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA 2 getErrorCollection() Errors: {}
2022-12-22 10:32:27,239+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA transitionValidationResult: com.atlassian.jira.bc.issue.IssueService$TransitionValidationResult@5325f11e actionID 111 transitionValidationResult.getAdditionInputs() null transitionValidationResult.getFieldValuesHolder().toString() [formToken:null]
2022-12-22 10:32:27,223+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA ORIGINAL STATUS IssueConstantImpl[[GenericEntity:Status][sequence,8][statuscategory,4][name,Fixed][iconurl,/images/icons/status_fixed-sag.gif][description,][id,10001]]DEST STATUS Tested
2022-12-22 10:32:27,223+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA first boolean true Fixed
2022-12-22 10:32:27,223+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA STATUS Open
2022-12-22 10:32:26,457+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA transitionValidationResult: com.atlassian.jira.bc.issue.IssueService$TransitionValidationResult@294cb9b9 actionID 71 transitionValidationResult.getAdditionInputs() [commentProperty:null, originalAssigneeId:JIRAUSER59200, comment:Transitioning issue from status Open to status Fixed, roleLevel:null, commentLevel:null, userKey:JIRAUSER59200] transitionValidationResult.getFieldValuesHolder().toString() [fixVersions:[], customfield_10298:CustomFieldParams: Readme Text. Params: {null=[]}., customfield_10002:CustomFieldParams: QA/QE Owner. Params: {null=[]}., customfield_10211:CustomFieldParams: Phase Missed. Params: {null=[]}., customfield_10531:CustomFieldParams: Fix Build. Params: {null=[]}., customfield_10215:CustomFieldParams: Test Steps. Params: {null=[]}., customfield_10217:CustomFieldParams: Source Control Ref.. Params: {null=[]}., formToken:null, customfield_10219:CustomFieldParams: Solution Description. Params: {null=[bm]}., customfield_19380:CustomFieldParams: Related Product Standard. Params: {null=[]}., comment:[levelPresent:true, comment:Transitioning issue from status Open to status Fixed, groupLevel:null, roleLevel:null], worklog:com.atlassian.jira.issue.fields.WorklogSystemField$WorklogValue$Builder$1@3ea48487, assignee:mouh]
2022-12-22 10:32:26,426+0100 https-openssl-nio-443-exec-3 WARN mouh 632x4183x1 jj2112 10.248.75.15 /secure/CommentAssignIssue.jspa [c.o.scriptrunner.runner.ScriptBindingsManager] MOUNA ORIGINAL STATUS IssueConstantImpl[[GenericEntity:Status][sequence,4][statuscategory,4][name,Open][iconurl,/images/icons/statuses/open.png][description,null][id,1]]DEST STATUS Fixed


问:
Using Istio circuit breakers in production
I'd like to start using the http2MaxRequests circuit breaker in my Kubernetes based Istio service mesh, but the semantics are befuddling to me:

on the destination side, it does what I would expect: each Envoy will accept at most the specified number of concurrent requests, and will then reject new requests. Importantly, the configuration is based on the concurrency supported by each instance of my application server; when I scale the number of instances up or down, I don't need to change this configuration.

on the source side, things are a lot more messy. The http2MaxRequests setting specifies the number of concurrent requests from each source Envoy to the entire set of destination Envoys. I simply don't understand how this can possible work in production!

First off, different source applications have wildly different concurrency models; we have an Nginx proxy that supports a massive amount of concurrent requests per instance, and we have internal services that support a handful. Those source applications will themselves be scaled very differently, with e.g. Nginx having very few instances that make lots of requests. I would need a DestinationRule for each source application pertaining to each destination service.

Even then, the http2MaxRequests setting limits the concurrent requests to the entire destination service, not to each individual instance (endpoint). This fundamentally breaks the notion of autoscaling, the entire point of which is to vary the capacity as needed.

What I would love to see is a way to enforce at the source side a destination-instance concurrency limit; that is, to tie the limit not to the entire Envoy cluster, but to each Envoy endpoint instead. That would make it actually useful for me, as I could then base the configuration on the concurrency supported by each instance of my service, which is a constant factor.


问:
Why my RabbitMQ Connections (in Kuberntes) are getting Blocked / Idle after 2 Hours?
I'm testing my Backend and using a StatefullSet Cluster of 3 RabbitMQ replicas , and using a client to test the Backend with "15" Users per Second.

We're using the NPM Package of

```<code>"amqplib": "0.10.3"
</code>```

After around 2 hours I get that all my RabbitMQ connections are getting closed , as follows:

After around those 2 hours I'm left with only a 4-5 active connections and the reset are idle and then they become blocked.

Here is my RabbitMQ connection handling:

```<code> import * as amqplib from 'amqplib'
 import { Connection } from "amqplib";

 async createChannel() {
    if (!this.connection) {
      this.connection = await this.connect();
      if (!this.connection) return;
      this.connection.on('close', () => this.handleConnectionClosed('close', {}));
      this.connection.on('error', (error) => this.handleConnectionClosed('error', { error }));
      this.connection.on('block', (blocked) => this.handleConnectionClosed('block', { blocked }));
    }

    if (!this.connectionChannel) {
      this.connectionChannel = await this.connection.createChannel().catch((error) => {
        this.handleConnectionClosed('close', error)
      });
      await this.connectionChannel.prefetch(config.queue.concurrentMessages);
      this.connectionError = null;
    }
    return this.connectionChannel;
  }
</code>```

And this is the Queues properties:

```<code>  async init(): Promise<void> {
    try {
      this.setSettings();
      this.queueName = this.settings?.serviceName;

      await this.createRejectedMessagesExchange();

      this.exchange = await this.createDirect(this.settings.exchangeName, {
        durable: true,
        autoDelete: false,
        [this.settings.deadLetterExchangeHeaderKey]: this.settings.deadLetterExchangeName,
      });
    } catch (error) {
      throw error;
    }
  }
</code>```

Why are all the connection getting idle or blocked within this short period of time ?

Body:
I'm testing my Backend and using a StatefullSet Cluster of 3 RabbitMQ replicas , and using a client to test the Backend with "15" Users per Second.

We're using the NPM Package of

"amqplib": "0.10.3"

After around 2 hours I get that all my RabbitMQ connections are getting closed , as follows:

After around those 2 hours I'm left with only a 4-5 active connections and the reset are idle and then they become blocked.

Here is my RabbitMQ connection handling:

 import * as amqplib from 'amqplib'
 import { Connection } from "amqplib";

 async createChannel() {
    if (!this.connection) {
      this.connection = await this.connect();
      if (!this.connection) return;
      this.connection.on('close', () => this.handleConnectionClosed('close', {}));
      this.connection.on('error', (error) => this.handleConnectionClosed('error', { error }));
      this.connection.on('block', (blocked) => this.handleConnectionClosed('block', { blocked }));
    }

    if (!this.connectionChannel) {
      this.connectionChannel = await this.connection.createChannel().catch((error) => {
        this.handleConnectionClosed('close', error)
      });
      await this.connectionChannel.prefetch(config.queue.concurrentMessages);
      this.connectionError = null;
    }
    return this.connectionChannel;
  }

And this is the Queues properties:

  async init(): Promise<void> {
    try {
      this.setSettings();
      this.queueName = this.settings?.serviceName;

      await this.createRejectedMessagesExchange();

      this.exchange = await this.createDirect(this.settings.exchangeName, {
        durable: true,
        autoDelete: false,
        [this.settings.deadLetterExchangeHeaderKey]: this.settings.deadLetterExchangeName,
      });
    } catch (error) {
      throw error;
    }
  }

Why are all the connection getting idle or blocked within this short period of time ?


问:
Flex-slots intermittently unable to execute trivial queries
I am running some tests using flex-slots. I have created a flex-slot commitment/reservation of 100 using QUERY as the type, and assigned it to my project. There have no other queries running concurrently. I am using a trivial query without cached results and mode set to INTERACTIVE to test performance. Everything is running in the US multi-region.

The table I am querying has just 1.2M rows (only 86MB), and is the public wikipedia dataset found in bigquery-samples.wikipedia_benchmark.Wiki1M.

This is the query:

```<code>SELECT
  SUM(views) AS total_views,
  title,
  LANGUAGE
FROM
  `bigquery-samples.wikipedia_benchmark.Wiki1M`
WHERE
  LANGUAGE='en'
  AND TITLE LIKE "%Germany%"
GROUP BY
  title,
  LANGUAGE
ORDER BY
  total_views DESC;
</code>```

A successful run (e.g. bquxjob_1f741592_1853646efb9) runs in under 1 second and uses on average less than a single slot. 100 slots for this query should be more than adequate.

However, intermittently the query (e.g. bquxjob_1913d525_185365564ea) fails with:

```<code>"Resources exceeded during query execution: Your project or organization exceeded the maximum disk and memory limit available for shuffle operations. Consider provisioning more slots, reducing query concurrency, or using more efficient logic in this job."
</code>```

Is there a reason why this trivial query would be failing even with 100 slots assigned and no other queries running concurrently?

Body:
I am running some tests using flex-slots. I have created a flex-slot commitment/reservation of 100 using QUERY as the type, and assigned it to my project. There have no other queries running concurrently. I am using a trivial query without cached results and mode set to INTERACTIVE to test performance. Everything is running in the US multi-region.

The table I am querying has just 1.2M rows (only 86MB), and is the public wikipedia dataset found in bigquery-samples.wikipedia_benchmark.Wiki1M.

This is the query:

SELECT
  SUM(views) AS total_views,
  title,
  LANGUAGE
FROM
  `bigquery-samples.wikipedia_benchmark.Wiki1M`
WHERE
  LANGUAGE='en'
  AND TITLE LIKE "%Germany%"
GROUP BY
  title,
  LANGUAGE
ORDER BY
  total_views DESC;

A successful run (e.g. bquxjob_1f741592_1853646efb9) runs in under 1 second and uses on average less than a single slot. 100 slots for this query should be more than adequate.

However, intermittently the query (e.g. bquxjob_1913d525_185365564ea) fails with:

"Resources exceeded during query execution: Your project or organization exceeded the maximum disk and memory limit available for shuffle operations. Consider provisioning more slots, reducing query concurrency, or using more efficient logic in this job."

Is there a reason why this trivial query would be failing even with 100 slots assigned and no other queries running concurrently?


问:
What is type of shift ALU perform?
Does the ALU perform an arithmetic or a logical shift(Right)?

am asking about signed number for example -128 shift right is -64 or 64 ? What is type of shift does ALU perform?

Title: What is type of shift ALU perform?


问:
Does the max size of an EKS ASG have to be exactly double the min and desired size
I've been told that the max size of my EKS ASG has to be double the min size for when the environment gets rebuilt...but I don't really understand why it has to be exactly double the min size...can anyone explain this...I've been googling without success...I think it's something like this...if I have a min and desired size of 2 and a maximum of only 3..then it could be that there are 2 bad instances and only 1 good instance and then there is not enough space for another 1 good instance to be spun up...is that right?</p>


问:
Hello I am facing an issue regarding maven dependencies in springboot project. While I am changing the version of org.apache.poi dependency version
I am facing build failure in Java spring project when I am updating the poi version from org.apache.poi 3.17 to 4.1.1. the 4.1.1 jar is not downloading to the libraries and build is getting failed. And the error is Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce(enforcer).
Please help me to solve this.
Thank you.

I tried adding jar file from external still same issue.


问:
React quill toolbar issue
I my using react quill to create journal in website. we also created app for android and ios. now when i indent on right side form web then it won't show on phone and vice versa.

any solution for this problem.

i try to replace react-quill class with custom indent like padding then it was not working in web.

Title: React quill toolbar issue


问:
Jenkins testing dynamic choise parameter
I am quiet having a hard time testing dynamic choice parameter plugin in Jenkins.

We are using scripted pipelines and looking like:

```<code>choiceParameter {
    name('pythonParams')
    description('Select environment from the dropdown list')
    choiceType('PT_SINGLE_SELECT')
    filterable(false)
    filterLength(0)
    randomName(null)
    script {
        groovyScript {
            script {
                script("""
                    import groovy.json.JsonSlurper
                    def envs = new JsonSlurper().parse('some.url/to/json/file'.toURL())
                    return envs
                """)
                sandbox(true)
            }
            fallbackScript {
                script("return ['ERROR: Could not get environments']")
                sandbox(true)
            }
        }
    }
}
</code>```

Instead of testing this script manually in the sandbox, I would like to test this automatically. But never seen something like this in Jenkins.

Someone have an idea?

Body:
I am quiet having a hard time testing dynamic choice parameter plugin in Jenkins.

We are using scripted pipelines and looking like:

choiceParameter {
    name('pythonParams')
    description('Select environment from the dropdown list')
    choiceType('PT_SINGLE_SELECT')
    filterable(false)
    filterLength(0)
    randomName(null)
    script {
        groovyScript {
            script {
                script("""
                    import groovy.json.JsonSlurper
                    def envs = new JsonSlurper().parse('some.url/to/json/file'.toURL())
                    return envs
                """)
                sandbox(true)
            }
            fallbackScript {
                script("return ['ERROR: Could not get environments']")
                sandbox(true)
            }
        }
    }
}

Instead of testing this script manually in the sandbox, I would like to test this automatically. But never seen something like this in Jenkins.

Someone have an idea?


问:
Call Salesforce Field Service Mobile flow for Service Report
I am designing a Field Service Mobile Flow for a Salesforce instance using the Field Service Lightning package to manage technicians with service appointments in the field. The flow will be presented to technicians in the field in the Salesforce Field Service Mobile app on iOS devices.

I want to create a flow to finalize a ServiceAppointment, answering final questions. After the flow is finished successfully, I want to call another flow to start creation of the ServiceReport.

According to Salesforce help on Capture Customer Signatures on Service Reports with a Flow you can create your flow and add it in the Field Service Mobile Settings as an app extension with the Name Service_Report_Flow: [...] when the mobile app detects the Service_Report_Flow name, it launches the Service Report preview interface when your flow completes.

BUT, this will start the creation of the ServiceReport if the flow ends, even if in an unsuccessful state, e.g. setting the final state of the ServiceAppointment to status "Cannot complete". In this case I don't want to start direct creation of the ServiceReport.

As additional caveat, if you setup different Field Service Mobile Settings (e.g. for different languages), you can only use the app extension Service_Report_Flow once (must be unique), i.e. only for one language...

Is there any way to explicitly CALL the flow / process to start creation of ServiceReport from my flow in the completed-branch?

A very simplified view of my desired approach

I tried creating a minimal flow, one screen stating ServiceReport will be created, adding it as an app extension with name Service_Report_Flow and calling it from the completed-branch in my flow, but this doesn't seem to work. The flow is called, but not detected as Service_Report_Flow and hence creation of ServiceReport is not started.


问:
Connect Spring Boot postgresql database with IAM Authentication
I have an Autentication Failed error when try to connect to SQL through IAM. The thing is the account name is correct since I double-checked on GCP console.

```<code>2022-12-22 09:54:23.333 ERROR 66136 --- [           main] com.zaxxer.hikari.pool.HikariPool        : APPHikariCP - Exception during pool initialization.
org.postgresql.util.PSQLException: FATAL: Cloud SQL IAM service account authentication failed for user "account@account.iam"
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:613) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:161) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.Driver.makeConnection(Driver.java:465) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.Driver.connect(Driver.java:264) ~[postgresql-42.2.18.jar:42.2.18]

    [...]
</code>```

This my yaml file details:

```<code>spring:
  profiles:
    active: postgresql
  cloud:
    gcp:
      sql:
        enabled: true
        database-name: ${DB_NAME:appdbname}
        instance-connection-name: ${INSTANCE_NAME}
      credentials:
        location: file:${SERVICE_ACCOUNT_JSON}
  groovy:
    template:
      check-template-location: false
  datasource:
    hikari:
      minimum-idle: ${CP_MIN_IDLE:5}
      maximum-pool-size: ${CP_MAX_POOL_SIZE:20}
      pool-name: APPHikariCP
      max-lifetime: ${CP_MAX_LIFETIME:3540000}
      data-source-properties:
        socketFactory: ${DATA_SOURCE_SOCKET_FACTORY}
        cloudSqlInstance: ${DATA_SOURCE_CLOUD_SQL_INSTANCE}
        enableIamAuth: true
        sslmode: disable
    url: ${SPRING_DATA_SOURCE_URL}
    driver-class-name: ${DB_DRIVER_CLASS_NAME}
    username: ${DATA_SOURCE_USERNAME_IAM}
    password: ${DATA_SOURCE_PASSWORD}
</code>```

Thank you so much for your time.

Body:
I have an Autentication Failed error when try to connect to SQL through IAM. The thing is the account name is correct since I double-checked on GCP console.

2022-12-22 09:54:23.333 ERROR 66136 --- [           main] com.zaxxer.hikari.pool.HikariPool        : APPHikariCP - Exception during pool initialization.
org.postgresql.util.PSQLException: FATAL: Cloud SQL IAM service account authentication failed for user "account@account.iam"
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:613) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:161) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.Driver.makeConnection(Driver.java:465) ~[postgresql-42.2.18.jar:42.2.18]
    at org.postgresql.Driver.connect(Driver.java:264) ~[postgresql-42.2.18.jar:42.2.18]

    [...]

This my yaml file details:

spring:
  profiles:
    active: postgresql
  cloud:
    gcp:
      sql:
        enabled: true
        database-name: ${DB_NAME:appdbname}
        instance-connection-name: ${INSTANCE_NAME}
      credentials:
        location: file:${SERVICE_ACCOUNT_JSON}
  groovy:
    template:
      check-template-location: false
  datasource:
    hikari:
      minimum-idle: ${CP_MIN_IDLE:5}
      maximum-pool-size: ${CP_MAX_POOL_SIZE:20}
      pool-name: APPHikariCP
      max-lifetime: ${CP_MAX_LIFETIME:3540000}
      data-source-properties:
        socketFactory: ${DATA_SOURCE_SOCKET_FACTORY}
        cloudSqlInstance: ${DATA_SOURCE_CLOUD_SQL_INSTANCE}
        enableIamAuth: true
        sslmode: disable
    url: ${SPRING_DATA_SOURCE_URL}
    driver-class-name: ${DB_DRIVER_CLASS_NAME}
    username: ${DATA_SOURCE_USERNAME_IAM}
    password: ${DATA_SOURCE_PASSWORD}

Thank you so much for your time.


问:
How to let blob URL convert to Image
How can i display these blob url to the Image? I am using Vuejs to upload the photo and want to preview the uploaded image.

//html

```<code><td><ion-input type="file"  @ionChange="loadImage($event)">
    <img v-if="Imageurl" :src="Imageurl" />
</ion-input></td>
</code>```
```<code>const file = e.detail.value;
      var binaryData = [];
      binaryData.push(file);
      this.Imageurl = window.URL.createObjectURL(new Blob(binaryData, {type: "image/*"}))
      alert(this.Imageurl);
</code>```

this is the alert return

Title: How to let blob URL convert to Image

Body:
How can i display these blob url to the Image? I am using Vuejs to upload the photo and want to preview the uploaded image.

//html

<ion-input type="file"  @ionChange="loadImage($event)">

</ion-input>

const file = e.detail.value;
      var binaryData = [];
      binaryData.push(file);
      this.Imageurl = window.URL.createObjectURL(new Blob(binaryData, {type: "image/*"}))
      alert(this.Imageurl);

this is the alert return


问:
Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist (jenkins, docker, ansible)
I am getting (Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist) error when I try to build docker image having  a centos installation script.
this is the docker file script
this is the error I got

Here I used a ubuntu server where ansible installed, when Jenkins get a docker file from git, ansible build the docker image.
In this process the error occurs when the Jenkins pipeline starts docker build.

Thank you!!!

run  the below code but no use
sudo chmod 666 /var/run/docker.sock

added user group still same error
usermod -a -G docker jenkins


问:
Some questions about pillow
close now this post close now .</p>

Title: Some questions about pillow

Body: close now this post close now .


问:
Bibtex reference recognition error despite following the overleaf tutorial or available guides
I am using bibtex in my project work and despite adding the bib file it isn't recognizing the citations put into here is my one of the attempts

```<code>\documentclass{report}
\usepackage{graphicx}
\usepackage{inputenc}

\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt
]{biblatex}
\addbibresource{refernces.bib}
\begin{document}

\chapter{Introduction}
    With the advancement in medical sciences, a lots of drugs and therapeutic techniques have been used for the ailment of the disease. However, despite the various methodologies a common concern is the efficiency of the treatment. For any treatment to work, the drug needs to reach the target area. Using the conventional method the main challenges and research topics in the pharmaceutical industry have been considered to be low productivity, increasing research and development costs, expiring proprietary products and more stringent regulatory requirements \cite{khanna2012drug}. Many drugs are sparingly soluble in aqueous environment and hence cannot be used in medicines despite their promising results. In addition, many substrates used for the synthesis of important drugs, such as nucleoside analogs, are poorly soluble in conventional solvents.5 In fact, this perennial problem is the prime concern in the pharmaceutical industries. \cite{adawiyah2016ionic}  \\
      \begin{figure}[h]
        \centering
        \includegraphics[width = 10cm]{IL cation anion.png}
        \caption{Commonly used cations and anions}
        \label{fig:1}
    \end{figure}

\end{document}
</code>```

Here is My bib File

```<code>

@article{khanna2012drug,
  title={Drug discovery in pharmaceutical industry: productivity challenges and trends},
  author={Khanna, Ish},
  journal={Drug discovery today},
  volume={17},
  number={19-20},
  pages={1088--1102},
  year={2012},
  publisher={Elsevier}
}

@article{adawiyah2016ionic,
  title={Ionic liquids as a potential tool for drug delivery systems},
  author={Adawiyah, Noorul and Moniruzzaman, Muhammad and Hawatulaila, Siti and Goto, Masahiro},
  journal={MedChemComm},
  volume={7},
  number={10},
  pages={1881--1897},
  year={2016},
  publisher={Royal Society of Chemistry}
}

@misc{lei2017introduction,
  title={Introduction: ionic liquids},
  author={Lei, Zhigang and Chen, Biaohua and Koo, Yoon-Mo and MacFarlane, Douglas R},
  journal={Chemical Reviews},
  volume={117},
  number={10},
  pages={6633--6635},
  year={2017},
  publisher={ACS Publications}
}

</code>```

While i am getting following error:

`
Citation 'khanna2012drug' on page 2 undefined

This is same for all the references.

Body:
I am using bibtex in my project work and despite adding the bib file it isn't recognizing the citations put into here is my one of the attempts

\documentclass{report}
\usepackage{graphicx}
\usepackage{inputenc}

\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt
]{biblatex}
\addbibresource{refernces.bib}
\begin{document}

\chapter{Introduction}
    With the advancement in medical sciences, a lots of drugs and therapeutic techniques have been used for the ailment of the disease. However, despite the various methodologies a common concern is the efficiency of the treatment. For any treatment to work, the drug needs to reach the target area. Using the conventional method the main challenges and research topics in the pharmaceutical industry have been considered to be low productivity, increasing research and development costs, expiring proprietary products and more stringent regulatory requirements \cite{khanna2012drug}. Many drugs are sparingly soluble in aqueous environment and hence cannot be used in medicines despite their promising results. In addition, many substrates used for the synthesis of important drugs, such as nucleoside analogs, are poorly soluble in conventional solvents.5 In fact, this perennial problem is the prime concern in the pharmaceutical industries. \cite{adawiyah2016ionic}  \\
      \begin{figure}[h]
        \centering
        \includegraphics[width = 10cm]{IL cation anion.png}
        \caption{Commonly used cations and anions}
        \label{fig:1}
    \end{figure}

\end{document}

Here is My bib File

@article{khanna2012drug,
  title={Drug discovery in pharmaceutical industry: productivity challenges and trends},
  author={Khanna, Ish},
  journal={Drug discovery today},
  volume={17},
  number={19-20},
  pages={1088--1102},
  year={2012},
  publisher={Elsevier}
}

@article{adawiyah2016ionic,
  title={Ionic liquids as a potential tool for drug delivery systems},
  author={Adawiyah, Noorul and Moniruzzaman, Muhammad and Hawatulaila, Siti and Goto, Masahiro},
  journal={MedChemComm},
  volume={7},
  number={10},
  pages={1881--1897},
  year={2016},
  publisher={Royal Society of Chemistry}
}

@misc{lei2017introduction,
  title={Introduction: ionic liquids},
  author={Lei, Zhigang and Chen, Biaohua and Koo, Yoon-Mo and MacFarlane, Douglas R},
  journal={Chemical Reviews},
  volume={117},
  number={10},
  pages={6633--6635},
  year={2017},
  publisher={ACS Publications}
}

While i am getting following error:

`
Citation 'khanna2012drug' on page 2 undefined

This is same for all the references.


问:
React svg panzoom unable to preventDefault
I am using this react svg panzoom library and when on mobile, I get this error when I try dragging the svg around (which works anyway)

```<code>Unable to preventDefault inside passive event listener invocation.
</code>```

Is there anyone that used this library and managed to fix this problem?

Thank you

Body:
I am using this react svg panzoom library and when on mobile, I get this error when I try dragging the svg around (which works anyway)

Unable to preventDefault inside passive event listener invocation.

Is there anyone that used this library and managed to fix this problem?

Thank you


问:
Cant understand or fix com.android.tools.build:gradle is no set in the build.gradle file Android studio
Trying to create an app using Huawei appGallery, but whenever I add the SDK and try to sync I get this error. Tried re-installing everthing but the same error keeps coming up and I dont understand it.
Error: com.android.tools.build:gradle is no set in the build.gradle
build.gradle (project)

```<code>    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        //Add the Maven address.
            maven {url 'https://developer.huawei.com/repo/'}
    }
    dependencies {
        classpath 'com.huawei.agconnect:agcp:1.5.2.300'
    }
}

plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}
</code>```

build.gradle (app)

```<code>plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.first.a1806957'
    compileSdk 32

    defaultConfig {
        applicationId "com.first.a1806957"
        minSdk 21
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
    implementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
}

apply plugin: 'com.huawei.agconnect'
</code>```

Body:
Trying to create an app using Huawei appGallery, but whenever I add the SDK and try to sync I get this error. Tried re-installing everthing but the same error keeps coming up and I dont understand it.
Error: com.android.tools.build:gradle is no set in the build.gradle
build.gradle (project)

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        //Add the Maven address.
            maven {url 'https://developer.huawei.com/repo/'}
    }
    dependencies {
        classpath 'com.huawei.agconnect:agcp:1.5.2.300'
    }
}

plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}

build.gradle (app)

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.first.a1806957'
    compileSdk 32

    defaultConfig {
        applicationId "com.first.a1806957"
        minSdk 21
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
    implementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
}

apply plugin: 'com.huawei.agconnect'


问:
Flutter vRouter: Assertion thrown on navigation
`Flutter vRouter: navigation error on successive navigation to same nested route.

Note : Flutter(Web), Everytime I wrote home means the job-seeker routes

Routing File :

```<code>        VNester(
         path: '/hindustaan-jobs',
         widgetBuilder: (child) => MyMaterialApp(
             child), // Child is the widget from nestedRoutes
         nestedRoutes: [
           ConnectedRoutes(),
           VWidget(
               path: 'job-view-page/:id/:flag',
               aliases: const ['job-view-page/:id'],
               widget: Builder(builder: (context) {
                 return JobViewPage(...);
               })]);
</code>```

`Connected Routes code :

```<code>        class ConnectedRoutes extends VRouteElementBuilder {
          static const String jobSeeker = 'job-seeker';

          static void toJobSeeker(BuildContext context) =>
              context.vRouter.to('/$jobSeeker');

          static const String homeServiceProvider = 'home-service-provider';

          static void toHomeServiceProvider(BuildContext context) =>
              context.vRouter.to('/$homeServiceProvider');

          static const String homeServiceSeeker = 'home-service-seeker';

          static void toHomeServiceSeeker(BuildContext context) =>
              context.vRouter.to('/$homeServiceSeeker');
          static const String localHunar = 'local-hunar';

          static void toLocalHunar(BuildContext context) =>
              context.vRouter.to('/$localHunar');

          @override
          List<VRouteElement> buildRoutes() {
            return [
              VNester.builder(
                path: '/',
                widgetBuilder: (_, state, child) => HomeAppBar(
                  child,
                  state.names.contains(jobSeeker)
                      ? 0
                      : state.names.contains(homeServiceProvider)
                          ? 1
                          : state.names.contains(homeServiceSeeker)
                              ? 2
                              : 3,
                ),
                nestedRoutes: [
                  VWidget(
                    path: jobSeeker,
                    name: jobSeeker,
                    widget: const JobSeekerTab(),
                  ),
                  VWidget(
                    path: homeServiceProvider,
                    name: homeServiceProvider,
                    widget: HomeServiceProviderTab(),
                  ),
                  VWidget(
        `your text`            path: homeServiceSeeker,
                    name: homeServiceSeeker,
                    widget: HomeServiceSeekerDashboard(),
                  ),
                  VWidget(
                    path: localHunar,
                    name: localHunar,
                    widget: LocalHunarAccountDashboard(),
                  ),
                ],
              ),
            ];
          }
        }
</code>```

Navigation code to above route :

context.vRouter.to('/hindustaan-jobs/job-view-page/${widget.listOfJobs[i].id}/${widget.cardState}',queryParameters: queryParams);

code for poping back to home page :
context.vRouter.to(context.vRouter.previousPath!);

Results: For the first time navigation from home to job-view-page working as excepted and on pop and again navigation error is thrown as shown in the figure.

Expected : Navigation should be same no matters how much time the routes getting Hits.`

Body:
`Flutter vRouter: navigation error on successive navigation to same nested route.

Note : Flutter(Web), Everytime I wrote home means the job-seeker routes

Routing File :

        VNester(
         path: '/hindustaan-jobs',
         widgetBuilder: (child) => MyMaterialApp(
             child), // Child is the widget from nestedRoutes
         nestedRoutes: [
           ConnectedRoutes(),
           VWidget(
               path: 'job-view-page/:id/:flag',
               aliases: const ['job-view-page/:id'],
               widget: Builder(builder: (context) {
                 return JobViewPage(...);
               })]);

`Connected Routes code :

        class ConnectedRoutes extends VRouteElementBuilder {
          static const String jobSeeker = 'job-seeker';

          static void toJobSeeker(BuildContext context) =>
              context.vRouter.to('/$jobSeeker');

          static const String homeServiceProvider = 'home-service-provider';

          static void toHomeServiceProvider(BuildContext context) =>
              context.vRouter.to('/$homeServiceProvider');

          static const String homeServiceSeeker = 'home-service-seeker';

          static void toHomeServiceSeeker(BuildContext context) =>
              context.vRouter.to('/$homeServiceSeeker');
          static const String localHunar = 'local-hunar';

          static void toLocalHunar(BuildContext context) =>
              context.vRouter.to('/$localHunar');

          @override
          List<VRouteElement> buildRoutes() {
            return [
              VNester.builder(
                path: '/',
                widgetBuilder: (_, state, child) => HomeAppBar(
                  child,
                  state.names.contains(jobSeeker)
                      ? 0
                      : state.names.contains(homeServiceProvider)
                          ? 1
                          : state.names.contains(homeServiceSeeker)
                              ? 2
                              : 3,
                ),
                nestedRoutes: [
                  VWidget(
                    path: jobSeeker,
                    name: jobSeeker,
                    widget: const JobSeekerTab(),
                  ),
                  VWidget(
                    path: homeServiceProvider,
                    name: homeServiceProvider,
                    widget: HomeServiceProviderTab(),
                  ),
                  VWidget(
        `your text`            path: homeServiceSeeker,
                    name: homeServiceSeeker,
                    widget: HomeServiceSeekerDashboard(),
                  ),
                  VWidget(
                    path: localHunar,
                    name: localHunar,
                    widget: LocalHunarAccountDashboard(),
                  ),
                ],
              ),
            ];
          }
        }

Navigation code to above route :

context.vRouter.to('/hindustaan-jobs/job-view-page/${widget.listOfJobs[i].id}/${widget.cardState}',queryParameters: queryParams);

code for poping back to home page :
context.vRouter.to(context.vRouter.previousPath!);

Results: For the first time navigation from home to job-view-page working as excepted and on pop and again navigation error is thrown as shown in the figure.

Expected : Navigation should be same no matters how much time the routes getting Hits.`


问:
Flutter Blue why found just gdevice beacon but not found my devices
I want my application to be able to find bluetooth devices which it can only find. gDevice-beacon But it can't find my device.

[it's found gDevice-beacon but not found my devices]
(https://i.stack.imgur.com/teouc.png)

Widget deviceName(ScanResult r) {
    String name = '';
    if (r.device.name.isNotEmpty) {
      name = r.device.name;
    } else if (r.advertisementData.localName.isNotEmpty) {
      name = r.advertisementData.localName;
    } else {
      name = 'N/A';
    }
    return Text(name);

  }
  void onTap(ScanResult r) {
    print('${r.device.name}');
  }
  Widget listItem(ScanResult r) {
    return ListTile(
      onTap: () => onTap(r),
      leading: leading(r),
      title: deviceName(r),
      subtitle: deviceMacAddress(r),
      trailing: deviceSignal(r),
    );
  }
```