问:
Firebase phone authentication is not working getting error - API key expired. Please renew the API key
Heya i m trying to setup firebase phone authentication for my website... few days ago default set number and otp were working but live numbers were not working it was not sending otp... and now suddenly even default otp is not working even after adding defualt number in firebase phone authentication....after running console i am getting error -

```<code>{
  "error": {
    "code": 400,
    "message": "API key expired. Please renew the API key.",
    "errors": [
      {
        "message": "API key expired. Please renew the API key.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "API_KEY_INVALID",
        "domain": "googleapis.com",
        "metadata": {
          "service": "identitytoolkit.googleapis.com"
        }
      }
    ]
  }
}
</code>```

I deleted web firebase project multiple times, tried to setup everything again but nothing is working now just getting this error not even default is working, its really fustrating as m stuck over here from days...can anyone help me and guide me...?

for refrence you can checkout error here - https://postimg.cc/9w4p1G02

Need help so my phone authentication will start working

Body:
Heya i m trying to setup firebase phone authentication for my website... few days ago default set number and otp were working but live numbers were not working it was not sending otp... and now suddenly even default otp is not working even after adding defualt number in firebase phone authentication....after running console i am getting error -

{
  "error": {
    "code": 400,
    "message": "API key expired. Please renew the API key.",
    "errors": [
      {
        "message": "API key expired. Please renew the API key.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "API_KEY_INVALID",
        "domain": "googleapis.com",
        "metadata": {
          "service": "identitytoolkit.googleapis.com"
        }
      }
    ]
  }
}

I deleted web firebase project multiple times, tried to setup everything again but nothing is working now just getting this error not even default is working, its really fustrating as m stuck over here from days...can anyone help me and guide me...?

for refrence you can checkout error here - https://postimg.cc/9w4p1G02

Need help so my phone authentication will start working


来源: stackexchange

问:
Compose services with named volume not working with Windows containers
I'm trying to created a named volume in which I can expose files from one Windows container to another.

The following docker-compose.yml produces an error 'The request is not supported':

```<code>version: "3.9"

services:
  nano:
    image: mcr.microsoft.com/windows/nanoserver:1809
    volumes:
      - test-data:C:/test-data
volumes:
  test-data:
    name: test-data
</code>```
```<code>[+] Running 2/3
 - Network test_default   Created                                                                                0.8s
 - Volume "test-data"     Created                                                                                0.0s
 - Container test-nano-1  Starting                                                                                0.3s
Error response from daemon: hcsshim::CreateComputeSystem 0a4d05d2775992400fecb66b060c1143d2204935b41702c198d580e7f56d409b: The request
is not supported.
</code>```

Alternatively, if I run a new container from the command line things seem to work.

```<code>docker run -it --rm -v test-data:C:/test-data mcr.microsoft.com/windows/nanoserver:1809 cmd
</code>```

In the first container I can create a file:

In the second container I can see the file:

Update

The issue appears to be known and documented here. Using lowercase seems to correct the behavior.

ContentLicense: CC BY-SA 4.0

Body:
I'm trying to created a named volume in which I can expose files from one Windows container to another.

The following docker-compose.yml produces an error 'The request is not supported':

version: "3.9"

services:
  nano:
    image: mcr.microsoft.com/windows/nanoserver:1809
    volumes:
      - test-data:C:/test-data
volumes:
  test-data:
    name: test-data

[+] Running 2/3
 - Network test_default   Created                                                                                0.8s
 - Volume "test-data"     Created                                                                                0.0s
 - Container test-nano-1  Starting                                                                                0.3s
Error response from daemon: hcsshim::CreateComputeSystem 0a4d05d2775992400fecb66b060c1143d2204935b41702c198d580e7f56d409b: The request
is not supported.

Alternatively, if I run a new container from the command line things seem to work.

docker run -it --rm -v test-data:C:/test-data mcr.microsoft.com/windows/nanoserver:1809 cmd

In the first container I can create a file:

In the second container I can see the file:

Update

The issue appears to be known and documented here. Using lowercase seems to correct the behavior.


问:
Squid log shows peer_response_time = 0 and status is 200
We have squid proxy configured as a forward proxy. But we see that for some request the log shows peer_response_time =0 but has status is 200. At times users on their browser see this as page not loading.

As we couldnt find documentation around this. We wish to know what this actually means and if this is a issue how to resolve it.


问:
store_response() takes 1 positional argument but 2 were given
I relatively new to the world of Python, and over the past few months I have been going over the exercises in Python Crash Course. I am stuck on the building of a class that takes answers for an anonymous survey. One of the methods of the class is store_response(self, response), which takes the response on the survey and appends it to a list of responses. However, when I create a variable 'response' and add it as the argument for the function, it gives me the error "store_response() takes 1 positional argument but 2 were given. I really don't understand why that is the case if clearly have only given the function 1 argument (response) and not two.
For more context, this is the "A class to Test" example of the 2nd edition Python Crash Course page 217.
Thanks!

```<code>#Consider a class that helps administer anonymous surveys
class AnonymousSurvey:
  """Collects anonymous answers to survey questions"""
  def __init__(self, question):
    """Store a question, and prepare to store responses."""
    self.question = question
    self.response = [] #An extra attribute that takes in the response and places it as a string in a list.

  def show_question(self):
    """Show the survey question"""
    print(self.question)

  def store_response(self, new_response):
    """Store a single response to the survey"""
    self.responses.append(new_response)

  def show_results(self):
    """Show all the responses that have been given"""
    print('Survey results:')
    for response in self.responses:
      print(f" -{response}")
</code>```
```<code># I want the survey to run for about a minute
import time
my_survey.show_question()
counter = 0
time_duration = 60
start_time = time.time()

while time.time() < start_time + time_duration:
  counter += 1
  response = input("Language: ")
  my_survey.store_response(response)

#Show the results of your survey
print("\nThank you to everyone who participated in the survey.")
my_survey.show_results()
</code>```
```<code>TypeError                                 Traceback (most recent call last)
<ipython-input-29-2f6d440992b8> in <module>
     22   counter += 1
     23   response = input("Language: ")
---> 24   my_survey.store_response(response)
     25
     26 #Show the results of your survey

TypeError: store_response() takes 1 positional argument but 2 were given
</code>```

I have looked back to make sure all my variables are defined and to make sure the code here matches that of the book, but I have not been able to find my mistake.

Body:
I relatively new to the world of Python, and over the past few months I have been going over the exercises in Python Crash Course. I am stuck on the building of a class that takes answers for an anonymous survey. One of the methods of the class is store_response(self, response), which takes the response on the survey and appends it to a list of responses. However, when I create a variable 'response' and add it as the argument for the function, it gives me the error "store_response() takes 1 positional argument but 2 were given. I really don't understand why that is the case if clearly have only given the function 1 argument (response) and not two.
For more context, this is the "A class to Test" example of the 2nd edition Python Crash Course page 217.
Thanks!

#Consider a class that helps administer anonymous surveys
class AnonymousSurvey:
  """Collects anonymous answers to survey questions"""
  def __init__(self, question):
    """Store a question, and prepare to store responses."""
    self.question = question
    self.response = [] #An extra attribute that takes in the response and places it as a string in a list.

  def show_question(self):
    """Show the survey question"""
    print(self.question)

  def store_response(self, new_response):
    """Store a single response to the survey"""
    self.responses.append(new_response)

  def show_results(self):
    """Show all the responses that have been given"""
    print('Survey results:')
    for response in self.responses:
      print(f" -{response}")

# I want the survey to run for about a minute
import time
my_survey.show_question()
counter = 0
time_duration = 60
start_time = time.time()

while time.time() < start_time + time_duration:
  counter += 1
  response = input("Language: ")
  my_survey.store_response(response)

#Show the results of your survey
print("\nThank you to everyone who participated in the survey.")
my_survey.show_results()

TypeError                                 Traceback (most recent call last)
<ipython-input-29-2f6d440992b8> in <module>
     22   counter += 1
     23   response = input("Language: ")
---> 24   my_survey.store_response(response)
     25
     26 #Show the results of your survey

TypeError: store_response() takes 1 positional argument but 2 were given

I have looked back to make sure all my variables are defined and to make sure the code here matches that of the book, but I have not been able to find my mistake.


问:
Restrict website access based on Private IP address using .htaccess file
I am trying to give access to my site to specifc IP Address. If I add my private IP Address it is not working(Gave me 403 error). Then I try adding my public IP and I was able to access the site.

I have tried adding below code to .htaccess file:

TRY 1

```<code><IfModule mod_rewrite.c>
    RewriteCond %{REMOTE_ADDR} !^XX\.XX\.XX\.XX\.XX$
    RewriteRule .* - [F,L]
</IfModule>
</code>```

TRY 2

```<code>order allow,deny
allow from XX.XXX.XX.XXX
deny from all
</code>```

Can you help me how I can give access to my private IP? Is there a way I can give website access to Private IP address?

Body:
I am trying to give access to my site to specifc IP Address. If I add my private IP Address it is not working(Gave me 403 error). Then I try adding my public IP and I was able to access the site.

I have tried adding below code to .htaccess file:

TRY 1

<IfModule mod_rewrite.c>
    RewriteCond %{REMOTE_ADDR} !^XX\.XX\.XX\.XX\.XX$
    RewriteRule .* - [F,L]
</IfModule>

TRY 2

order allow,deny
allow from XX.XXX.XX.XXX
deny from all

Can you help me how I can give access to my private IP? Is there a way I can give website access to Private IP address?


问:
Avoid fake credit cards using stripe
I have a 7 day free trial in my app but many people are adding fake credit cards that get declined when the trial is over. Is there a way to use the stripe api to charge the card for a small amount and refund the payment afterward to make sure the credit card is valid? Or some other way. I want stripe to stop accepting invalid credit cards</p>

Title: Avoid fake credit cards using stripe


问:
Can you make responsive text scale with div container size, not whole viewport size?
Problem: I want to set a div container to a max-width of 500px, but if the font-size: 5vw; inside of the div is set to 5vw, the text keeps getting bigger even after the div reaches its max size.

So basically I want to make text inside an image scale with the size of that image, but stop growing when the div texts' container stops growing.

Main Question: Is there a way for me to have font-size: 5vw scale with the size of its container div, and not the whole viewport?


问:
Are there any tools or methods for automatic search & discovery of publicly available API endpoints?
I'm trying to use an automated method to discover publicly available API endpoints from job search results pages/career pages of different companies

I need some tools (maybe Selenium?) to automatically discover API endpoints and than filter out (manually) the ones that contain job postings.

I just need to discover API endpoints that are public; I don't need any testing, hacking etc. tools, just search & discovery

Are there any tools or methods for automatic search & discovery publicly available APIs like the ones in the examples below?

https://jobsapi-internal.m-cloud.io/api/stjobbulk?organization=2242&limitkey=4A8B5EF8-AA98-4A8B-907D-C21723FE4C6B&facet=publish_to_cws:true&fields=ref,title,primary_city,primary_state,primary_country,primary_category,level,url,sub_category,addtnl_locations,brand

https://www.pepsicojobs.com/api/jobs?page=1&sortBy=relevance&descending=false&internal=false

I've tried Kiterunner, Burp but haven't got what I need


问:
How can we implement a routing logic to control the percentage of traffic hitting a service?
Currently in my application, I have created a validation service that validates certain fields between two objects. The ask is that, we must implement a percentage based routing logic based on which the requests will be sent to another service. For example, if I set the percentage as 10 in application properties file of my Springboot application, then only 10% of the overall requests should go to my service after which they will no longer be sent.

The reason for implementing this is because sometimes we can get between a thousand to a million requests, if the traffic is too high, we don't want to waste our resources on a less priority service.

I am very confused on how to begin this. I am not sure how to even determine the percentage because the number of requests per day or per hour varies a lot on a day to day basis.

My application is a Java Spring boot application. Is there any existing routing logic that I can use or any pseudo code that can help me out?


问:
Installing libraries in Python in the correct version
I can't find the correct set of versions for my project

I am writing a project in Python for image classification. I need to use libraries OpenCV, TensorFlow, and Keras. Currently, my version of Python is 3.8.1.

I got confused with the versions when installing the libraries. What is the right version for these libraries so they can all work together, or what version in Python supports them all and in which version?


问:
Installing pdo_pgsql and pgsql on macOS Ventura Version 13.1
I want to use postgresql on my laravel project, and I have enabled extensions for pdo_pgsql and pgsql in php.ini (php 8.2); however, I face two problems below:

```<code>Warning: PHP Startup: Unable to load dynamic library 'pdo_pgsql'
Warning: PHP Startup: Unable to load dynamic library 'pgsql'

</code>```

Does anyone know how to install them?

I expect to connect with my postgresql db

Body:
I want to use postgresql on my laravel project, and I have enabled extensions for pdo_pgsql and pgsql in php.ini (php 8.2); however, I face two problems below:

Warning: PHP Startup: Unable to load dynamic library 'pdo_pgsql'
Warning: PHP Startup: Unable to load dynamic library 'pgsql'

Does anyone know how to install them?

I expect to connect with my postgresql db


问:
Why join with subquery performs better
I have three tables;

```<code>Users -> id (indexed, big int)
Accounts -> uuid (varchar, indexed), user_id (indexed, big int)
Trades -> uuid (varchar, indexed), account_uuid (varchar, not indexed)
</code>```

None of them defines foreign keys.

I would like to fetch Trades entries by user id.

I can get what i need with the following queries

Query 1:

```<code>select t.account_uuid
from trades t
inner join accounts acc on acc.uuid = t.account_uuid
inner join users u on acc.user_id = u.id
where u.id = 1;
</code>```

takes ~4 secs.

Query 2:

```<code>select t.account_uuid
from trades t
where t.account_uuid in (select acc.uuid from accounts acc where acc.user_id = 1);
</code>```

takes ~4 secs.

Query 3:

```<code>select t.account_uuid from trades t
inner join (
    select acc.uuid
    from accounts acc
    where acc.user_id = 1
    group by acc.uuid
) as acc on acc.uuid = t.account_uuid;
</code>```

Takes ~1.3 secs.

I'm trying to reason about why the last query is faster compared to others? If i remove group by acc.uuid from the last query, it performs the same as others.

Title: Why join with subquery performs better

Body:
I have three tables;

Users -> id (indexed, big int)
Accounts -> uuid (varchar, indexed), user_id (indexed, big int)
Trades -> uuid (varchar, indexed), account_uuid (varchar, not indexed)

None of them defines foreign keys.

I would like to fetch Trades entries by user id.

I can get what i need with the following queries

Query 1:

select t.account_uuid
from trades t
inner join accounts acc on acc.uuid = t.account_uuid
inner join users u on acc.user_id = u.id
where u.id = 1;

takes ~4 secs.

Query 2:

select t.account_uuid
from trades t
where t.account_uuid in (select acc.uuid from accounts acc where acc.user_id = 1);

takes ~4 secs.

Query 3:

select t.account_uuid from trades t
inner join (
    select acc.uuid
    from accounts acc
    where acc.user_id = 1
    group by acc.uuid
) as acc on acc.uuid = t.account_uuid;

Takes ~1.3 secs.

I'm trying to reason about why the last query is faster compared to others? If i remove group by acc.uuid from the last query, it performs the same as others.


问:
How to run a macro defined in PERSONAL.XLSB for any opened workbook sheet when I change the cell?
I want to run the macro 'HighlightMisspelledCells' defined in the module node of Personal.xlsb on cell change of any workbook sheet.

I know that if I insert the following code on the sheet node in VBA Editor then this will call the macro defined in Personal.xlsb, but then for this, I have to insert this code every time for every new sheet, so is there any other way by which I simply add few lines in the PERSONAL.XLSB macro which runs on cell change of any opened sheet.

```<code>Private Sub Worksheet_Change(ByVal Target As Range)
    Application.Run "Personal.xlsb!HighlightMisspelledCells"
End Sub
</code>```

Note : There is also another problem (not specific to the question) is, when I save the above code then get an error message box "The Following feature cannot be saved in macro-free workbook" but still code works if I click on 'Yes' to save. But when I opened the same workbook next time then this 'Sheet specific' VBA code disappears.

PERSONAL.XLSB

```<code>
Sub HighlightMisspelledCells()
    Dim cl As Range
        For Each cl In ActiveSheet.UsedRange
            If Not Application.CheckSpelling(word:=cl.Text) Then
                cl.Interior.Color = vbRed
            End If
    Next cl
End Sub
</code>```

Note : I am using MS Excel 2016 on Windows PC

I have already tried searching on the internet but have not been able to find a solution to my specific problem.

Body:
I want to run the macro 'HighlightMisspelledCells' defined in the module node of Personal.xlsb on cell change of any workbook sheet.

I know that if I insert the following code on the sheet node in VBA Editor then this will call the macro defined in Personal.xlsb, but then for this, I have to insert this code every time for every new sheet, so is there any other way by which I simply add few lines in the PERSONAL.XLSB macro which runs on cell change of any opened sheet.

Private Sub Worksheet_Change(ByVal Target As Range)
    Application.Run "Personal.xlsb!HighlightMisspelledCells"
End Sub

Note : There is also another problem (not specific to the question) is, when I save the above code then get an error message box "The Following feature cannot be saved in macro-free workbook" but still code works if I click on 'Yes' to save. But when I opened the same workbook next time then this 'Sheet specific' VBA code disappears.

PERSONAL.XLSB

Sub HighlightMisspelledCells()
    Dim cl As Range
        For Each cl In ActiveSheet.UsedRange
            If Not Application.CheckSpelling(word:=cl.Text) Then
                cl.Interior.Color = vbRed
            End If
    Next cl
End Sub

Note : I am using MS Excel 2016 on Windows PC

I have already tried searching on the internet but have not been able to find a solution to my specific problem.


问:
Do servers send responses back to proxy servers or directly to clients?
Given a client sending requests to a proxy server. The proxy server forwards the requests to another server.

Does this "other" server send the response directly back to the client like so

or does it send the response to the proxy server and the proxy server sends the response back to the client like so


问:
VBA rounding issue (that's not banker's rounding)
I'm having an issue with the Round function in VBA. I'm aware that it uses Banker's Rounding but the results still seem inconsistent to me:

```<code>? Round(1.425, 2)
 1.42
? Round(2.425, 2)
 2.42
? Round(3.425, 2)
 3.42
? Round(4.425, 2)
 4.42
? Round(5.425, 2)
 5.42
? Round(6.425, 2)
 6.42
? Round(7.425, 2)
 7.42
? Round(8.425, 2)
 8.43
? Round(9.425, 2)
 9.43
? Round(10.425, 2)
 10.42
? Round(11.425, 2)
 11.42
? Round(12.425, 2)
 12.42
</code>```

If I understand Banker's Rounding, all of these should round to x.42 but 8.425 and 9.425 don't. This is in Excel 16.66 for Mac but I've verified it in other products as well.

EDIT

I confirmed the same behaviour occurs in C# as well when I use double data types. But when I use decimal, all is right again. Which leads me to believe this is an issue with floating points in VBA.

Body:
I'm having an issue with the Round function in VBA. I'm aware that it uses Banker's Rounding but the results still seem inconsistent to me:

? Round(1.425, 2)
 1.42
? Round(2.425, 2)
 2.42
? Round(3.425, 2)
 3.42
? Round(4.425, 2)
 4.42
? Round(5.425, 2)
 5.42
? Round(6.425, 2)
 6.42
? Round(7.425, 2)
 7.42
? Round(8.425, 2)
 8.43
? Round(9.425, 2)
 9.43
? Round(10.425, 2)
 10.42
? Round(11.425, 2)
 11.42
? Round(12.425, 2)
 12.42

If I understand Banker's Rounding, all of these should round to x.42 but 8.425 and 9.425 don't. This is in Excel 16.66 for Mac but I've verified it in other products as well.

EDIT

I confirmed the same behaviour occurs in C# as well when I use double data types. But when I use decimal, all is right again. Which leads me to believe this is an issue with floating points in VBA.


问:
Create linked list causes segmentation fault
I am attempting to overcome my fear of linked lists since my confidence built after my last few posts. I have re-attempted an older algorithmic exercise I had done before (incompleted.) Now, I am confident it is complete, however, I'm thrown the usual segmentation fault error. I wonder, if there is a way to understand what causes this issue in the code, I can rarely identify it (but I'm still novice.)

For example:

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

typedef struct node {
    int DATA;
    struct node* LINK;
} node;

void create(struct node* head, int item){
    struct node* new;
    new = (struct node*)malloc(sizeof(new));
    if (new == NULL){
        printf("Memory not Available");
    }
    new->DATA=item;
    new->LINK = NULL;
    if (head == NULL){
        head = new;
    }else {
        struct node* temp;
        temp = head;
        while(temp->LINK != NULL){
            temp = temp->LINK;
        }
        temp->LINK=new;
    }
}

int main(){

    node* former = NULL;
    int itm = 7;
    create(former, itm);

    printf("%i", former->DATA);

    return 0;
}
</code>```

Will produce the segmentation fault.

The algorithm I am attempting:

The following algorithm creates a node and appends it at the end of the existing list. head is a pointer which holds the address of the header of the linked list and item is the value of the new
node. NEW is a pointer which holds the address of the new node and temp is a temporary pointer.

```<code>Algorithm: CREATE (HEAD, ITEM)
1. [Create NEW node]
a) Allocate memory for NEW node.
b) IF NEW = NULL then Print: “Memory not Available” and Return
c) Set NEW→DATA = ITEM
d) Set NEW→LINK = NULL
2. [Whether List is empty, head is the content of HEADER]
If HEAD = NULL then Set HEAD = NEW
3. Else
a) Set Temp = HEAD
b) While Temp→LINK ≠ NULL do
Set Temp = Temp→LINK
[End of while]
c) Set Temp→LINK = NEW
[End of IF]
4. Return
</code>```

Based on the suggested link I continue to get the same error:

```<code>void create(node** head, int item){
    *head = NULL;
    node* new;
    new = (node*)malloc(sizeof(*new));
    if (new == NULL){printf("Memory not Available");}
    new->DATA=item;
    new->LINK = NULL;
    if (head == NULL){head = &new;}else {
         node* temp;
        temp = *head;
        while(temp->LINK != NULL){
            temp = temp->LINK;}
        temp->LINK=new;}}

int main(){
    node* former;
    int itm = 7;
    create(&former, itm);
    printf("%i", former->DATA);
    return 0;
}

</code>```

Body:
I am attempting to overcome my fear of linked lists since my confidence built after my last few posts. I have re-attempted an older algorithmic exercise I had done before (incompleted.) Now, I am confident it is complete, however, I'm thrown the usual segmentation fault error. I wonder, if there is a way to understand what causes this issue in the code, I can rarely identify it (but I'm still novice.)

For example:

#include <stdio.h>
#include <stdlib.h>

typedef struct node {
    int DATA;
    struct node* LINK;
} node;

void create(struct node* head, int item){
    struct node* new;
    new = (struct node*)malloc(sizeof(new));
    if (new == NULL){
        printf("Memory not Available");
    }
    new->DATA=item;
    new->LINK = NULL;
    if (head == NULL){
        head = new;
    }else {
        struct node* temp;
        temp = head;
        while(temp->LINK != NULL){
            temp = temp->LINK;
        }
        temp->LINK=new;
    }
}

int main(){

    node* former = NULL;
    int itm = 7;
    create(former, itm);

    printf("%i", former->DATA);

    return 0;
}

Will produce the segmentation fault.

The algorithm I am attempting:

The following algorithm creates a node and appends it at the end of the existing list. head is a pointer which holds the address of the header of the linked list and item is the value of the new
node. NEW is a pointer which holds the address of the new node and temp is a temporary pointer.

Algorithm: CREATE (HEAD, ITEM)
1. [Create NEW node]
a) Allocate memory for NEW node.
b) IF NEW = NULL then Print: “Memory not Available” and Return
c) Set NEW→DATA = ITEM
d) Set NEW→LINK = NULL
2. [Whether List is empty, head is the content of HEADER]
If HEAD = NULL then Set HEAD = NEW
3. Else
a) Set Temp = HEAD
b) While Temp→LINK ≠ NULL do
Set Temp = Temp→LINK
[End of while]
c) Set Temp→LINK = NEW
[End of IF]
4. Return

Based on the suggested link I continue to get the same error:

void create(node** head, int item){
    *head = NULL;
    node* new;
    new = (node*)malloc(sizeof(*new));
    if (new == NULL){printf("Memory not Available");}
    new->DATA=item;
    new->LINK = NULL;
    if (head == NULL){head = &new;}else {
         node* temp;
        temp = *head;
        while(temp->LINK != NULL){
            temp = temp->LINK;}
        temp->LINK=new;}}

int main(){
    node* former;
    int itm = 7;
    create(&former, itm);
    printf("%i", former->DATA);
    return 0;
}


问:
Celery best way for callback after 1M tasks
I'm working with Celery 5.2.7 and Redis 4.4.0 in a single node docker-compose cluster and was wonder what's the best way to trigger a finalizer task after a bunch of 1M simple, but long lasting tasks have completed?

The tasks would have a single integer as input and no output at all.
Can this be done with Chord?

Or are there better solutions, since I have read about memory issues that limit the amount of tasks in a chord...

How would I create such a task object, as examples are just dealing with range(100)?

BTW, I work on a 24 core machine with 128GB RAM.


问:
Google Sheets activity sending to GA4 with App Script
I have been trying to change my script that used to send to the old UA Google Analytics using the IMAGE() but with the new GA4 you have to send a POST. I tried to use the onOpen(e) with some of the code below but nothing seems to work even though I am not getting any errors. Does anyone know if it is possible to make a call [POST] with this information:

```<code>function onOpen(e) {

  // Make a POST request with a JSON payload.
  var data = {
    "client_id": Utilities.getUuid(),
    "user_id": "webuser",
    "events": ["name", "cve_database"]
  };
  var options = {
    'method' : 'post',
    'contentType': 'application/json',
    // Convert the JavaScript object to a JSON string.
    'payload' : JSON.stringify(data)
  };

  var response = UrlFetchApp.fetch('https://www.google-analytics.com/mp/collect?api_secret=<ID-Here>&measurement_id=<GA4 Acc>', options);

  Logger.log(response)
}
</code>```

I tried to get it to update the Google Analytics information so that I can keep track of the users who view the page.

Body:
I have been trying to change my script that used to send to the old UA Google Analytics using the IMAGE() but with the new GA4 you have to send a POST. I tried to use the onOpen(e) with some of the code below but nothing seems to work even though I am not getting any errors. Does anyone know if it is possible to make a call [POST] with this information:

function onOpen(e) {

  // Make a POST request with a JSON payload.
  var data = {
    "client_id": Utilities.getUuid(),
    "user_id": "webuser",
    "events": ["name", "cve_database"]
  };
  var options = {
    'method' : 'post',
    'contentType': 'application/json',
    // Convert the JavaScript object to a JSON string.
    'payload' : JSON.stringify(data)
  };

  var response = UrlFetchApp.fetch('https://www.google-analytics.com/mp/collect?api_secret=<ID-Here>&measurement_id=<GA4 Acc>', options);

  Logger.log(response)
}

I tried to get it to update the Google Analytics information so that I can keep track of the users who view the page.


问:
How to make the 'wheel' event fire once per scroll?
I'm trying to write some React code that detects if a user is scrolling up or down and then increments or decrements a state depending on the direction. I'm using the 'wheel' event because I have a 1 viewport sized page that has the 'overflow: hidden' property on it, so there's no where to actually scroll. Instead, I detect the page to show based on the state mentioned earlier.

Here's what I have so far, but this fires multiple times per scroll instead of just once:

```<code>useEffect(() => {
    const handleTrackpadSwipe = (event) => {
      if (event.deltaY > 0) {
        console.log('swiped down')
        setTrackpadSwipe('swiped down');
        if(pageNumber < 4 ) {
          setPageNumber(pageNumber + 1);
        }
        setTrackpadSwipe('none');
      }
      else if (event.deltaY < 0) {
        console.log('swiped up')
        setTrackpadSwipe('swiped up');
        if(pageNumber > 1) {
          setPageNumber(pageNumber - 1);
        }
        setTrackpadSwipe('none');
      }
    };

    window.addEventListener('wheel', handleTrackpadSwipe);

  }, [trackpadSwipe, pageNumber]);
</code>```

Body:
I'm trying to write some React code that detects if a user is scrolling up or down and then increments or decrements a state depending on the direction. I'm using the 'wheel' event because I have a 1 viewport sized page that has the 'overflow: hidden' property on it, so there's no where to actually scroll. Instead, I detect the page to show based on the state mentioned earlier.

Here's what I have so far, but this fires multiple times per scroll instead of just once:

useEffect(() => {
    const handleTrackpadSwipe = (event) => {
      if (event.deltaY > 0) {
        console.log('swiped down')
        setTrackpadSwipe('swiped down');
        if(pageNumber < 4 ) {
          setPageNumber(pageNumber + 1);
        }
        setTrackpadSwipe('none');
      }
      else if (event.deltaY < 0) {
        console.log('swiped up')
        setTrackpadSwipe('swiped up');
        if(pageNumber > 1) {
          setPageNumber(pageNumber - 1);
        }
        setTrackpadSwipe('none');
      }
    };

    window.addEventListener('wheel', handleTrackpadSwipe);

  }, [trackpadSwipe, pageNumber]);


问:
Multiple bootstrap code is observed in Angular
I have an angular application, I am using Bootstrap classes. Whenever I am adding a new component like nav, button, etc. I am not able to see exact color and properties whatever I see in the bootstrap documentation, for eg: if I add a button HTML and added btn and btn-primary classes then I am not getting the exact color which is specified in bootstrap documentation:

Primary button in my application

Primary button from bootstrap documentation

In the inspect page I can see like this:
Inspect page for button

Could someone please help me on this


问:
JSON Key name with spaces
I am getting a JSON file in the format below which i am trying to consume and upload to SQL Server, I can upload most data except for any key with spaces in the name, like below Location (Last Level), I have 36 records in the JSON file and SSIS created 36 records in the SQL table but Location (Last Level) is blank, if I Country just to test it works and populate the table with correct values, I am only interested in Location (Last Level):

```<code>"records": [
        {
            "Location (Last Level)": "Calgary",
            "Country": "Canada"

        },
        {
            "Location (Last Level)": "Coconut Creek",
            "Country": "United States"

        },
</code>```

I created a class for this:

```<code>namespace SC_0fc0e19fc563441a96856fc8e8911872
{
    public class LocAPI
    {

        public string LocationLastLevel { get; set; }

    }
    public class Root
    {

        public List<LocAPI> records { get; set; }

    }
}
</code>```

I am not sure how do I consume or refer to JSON keys with spaces in the name like Location (Last Level).
Any help appreciated.

Thanks

Update: I have change the class a little bit based on another thread but still didnt work:

```<code>using System.Text.Json.Serialization;

namespace SC_0fc0e19fc563441a96856fc8e8911872
{
    public class LocAPI
    {
        [JsonPropertyName("Location (Last Level)")]
        public string LocationLastLevel { get; set; }

    }
    public class Root
    {

        public List<LocAPI> records { get; set; }

    }
}
</code>```

Main:

```<code>var response = client.GetAsync(APIUrl).Result;
        if (response.IsSuccessStatusCode)
        {
            var result = response.Content.ReadAsStringAsync().Result;

            Root loc = new JavaScriptSerializer().Deserialize<Root>(result);

            foreach (var item in loc.records)
            {

                LocationAPIBuffer.AddRow();

                LocationAPIBuffer.Location = item.LocationLastLevel;

            }
</code>```

Title: JSON Key name with spaces

Body:
I am getting a JSON file in the format below which i am trying to consume and upload to SQL Server, I can upload most data except for any key with spaces in the name, like below Location (Last Level), I have 36 records in the JSON file and SSIS created 36 records in the SQL table but Location (Last Level) is blank, if I Country just to test it works and populate the table with correct values, I am only interested in Location (Last Level):

"records": [
        {
            "Location (Last Level)": "Calgary",
            "Country": "Canada"

        },
        {
            "Location (Last Level)": "Coconut Creek",
            "Country": "United States"

        },

I created a class for this:

namespace SC_0fc0e19fc563441a96856fc8e8911872
{
    public class LocAPI
    {

        public string LocationLastLevel { get; set; }

    }
    public class Root
    {

        public List<LocAPI> records { get; set; }

    }
}

I am not sure how do I consume or refer to JSON keys with spaces in the name like Location (Last Level).
Any help appreciated.

Thanks

Update: I have change the class a little bit based on another thread but still didnt work:

using System.Text.Json.Serialization;

namespace SC_0fc0e19fc563441a96856fc8e8911872
{
    public class LocAPI
    {
        [JsonPropertyName("Location (Last Level)")]
        public string LocationLastLevel { get; set; }

    }
    public class Root
    {

        public List<LocAPI> records { get; set; }

    }
}

Main:

var response = client.GetAsync(APIUrl).Result;
        if (response.IsSuccessStatusCode)
        {
            var result = response.Content.ReadAsStringAsync().Result;

            Root loc = new JavaScriptSerializer().Deserialize<Root>(result);

            foreach (var item in loc.records)
            {

                LocationAPIBuffer.AddRow();

                LocationAPIBuffer.Location = item.LocationLastLevel;

            }


问:
Send SMS in Nodejs with From as my own number
I had a look on

MessgaeBird

Text Magic

Twilio

Plivo

Nexmo

AWS Pinpoint

These services require the phone number specified for "FROM" to be associated with them. Is there any way or any service that takes "FROM" as dynamic number. Our use case is to send SMS with dynamic "to" and "from" number. "FROM" number will be the number of the user who is currently logged in to our application built with React and Nodejs, and "to" will be any number the logged in user specify.

Thank you.


问:
Enrich array of objects with another document based on a condition
Given two collections users and activities, I want to enrich users.friends.user with all relevant activities, such that users.friends.user matches doc2.invitations.userId.

Below describes exactly what I would like:

user f24b189f-9e00-4d2b-b7f2-148a265fae7c is not a part of any activity, so their activities array is [].

user 223f2e04-6f0c-40a3-a88a-69d0127f2e92 is a part of an activity, so their activities array is populated with the activity object.

Raw:

```<code>db={
  "users": [
    {
      "_id": "9c69a57f-e90a-43be-b559-449e973c6cba",
      "__v": {
        "$numberInt": "0"
      },
      "friends": [
        {
          "status": "ACCEPTED",
          "user": "f24b189f-9e00-4d2b-b7f2-148a265fae7c"
        },
        {
          "status": "ACCEPTED",
          "user": "223f2e04-6f0c-40a3-a88a-69d0127f2e92"
        }
      ]
    }
  ],
  "activities": [
    {
      "_id": {
        "$oid": "63a92531bc6dea668f93bb06"
      },
      "invitations": [
        {
          "_id": {
            "$oid": "63a92531bc6dea668f93bb07"
          },
          "userId": "9c69a57f-e90a-43be-b559-449e973c6cba",
          "status": "ACCEPTED"
        },
        {
          "_id": {
            "$oid": "63a92544bc6dea668f93bb09"
          },
          "userId": "223f2e04-6f0c-40a3-a88a-69d0127f2e92",
          "status": "ACCEPTED"
        },

      ],
      "__v": {
        "$numberInt": "0"
      }
    }
  ]
}
</code>```

Expected result:

```<code> "expectedResult": [
    {
      "_id": "9c69a57f-e90a-43be-b559-449e973c6cba",
      "__v": {
        "$numberInt": "0"
      },
      "friends": [
        {
          "status": "ACCEPTED",
          "activities": [{
            "_id": {
              "$oid": "63a92531bc6dea668f93bb06"
            },
            "invitations": [
              {
                "_id": {
                  "$oid": "63a92531bc6dea668f93bb07"
                },
                "userId": "9c69a57f-e90a-43be-b559-449e973c6cba",
                "status": "ACCEPTED"
              },
              {
                "_id": {
                  "$oid": "63a92544bc6dea668f93bb09"
                },
                "userId": "223f2e04-6f0c-40a3-a88a-69d0127f2e92",
                "status": "ACCEPTED"
              },

            ],
            "__v": {
              "$numberInt": "0"
            }
          }]
        },
        {
          "status": "ACCEPTED",
          "activities": []
        }
      ]
    }
  ]
</code>```

And here's a link to the playground.

I played around with aggregate and populate, but this use case is unlike a regular "join", which is throwing me off. Any pointers will be appreciated.

Body:
Given two collections users and activities, I want to enrich users.friends.user with all relevant activities, such that users.friends.user matches doc2.invitations.userId.

Below describes exactly what I would like:

user f24b189f-9e00-4d2b-b7f2-148a265fae7c is not a part of any activity, so their activities array is [].

user 223f2e04-6f0c-40a3-a88a-69d0127f2e92 is a part of an activity, so their activities array is populated with the activity object.

Raw:

db={
  "users": [
    {
      "_id": "9c69a57f-e90a-43be-b559-449e973c6cba",
      "__v": {
        "$numberInt": "0"
      },
      "friends": [
        {
          "status": "ACCEPTED",
          "user": "f24b189f-9e00-4d2b-b7f2-148a265fae7c"
        },
        {
          "status": "ACCEPTED",
          "user": "223f2e04-6f0c-40a3-a88a-69d0127f2e92"
        }
      ]
    }
  ],
  "activities": [
    {
      "_id": {
        "$oid": "63a92531bc6dea668f93bb06"
      },
      "invitations": [
        {
          "_id": {
            "$oid": "63a92531bc6dea668f93bb07"
          },
          "userId": "9c69a57f-e90a-43be-b559-449e973c6cba",
          "status": "ACCEPTED"
        },
        {
          "_id": {
            "$oid": "63a92544bc6dea668f93bb09"
          },
          "userId": "223f2e04-6f0c-40a3-a88a-69d0127f2e92",
          "status": "ACCEPTED"
        },

      ],
      "__v": {
        "$numberInt": "0"
      }
    }
  ]
}

Expected result:

 "expectedResult": [
    {
      "_id": "9c69a57f-e90a-43be-b559-449e973c6cba",
      "__v": {
        "$numberInt": "0"
      },
      "friends": [
        {
          "status": "ACCEPTED",
          "activities": [{
            "_id": {
              "$oid": "63a92531bc6dea668f93bb06"
            },
            "invitations": [
              {
                "_id": {
                  "$oid": "63a92531bc6dea668f93bb07"
                },
                "userId": "9c69a57f-e90a-43be-b559-449e973c6cba",
                "status": "ACCEPTED"
              },
              {
                "_id": {
                  "$oid": "63a92544bc6dea668f93bb09"
                },
                "userId": "223f2e04-6f0c-40a3-a88a-69d0127f2e92",
                "status": "ACCEPTED"
              },

            ],
            "__v": {
              "$numberInt": "0"
            }
          }]
        },
        {
          "status": "ACCEPTED",
          "activities": []
        }
      ]
    }
  ]

And here's a link to the playground.

I played around with aggregate and populate, but this use case is unlike a regular "join", which is throwing me off. Any pointers will be appreciated.


问:
How to change report directory in karate?
2 concerns mentioned below

Unable to change report directory of karate html reports. I tried with below snippet by using both relative and absolute path of new dir.

```<code> @testpathchange
     Scenario: Test report
             * configure report = { dir: 'src/test/java' }
             * print "Hello Test"
</code>```

I also added this in karate-config.js

```<code>karate.configure('report', { dir: 'src/test/java' });
</code>```

but report dir didn't change

[Updated] I noticed that for every run from ParalleRunner 'karate-summary.html' gets generated but when run using Junit5 it doesn't generate 'karate-summary.html', it only generate feature specific html

Also, ParallelRunner doesn't generate cucumber.json file even if I use outputCucumberJson(true) in testParallel() method

.outputCucumberJson(true)

Body:
2 concerns mentioned below

Unable to change report directory of karate html reports. I tried with below snippet by using both relative and absolute path of new dir.

 @testpathchange
     Scenario: Test report
             * configure report = { dir: 'src/test/java' }
             * print "Hello Test"

I also added this in karate-config.js

karate.configure('report', { dir: 'src/test/java' });

but report dir didn't change

[Updated] I noticed that for every run from ParalleRunner 'karate-summary.html' gets generated but when run using Junit5 it doesn't generate 'karate-summary.html', it only generate feature specific html

Also, ParallelRunner doesn't generate cucumber.json file even if I use outputCucumberJson(true) in testParallel() method

.outputCucumberJson(true)


问:
Cucumber test cases passing when run from file but not from folder
running from file

running from folder

Both options run the same test cases. If I run from the actual file(pic 1), I successfully pass my test cases. If I run from right clicking the test folder, I fail them. I have confirmed that they are the same. Anybody know what could cause this?


问:
Next.config.js -- if I want to test for a phase, should I export two objects?
```<code>/** @type {import('next').NextConfig} */
module.exports = {
  reactStrictMode: true,
};

module.exports = (phase) => {
  console.log("starting at phase: ", phase);

  const nextConfig = {
  };

  return nextConfig;
};
</code>```

In next.config.js, I have two exports. This feels wrong. While it works correctly, I get the feeling one is overwriting the other, despite one being an object and one being a function.

Am I doing this correctly?

Body:
/** @type {import('next').NextConfig} */
module.exports = {
  reactStrictMode: true,
};

module.exports = (phase) => {
  console.log("starting at phase: ", phase);

  const nextConfig = {
  };

  return nextConfig;
};

In next.config.js, I have two exports. This feels wrong. While it works correctly, I get the feeling one is overwriting the other, despite one being an object and one being a function.

Am I doing this correctly?


问:
How can I read the xls and ppt file and transform it into text in PHP
I'm working on a project in which I'm going to take the contents of two files (xls and ppt) and transform them into text. Can you explain me clearly how I can read these two files(xls and ppt) and transform it into text please?

Here is what I had tried to transform into text this xlsx file.

```<code>function xlsx_to_text($filePath) {

        if (!empty($filePath)) {

            $xml_filename = "xl/sharedStrings.xml"; //content file name
            $zip_handle = new ZipArchive;
            $output_text = "";

            if ( true === $zip_handle->open($filePath) ) {

                if(($xml_index = $zip_handle->locateName($xml_filename)) !== false) {

                    $xml_datas = $zip_handle->getFromIndex($xml_index);
                    $xml_handle = DOMDocument::loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
                    $output_text = strip_tags($xml_handle->saveXML());

                } else {

                    $output_text .="";

                }

                $zip_handle->close();

            } else {
                $output_text .="";
            }

            return $output_text;

        } else {
            return '';
        }

    }
</code>```

But I'm having trouble getting the text for the xls document. But what should I do?

Here is what I had tried to transform into text this pptx file.

```<code>function pptx_to_text($filePath){

        if (!empty($filePath)) {

            $zip_handle = new ZipArchive;
            $output_text = "";

            if(true === $zip_handle->open($filePath)){

                $slide_number = 1; //loop through slide files

                while(($xml_index = $zip_handle->locateName("ppt/slides/slide".$slide_number.".xml")) !== false) {

                    $xml_datas = $zip_handle->getFromIndex($xml_index);
                    $xml_handle = DOMDocument::loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
                    $output_text .= strip_tags($xml_handle->saveXML());
                    $slide_number++;

                }

                if($slide_number == 1){

                    $output_text .="";

                }

                $zip_handle->close();

            } else{

                $output_text .="";

            }

            return $output_text;

        } else {
            return '';
        }
    }
</code>```

But I'm having trouble getting the text for the ppt document. But what should I do?

Body:
I'm working on a project in which I'm going to take the contents of two files (xls and ppt) and transform them into text. Can you explain me clearly how I can read these two files(xls and ppt) and transform it into text please?

Here is what I had tried to transform into text this xlsx file.

function xlsx_to_text($filePath) {

        if (!empty($filePath)) {

            $xml_filename = "xl/sharedStrings.xml"; //content file name
            $zip_handle = new ZipArchive;
            $output_text = "";

            if ( true === $zip_handle->open($filePath) ) {

                if(($xml_index = $zip_handle->locateName($xml_filename)) !== false) {

                    $xml_datas = $zip_handle->getFromIndex($xml_index);
                    $xml_handle = DOMDocument::loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
                    $output_text = strip_tags($xml_handle->saveXML());

                } else {

                    $output_text .="";

                }

                $zip_handle->close();

            } else {
                $output_text .="";
            }

            return $output_text;

        } else {
            return '';
        }

    }

But I'm having trouble getting the text for the xls document. But what should I do?

Here is what I had tried to transform into text this pptx file.

function pptx_to_text($filePath){

        if (!empty($filePath)) {

            $zip_handle = new ZipArchive;
            $output_text = "";

            if(true === $zip_handle->open($filePath)){

                $slide_number = 1; //loop through slide files

                while(($xml_index = $zip_handle->locateName("ppt/slides/slide".$slide_number.".xml")) !== false) {

                    $xml_datas = $zip_handle->getFromIndex($xml_index);
                    $xml_handle = DOMDocument::loadXML($xml_datas, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);
                    $output_text .= strip_tags($xml_handle->saveXML());
                    $slide_number++;

                }

                if($slide_number == 1){

                    $output_text .="";

                }

                $zip_handle->close();

            } else{

                $output_text .="";

            }

            return $output_text;

        } else {
            return '';
        }
    }

But I'm having trouble getting the text for the ppt document. But what should I do?


问:
ERR_REQUIRE_ESM when importing React Library bundled with rollup
I'm already a couple of days trying to figure a way out of ERR_REQUIRE_ESM error.

I'm trying to create a React library on top of another React Library bundled with rollup.js

Thats my rollup config:

```<code>export default [
  {
    input: "src/index.ts",
    output: [
      {
        file: packageJson.main,
        format: "cjs",
        sourcemap: true,
        inlineDynamicImports: true,
      },
      {
        file: packageJson.module,
        format: "esm",
        sourcemap: true,
        inlineDynamicImports: true,
      },
    ],
    plugins: [
      peerDepsExternal(),
      json(),
      resolve({
        preferBuiltins: true,
        mainFields: ["browser", "module", "main"],
      }),
      commonjs(),

      typescript({ tsconfig: "./tsconfig.json" }),
      // terser(),
    ],
  },
  {
    input: "dist/esm/types/index.d.ts",
    output: [{ file: "dist/index.d.ts", format: "esm" }],
    plugins: [dts()],
  },
];
</code>```

and this is my package.js

```<code>...
...
"main": "dist/cjs/index.js",
  "module": "dist/esm/index.js",
  "types": "dist/index.d.ts",
  "peerDependencies": {
    "ethers": ">=5.5.1",
    "react": "^18.2.0",
    "wagmi": "0.9.x"
  },
  "files": [
    "dist"
  ],
  "exports": {
    ".": "./dist/index.js"
  },
...
...
</code>```

Update

I also tried DTS, but the outcome was the same

Body:
I'm already a couple of days trying to figure a way out of ERR_REQUIRE_ESM error.

I'm trying to create a React library on top of another React Library bundled with rollup.js

Thats my rollup config:

export default [
  {
    input: "src/index.ts",
    output: [
      {
        file: packageJson.main,
        format: "cjs",
        sourcemap: true,
        inlineDynamicImports: true,
      },
      {
        file: packageJson.module,
        format: "esm",
        sourcemap: true,
        inlineDynamicImports: true,
      },
    ],
    plugins: [
      peerDepsExternal(),
      json(),
      resolve({
        preferBuiltins: true,
        mainFields: ["browser", "module", "main"],
      }),
      commonjs(),

      typescript({ tsconfig: "./tsconfig.json" }),
      // terser(),
    ],
  },
  {
    input: "dist/esm/types/index.d.ts",
    output: [{ file: "dist/index.d.ts", format: "esm" }],
    plugins: [dts()],
  },
];

and this is my package.js

...
...
"main": "dist/cjs/index.js",
  "module": "dist/esm/index.js",
  "types": "dist/index.d.ts",
  "peerDependencies": {
    "ethers": ">=5.5.1",
    "react": "^18.2.0",
    "wagmi": "0.9.x"
  },
  "files": [
    "dist"
  ],
  "exports": {
    ".": "./dist/index.js"
  },
...
...

Update

I also tried DTS, but the outcome was the same


问:
Java springboot gke + secret manager
I have a problem with my java pod application:

I put a service account in the deployment.yaml, my code is:

```<code>@RestController
public class HelloSecretController{
    @Value("${sm://myjavasecret}")
    String myJavaSecret;
    @Autowired
    private Quickstart quick;
    @Autowired
    private GoogleCredentialsConfig config;
    @GetMapping
    public String hello(){
        String resultado ="";
        try{
             resultado = myJavaSecret + " World";
        }
        catch(com.google.api.gax.rpc.PermissionDeniedException deniedException){
            System.out.println("Houve um erro ao tentar pegar o SECRET MANAGER  {}"+ deniedException.getMessage());
            throw deniedException;
        }
        catch(Exception exception){
            System.out.println("Houve um erro ao tentar pegar o SECRET MANAGER  {}"+ exception.getMessage());
         }
        return resultado;
    }
}
</code>```

also put the reference in the properties.
But insede of the gke in GCP I'm getting this error:

Injection of autowired dependencies failed; nested exception is com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Permission 'secretmanager.versions.access' denied for resource

Can somebody please help?

I tryed declare a externalSecret, set this with a clusterStorage and set the same namespace at my deployment pod. I expected just print a simple hello word.

Title: Java springboot gke + secret manager

Body:
I have a problem with my java pod application:

I put a service account in the deployment.yaml, my code is:

@RestController
public class HelloSecretController{
    @Value("${sm://myjavasecret}")
    String myJavaSecret;
    @Autowired
    private Quickstart quick;
    @Autowired
    private GoogleCredentialsConfig config;
    @GetMapping
    public String hello(){
        String resultado ="";
        try{
             resultado = myJavaSecret + " World";
        }
        catch(com.google.api.gax.rpc.PermissionDeniedException deniedException){
            System.out.println("Houve um erro ao tentar pegar o SECRET MANAGER  {}"+ deniedException.getMessage());
            throw deniedException;
        }
        catch(Exception exception){
            System.out.println("Houve um erro ao tentar pegar o SECRET MANAGER  {}"+ exception.getMessage());
         }
        return resultado;
    }
}

also put the reference in the properties.
But insede of the gke in GCP I'm getting this error:

Injection of autowired dependencies failed; nested exception is com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Permission 'secretmanager.versions.access' denied for resource

Can somebody please help?

I tryed declare a externalSecret, set this with a clusterStorage and set the same namespace at my deployment pod. I expected just print a simple hello word.


问:
Post request using fetch to send image(files) but the files cannot be accesed at the server side
I am trying to make a airbnb type website where a host who wants to display his hotel can do so to the users. The host uploads images and other data in a form. The image i will host up using cloudinary(a cloud based hosting service) and display it to the users.

So for right now i want to send the images (along with other data which is mainly text and i know how to deal with that) to the server side.

My current html form code looks like this:

```<code><form className="form" method="POST" onSubmit={dealingWithAddListing} encType="multipart/form-data">
            <input
                        onChange={validateFileType}
                        type="file"
                        accept='image/png,image/jpeg'
                        multiple
                        id='image'
                        name='image'
            ></input>
</form>
</code>```

There is a submit type button which fires this function:

```<code>const dealingWithAddListing = async (event) => {
        event.preventDefault();

        var imageFiles = document.getElementById("image")
        const formData = new FormData();

        for(const file of imageFiles.files){
          formData.append("image",file)
        }
        for(const [key,value] of formData){
          console.log(`key is ${key}`)
          console.log(`value is ${value}`)
        }

        console.log(...formData.entries())
        const response = await fetch("/uploadingImages",{
          method:"POST",
          body: formData
        })
        console.log("the response to formdata is ")
        console.log(response)
}
</code>```

The server side code:

```<code>router.post("/uploadingImages", async (req,res)=>{
  try{
    console.log(req.files)
  }catch(error){
    console.log(error)
  }
})
</code>```

Now in the console i can see the formdata part working as i have logged it.Even the request is hitting properly. But when i access it req.body gives me {} and req.files gives me undefined.

Body:
I am trying to make a airbnb type website where a host who wants to display his hotel can do so to the users. The host uploads images and other data in a form. The image i will host up using cloudinary(a cloud based hosting service) and display it to the users.

So for right now i want to send the images (along with other data which is mainly text and i know how to deal with that) to the server side.

My current html form code looks like this:

<form className="form" method="POST" onSubmit={dealingWithAddListing} encType="multipart/form-data">
            <input
                        onChange={validateFileType}
                        type="file"
                        accept='image/png,image/jpeg'
                        multiple
                        id='image'
                        name='image'
            ></input>
</form>

There is a submit type button which fires this function:

const dealingWithAddListing = async (event) => {
        event.preventDefault();

        var imageFiles = document.getElementById("image")
        const formData = new FormData();

        for(const file of imageFiles.files){
          formData.append("image",file)
        }
        for(const [key,value] of formData){
          console.log(`key is ${key}`)
          console.log(`value is ${value}`)
        }

        console.log(...formData.entries())
        const response = await fetch("/uploadingImages",{
          method:"POST",
          body: formData
        })
        console.log("the response to formdata is ")
        console.log(response)
}

The server side code:

router.post("/uploadingImages", async (req,res)=>{
  try{
    console.log(req.files)
  }catch(error){
    console.log(error)
  }
})

Now in the console i can see the formdata part working as i have logged it.Even the request is hitting properly. But when i access it req.body gives me {} and req.files gives me undefined.


问:
Why does git ignore my edits to COMMIT_EDITMSG?
```<code>$ git config --global core.editor
code --wait
</code>```

When I run git commit --amend, a new tab is opened in VSCode named COMMIT_EDITMSG, but the command doesn't wait for me to edit and close the tab—the command completes and I get a new prompt in the terminal. When I edit the commit message, save, and close, and then do git log, the message hasn't changed.

Body:
$ git config --global core.editor
code --wait

When I run git commit --amend, a new tab is opened in VSCode named COMMIT_EDITMSG, but the command doesn't wait for me to edit and close the tab—the command completes and I get a new prompt in the terminal. When I edit the commit message, save, and close, and then do git log, the message hasn't changed.


问:
How to trigger a notification in AWS OpenSearch
I have created a Lambda which is triggered by an EventBridge rule that I created.

The purpose is for the Lambda to send a slack notification when an OpenSearch Service Upgrade is available.

I've tested the Lambda manually with a sample event and it works well, but I want to test it "for real" by getting a real OpenSearch instance to send a notification.

The OpenSearch domain I created is not sending notifications like I would expect it to.

I've created a new OpenSearch domain and used an old version of OpenSearch (1.0).

When I look at the OpenSearch domain I created in the AWS console, it shows the Version is OpenSearch 1.0 and there is an Upgrade Available (to 1.3).

However, this did not trigger a notification.

How do notifications get triggered? Would a notification only get triggered if a new Upgrade becomes available (e.g. 1.4) when my OpenSearch domain is already up and running?

Is there any way to force OpenSearch to trigger the notification?

I want OpenSearch to trigger a notification, which in turn is captured by EventBridge, and triggers my Lambda with an event like:

`

```<code>{
  "version": "0",
  "id": "01234567-0123-0123-0123-012345678901",
  "detail-type": "Amazon OpenSearch Service Software Update Notification",
  "source": "aws.es",
  "account": "123456789012",
  "time": "2016-11-01T13:12:22Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:es:us-east-1:123456789012:domain/test-domain"
  ],
  "detail": {
    "event": "Service Software Update",
    "status": "Available",
    "severity": "Informational",
    "description": "Service software update [R20200330-p1] available."
  }
}
</code>```

`

Body:
I have created a Lambda which is triggered by an EventBridge rule that I created.

The purpose is for the Lambda to send a slack notification when an OpenSearch Service Upgrade is available.

I've tested the Lambda manually with a sample event and it works well, but I want to test it "for real" by getting a real OpenSearch instance to send a notification.

The OpenSearch domain I created is not sending notifications like I would expect it to.

I've created a new OpenSearch domain and used an old version of OpenSearch (1.0).

When I look at the OpenSearch domain I created in the AWS console, it shows the Version is OpenSearch 1.0 and there is an Upgrade Available (to 1.3).

However, this did not trigger a notification.

How do notifications get triggered? Would a notification only get triggered if a new Upgrade becomes available (e.g. 1.4) when my OpenSearch domain is already up and running?

Is there any way to force OpenSearch to trigger the notification?

I want OpenSearch to trigger a notification, which in turn is captured by EventBridge, and triggers my Lambda with an event like:

`

{
  "version": "0",
  "id": "01234567-0123-0123-0123-012345678901",
  "detail-type": "Amazon OpenSearch Service Software Update Notification",
  "source": "aws.es",
  "account": "123456789012",
  "time": "2016-11-01T13:12:22Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:es:us-east-1:123456789012:domain/test-domain"
  ],
  "detail": {
    "event": "Service Software Update",
    "status": "Available",
    "severity": "Informational",
    "description": "Service software update [R20200330-p1] available."
  }
}

`


问:
How can i showcase a status of a transfer window which is open in blade file of players panel in a sports management system
I m working on a transfer window on a sports management system i have implemented the window and its already open and in the admin panel it shows that the transfer is operating.. i tried in the players panel and i cant get the same status, on, as in admin panel. here it the transfer is closed. below is my code  in my controllers and blades

Here is the PlayersAdminpanel Controller where i have passed all the models associated with the transfer as it it checks the dates if the transfer is still in operation

```<code>public function index()
    {
        $teams = Team::get();
        $currentTranfer = TransferWindow::where('start_date', '<=', now())
        ->where('end_date', '>=', now())
        ->first();

        return view('player.index', [
            'teams' => $teams,
            'currentTranfer'=> $currentTranfer,

        ]);

    }
</code>```
```<code>
 @if (now() >= $currentTranfer->start_date && now() <= $currentTranfer->end_date)
                                <span class="badge badge-success">window is open</span>
                            @else
                                <span class="badge badge-danger">window is open</span>
                            @endif

Here is the if statement in blade file in players dashboard which checks is the transfer window is open//
</code>```

Body:
I m working on a transfer window on a sports management system i have implemented the window and its already open and in the admin panel it shows that the transfer is operating.. i tried in the players panel and i cant get the same status, on, as in admin panel. here it the transfer is closed. below is my code  in my controllers and blades

Here is the PlayersAdminpanel Controller where i have passed all the models associated with the transfer as it it checks the dates if the transfer is still in operation

public function index()
    {
        $teams = Team::get();
        $currentTranfer = TransferWindow::where('start_date', '<=', now())
        ->where('end_date', '>=', now())
        ->first();

        return view('player.index', [
            'teams' => $teams,
            'currentTranfer'=> $currentTranfer,

        ]);

    }

 @if (now() >= $currentTranfer->start_date && now() <= $currentTranfer->end_date)
                                window is open
                            @else
                                window is open
                            @endif

Here is the if statement in blade file in players dashboard which checks is the transfer window is open//


问:
Nuxt serverMiddleware deploying to Vercel Serverless Function not finding Axios
I'm trying to utilize Vercel's Serverless Functions with Nuxt's serverMiddleware as outlined in vercel-builder.

The function is simple, just making a http request using axios:

~/api/index.js

```<code>import express from 'express'
import bodyParser from 'body-parser'
import axios from 'axios'

const app = express()
app.use(bodyParser.json())

app.get('/api/product', async function (_, res) {
    const url = 'https://connect.squareup.com/v2/catalog/list?types=ITEM'
    const headers = {
        Authorization: `Bearer abc`
    }
    const result = await axios.get(url, { headers })

    res.status(200).send(result.data)
})

export default app
</code>```

It works fine locally, however when deployed to Vercel, I get the following error in the functions logs:

```<code>ERROR   Cannot find module '/var/task/node_modules/axios/dist/node/axios.cjs'
ERROR   Did you forget to add it to "dependencies" in `package.json`?
</code>```

Axios is defined in the package.json:

```<code>...
"engines": {
  "node": "16.x"
},
"dependencies": {
  "@nuxtjs/axios": "^5.13.6",
  "axios": "1.2.1",
  "body-parser": "1.20.1",
  "core-js": "^3.19.3",
  "express": "4.18.2",
  "got": "12.5.3",
  "nuxt": "^2.15.8",
  "vue": "^2.6.14",
  "vue-gtag": "1.16.1",
  "vue-server-renderer": "^2.6.14",
  "vue-template-compiler": "^2.6.14",
  "vue2-touch-events": "3.2.2",
  "webpack": "^4.46.0"
},
...
</code>```

nuxt.config.js

```<code>  ..
  serverMiddleware: process.env.NODE_ENV === 'production' ? [] : ['~/api/index.js']
  ..
</code>```

vercel.json

```<code>{
  "version": 2,
  "routes": [
    {
      "src": "/api/product",
      "dest": "/api/index.js"
    }
  ],
  "builds": [
    {
       "src": "/api/index.js",
       "use": "@vercel/node"
    },
    {
       "src": "nuxt.config.js",
       "use": "@nuxtjs/vercel-builder",
       "config": {
          "serverFiles": ["api/**"]
       }
    }
  ]
}
</code>```

I've tried switching to use require() and a number of edits to nuxt.config.js and vercel.json to no avail.

Body:
I'm trying to utilize Vercel's Serverless Functions with Nuxt's serverMiddleware as outlined in vercel-builder.

The function is simple, just making a http request using axios:

~/api/index.js

import express from 'express'
import bodyParser from 'body-parser'
import axios from 'axios'

const app = express()
app.use(bodyParser.json())

app.get('/api/product', async function (_, res) {
    const url = 'https://connect.squareup.com/v2/catalog/list?types=ITEM'
    const headers = {
        Authorization: `Bearer abc`
    }
    const result = await axios.get(url, { headers })

    res.status(200).send(result.data)
})

export default app

It works fine locally, however when deployed to Vercel, I get the following error in the functions logs:

ERROR   Cannot find module '/var/task/node_modules/axios/dist/node/axios.cjs'
ERROR   Did you forget to add it to "dependencies" in `package.json`?

Axios is defined in the package.json:

...
"engines": {
  "node": "16.x"
},
"dependencies": {
  "@nuxtjs/axios": "^5.13.6",
  "axios": "1.2.1",
  "body-parser": "1.20.1",
  "core-js": "^3.19.3",
  "express": "4.18.2",
  "got": "12.5.3",
  "nuxt": "^2.15.8",
  "vue": "^2.6.14",
  "vue-gtag": "1.16.1",
  "vue-server-renderer": "^2.6.14",
  "vue-template-compiler": "^2.6.14",
  "vue2-touch-events": "3.2.2",
  "webpack": "^4.46.0"
},
...

nuxt.config.js

  ..
  serverMiddleware: process.env.NODE_ENV === 'production' ? [] : ['~/api/index.js']
  ..

vercel.json

{
  "version": 2,
  "routes": [
    {
      "src": "/api/product",
      "dest": "/api/index.js"
    }
  ],
  "builds": [
    {
       "src": "/api/index.js",
       "use": "@vercel/node"
    },
    {
       "src": "nuxt.config.js",
       "use": "@nuxtjs/vercel-builder",
       "config": {
          "serverFiles": ["api/**"]
       }
    }
  ]
}

I've tried switching to use require() and a number of edits to nuxt.config.js and vercel.json to no avail.


问:
Looking for a clean way to use Lamba in React HOC without using a named function
The following code errors when I use the React lint rules included with Next.js.

```<code>export const withTheme = (Component) => {
  // eslint-disable-next-line react/display-name
  return props => {
    const darkTheme = true;
    return (
      <Component {...props} darkTheme={darkTheme} />
    );
  }
};
</code>```

I can converted it by adding a name "func", but that makes me uncomfortable as this is a perfect use case for an anonymous function. Otherwise, it seems confusing why I would have made it a function that is only called once, and inline.

Here is the code without any lint errors, but it uses a name that is not used anyplace.

```<code>export const withTheme = (Component) => {
  return func
  function func(props) {
    const darkTheme = true;
    return (
      <Component {...props} darkTheme={darkTheme}/>
    );
  }
};
</code>```

Is there a way to keep the anonymous function in React without violating React lint rules?

BTW, the lint rules comes from nextjs and the file .eslintrc.json as follows.

```<code>{
  "extends": "next/core-web-vitals"
}
</code>```

Body:
The following code errors when I use the React lint rules included with Next.js.

export const withTheme = (Component) => {
  // eslint-disable-next-line react/display-name
  return props => {
    const darkTheme = true;
    return (
      <Component {...props} darkTheme={darkTheme} />
    );
  }
};

I can converted it by adding a name "func", but that makes me uncomfortable as this is a perfect use case for an anonymous function. Otherwise, it seems confusing why I would have made it a function that is only called once, and inline.

Here is the code without any lint errors, but it uses a name that is not used anyplace.

export const withTheme = (Component) => {
  return func
  function func(props) {
    const darkTheme = true;
    return (
      <Component {...props} darkTheme={darkTheme}/>
    );
  }
};

Is there a way to keep the anonymous function in React without violating React lint rules?

BTW, the lint rules comes from nextjs and the file .eslintrc.json as follows.

{
  "extends": "next/core-web-vitals"
}


问:
Schema Search - Oracle Developer Tools v21.5.0 for VS Code
Is it possible to use Oracle Developer Tools (v21.5.0) to search the connected schema for a table/object/view/column without initiating a query? For example, I want to know if the column "EmployeeName" exists anywhere in a database schema.

I tried searching from the sidebar which is partially successful. The search & filter works but only at the level displayed. This is fine if I am looking for a table or view name but not if I am searching for a column name across the entire database.


问:
How can i get ibeacon's (major and minor) values with react-native-ble-plx?
I need bluetooth data of surrounding ibeacons. (device name, mac address, rssi value) I can get these values. But major and minor values are important to me. how can i get them? I use react-native-ble-plx library. What solutions can you suggest me?

Library's Documentation:  https://dotintent.github.io/react-native-ble-plx/

My Codes:

```<code>import React, { useState } from 'react';
import {
  Button,
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
} from 'react-native';

import {
  Colors,
  DebugInstructions,
  Header,
  LearnMoreLinks,
  ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

import {BleManager} from 'react-native-ble-plx';
import useBLE from './useBLE';
var Buffer = require('buffer/').Buffer;
import base64 from 'react-native-base64';
const Parser = require("binary-parser").Parser;

const App = () => {
  const manager = new BleManager();
  const {requestPermissions} = useBLE();

  useState(() => {
    requestPermissions((isGranted) => {
      if (!isgranted) {
        alert("android permission granted: " + isGranted);
      }
    });
  }, []);

  // const ibeacon_format = Struct(
  //   "uuid" / Array(16, Byte),
  //   "major" / Int16ub,
  //   "minor" / Int16ub,
  //   "power" / Int8sl,
  // )

  const ibeaconFormat = new Parser()
    .int16("major")
    .int16("minor");

  function deneme() {
    manager.startDeviceScan(null, null, (error, device) => {

      console.log("device id: ",device.id);
      console.log("device name: ", device.localName);
      console.log("device rssi: ", device.rssi);
      // console.log(device.readCharacteristicForService());
      console.log("--------------------");

      // let data = new Buffer(device.manufacturerData.toString("base64"));
      // console.log(data);
      // let data = device.manufacturerData[0x004C];
      // let beacon = ibeacon_format.parse(data);
      // console.log(beacon);

      // let data = Buffer.from(device.manufacturerData, "base64");
      // console.log(ibeaconFormat.parse(data));

      if (error) {
        console.log(error);
      }
    });

  }

  function durdur() {
    manager.stopDeviceScan();
  }

  return (
    <View>
      <Text>Hello World</Text>
      <Button title="Deneme" onPress={deneme} />
      <Button title="Durdur" onPress={durdur} />
    </View>
  );
};

export default App;

// let time = date.getTime();
// let seconds = parseInt(time / 1000);
// let data = new Buffer(4);
// data.writeUInt32BE(seconds);

// this.manager.writeCharacteristicWithResponseForDevice(deviceId, serviceUUID, charUUID, data.toString('base64'))
// .then((success) => {
// resolve(success);
// })
// .catch((error) => {
// reject(error)
// })
// });
</code>```

Body:
I need bluetooth data of surrounding ibeacons. (device name, mac address, rssi value) I can get these values. But major and minor values are important to me. how can i get them? I use react-native-ble-plx library. What solutions can you suggest me?

Library's Documentation:  https://dotintent.github.io/react-native-ble-plx/

My Codes:

import React, { useState } from 'react';
import {
  Button,
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
} from 'react-native';

import {
  Colors,
  DebugInstructions,
  Header,
  LearnMoreLinks,
  ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

import {BleManager} from 'react-native-ble-plx';
import useBLE from './useBLE';
var Buffer = require('buffer/').Buffer;
import base64 from 'react-native-base64';
const Parser = require("binary-parser").Parser;

const App = () => {
  const manager = new BleManager();
  const {requestPermissions} = useBLE();

  useState(() => {
    requestPermissions((isGranted) => {
      if (!isgranted) {
        alert("android permission granted: " + isGranted);
      }
    });
  }, []);

  // const ibeacon_format = Struct(
  //   "uuid" / Array(16, Byte),
  //   "major" / Int16ub,
  //   "minor" / Int16ub,
  //   "power" / Int8sl,
  // )

  const ibeaconFormat = new Parser()
    .int16("major")
    .int16("minor");

  function deneme() {
    manager.startDeviceScan(null, null, (error, device) => {

      console.log("device id: ",device.id);
      console.log("device name: ", device.localName);
      console.log("device rssi: ", device.rssi);
      // console.log(device.readCharacteristicForService());
      console.log("--------------------");

      // let data = new Buffer(device.manufacturerData.toString("base64"));
      // console.log(data);
      // let data = device.manufacturerData[0x004C];
      // let beacon = ibeacon_format.parse(data);
      // console.log(beacon);

      // let data = Buffer.from(device.manufacturerData, "base64");
      // console.log(ibeaconFormat.parse(data));

      if (error) {
        console.log(error);
      }
    });

  }

  function durdur() {
    manager.stopDeviceScan();
  }

  return (
    <View>
      <Text>Hello World</Text>
      <Button title="Deneme" onPress={deneme} />
      <Button title="Durdur" onPress={durdur} />
    </View>
  );
};

export default App;

// let time = date.getTime();
// let seconds = parseInt(time / 1000);
// let data = new Buffer(4);
// data.writeUInt32BE(seconds);

// this.manager.writeCharacteristicWithResponseForDevice(deviceId, serviceUUID, charUUID, data.toString('base64'))
// .then((success) => {
// resolve(success);
// })
// .catch((error) => {
// reject(error)
// })
// });


问:
Nginx proxy pass is having 502/504 error and cannot reach the backend
I have a react project deployed inside an nginx docker container which is deployed on k8s which is on AWS.

I have a backend service which is deployed also on aws and I have a url to access it. It can be accessed directly on browser, on postman or my react app if I remove the proxy pass for this url, but I need the proxy pass to solve other issues.

It was working at the beginning and stopped working and I got 504, after trying every related solution from stack overflow, now I get 502 instead. And backend shows that nginx could never reach this backend.

There are many other backend Urls being used exactly the same way, and they are totally fine, it is just this one url which is not accessible.

I also have a local nginx running which never gives me issue on this backend Url, but even if I redeploy the react nginx server on aws and redeploy that backend service, it is still giving me 502. Any one have opinion on this weird issue?

Thank you for taking a look.

I tried every possible and related config for the locaton of this url in conf file. But none of them worked


问:
React-Data-Table problem with header/title styling
This is my code:

```<code>const customStyles = {
    header: {
      style: {
        textAlign: "left",
        backgroundColor: "#fafafa",
        borderBottom: "solid #eee 3px",
      },
    },
  };
        <DataTable
          title="AMERICAN FOOTBALL FEDERATION"
          data={data}
          columns={columns}
          customStyles={customStyles}
          theme="standings_theme"
          striped
        />
</code>```

I am trying to make the title a bigger font and change the font weight. In the header: style: section, those styles get applied, and I can work example change the color of the title text, but I can't change anything relating to the font. When I inspect element the font-size for the title is crossed out. Adding !important to the styles doesn't work either.

Thanks for the help!

Body:
This is my code:

const customStyles = {
    header: {
      style: {
        textAlign: "left",
        backgroundColor: "#fafafa",
        borderBottom: "solid #eee 3px",
      },
    },
  };
        <DataTable
          title="AMERICAN FOOTBALL FEDERATION"
          data={data}
          columns={columns}
          customStyles={customStyles}
          theme="standings_theme"
          striped
        />

I am trying to make the title a bigger font and change the font weight. In the header: style: section, those styles get applied, and I can work example change the color of the title text, but I can't change anything relating to the font. When I inspect element the font-size for the title is crossed out. Adding !important to the styles doesn't work either.

Thanks for the help!


问:
Is there a way to set up @Before and @After on cucumber test projects?
I have this code set up on a Hooks.java class

```<code>@Before("@Tag")
    public static void before() {
        System.out.println("Hooks inicando o driver");
        driver = DriverTypeFactory.getDriver(DriverTypeFactory.GECKO_DRIVER);
    }
    public static WebDriver getDriver(){
        return driver;
    }
    @After
    public static void after() {
        System.out.println("Hooks encerrando o driver");
        driver.close();
    }
</code>```

All the webdriver stuff works correctly, however i wanted to open and close the browser everytime a test ends.

However the Before and After steps won't execute no matter what i try. even those prints i set up wont appear on the console, so im sure the Cucumber code just skips the Before and jumps directly to my @Given Step.
Anyone knows some solution?

Body:
I have this code set up on a Hooks.java class

@Before("@Tag")
    public static void before() {
        System.out.println("Hooks inicando o driver");
        driver = DriverTypeFactory.getDriver(DriverTypeFactory.GECKO_DRIVER);
    }
    public static WebDriver getDriver(){
        return driver;
    }
    @After
    public static void after() {
        System.out.println("Hooks encerrando o driver");
        driver.close();
    }

All the webdriver stuff works correctly, however i wanted to open and close the browser everytime a test ends.

However the Before and After steps won't execute no matter what i try. even those prints i set up wont appear on the console, so im sure the Cucumber code just skips the Before and jumps directly to my @Given Step.
Anyone knows some solution?


问:
IntelliJ IDEA won't let me write to WSL directories in Dec 2022
Can anyone help with getting IntelliJ IDEA to allow me to create new projects into my WSL2 directories as well as open projects from them? I followed the guidance here https://www.jetbrains.com/help/idea/how-to-use-wsl-development-environment-in-product.html and it doesn't address this issue at all. Thank you.


问:
Is there an example of a java.net.http request with URI that does not refer to http(s)?
The java.net.http package takes URI to build a request. Is there an example of a working request URI that does not refer to http(s)?

For example:

```<code>HttpRequest.newBuilder()
  .uri(new URI("https://postman-echo.com/get"))
</code>```

Why does the builder take URI rather than a URL? Are there any working examples that demonstrate the usefulness of URI in this context, over URL?

Body:
The java.net.http package takes URI to build a request. Is there an example of a working request URI that does not refer to http(s)?

For example:

HttpRequest.newBuilder()
  .uri(new URI("https://postman-echo.com/get"))

Why does the builder take URI rather than a URL? Are there any working examples that demonstrate the usefulness of URI in this context, over URL?


问:
Debug Flutter app on Android device while simultaneously showing its screen on desktop with scrcpy
Working in Ubuntu, I'm debugging a Flutter app on my Android phone while I code it. So far that works fine, but I would like to see the phone screen on my pc for comfort. I know an emulator would do the trick, but for performance issues I used my phone instead.

So far I installed scrcpy, and managed to show the phone screen on the pc via WiFi debugging. The problem comes when I try to run both connections at the same time. If I have the WiFi scrcpy connection on, it disconects right when VS Code connects with the device via USB. And viceversa, if the USB debugging is on, attempting to start scrcpy kills the Flutter debug.


问:
How can I format cell with PHPExcel for CNPJ and Credit Card format
I'm using PHPExcel to generate a spreadsheet but I'm having trouble showing the values for the CNPJ and Credit Card fields, the Credit Card view is being rounded, I'm removing the CNPJ points and Credit Card spaces to display spreadsheet generation.

What I have:

```
    // CARTÃO DE CRÉDITO
    $objPHPExcel->getActiveSheet()->getStyle('A3')->getNumberFormat()->setFormatCode('################');
    // CNPJ
    $objPHPExcel->getActiveSheet()->getStyle('B3')->getNumberFormat()->setFormatCode('##############');
```

How can I display correctly?

Body:
I'm using PHPExcel to generate a spreadsheet but I'm having trouble showing the values for the CNPJ and Credit Card fields, the Credit Card view is being rounded, I'm removing the CNPJ points and Credit Card spaces to display spreadsheet generation.

What I have:

    // CARTÃO DE CRÉDITO
    $objPHPExcel->getActiveSheet()->getStyle('A3')->getNumberFormat()->setFormatCode('################');
    // CNPJ
    $objPHPExcel->getActiveSheet()->getStyle('B3')->getNumberFormat()->setFormatCode('##############');

How can I display correctly?


问:
I'm having trouble with testing part while making flutter package
I want to develop a more advanced version of the ListView widget as a package. This is my first package.

I wrote a code like this:

modern_card_listview.dart:

```<code>library modern_card_listview;

import 'package:flutter/material.dart';

class CardListView extends StatefulWidget {
  List items;
  CardListView({Key? key, required this.items}) : super(key: key);
  @override
  State<CardListView> createState() => _CardListViewState();
}

class _CardListViewState extends State<CardListView> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: ListView.builder(
          itemCount: widget.items.length,
          itemBuilder: ((context, index) {
            return Card(
              child: ListTile(
                title: widget.items[index],
              ),
            );
          }),
        ),
      ),
    );
  }
}
</code>```

I guess I need to use the dart file in the test folder to test the code.

modern_card_listview_test.dart:

```<code>import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:modern_card_listview/modern_card_listview.dart';

CardListView _listView = CardListView(
    items: const ["Bu bir", "Bu iki", "Bu uc", "Bu dort", "Bu bes"]);

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: _listView,
      ),
    );
  }
}
</code>```

How can I try the package I wrote? When I ran the code above, No tests were found. I get an error.This is my first pack and I'm still new. I would be grateful if you help.

I couldn't find a solution

Body:
I want to develop a more advanced version of the ListView widget as a package. This is my first package.

I wrote a code like this:

modern_card_listview.dart:

library modern_card_listview;

import 'package:flutter/material.dart';

class CardListView extends StatefulWidget {
  List items;
  CardListView({Key? key, required this.items}) : super(key: key);
  @override
  State<CardListView> createState() => _CardListViewState();
}

class _CardListViewState extends State<CardListView> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: ListView.builder(
          itemCount: widget.items.length,
          itemBuilder: ((context, index) {
            return Card(
              child: ListTile(
                title: widget.items[index],
              ),
            );
          }),
        ),
      ),
    );
  }
}

I guess I need to use the dart file in the test folder to test the code.

modern_card_listview_test.dart:

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:modern_card_listview/modern_card_listview.dart';

CardListView _listView = CardListView(
    items: const ["Bu bir", "Bu iki", "Bu uc", "Bu dort", "Bu bes"]);

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: _listView,
      ),
    );
  }
}

How can I try the package I wrote? When I ran the code above, No tests were found. I get an error.This is my first pack and I'm still new. I would be grateful if you help.

I couldn't find a solution


问:
CDK Tokens Resolve To Empty String
I am trying to add a CDK Aspect to this AWS workshop

https://github.com/aws-samples/aws-cdk-intro-workshop/tree/master/code/python/pipelines-workshop

My Aspect would prefix "my-custom-prefix-" to all role and policy names (org requirement don't ask why). And also adds a permission boundary to all roles.

```<code>@jsii.implements(IAspect)
class PermissionBoundaryAspect:
    def __init__(self, permission_boundary: Union[_iam.ManagedPolicy, str]) -> None:
        self.permission_boundary = permission_boundary

    def visit(self, construct_ref: IConstruct) -> None:
        if isinstance(scope, iam.Role):
            iam_role = scope.node.find_child('Resource')
            iam_role.add_property_override(property_path='PermissionsBoundary', value=self.permission_boundary)
            if iam_role.role_name.startswith("my-custom-prefix-"):
                pass
            else:
                newrolename = f"{iam_prefix}{iam_role.role_name}"
                iam_role.add_property_override(property_path='RoleName', value=newrolename)
</code>```

and I use it in my app.py

```<code>app = cdk.App()
WorkshopPipelineStack(app, "WorkshopPipelineStack")

cftdeveloperboundary = f"arn:aws:iam::{t_account_id}:policy/my-boundary-policy"
cdk.Aspects.of(app).add(PermissionBoundaryAspect(cftdeveloperboundary))

app.synth()
</code>```

Next I do cdk synth and in the CloudFormation template see the boundary is attached to roles and policy names are prefixed but not role names. The roles names are all RoleName: my-custom-prefix- whereas policy names are properly prefixed e.g. PolicyName: my-custom-prefix-PipelineRoleDefaultPolicy7BDC1ABB

Title: CDK Tokens Resolve To Empty String

Body:
I am trying to add a CDK Aspect to this AWS workshop

https://github.com/aws-samples/aws-cdk-intro-workshop/tree/master/code/python/pipelines-workshop

My Aspect would prefix "my-custom-prefix-" to all role and policy names (org requirement don't ask why). And also adds a permission boundary to all roles.

@jsii.implements(IAspect)
class PermissionBoundaryAspect:
    def __init__(self, permission_boundary: Union[_iam.ManagedPolicy, str]) -> None:
        self.permission_boundary = permission_boundary

    def visit(self, construct_ref: IConstruct) -> None:
        if isinstance(scope, iam.Role):
            iam_role = scope.node.find_child('Resource')
            iam_role.add_property_override(property_path='PermissionsBoundary', value=self.permission_boundary)
            if iam_role.role_name.startswith("my-custom-prefix-"):
                pass
            else:
                newrolename = f"{iam_prefix}{iam_role.role_name}"
                iam_role.add_property_override(property_path='RoleName', value=newrolename)

and I use it in my app.py

app = cdk.App()
WorkshopPipelineStack(app, "WorkshopPipelineStack")

cftdeveloperboundary = f"arn:aws:iam::{t_account_id}:policy/my-boundary-policy"
cdk.Aspects.of(app).add(PermissionBoundaryAspect(cftdeveloperboundary))

app.synth()

Next I do cdk synth and in the CloudFormation template see the boundary is attached to roles and policy names are prefixed but not role names. The roles names are all RoleName: my-custom-prefix- whereas policy names are properly prefixed e.g. PolicyName: my-custom-prefix-PipelineRoleDefaultPolicy7BDC1ABB