问:
How to switch to using Zeta SQL with DirectRunner?
Q: While using DirectRunner to test Beam SQL, how do I switch to using Zeta instead of Calcite?

Back story:
I am studying Apache Beam and am now playing with the SqlTransform.  I understand that there are two flavors of SQL processor available ... Zeta and Calcite.  I understand that the default is Calcite.  Since I eventually plan on running my pipeline in Dataflow, I wanted to switch to Zeta for testing.  I read the docs here which said:

To change dialects, pass the dialect’s full package name to the setPlannerName method in the PipelineOptions interface.

That was rather vague but I ended up coding:

```<code>var options = PipelineOptionsFactory.fromArgs(args).withValidation().create();
options.as(org.apache.beam.sdk.extensions.sql.impl.BeamSqlPipelineOptions.class).setPlannerName("org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner");
</code>```

When I now run my pipeline, I fail with:

```<code>---------------------------------------------------------------------------
com.google.zetasql.io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
    at com.google.zetasql.io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
    at com.google.zetasql.io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
    at com.google.zetasql.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
    at com.google.zetasql.ZetaSqlLocalServiceGrpc$ZetaSqlLocalServiceBlockingStub.getLanguageOptions(ZetaSqlLocalServiceGrpc.java:1562)
    at com.google.zetasql.LanguageOptions.getDefaultFeatures(LanguageOptions.java:57)
    at com.google.zetasql.LanguageOptions.<init>(LanguageOptions.java:65)
    at com.google.zetasql.AnalyzerOptions.<init>(AnalyzerOptions.java:56)
    at org.apache.beam.sdk.extensions.sql.zetasql.SqlAnalyzer.baseAnalyzerOptions(SqlAnalyzer.java:138)
    at org.apache.beam.sdk.extensions.sql.zetasql.SqlAnalyzer.getAnalyzerOptions(SqlAnalyzer.java:162)
    at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLPlannerImpl.rel(ZetaSQLPlannerImpl.java:80)
    at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner.convertToBeamRelInternal(ZetaSQLQueryPlanner.java:199)
    at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner.convertToBeamRel(ZetaSQLQueryPlanner.java:187)
    at org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv.parseQuery(BeamSqlEnv.java:112)
    at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:171)
    at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:110)
    at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:548)
    at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:499)
    at org.apache.beam.sdk.values.PCollection.apply(PCollection.java:373)
    at .(#47:1)
</code>```

It should be noted that the exact same pipeline works just fine without switching to Zeta.

In my maven dependencies I have (among others):

```<code>    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-extensions-sql</artifactId>
      <version>2.43.0</version>
    </dependency>

    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-extensions-sql-zetasql</artifactId>
      <version>2.43.0</version>
    </dependency>
</code>```

Here is a Gist showing the full Java notebook including the error.

Body:
Q: While using DirectRunner to test Beam SQL, how do I switch to using Zeta instead of Calcite?

Back story:
I am studying Apache Beam and am now playing with the SqlTransform.  I understand that there are two flavors of SQL processor available ... Zeta and Calcite.  I understand that the default is Calcite.  Since I eventually plan on running my pipeline in Dataflow, I wanted to switch to Zeta for testing.  I read the docs here which said:

To change dialects, pass the dialect’s full package name to the setPlannerName method in the PipelineOptions interface.

That was rather vague but I ended up coding:

var options = PipelineOptionsFactory.fromArgs(args).withValidation().create();
options.as(org.apache.beam.sdk.extensions.sql.impl.BeamSqlPipelineOptions.class).setPlannerName("org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner");

When I now run my pipeline, I fail with:

---------------------------------------------------------------------------
com.google.zetasql.io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
    at com.google.zetasql.io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
    at com.google.zetasql.io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
    at com.google.zetasql.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
    at com.google.zetasql.ZetaSqlLocalServiceGrpc$ZetaSqlLocalServiceBlockingStub.getLanguageOptions(ZetaSqlLocalServiceGrpc.java:1562)
    at com.google.zetasql.LanguageOptions.getDefaultFeatures(LanguageOptions.java:57)
    at com.google.zetasql.LanguageOptions.<init>(LanguageOptions.java:65)
    at com.google.zetasql.AnalyzerOptions.<init>(AnalyzerOptions.java:56)
    at org.apache.beam.sdk.extensions.sql.zetasql.SqlAnalyzer.baseAnalyzerOptions(SqlAnalyzer.java:138)
    at org.apache.beam.sdk.extensions.sql.zetasql.SqlAnalyzer.getAnalyzerOptions(SqlAnalyzer.java:162)
    at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLPlannerImpl.rel(ZetaSQLPlannerImpl.java:80)
    at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner.convertToBeamRelInternal(ZetaSQLQueryPlanner.java:199)
    at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner.convertToBeamRel(ZetaSQLQueryPlanner.java:187)
    at org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv.parseQuery(BeamSqlEnv.java:112)
    at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:171)
    at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:110)
    at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:548)
    at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:499)
    at org.apache.beam.sdk.values.PCollection.apply(PCollection.java:373)
    at .(#47:1)

It should be noted that the exact same pipeline works just fine without switching to Zeta.

In my maven dependencies I have (among others):

    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-extensions-sql</artifactId>
      <version>2.43.0</version>
    </dependency>

    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-extensions-sql-zetasql</artifactId>
      <version>2.43.0</version>
    </dependency>

Here is a Gist showing the full Java notebook including the error.


来源: stackexchange

问:
How should I change the code using the 8085 microprocessor to execute and read what is in quotes?
I am trying to write a code in an assembly programming language using 8085 microprocessor. The code should change all uppercase characters into lowercase taking into account that the text is written in ASCII code.
My simulator does not read what is in the brackets, to be more precise cpi 'A' (6th row), the same problems happen with other text in the brackets. Maybe someone knows how to change it so the simulator would be able to read that.

```<code>lowercase: mov b, a ; move N (length of text) to register B
    mov c, h ; move high byte of HL to register C
    mov d, l ; move low byte of HL to register D

lowercaseloop: ldax d ; load character from memory address pointed to by HL into accumulator
    cpi 'A'; compare character in accumulator with uppercase 'A'
    jc lowercaseskip ; if character is less than 'A', skip to next character
    cpi 'Z'+1 ; compare character in accumulator with one greater than uppercase 'Z'
    jnc lowercaseskip ; if character is not less than or equal to 'Z', skip to next character
    add a, 'a'-'A' ; convert uppercase character to lowercase
    stax d ; store character in accumulator back to memory address pointed to by HL

lowercaseskip: inx h ; increment high byte of HL
    inx d ; increment low byte of HL
    dec b ; decrement B (counter)
    jnz lowercaseloop ; repeat loop until B becomes zero
    ret ; return to caller
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I am trying to write a code in an assembly programming language using 8085 microprocessor. The code should change all uppercase characters into lowercase taking into account that the text is written in ASCII code.
My simulator does not read what is in the brackets, to be more precise cpi 'A' (6th row), the same problems happen with other text in the brackets. Maybe someone knows how to change it so the simulator would be able to read that.

lowercase: mov b, a ; move N (length of text) to register B
    mov c, h ; move high byte of HL to register C
    mov d, l ; move low byte of HL to register D

lowercaseloop: ldax d ; load character from memory address pointed to by HL into accumulator
    cpi 'A'; compare character in accumulator with uppercase 'A'
    jc lowercaseskip ; if character is less than 'A', skip to next character
    cpi 'Z'+1 ; compare character in accumulator with one greater than uppercase 'Z'
    jnc lowercaseskip ; if character is not less than or equal to 'Z', skip to next character
    add a, 'a'-'A' ; convert uppercase character to lowercase
    stax d ; store character in accumulator back to memory address pointed to by HL

lowercaseskip: inx h ; increment high byte of HL
    inx d ; increment low byte of HL
    dec b ; decrement B (counter)
    jnz lowercaseloop ; repeat loop until B becomes zero
    ret ; return to caller


问:
iOS React 16.8.0 site not loading anchored to the top of the page
When loading my React 16.8.0 site on an iOS device, it is not anchored to the top when it renders the first time.  Every other page is scrolled to the top and even after you logout and navigate back to the homepage.

My developer believes there is an issue with the react-helmet package we are using.

React 16.8.0
React-router-dom 5.2.0
Site: newlifeame.faithmo.com

Tried using a ScrollToTop javascript element to handle this.

Scroll to top


问:
vscode - how to open definition in split pane
I want vscode to open definition of a function/method in another split pane where the file is already open. Is there a shortcut/way to do this ?

I open my spec and code into split panes (say left side is spec and right side the code being tested). When I ctrl-click on the function under test in the spec (function call) it opens the same file in the spec pane. Why ? Why can't it scroll to the function in the already open file in the other pane ?

Or if there is some trick I am missing.


问:
ERR_TOO_MANY_REDIRECTS Spring Boot 3.0 security
Security config:

@Configuration
public class WebSecurityConfig {
    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        // default login
        // http.formLogin(Customizer.withDefaults());
        // custom authorize
        http
            .authorizeHttpRequests(authorize -> authorize
                .requestMatchers("/user/**", "/log", "/login", "/login.html").permitAll()
                .anyRequest().denyAll()
                )
            .formLogin(form -> form
                .loginPage("/log")
                .permitAll()
                );

        return http.build();
    }
}
```
<p><strong>Controller:</strong></p>
<pre class="lang-java prettyprint-override"><code>@Controller
public class LoginController {
    @RequestMapping("/log")
    String login() {
        return "login.html";
    }
}
</code>```

Application.yml:

enter image description here

I used http.formLogin(Customizer.withDefaults()); in SecurityFilterChain, it was working fine but I used formLogin it dosen`t work.

Body:
Security config:

@Configuration
public class WebSecurityConfig {
    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        // default login
        // http.formLogin(Customizer.withDefaults());
        // custom authorize
        http
            .authorizeHttpRequests(authorize -> authorize
                .requestMatchers("/user/**", "/log", "/login", "/login.html").permitAll()
                .anyRequest().denyAll()
                )
            .formLogin(form -> form
                .loginPage("/log")
                .permitAll()
                );

        return http.build();
    }
}

Controller:

@Controller
public class LoginController {
    @RequestMapping("/log")
    String login() {
        return "login.html";
    }
}

Application.yml:

enter image description here

I used http.formLogin(Customizer.withDefaults()); in SecurityFilterChain, it was working fine but I used formLogin it dosen`t work.


问:
Unity error CS0246: The type or namespace name 'UnityStandardAssets' could not be found
Even though there are surely a bunch of the same questions out there revealing the same exact topic as my problem, but I haven't found a suitable answer for me, therefore I do still have an issue.

Problem

I'm trying to code a game in Unity. The version I'm using is Unity 2021.3.15f1.

There, I have made a script (C#), which objective is to show a sequence message above the screen (subtitles for short). However, while making the script, I experienced the following error:

Assets\Scripts\Sequences\AOpening.cs(4,7): error CS0246: The type or namespace name 'UnityStandardAssets' could not be found (are you missing a using directive or an assembly reference?)

Here's my AOpening code, where the error came from:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;
using UnityEngine.UI;

public class AOpening : MonoBehaviour {

    public GameObject ThePlayer;
    public GameObject FadeScreenIn;
    public GameObject TextBox;

    void Start () {
        ThePlayer.GetComponent<FirstPersonController> ().enabled = false;
        StartCoroutine (ScenePlayer ());
    }

    IEnumerator ScenePlayer () {
        yield return new WaitForSeconds (1.5f);
        FadeScreenIn.SetActive (false);
        TextBox.GetComponent<Text> ().text = "I need to get out of here.";
        yield return new WaitForSeconds (2);
        TextBox.GetComponent<Text> ().text = "";
        ThePlayer.GetComponent<FirstPersonController> ().enabled = true;

    }

}
```

What I tried?

Relaunching the Unity engine

Removing using UnityStandardAssets.Characters.FirstPerson; from the script

None of these helped me.

I'd be more than grateful if someone here would be able to help me resolve this problem. Many thanks and have a nice day!

Body:
Even though there are surely a bunch of the same questions out there revealing the same exact topic as my problem, but I haven't found a suitable answer for me, therefore I do still have an issue.

Problem

I'm trying to code a game in Unity. The version I'm using is Unity 2021.3.15f1.

There, I have made a script (C#), which objective is to show a sequence message above the screen (subtitles for short). However, while making the script, I experienced the following error:

Assets\Scripts\Sequences\AOpening.cs(4,7): error CS0246: The type or namespace name 'UnityStandardAssets' could not be found (are you missing a using directive or an assembly reference?)

Here's my AOpening code, where the error came from:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;
using UnityEngine.UI;

public class AOpening : MonoBehaviour {

    public GameObject ThePlayer;
    public GameObject FadeScreenIn;
    public GameObject TextBox;

    void Start () {
        ThePlayer.GetComponent<FirstPersonController> ().enabled = false;
        StartCoroutine (ScenePlayer ());
    }

    IEnumerator ScenePlayer () {
        yield return new WaitForSeconds (1.5f);
        FadeScreenIn.SetActive (false);
        TextBox.GetComponent<Text> ().text = "I need to get out of here.";
        yield return new WaitForSeconds (2);
        TextBox.GetComponent<Text> ().text = "";
        ThePlayer.GetComponent<FirstPersonController> ().enabled = true;

    }

}

What I tried?

Relaunching the Unity engine

Removing using UnityStandardAssets.Characters.FirstPerson; from the script

None of these helped me.

I'd be more than grateful if someone here would be able to help me resolve this problem. Many thanks and have a nice day!


问:
SharePoint programmatic reading of list returns items on some lists but not on others on the same site
I have a question around the topic of reading SharePoint lists programmatically.

The code I've written is using app level authentication.

I am able to read items from some lists of the same SharePoint site but not others.

I think there's an issue that is related to the configuration of the permissions on the site and I wanted to know if anyone could share any thoughts around this issue.

I am at a point where I might just re-create a list myself instead of reading the one that already exists because I am not sure how to resolve this issue otherwise.

Any help would be greatly appreciated ! Thanks

```<code>def test_get_ibrx_it_list_count(self, office_service):
    """assert ibrx-it list count is greater than zero"""
    base_url = 'https://omitted.sharepoint.com/sites/example/'
    ctx = office_service.set_client_context(base_url)

    def print_progress(items):
        """
        :type items: office365.sharepoint.listitems.collection.ListItemCollection
        """
        print("Items read: {0}".format(len(items)))

    def get_total_count(target_list):
        """
        :type target_list: office365.sharepoint.lists.list.List
        """
        # all_items = target_list.items.top(50).get().execute_query()
        # all_items = target_list.items.get_all(500).execute_query()
        all_items = target_list.items.get_all(50, print_progress).execute_query()
        print("Total items count: {0}".format(len(all_items)))
        return len(all_items)

    # this list is empty as of 221227 -- this list exists and does NOT return items.
    # sharepoint_list = ctx.web.lists.get_by_title("IT Provisioning Request")

    # this list is NOT empty as of 221227 -- this list exists and it returns items.
    # sharepoint_list = ctx.web.lists.get_by_title("IT Employee List")

    # create by my user, and it returns a list of items. -- this list exists and it returns items.
    sharepoint_list = ctx.web.lists.get_by_title("Test List")

    count = get_total_count(sharepoint_list)
    assert count > 0
</code>```

This code works if I'm attempting to read a list that I've created on the SharePoint site. It also works for a pre-existing list on the SharePoint site of which I did not create. However, there are some lists that I did not create on the SharePoint site which I did not create that it can't read. I'm not sure why it's able to read some lists but not others on the same SharePoint site.

Body:
I have a question around the topic of reading SharePoint lists programmatically.

The code I've written is using app level authentication.

I am able to read items from some lists of the same SharePoint site but not others.

I think there's an issue that is related to the configuration of the permissions on the site and I wanted to know if anyone could share any thoughts around this issue.

I am at a point where I might just re-create a list myself instead of reading the one that already exists because I am not sure how to resolve this issue otherwise.

Any help would be greatly appreciated ! Thanks

def test_get_ibrx_it_list_count(self, office_service):
    """assert ibrx-it list count is greater than zero"""
    base_url = 'https://omitted.sharepoint.com/sites/example/'
    ctx = office_service.set_client_context(base_url)

    def print_progress(items):
        """
        :type items: office365.sharepoint.listitems.collection.ListItemCollection
        """
        print("Items read: {0}".format(len(items)))

    def get_total_count(target_list):
        """
        :type target_list: office365.sharepoint.lists.list.List
        """
        # all_items = target_list.items.top(50).get().execute_query()
        # all_items = target_list.items.get_all(500).execute_query()
        all_items = target_list.items.get_all(50, print_progress).execute_query()
        print("Total items count: {0}".format(len(all_items)))
        return len(all_items)

    # this list is empty as of 221227 -- this list exists and does NOT return items.
    # sharepoint_list = ctx.web.lists.get_by_title("IT Provisioning Request")

    # this list is NOT empty as of 221227 -- this list exists and it returns items.
    # sharepoint_list = ctx.web.lists.get_by_title("IT Employee List")

    # create by my user, and it returns a list of items. -- this list exists and it returns items.
    sharepoint_list = ctx.web.lists.get_by_title("Test List")

    count = get_total_count(sharepoint_list)
    assert count > 0

This code works if I'm attempting to read a list that I've created on the SharePoint site. It also works for a pre-existing list on the SharePoint site of which I did not create. However, there are some lists that I did not create on the SharePoint site which I did not create that it can't read. I'm not sure why it's able to read some lists but not others on the same SharePoint site.


问:
PowerBI (version 2.112.603.0) freezez on Windows 11 (version 22H2)
For the last couple of days I can't launch PowerBI (version 2.112.603.0) as an admin.

I'm on Windows 11 (version 22H2).

As per the doc suggests (https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-error-launching-desktop) I checked the content of the following folders and they're both empty.

C:\Users\[user]\AppData\Local\Microsoft\Power BI Desktop\WebView2\EBWebView\Crashpad\reports

C:\Users\[user]\AppData\Local\Microsoft\Power BI Desktop\WebView2\EBWebViewElevated\Crashpad\reports

What i'm observing is the following :

No error message, no alert, nothing.  I tried to reboot the computer, reinstall the windows app, install a previous release (Nov & Oct). Nothing works. The process starts and then freezes.

It was working like a charm a week ago. Any insights on this please ?


问:
Errno 30 read-only file system
I was coding a program for my raspberry pi pico. I wanted it to run a program as soon as it was plugged in. However, it should also register in a file called logs that something has happened.

Then I got the error. I'm from Austria, so it's in German, but it means, that I have no permission the write in that file. Can somebody please help me? (German error code: Schreibgeschützte Dateisystem)
Here is the Code:

```<code>print("Registering the process..")

logs = open("logs.txt", "a")

logs.write("Operation has been saved")

logs. Close()
</code>```

bb

Title: Errno 30 read-only file system

Body:
I was coding a program for my raspberry pi pico. I wanted it to run a program as soon as it was plugged in. However, it should also register in a file called logs that something has happened.

Then I got the error. I'm from Austria, so it's in German, but it means, that I have no permission the write in that file. Can somebody please help me? (German error code: Schreibgeschützte Dateisystem)
Here is the Code:

print("Registering the process..")

logs = open("logs.txt", "a")

logs.write("Operation has been saved")

logs. Close()

bb


问:
Copy a file from one archige directly to 2nd archive
Lets say I have archive1.zip with 3 files file1.txt, file2.txt and file3.txt and another archive with a folder folder 1 with file4.txt contained within it. How do I use winRAR or Winzip 27.0 either with command line or GUI, to transfer (copy, move) only file4.txt or folder 1 folder from archive 2.zip directly to archive1.zip

I have already tried using winRAR to add files from the 2nd archive to 1st archive in the file textbox but it cannot find the path and returns an error


问:
How I send email after upload the CSV file into mysql database using spring boot and mysql database
After upload, show number of successful, number of failed records. Eg 49 successful, 1 fail.
After upload the csv file how to send the email with attachment csv file and success message.
After upload, create email trigger showing details of upload.

Dear Sir,
After upload, show number of successful, number of failed records. Eg 49 successful, 1 fail(through the REST APIs)
After upload the csv file how to send the email with attachment csv file and success message(through the REST APIs).
After upload, create email trigger showing details of upload(Through the REST APIs).


问:
NestJS: .env variables is not loading properly
I am trying to manage some logic by using .env varibles but I dont how what I am doing wrong and a can get the variables loaded inside my services.

Here is my App.module.ts:

...
import { ConfigModule } from '@nestjs/config';
import configuration from './config/configuration';
...

@Module({
  imports: [
    ConfigModule.forRoot({
      load: [configuration],
      validationSchema: JoiValidationSchema,
      isGlobal: true,
    }),

    ...
  ],
  ...
})
export class AppModule {}
```
<p>Here is the configuration file:</p>
<pre class="lang-js prettyprint-override"><code>export default () => ({
  environment: process.env.NODE_ENV || 'dev',
  port: process.env.PORT || 5000,
  postgresPassword: process.env.POSTGRES_PASSWORD,
  postgresUsername: process.env.POSTGRES_USERNAME,
  postgresDbName: process.env.POSTGRES_NAME,
  postgresHost: process.env.POSTGRES_HOST,
  postgresPort: parseInt(process.env.POSTGRES_PORT, 10),
  defaultLimit: parseInt(process.env.DEFAULT_LIMIT, 10) || 10,
});
</code>```

When I print the variables in my ProductServices contructor it works good

export class ProductsService {
  private readonly logger = new Logger('ProductsServices');

  constructor(
    ...
    private readonly configService: ConfigService,
  ) {
    console.log(this.defaultLimit); // 10
    console.log(this.environment); // 'dev'
  }
  defaultLimit = this.configService.get<number>('defaultLimit');
  environment = this.configService.get<string>('environment');
```
<p>But when I trying to using in one of my <code>ProductService</code> methods it is <code>undefined</code>:</p>
<pre class="lang-js prettyprint-override"><code>  async removeAll() {
    console.log(this.environment); // undefined
    try {
      if (this.environment !== 'dev') {
        throw new UnauthorizedException();
      }
      ...
    } catch (error) {
      ...
    }
  }
</code>```

Any help will be appreciated

I need get the enviroment to manage some seed logic

Body:
I am trying to manage some logic by using .env varibles but I dont how what I am doing wrong and a can get the variables loaded inside my services.

Here is my App.module.ts:

...
import { ConfigModule } from '@nestjs/config';
import configuration from './config/configuration';
...

@Module({
  imports: [
    ConfigModule.forRoot({
      load: [configuration],
      validationSchema: JoiValidationSchema,
      isGlobal: true,
    }),

    ...
  ],
  ...
})
export class AppModule {}

Here is the configuration file:

export default () => ({
  environment: process.env.NODE_ENV || 'dev',
  port: process.env.PORT || 5000,
  postgresPassword: process.env.POSTGRES_PASSWORD,
  postgresUsername: process.env.POSTGRES_USERNAME,
  postgresDbName: process.env.POSTGRES_NAME,
  postgresHost: process.env.POSTGRES_HOST,
  postgresPort: parseInt(process.env.POSTGRES_PORT, 10),
  defaultLimit: parseInt(process.env.DEFAULT_LIMIT, 10) || 10,
});

When I print the variables in my ProductServices contructor it works good

export class ProductsService {
  private readonly logger = new Logger('ProductsServices');

  constructor(
    ...
    private readonly configService: ConfigService,
  ) {
    console.log(this.defaultLimit); // 10
    console.log(this.environment); // 'dev'
  }
  defaultLimit = this.configService.get<number>('defaultLimit');
  environment = this.configService.get<string>('environment');

But when I trying to using in one of my ProductService methods it is undefined:

  async removeAll() {
    console.log(this.environment); // undefined
    try {
      if (this.environment !== 'dev') {
        throw new UnauthorizedException();
      }
      ...
    } catch (error) {
      ...
    }
  }

Any help will be appreciated

I need get the enviroment to manage some seed logic


问:
IndexedDB doesn't work with javascript, doesn't collect data, includes doesn't exist
context: I have created a class to manage a table in indexedDB api; the problem is that this table has around 30K Records.

the Goal is Final is to create a search engine.

This is the class in question:

```<code>class TCGWallet {
    constructor() {
        this.dbName = "tcg-wallet";
        this.storeName = "quick_search";
        this.db = null;
        this.lastUpdateTimestamp = null;
    }

    async openDatabase() {
        // Abre la base de datos o la crea si no existe
        this.db = await new Promise((resolve, reject) => {
            const request = window.indexedDB.open(this.dbName, 1);
            request.onerror = event => reject(request.error);
            request.onsuccess = event => resolve(request.result);
            request.onupgradeneeded = event => {
                // Crea el almacenamiento (store) si no existe
                const db = event.target.result;
                if (!db.objectStoreNames.contains(this.storeName)) {
                    const store = db.createObjectStore(this.storeName, {
                        keyPath: "id",
                        autoIncrement: true
                    });
                    store.createIndex("card_id", "card_id");
                    store.createIndex("card_name", "card_name");
                    store.createIndex("set_code", "set_code");
                    store.createIndex("composite", ["card_id", "card_name", "set_code"]);
                }
            };
        });
    }

    async getLastUpdateTimestamp() {
        // Obtiene el último timestamp de actualización almacenado en la base de datos
        const store = this.db.transaction(this.storeName).objectStore(this.storeName);
        const lastUpdate = await new Promise((resolve, reject) => {
            const request = store.get("last_update");
            request.onerror = event => reject(request.error);
            request.onsuccess = event => resolve(request.result);
        });
        return lastUpdate ? lastUpdate.timestamp : null;
    }

    async setLastUpdateTimestamp(timestamp) {
        // Almacena el timestamp de actualización en la base de datos
        const store = this.db.transaction(this.storeName, "readwrite").objectStore(this.storeName);
        await new Promise((resolve, reject) => {
            const request = store.put({id: "last_update", timestamp});
            request.onerror = event => reject(request.error);
            request.onsuccess = event => resolve();
        });
    }

    async updateIfNecessary() {
        // Si han pasado 12 horas desde la última actualización, se actualiza la base de datos con los datos del archivo JSON
        const currentTimestamp = Date.now();
        this.lastUpdateTimestamp = await this.getLastUpdateTimestamp();
        if (!this.lastUpdateTimestamp || currentTimestamp - this.lastUpdateTimestamp > 12 * 60 * 60 * 1000) {
            const response = await fetch("/assets/sources/quick_search.json");
            const data = await response.json();
            const store = this.db.transaction(this.storeName, "readwrite").objectStore(this.storeName);
            for (const item of data) {
                store.put({card_id: item[0], card_name: item[1], set_code: item[2]});
            }
            await this.setLastUpdateTimestamp(currentTimestamp);
        }
    }

    async search(query) {
        // Realiza una búsqueda en la tabla quick_search de la base de datos y devuelve los resultados
        const transaction = this.db.transaction(this.storeName);
        const store = transaction.objectStore(this.storeName);
        const index = store.index("composite");
        const request = store.openKeyCursor();
        const results = [];
        request.onsuccess = event => {
            const cursor = event.target.result;
            if (cursor) {
                const key = cursor.primaryKey;
                const value = store.get(key);
                if (value.card_id.includes(query) || value.card_name.includes(query) || value.set_code.includes(query)) {
                    results.push(value);
                }
                cursor.continue();
            }
        };
        await transaction.done;
        return results;
    }

    async showSuggestions(query) {
        const suggestions = await this.search(query);
        const suggestionBox = document.querySelector("#suggestion-box");
        suggestionBox.innerHTML = "";
        for (const suggestion of suggestions) {
            const suggestionElement = document.createElement("div");
            suggestionElement.classList.add("suggestion");
            suggestionElement.innerText = suggestion.card_name;
            suggestionElement.addEventListener("click", event => {
                document.querySelector("#search").value = suggestion.card_name;
                suggestionBox.style.display = "none";
            });
            suggestionBox.appendChild(suggestionElement);
        }
        suggestionBox.style.display = "block";
    }
}

async function quickSearchEngine() {
    const wallet = new TCGWallet();
    await wallet.openDatabase();
    await wallet.updateIfNecessary();

    const searchInput = document.querySelector("#search");
    const suggestionBox = document.querySelector("#suggestion-box");

    searchInput.addEventListener("input", async function () {
        const query = this.value;
        if (query.length === 0) {
            suggestionBox.style.display = "none";
        } else {
            await wallet.showSuggestions(query);
        }
    });
}

document.addEventListener("DOMContentLoaded", function () {
    window.quickSearchEngine();

});

</code>```

The information is loaded through a json file that I have created in PHP from a database:

https://gist.github.com/arcanisgk/955784c6b118274fec425886de508fd1

I have tried several things but the problem is almost always the same; upon reaching the search method; it returns nothing.

therefore the error occurs in the if line:

value.card_id.includes(query)

I really have no idea what's wrong; if is the way the data was inserted; if it is in the form in which the search query is applied.

Body:
context: I have created a class to manage a table in indexedDB api; the problem is that this table has around 30K Records.

the Goal is Final is to create a search engine.

This is the class in question:

class TCGWallet {
    constructor() {
        this.dbName = "tcg-wallet";
        this.storeName = "quick_search";
        this.db = null;
        this.lastUpdateTimestamp = null;
    }

    async openDatabase() {
        // Abre la base de datos o la crea si no existe
        this.db = await new Promise((resolve, reject) => {
            const request = window.indexedDB.open(this.dbName, 1);
            request.onerror = event => reject(request.error);
            request.onsuccess = event => resolve(request.result);
            request.onupgradeneeded = event => {
                // Crea el almacenamiento (store) si no existe
                const db = event.target.result;
                if (!db.objectStoreNames.contains(this.storeName)) {
                    const store = db.createObjectStore(this.storeName, {
                        keyPath: "id",
                        autoIncrement: true
                    });
                    store.createIndex("card_id", "card_id");
                    store.createIndex("card_name", "card_name");
                    store.createIndex("set_code", "set_code");
                    store.createIndex("composite", ["card_id", "card_name", "set_code"]);
                }
            };
        });
    }

    async getLastUpdateTimestamp() {
        // Obtiene el último timestamp de actualización almacenado en la base de datos
        const store = this.db.transaction(this.storeName).objectStore(this.storeName);
        const lastUpdate = await new Promise((resolve, reject) => {
            const request = store.get("last_update");
            request.onerror = event => reject(request.error);
            request.onsuccess = event => resolve(request.result);
        });
        return lastUpdate ? lastUpdate.timestamp : null;
    }

    async setLastUpdateTimestamp(timestamp) {
        // Almacena el timestamp de actualización en la base de datos
        const store = this.db.transaction(this.storeName, "readwrite").objectStore(this.storeName);
        await new Promise((resolve, reject) => {
            const request = store.put({id: "last_update", timestamp});
            request.onerror = event => reject(request.error);
            request.onsuccess = event => resolve();
        });
    }

    async updateIfNecessary() {
        // Si han pasado 12 horas desde la última actualización, se actualiza la base de datos con los datos del archivo JSON
        const currentTimestamp = Date.now();
        this.lastUpdateTimestamp = await this.getLastUpdateTimestamp();
        if (!this.lastUpdateTimestamp || currentTimestamp - this.lastUpdateTimestamp > 12 * 60 * 60 * 1000) {
            const response = await fetch("/assets/sources/quick_search.json");
            const data = await response.json();
            const store = this.db.transaction(this.storeName, "readwrite").objectStore(this.storeName);
            for (const item of data) {
                store.put({card_id: item[0], card_name: item[1], set_code: item[2]});
            }
            await this.setLastUpdateTimestamp(currentTimestamp);
        }
    }

    async search(query) {
        // Realiza una búsqueda en la tabla quick_search de la base de datos y devuelve los resultados
        const transaction = this.db.transaction(this.storeName);
        const store = transaction.objectStore(this.storeName);
        const index = store.index("composite");
        const request = store.openKeyCursor();
        const results = [];
        request.onsuccess = event => {
            const cursor = event.target.result;
            if (cursor) {
                const key = cursor.primaryKey;
                const value = store.get(key);
                if (value.card_id.includes(query) || value.card_name.includes(query) || value.set_code.includes(query)) {
                    results.push(value);
                }
                cursor.continue();
            }
        };
        await transaction.done;
        return results;
    }

    async showSuggestions(query) {
        const suggestions = await this.search(query);
        const suggestionBox = document.querySelector("#suggestion-box");
        suggestionBox.innerHTML = "";
        for (const suggestion of suggestions) {
            const suggestionElement = document.createElement("div");
            suggestionElement.classList.add("suggestion");
            suggestionElement.innerText = suggestion.card_name;
            suggestionElement.addEventListener("click", event => {
                document.querySelector("#search").value = suggestion.card_name;
                suggestionBox.style.display = "none";
            });
            suggestionBox.appendChild(suggestionElement);
        }
        suggestionBox.style.display = "block";
    }
}

async function quickSearchEngine() {
    const wallet = new TCGWallet();
    await wallet.openDatabase();
    await wallet.updateIfNecessary();

    const searchInput = document.querySelector("#search");
    const suggestionBox = document.querySelector("#suggestion-box");

    searchInput.addEventListener("input", async function () {
        const query = this.value;
        if (query.length === 0) {
            suggestionBox.style.display = "none";
        } else {
            await wallet.showSuggestions(query);
        }
    });
}

document.addEventListener("DOMContentLoaded", function () {
    window.quickSearchEngine();

});

The information is loaded through a json file that I have created in PHP from a database:

https://gist.github.com/arcanisgk/955784c6b118274fec425886de508fd1

I have tried several things but the problem is almost always the same; upon reaching the search method; it returns nothing.

therefore the error occurs in the if line:

value.card_id.includes(query)

I really have no idea what's wrong; if is the way the data was inserted; if it is in the form in which the search query is applied.


Title: how to use capscale {vegan} r

Body:
I have used

?capscale

and scoured the internet for answers, but am still not understanding what should be the dependent variable for my dataset if I want to use

capscale()

to analyze my data.

I have NDVI data with some continuous and some categorical variables:

ndvi=structure(list(siteOID = 25840:25939, Elevation = c(1871.92,
1875.38, 1878.28, 1878.54, 1878.33, 1879.2, 1880.51, 1883.78,
1884.6, 1884.85, 1885.46, 1888.72, 1890.94, 1897.19, 1901.95,
1902.47, 1902.81, 1903.49, 1906.62, 1908.73, 1909.4, 1910.65,
1913.44, 1915, 1915.81, 1918.06, 1920.01, 1921.53, 1925.48, 1926.66,
1927.64, 1931.02, 1932.8, 1935.27, 1938.33, 1941.19, 1945.71,
1948.68, 1951.52, 1951.83, 1955.76, 1961.02, 1963.92, 1963.25,
1969.53, 1972.56, 1977.92, 1978.93, 1981.54, 1985.64, 1987.6,
1987.62, 1988.78, 1991.92, 1997.03, 1998.06, 1998.98, 2001.26,
2006.97, 2009.56, 2009.81, 2011.55, 2017.92, 2021.75, 2023.42,
2024.91, 2028.15, 2032.83, 2032.83, 2033.5, 2035.75, 2037.44,
2045.51, 2047.38, 2049.85, 2052.33, 2059.36, 2069.27, 2071.41,
2071.83, 2074.15, 2081.55, 2083.52, 2086.3, 2090.5, 2095.57,
2096.69, 2100.65, 2108.06, 2110.48, 2113.45, 2121.78, 2124.82,
2133.54, 2137.54, 2146.43, 2150.53, 2156.63, 2160.05, 2168.57
), Shape_Area = c(2940.395887, 5105.447128, 3763.362181, 2801.775054,
3854.690283, 4627.01632, 6863.6264, 5452.724569, 3504.284818,
3967.710707, 7004.963815, 3926.00215, 7645.532158, 6306.085153,
3451.101972, 4699.688114, 3880.378241, 4792.898829, 5542.142348,
3674.957345, 3562.897792, 3219.790167, 5369.915585, 3854.684578,
3737.522732, 5190.103216, 5137.457907, 4753.975071, 3605.727759,
4682.430962, 3412.007599, 4955.96479, 0, 5106.057222, 3026.454348,
6814.973732, 5422.439336, 4523.077568, 3092.711952, 2667.1801,
2318.487235, 1623.008863, 2672.648264, 2524.245809, 2164.660806,
3153.921959, 3170.875701, 3755.980623, 4505.277, 3954.724973,
3592.717424, 2877.927426, 3465.37684, 2317.185185, 3249.657309,
2710.26402, 3421.803771, 2556.020604, 3849.407062, 3782.797907,
1950.365079, 3522.797668, 2340.599897, 2451.029503, 3034.109721,
2873.167998, 2278.337947, 2546.02206, 3545.854694, 3514.69201,
2731.819076, 2537.618027, 2116.84627, 2213.553587, 4430.489625,
2648.387315, 4408.844477, 3453.225099, 2457.844425, 3597.718985,
3933.191433, 3280.424579, 2309.053402, 4062.750209, 2755.087578,
3785.974581, 3485.221528, 4698.642524, 3647.400111, 4512.594002,
4509.418612, 3908.621289, 5856.573472, 4084.254238, 4772.464487,
4587.251362, 3275.527576, 3236.108516, 4771.636048, 5241.064376
),slopemean = c(7.012740221, 6.374673005, 6.713881453, 6.219425964,
5.393005565, 5.567550724, 4.557037692, 5.122994391, 5.608577084,
5.054081163, 3.020378928, 3.535192937, 2.910682318, 2.262314184,
1.872473637, 2.04489899, 1.358906129, 1.738190173, 2.190473907,
2.285263883, 1.932403531, 1.318049102, 2.323188104, 2.838744229,
2.5508166, 3.662199524, 2.645026659, 2.691092801, 2.209619006,
2.360828268, 2.83633309, 2.917255029, 3.814524024, 3.594417877,
2.537033654, 2.758014447, 6.487904879, 6.546860137, 6.611400228,
6.548973659, 7.320545057, 7.167488849, 7.486095047, 6.736548642,
6.978404939, 6.209158245, 5.780635711, 5.952286865, 6.21757545,
6.026404989, 8.286706911, 5.013909823, 4.302618208, 5.958519395,
4.735497169, 6.86024694, 5.923437148, 4.814125561, 6.278868822,
6.369820399, 4.211901608, 5.067338774, 7.276210246, 9.342363631,
7.382804547, 7.026542905, 7.386944243, 6.993269548, 4.999933584,
5.386859906, 5.74222567, 6.407413812, 6.220262604, 6.361011563,
7.89187751, 7.504486516, 8.071826326, 7.282463079, 5.730589071,
6.75588336, 5.865557512, 5.567460529, 5.743696501, 6.234486916,
6.672290961, 4.424730467, 3.993647329, 5.934593258, 7.937450668,
8.264807165, 7.39251924, 7.862093222, 6.829388913, 7.447980573,
6.477102849, 6.185640762, 7.760704698, 8.44009344, 8.557933442,
7.60872553), avwidth = c(41.38533, 44.11806, 43.54585, 38.07962,
40.80878, 49.52246, 49.97194, 51.36124, 50.45419, 51.12577, 52.46919,
49.68379, 43.48322, 51.95128, 46.91944, 58.70265, 55.41018, 50.92463,
55.55058, 45.73485, 50.29035, 49.08618, 52.57013, 51.48199, 52.90921,
44.27491, 55.71036, 50.08104, 47.3439, 49.8397, 51.81409, 50.43767,
60.95491, 38.50229, 47.8118, 52.66532, 44.10194, 46.67934, 46.46481,
37.64217, 21.84973, 25.04575, 33.79403, 29.61029, 29.71018, 21.3549,
28.02716, 38.25882, 45.25996, 40.10562, 46.15768, 40.82856, 42.1975,
31.75748, 32.83316, 34.33412, 33.54285, 39.29999, 33.25312, 33.65804,
30.00087, 32.63515, 31.11767, 31.14068, 27.83876, 30.20586, 34.80735,
32.65111, 38.31069, 43.65983, 35.21719, 32.87317, 28.83573, 33.8517,
29.72621, 32.61762, 31.11199, 23.89315, 31.26606, 33.78306, 34.89358,
38.64512, 34.68206, 34.2003, 44.12035, 35.59922, 48.34063, 47.52268,
47.02729, 51.07513, 51.5254, 43.25953, 47.01821, 38.28714, 35.90366,
40.30569, 48.04857, 54.46596, 49.70541, 49.18992), watershed = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L), .Label = c("marys", "reese", "wwalker"), class = "factor")), row.names = c(NA,
100L), class = "data.frame")

So, siteOID is each individual site and the categorical variable is watershed.

Now, I am trying to evaluate potential influences of NDVI in multivariate space, by conducting a Canonical Analysis of Principal Coordinates on a Gower similarity matrix of scaled habitat variables using the “capscale” function from the vegan package in R (Oksanen et al. 2013).

ndvi.cap <- capscale(siteOID~ Elevation + Shape_Area + avwidth + slopemean + watershed, ndvi,
                     dist="bray")

I don't understand how capscale formula is meant to be set up due to the lack of examples with actual explanations of what should be the dependent variable. The example in

?capscale

## Basic Analysis
vare.cap <- capscale(varespec ~ N + P + K + Condition(Al), varechem,
                     dist="bray")
vare.cap
plot(vare.cap)
anova(vare.cap)

uses two (!) different datasets, which does not make sense to me. Should I be putting the actual NDVI values as the dependent variable and not the site? I do have many NDVI-related variables associated with each site (actual NDVI value, differences between seasons, sens slope for trend), but I am not sure if a continuous variable should be listed as the dependent variable or not.

My question is similar to : Alternative example for capscale function in vegan package

but the answer given there did not help me.


问:
glob.glob special characters
I usually uses the code below to loop from a dir and concatenate multiple files, however, the folders I'm trying to access have multiple special characters, hence, glob.glob output an empty list.

```<code>    tfn = str(list(p[i]))
    filepath = r'/mnt/HDD/{}/*.csv'
    filenames = glob.glob(filepath.format(tfn))
</code>```

example of folders' name:

```<code>HV1650p2_['age', 'country']
HV1650p2_['age', 'country', 'width']
HV1650p2_['age', 'country', 'length']
HV1650p2_['age', 'country', 'season', 'length']
</code>```

Is there anyway to circumvent this with glob.glob? I've tried glob.escape but with no luck

thanks in advance

Title: glob.glob special characters

Body:
I usually uses the code below to loop from a dir and concatenate multiple files, however, the folders I'm trying to access have multiple special characters, hence, glob.glob output an empty list.

    tfn = str(list(p[i]))
    filepath = r'/mnt/HDD/{}/*.csv'
    filenames = glob.glob(filepath.format(tfn))

example of folders' name:

HV1650p2_['age', 'country']
HV1650p2_['age', 'country', 'width']
HV1650p2_['age', 'country', 'length']
HV1650p2_['age', 'country', 'season', 'length']

Is there anyway to circumvent this with glob.glob? I've tried glob.escape but with no luck

thanks in advance


问:
MySQL explain output format in JSON
Can somebody explain the what's the query_cost and cost_info fields in the output of EXPLAIN FORMAT=JSON in MySQL. I know that mysql costs are calculated with cost values defined in the table mysql.server_cost and mysql.engine_cost, But I'm not able to understand what are the steps are accounted in query_cost, read_cost, eval_cost, prefix_cost, data_read_per_join

An example EXPAIN FORMAT=JSON output is added for reference.
I did very simple query like this `

```<code>EXPLAIN FORMAT=JSON SELECT * FROM test WHERE id >= 1 and id <= 9;

</code>```

And the output is...

```<code>{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.06"
    },
    "table": {
      "table_name": "test",
      "access_type": "range",
      "possible_keys": [
        "PRIMARY"
      ],
      "key": "PRIMARY",
      "used_key_parts": [
        "id"
      ],
      "key_length": "4",
      "rows_examined_per_scan": 9,
      "rows_produced_per_join": 9,
      "filtered": "100.00",
      "cost_info": {
        "read_cost": "1.16",
        "eval_cost": "0.90",
        "prefix_cost": "2.06",
        "data_read_per_join": "288"
      },
      "used_columns": [
        "id",
        "catIds"
      ],
      "attached_condition": "((`test_dec_2022`.`test`.`id` >= 1) and (`test_dec_2022`.`test`.`id` <= 9))"
    }
  }
}
</code>```

Understanding of MySQL explain statement output in JSON format.

Title: MySQL explain output format in JSON

Body:
Can somebody explain the what's the query_cost and cost_info fields in the output of EXPLAIN FORMAT=JSON in MySQL. I know that mysql costs are calculated with cost values defined in the table mysql.server_cost and mysql.engine_cost, But I'm not able to understand what are the steps are accounted in query_cost, read_cost, eval_cost, prefix_cost, data_read_per_join

An example EXPAIN FORMAT=JSON output is added for reference.
I did very simple query like this `

EXPLAIN FORMAT=JSON SELECT * FROM test WHERE id >= 1 and id <= 9;

And the output is...

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.06"
    },
    "table": {
      "table_name": "test",
      "access_type": "range",
      "possible_keys": [
        "PRIMARY"
      ],
      "key": "PRIMARY",
      "used_key_parts": [
        "id"
      ],
      "key_length": "4",
      "rows_examined_per_scan": 9,
      "rows_produced_per_join": 9,
      "filtered": "100.00",
      "cost_info": {
        "read_cost": "1.16",
        "eval_cost": "0.90",
        "prefix_cost": "2.06",
        "data_read_per_join": "288"
      },
      "used_columns": [
        "id",
        "catIds"
      ],
      "attached_condition": "((`test_dec_2022`.`test`.`id` >= 1) and (`test_dec_2022`.`test`.`id` <= 9))"
    }
  }
}

Understanding of MySQL explain statement output in JSON format.


问:
Auto update container image when new build is released into kubernetes with gitlab ci/cd and helm
I have a private repository. How can update my kubernetes automatically every time I deploy new build?

I found a similar post here: Auto Update Container Image When New Build Released on Kubernetes

But I already have the ImagePull set to always. And I’musing gitlab ci/cd and helm for the deployment.


问:
Specifying Dapr command arguments for individual services throws an error
As stated in the docs  you can Configure --app-max-concurrency for the orders service

```<code># Configure --app-max-concurrency for the orders service
extensions:
- name: dapr
  services:
    orders:
      app-max-concurrency: 1
services:
- name: orders
  project: orders/orders.csproj
- name: products
  project: products/products.csproj
- name: store
  project: store/store.csproj
</code>```

but when I try on my tye.yaml file I get the following error message:

```<code>Error parsing tye.yaml: (23, 7): Expected scalar value for key: "services".
</code>```

Body:
As stated in the docs  you can Configure --app-max-concurrency for the orders service

# Configure --app-max-concurrency for the orders service
extensions:
- name: dapr
  services:
    orders:
      app-max-concurrency: 1
services:
- name: orders
  project: orders/orders.csproj
- name: products
  project: products/products.csproj
- name: store
  project: store/store.csproj

but when I try on my tye.yaml file I get the following error message:

Error parsing tye.yaml: (23, 7): Expected scalar value for key: "services".


问:
Does priority_queue provide a predictable order?
Does std::priorirty_queue guarantee a specific ordering (regardless of the standard library implementation) when extracting elements in a largest-first order?

Suppose that the comparison function that is provided cannot resolve all ties. For example, we may be storing pairs of integers in the priority queue, and comparing them based on the first value. This way (1,2) and (1,3) compare equal. For a given insertion order with .push(), is a specific extraction order guaranteed when using .pop()? Or is it possible (i.e. consistent with the standard) that some implementations return (1,2) before (1,3) while others return (1,3) first?


问:
how to convert balise xml to an Excel format
I have an xml file which have a special structure , I need to convert it to Excel file using a script python This is a part of my xml File :

```<code><?xml version="1.0" encoding="UTF-8"?>
<results version="2">
<cppcheck version="2.9"/>
<errors>
    <error id="identicalInnerCondition" severity="warning" msg="Identical inner 'if' condition is always true." verbose="Identical inner 'if' condition is always true (outer condition is 'nTransSize!=0' and inner condition is 'nTransSize!=0')." cwe="398" file0="../Apps/TSI/Src/ECRTransport.cpp">
        <location file="..\Apps\TSI\Src\ECRTransport.cpp" line="123" column="32" info="identical inner condition: nTransSize!=0"/>
        <location file="..\Apps\TSI\Src\ECRTransport.cpp" line="121" column="28" info="outer condition: nTransSize!=0"/>
    </error>
    <error id="syntaxError" severity="error" msg="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." verbose="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." file0="../Apps/TeliumGeneric/Cust_Chase/Src/cust_chase.c">
        <location file="..\Apps\TeliumGeneric\Cust_Chase\Src\cust_chase.c" line="116" column="1"/>
    </error>
    <error id="syntaxError" severity="error" msg="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." verbose="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." file0="../Apps/TeliumGeneric/Cust_Chase/Src/cust_chase_reports.c">
        <location file="..\Apps\TeliumGeneric\Cust_Chase\Src\cust_chase_reports.c" line="95" column="1"/>
    </error>
    <error id="syntaxError" severity="error" msg="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." verbose="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." file0="../Apps/TeliumGeneric/Cust_Chase/Src/host_chase.c">
        <location file="..\Apps\TeliumGeneric\Cust_Chase\Src\host_chase.c" line="111" column="1"/>
    </error>
    <error id="syntaxError" severity="error" msg="Code 'TeliumUtilities::STR_FormatAmountComma' is invalid C code. Use --std or --language to configure the language." verbose="Code 'TeliumUtilities::STR_FormatAmountComma' is invalid C code. Use --std or --language to configure the language." file0="../Apps/TeliumGeneric/Cust_Elavon/Src/cust_elavon.c">
        <location file="..\Apps\TeliumGeneric\Cust_Elavon\Src\cust_elavon.c" line="522" column="9"/>
    </error>
</code>```

I'm using a script python and it works fine for me Just there is something wrong , if we have an info (message error in the location balise) it must be shown on the Excel file , else we must have the msg error shown in the Excel File.
This is my script python:

```<code>import xml.etree.ElementTree as ET
import csv
import openpyxl
import sys

xml_data = open('.\CppCheckReport.xml', 'r').read()

root = ET.fromstring(xml_data)

csvfile = open("Report.csv",'w', newline='')
csvfile_writer = csv.writer(csvfile)
csvfile_writer.writerow(["File","Line","Severity","Id","Summary"])

for child in root.findall("errors"):
    for item in child:
        csv_line1 = [item.attrib["severity"],item.attrib["id"] , item.attrib["msg"]]
        for location in item.findall('location'):
           csv_line2 = [location.attrib["file"],location.attrib["line"]]
           for info in location.findall("info"):
               print(info.attrib["info"])
               if(info.attrib["info"]!=''):
                  csv_line3 = [item.attrib["severity"],item.attrib["id"] , info.attrib["info"]]
                   print(csv_line3)
                else:
                   csv_line3 = csv_line1
    csvfile_writer.writerow(csv_line2 + csv_line3)
  csvfile.close()

  wb = openpyxl.Workbook()
  ws = wb.active

  with open('Report.csv') as f:
       reader = csv.reader(f, delimiter=',')
       for row in reader:
           ws['A1'] = 'CppCheck 2.9 Report'
           ws['A2'] = 'Bamboo Plan Link : '
        ws.append(row)

  wb.save('CppCheckReport.xlsx')
</code>```

Have you any idea why this portion doesn't function :

```<code>for location in item.findall('location'):
        csv_line2 = [location.attrib["file"],location.attrib["line"]]
        for info in location.findall("info"):
            print(info.attrib["info"])
            if(info.attrib["info"]!=''):
                csv_line3 = [item.attrib["severity"],item.attrib["id"] , info.attrib["info"]]
                print(csv_line3)
            else:
                csv_line3 = csv_line1
    csvfile_writer.writerow(csv_line2 + csv_line3)
</code>```

Body:
I have an xml file which have a special structure , I need to convert it to Excel file using a script python This is a part of my xml File :

<?xml version="1.0" encoding="UTF-8"?>
<results version="2">
<cppcheck version="2.9"/>
<errors>
    <error id="identicalInnerCondition" severity="warning" msg="Identical inner 'if' condition is always true." verbose="Identical inner 'if' condition is always true (outer condition is 'nTransSize!=0' and inner condition is 'nTransSize!=0')." cwe="398" file0="../Apps/TSI/Src/ECRTransport.cpp">
        <location file="..\Apps\TSI\Src\ECRTransport.cpp" line="123" column="32" info="identical inner condition: nTransSize!=0"/>
        <location file="..\Apps\TSI\Src\ECRTransport.cpp" line="121" column="28" info="outer condition: nTransSize!=0"/>
    </error>
    <error id="syntaxError" severity="error" msg="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." verbose="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." file0="../Apps/TeliumGeneric/Cust_Chase/Src/cust_chase.c">
        <location file="..\Apps\TeliumGeneric\Cust_Chase\Src\cust_chase.c" line="116" column="1"/>
    </error>
    <error id="syntaxError" severity="error" msg="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." verbose="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." file0="../Apps/TeliumGeneric/Cust_Chase/Src/cust_chase_reports.c">
        <location file="..\Apps\TeliumGeneric\Cust_Chase\Src\cust_chase_reports.c" line="95" column="1"/>
    </error>
    <error id="syntaxError" severity="error" msg="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." verbose="Code 'using namespace TeliumUtilities' is invalid C code. Use --std or --language to configure the language." file0="../Apps/TeliumGeneric/Cust_Chase/Src/host_chase.c">
        <location file="..\Apps\TeliumGeneric\Cust_Chase\Src\host_chase.c" line="111" column="1"/>
    </error>
    <error id="syntaxError" severity="error" msg="Code 'TeliumUtilities::STR_FormatAmountComma' is invalid C code. Use --std or --language to configure the language." verbose="Code 'TeliumUtilities::STR_FormatAmountComma' is invalid C code. Use --std or --language to configure the language." file0="../Apps/TeliumGeneric/Cust_Elavon/Src/cust_elavon.c">
        <location file="..\Apps\TeliumGeneric\Cust_Elavon\Src\cust_elavon.c" line="522" column="9"/>
    </error>

I'm using a script python and it works fine for me Just there is something wrong , if we have an info (message error in the location balise) it must be shown on the Excel file , else we must have the msg error shown in the Excel File.
This is my script python:

import xml.etree.ElementTree as ET
import csv
import openpyxl
import sys

xml_data = open('.\CppCheckReport.xml', 'r').read()

root = ET.fromstring(xml_data)

csvfile = open("Report.csv",'w', newline='')
csvfile_writer = csv.writer(csvfile)
csvfile_writer.writerow(["File","Line","Severity","Id","Summary"])

for child in root.findall("errors"):
    for item in child:
        csv_line1 = [item.attrib["severity"],item.attrib["id"] , item.attrib["msg"]]
        for location in item.findall('location'):
           csv_line2 = [location.attrib["file"],location.attrib["line"]]
           for info in location.findall("info"):
               print(info.attrib["info"])
               if(info.attrib["info"]!=''):
                  csv_line3 = [item.attrib["severity"],item.attrib["id"] , info.attrib["info"]]
                   print(csv_line3)
                else:
                   csv_line3 = csv_line1
    csvfile_writer.writerow(csv_line2 + csv_line3)
  csvfile.close()

  wb = openpyxl.Workbook()
  ws = wb.active

  with open('Report.csv') as f:
       reader = csv.reader(f, delimiter=',')
       for row in reader:
           ws['A1'] = 'CppCheck 2.9 Report'
           ws['A2'] = 'Bamboo Plan Link : '
        ws.append(row)

  wb.save('CppCheckReport.xlsx')

Have you any idea why this portion doesn't function :

for location in item.findall('location'):
        csv_line2 = [location.attrib["file"],location.attrib["line"]]
        for info in location.findall("info"):
            print(info.attrib["info"])
            if(info.attrib["info"]!=''):
                csv_line3 = [item.attrib["severity"],item.attrib["id"] , info.attrib["info"]]
                print(csv_line3)
            else:
                csv_line3 = csv_line1
    csvfile_writer.writerow(csv_line2 + csv_line3)


问:
Why Showing Error in Stack ? i used flutter swipable
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_swipable-0.1.1/lib/flutter_swipable.dart:121:11: Error: No named parameter with the name 'overflow'.
overflow: Overflow.visible,
^^^^^^^^
/C:/src/flutter/flutter/packages/flutter/lib/src/widgets/basic.dart:3787:3: Context: Found this candidate, but the arguments don't match.
Stack({
^^^^^

```<code>            Container(
          height: 300,
          width: 200,
          child: Stack(
            clipBehavior: Clip.none,
            children: [
              TinderCard(color: Colors.red),

            ],
          ),
        )

class _TinderCardState extends State<TinderCard> {
</code>```

@override
Widget build(BuildContext context) {
return Swipable(
child: Container(
color: Colors.red,
),
);
}
}

Body:
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_swipable-0.1.1/lib/flutter_swipable.dart:121:11: Error: No named parameter with the name 'overflow'.
overflow: Overflow.visible,
^^^^^^^^
/C:/src/flutter/flutter/packages/flutter/lib/src/widgets/basic.dart:3787:3: Context: Found this candidate, but the arguments don't match.
Stack({
^^^^^

            Container(
          height: 300,
          width: 200,
          child: Stack(
            clipBehavior: Clip.none,
            children: [
              TinderCard(color: Colors.red),

            ],
          ),
        )

class _TinderCardState extends State<TinderCard> {

@override
Widget build(BuildContext context) {
return Swipable(
child: Container(
color: Colors.red,
),
);
}
}


问:
google app billing v4 products are not visible when the page is first opened
I was using google app billing v3. I upgraded it to v4. GetSku() gave an error when I upgraded.

Doing this with getSkus() and "purchase.getSkus().contains(getResources().getString(R.string.Product_ID)) && purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED" fixed the error.

When I click and open the premium purchase page for the first time, the products and prices do not appear. When I leave the page and enter the 2nd and 3rd time, the products and prices appear. Both in-app product selling and subscription part have the same problem. The codes are the same.
I was not having this issue in v3. I had this problem after upgrading to v4. Where could the problem be?

```<code>private BillingClient billingClient;
    ConsumeResponseListener listener ;
    RecyclerView recyclerView;
    Context context = this;

recyclerView = findViewById(R.id.recyler_product);
        recyclerView.setHasFixedSize(true);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
        recyclerView.setLayoutManager(layoutManager);

        setupBillingClient();

private void loadProductToRecyclerView(List<SkuDetails> list) {
        MyProductAdapter adapter = new MyProductAdapter(this,list,billingClient);
        recyclerView.setAdapter(adapter);

    }

    private void setupBillingClient() {
        listener = new ConsumeResponseListener() {
            @Override
            public void onConsumeResponse(BillingResult billingResult, String s) {
                if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK)
                {
                    //  "Consume OK"
                }

            }
        };

        billingClient = BillingClientSetup.getInstance(this,this);
        billingClient.startConnection(new BillingClientStateListener() {
            @Override
            public void onBillingSetupFinished(BillingResult billingResult) {
                if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK)
                {
                    //  "Succes to connect billing"
                    List<Purchase> purchases = billingClient.queryPurchases(BillingClient.SkuType.INAPP)
                            .getPurchasesList();
                    handleItemAlreadyPuchase(purchases);
                    loadAllPurchasePackage();
                }
                else
                    Toast.makeText(context,
                            billingResult.getResponseCode(), Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onBillingServiceDisconnected() {
                Toast.makeText(context, "Failed", Toast.LENGTH_SHORT).show();

            }
        });
    }

    public void loadAllPurchasePackage(){
        if (billingClient.isReady())
        {
            SkuDetailsParams params= SkuDetailsParams.newBuilder()
                  .setSkusList(Arrays.asList("product_example_1","product_example_2","product_example_3"))
                    .setType(BillingClient.SkuType.INAPP)
                    .build();
            billingClient.querySkuDetailsAsync(params, new SkuDetailsResponseListener() {
                @Override
                public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> list) {
                    if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK)
                    {
                        loadProductToRecyclerView(list);
                    }

                    else
                        Toast.makeText(context, "Failed:"+billingResult.getResponseCode(), Toast.LENGTH_SHORT).show();
                }
            });
        }
    }

    private void handleItemAlreadyPuchase(List<Purchase> purchases) {
        StringBuilder purchasedItem = new StringBuilder(txtpremium.getText()); // empty
        for (Purchase purchase : purchases)
        {
         //   if (purchase.getSku().equals("product_example_1")) // consume item
         //   if (purchase.getSkus().equals("product_example_1")) // consume item
            if (purchase.getSkus().contains(getResources().getString(R.string.Product_ID)) && purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) // consume item
            {
                ConsumeParams consumeParams = ConsumeParams.newBuilder()
                        .setPurchaseToken(purchase.getPurchaseToken())
                        .build();
                billingClient.consumeAsync(consumeParams,listener);
                product1savedatabase();
            }
       //     if (purchase.getSku().equals("product_example_2")) // consume item
            if (purchase.getSkus().contains(getResources().getString(R.string.Product_ID2)) && purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) // consume item
            {
                ConsumeParams consumeParams = ConsumeParams.newBuilder()
                        .setPurchaseToken(purchase.getPurchaseToken())
                        .build();
                billingClient.consumeAsync(consumeParams,listener);
                product2savedatabase();
            }

       //     purchasedItem.append("\n"+purchase.getSku())
            purchasedItem.append("\n"+purchase.getSkus()).append("\n");
        }

        txtpremium.setVisibility(View.VISIBLE);

    }

    @Override
    public void onPurchasesUpdated(BillingResult billingResult, List<Purchase> list) {
        if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK
                && list != null){
            handleItemAlreadyPuchase(list);
        }

        else  if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.USER_CANCELED)
            Toast.makeText(this, "Purchase canceled
", Toast.LENGTH_SHORT).show();
        else
            Toast.makeText(this, "Failed:"+billingResult.getResponseCode(), Toast.LENGTH_SHORT).show();
    }
</code>```

MyProductAdapter :

```<code>public class MyProductAdapter extends RecyclerView.Adapter<MyProductAdapter .MyViewHolder> {

    AppCompatActivity appCompatActivity ;
    List<SkuDetails> skuDetailsList;
    BillingClient billingClient;

    public MyProductAdapter (AppCompatActivity appCompatActivity, List<SkuDetails> skuDetailsList, BillingClient billingClient) {
        this.appCompatActivity = appCompatActivity;
        this.skuDetailsList = skuDetailsList;
        this.billingClient = billingClient;
    }

    @NonNull
    @Override
    public MyProductAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int i) {
        return new MyProductAdapter.MyViewHolder(LayoutInflater.from(appCompatActivity.getBaseContext())
                .inflate(R.layout.layout_product_display,parent,false));
    }

    @Override
    public void onBindViewHolder(@NonNull MyProductAdapter.MyViewHolder myViewHolder, int position) {

            myViewHolder.txt_product_name.setText(skuDetailsList.get(position).getTitle().substring(0,8));

            myViewHolder.txt_price.setText(skuDetailsList.get(position).getPrice());

          myViewHolder.setListener(new IRecylerClickListener() {
            @Override
                public void onClick(View view, int position) {
                    //     //Launch billing flow
           BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
                    .setSkuDetails(skuDetailsList.get(position))
                     .build();
             int reponse = billingClient.launchBillingFlow(appCompatActivity,billingFlowParams)
                     .getResponseCode();
             switch (reponse)
             {
                 case BillingClient.BillingResponseCode.BILLING_UNAVAILABLE:
                     Toast.makeText(appCompatActivity, "BILLING UNAVAILABLE", Toast.LENGTH_LONG).show();
                      break;
                  case BillingClient.BillingResponseCode.DEVELOPER_ERROR:
                       Toast.makeText(appCompatActivity, "DEVELOPER ERROR", Toast.LENGTH_LONG).show();
                      break;
                   case BillingClient.BillingResponseCode.FEATURE_NOT_SUPPORTED:
                        Toast.makeText(appCompatActivity, "FEATURE NOT SUPPORTED", Toast.LENGTH_LONG).show();
                       break;
                  case BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED:
                      Toast.makeText(appCompatActivity, "ITEM ALREADY OWNED", Toast.LENGTH_LONG).show();
                       break;
                  case BillingClient.BillingResponseCode.SERVICE_DISCONNECTED:
                         Toast.makeText(appCompatActivity, "SERVICE DISCONNECTED", Toast.LENGTH_LONG).show();
                        break;
                     case BillingClient.BillingResponseCode.SERVICE_TIMEOUT:
                          Toast.makeText(appCompatActivity, "SERVICE TIMEOUT", Toast.LENGTH_LONG).show();
                          break;
                      case BillingClient.BillingResponseCode.ITEM_UNAVAILABLE:
                          Toast.makeText(appCompatActivity, "ITEM UNAVAILABLE", Toast.LENGTH_LONG).show();
                          break;

                      default:
                        break;
                 }
          }
  });

    }

    @Override
    public int getItemCount() {
        return skuDetailsList.size();
    }

    public class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

        TextView txt_product_name, txt_price , txt_description ;
        IRecylerClickListener listener;

        public void setListener(IRecylerClickListener listener) {
            this.listener = listener;
        }

        public MyViewHolder(@NonNull View itemView) {
            super(itemView);

            txt_price = itemView.findViewById(R.id.txt_pricealtin);
            txt_product_name = itemView.findViewById(R.id.txt_product_namealtin);

            itemView.setOnClickListener(this);
        }
        public void onClick(View view){
            listener.onClick(view,getAdapterPosition());
        }
    }

</code>```

Body:
I was using google app billing v3. I upgraded it to v4. GetSku() gave an error when I upgraded.

Doing this with getSkus() and "purchase.getSkus().contains(getResources().getString(R.string.Product_ID)) && purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED" fixed the error.

When I click and open the premium purchase page for the first time, the products and prices do not appear. When I leave the page and enter the 2nd and 3rd time, the products and prices appear. Both in-app product selling and subscription part have the same problem. The codes are the same.
I was not having this issue in v3. I had this problem after upgrading to v4. Where could the problem be?

private BillingClient billingClient;
    ConsumeResponseListener listener ;
    RecyclerView recyclerView;
    Context context = this;

recyclerView = findViewById(R.id.recyler_product);
        recyclerView.setHasFixedSize(true);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
        recyclerView.setLayoutManager(layoutManager);

        setupBillingClient();

private void loadProductToRecyclerView(List<SkuDetails> list) {
        MyProductAdapter adapter = new MyProductAdapter(this,list,billingClient);
        recyclerView.setAdapter(adapter);

    }

    private void setupBillingClient() {
        listener = new ConsumeResponseListener() {
            @Override
            public void onConsumeResponse(BillingResult billingResult, String s) {
                if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK)
                {
                    //  "Consume OK"
                }

            }
        };

        billingClient = BillingClientSetup.getInstance(this,this);
        billingClient.startConnection(new BillingClientStateListener() {
            @Override
            public void onBillingSetupFinished(BillingResult billingResult) {
                if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK)
                {
                    //  "Succes to connect billing"
                    List<Purchase> purchases = billingClient.queryPurchases(BillingClient.SkuType.INAPP)
                            .getPurchasesList();
                    handleItemAlreadyPuchase(purchases);
                    loadAllPurchasePackage();
                }
                else
                    Toast.makeText(context,
                            billingResult.getResponseCode(), Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onBillingServiceDisconnected() {
                Toast.makeText(context, "Failed", Toast.LENGTH_SHORT).show();

            }
        });
    }

    public void loadAllPurchasePackage(){
        if (billingClient.isReady())
        {
            SkuDetailsParams params= SkuDetailsParams.newBuilder()
                  .setSkusList(Arrays.asList("product_example_1","product_example_2","product_example_3"))
                    .setType(BillingClient.SkuType.INAPP)
                    .build();
            billingClient.querySkuDetailsAsync(params, new SkuDetailsResponseListener() {
                @Override
                public void onSkuDetailsResponse(BillingResult billingResult, List<SkuDetails> list) {
                    if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK)
                    {
                        loadProductToRecyclerView(list);
                    }

                    else
                        Toast.makeText(context, "Failed:"+billingResult.getResponseCode(), Toast.LENGTH_SHORT).show();
                }
            });
        }
    }

    private void handleItemAlreadyPuchase(List<Purchase> purchases) {
        StringBuilder purchasedItem = new StringBuilder(txtpremium.getText()); // empty
        for (Purchase purchase : purchases)
        {
         //   if (purchase.getSku().equals("product_example_1")) // consume item
         //   if (purchase.getSkus().equals("product_example_1")) // consume item
            if (purchase.getSkus().contains(getResources().getString(R.string.Product_ID)) && purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) // consume item
            {
                ConsumeParams consumeParams = ConsumeParams.newBuilder()
                        .setPurchaseToken(purchase.getPurchaseToken())
                        .build();
                billingClient.consumeAsync(consumeParams,listener);
                product1savedatabase();
            }
       //     if (purchase.getSku().equals("product_example_2")) // consume item
            if (purchase.getSkus().contains(getResources().getString(R.string.Product_ID2)) && purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) // consume item
            {
                ConsumeParams consumeParams = ConsumeParams.newBuilder()
                        .setPurchaseToken(purchase.getPurchaseToken())
                        .build();
                billingClient.consumeAsync(consumeParams,listener);
                product2savedatabase();
            }

       //     purchasedItem.append("\n"+purchase.getSku())
            purchasedItem.append("\n"+purchase.getSkus()).append("\n");
        }

        txtpremium.setVisibility(View.VISIBLE);

    }

    @Override
    public void onPurchasesUpdated(BillingResult billingResult, List<Purchase> list) {
        if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK
                && list != null){
            handleItemAlreadyPuchase(list);
        }

        else  if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.USER_CANCELED)
            Toast.makeText(this, "Purchase canceled
", Toast.LENGTH_SHORT).show();
        else
            Toast.makeText(this, "Failed:"+billingResult.getResponseCode(), Toast.LENGTH_SHORT).show();
    }

MyProductAdapter :

public class MyProductAdapter extends RecyclerView.Adapter<MyProductAdapter .MyViewHolder> {

    AppCompatActivity appCompatActivity ;
    List<SkuDetails> skuDetailsList;
    BillingClient billingClient;

    public MyProductAdapter (AppCompatActivity appCompatActivity, List<SkuDetails> skuDetailsList, BillingClient billingClient) {
        this.appCompatActivity = appCompatActivity;
        this.skuDetailsList = skuDetailsList;
        this.billingClient = billingClient;
    }

    @NonNull
    @Override
    public MyProductAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int i) {
        return new MyProductAdapter.MyViewHolder(LayoutInflater.from(appCompatActivity.getBaseContext())
                .inflate(R.layout.layout_product_display,parent,false));
    }

    @Override
    public void onBindViewHolder(@NonNull MyProductAdapter.MyViewHolder myViewHolder, int position) {

            myViewHolder.txt_product_name.setText(skuDetailsList.get(position).getTitle().substring(0,8));

            myViewHolder.txt_price.setText(skuDetailsList.get(position).getPrice());

          myViewHolder.setListener(new IRecylerClickListener() {
            @Override
                public void onClick(View view, int position) {
                    //     //Launch billing flow
           BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
                    .setSkuDetails(skuDetailsList.get(position))
                     .build();
             int reponse = billingClient.launchBillingFlow(appCompatActivity,billingFlowParams)
                     .getResponseCode();
             switch (reponse)
             {
                 case BillingClient.BillingResponseCode.BILLING_UNAVAILABLE:
                     Toast.makeText(appCompatActivity, "BILLING UNAVAILABLE", Toast.LENGTH_LONG).show();
                      break;
                  case BillingClient.BillingResponseCode.DEVELOPER_ERROR:
                       Toast.makeText(appCompatActivity, "DEVELOPER ERROR", Toast.LENGTH_LONG).show();
                      break;
                   case BillingClient.BillingResponseCode.FEATURE_NOT_SUPPORTED:
                        Toast.makeText(appCompatActivity, "FEATURE NOT SUPPORTED", Toast.LENGTH_LONG).show();
                       break;
                  case BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED:
                      Toast.makeText(appCompatActivity, "ITEM ALREADY OWNED", Toast.LENGTH_LONG).show();
                       break;
                  case BillingClient.BillingResponseCode.SERVICE_DISCONNECTED:
                         Toast.makeText(appCompatActivity, "SERVICE DISCONNECTED", Toast.LENGTH_LONG).show();
                        break;
                     case BillingClient.BillingResponseCode.SERVICE_TIMEOUT:
                          Toast.makeText(appCompatActivity, "SERVICE TIMEOUT", Toast.LENGTH_LONG).show();
                          break;
                      case BillingClient.BillingResponseCode.ITEM_UNAVAILABLE:
                          Toast.makeText(appCompatActivity, "ITEM UNAVAILABLE", Toast.LENGTH_LONG).show();
                          break;

                      default:
                        break;
                 }
          }
  });

    }

    @Override
    public int getItemCount() {
        return skuDetailsList.size();
    }

    public class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

        TextView txt_product_name, txt_price , txt_description ;
        IRecylerClickListener listener;

        public void setListener(IRecylerClickListener listener) {
            this.listener = listener;
        }

        public MyViewHolder(@NonNull View itemView) {
            super(itemView);

            txt_price = itemView.findViewById(R.id.txt_pricealtin);
            txt_product_name = itemView.findViewById(R.id.txt_product_namealtin);

            itemView.setOnClickListener(this);
        }
        public void onClick(View view){
            listener.onClick(view,getAdapterPosition());
        }
    }


问:
Angular 14 project installation
I am facing the following issue. Error posted down. Please share your answer I am waiting for valuable feedback.

```<code>DEPRECATED: The 'defaultProject' workspace option has been deprecated. The project to use will be determined from the current working directory.
Your global Angular CLI version (15.0.4) is greater than your local version (11.2.19). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
\ Generating browser application bundles (phase: building)...node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at context.callback (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\babel-loader\lib\index.js:59:71
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.1

C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08>export NODE_OPTIONS=--openssl-legacy-provider
'export' is not recognized as an internal or external command,
operable program or batch file.

</code>```

I tried these:-

Node version uninstall and install.

cli version uninstall and install.

The following commands are used:-

```<code>npm install -g @angular/cli
npm install -g @angular/cli@latest
</code>```

If you try ng --version with angular cli 14, you will get that error. Please use ng version instead.

Title: Angular 14 project installation

Body:
I am facing the following issue. Error posted down. Please share your answer I am waiting for valuable feedback.

DEPRECATED: The 'defaultProject' workspace option has been deprecated. The project to use will be determined from the current working directory.
Your global Angular CLI version (15.0.4) is greater than your local version (11.2.19). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
\ Generating browser application bundles (phase: building)...node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at context.callback (C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08\node_modules\babel-loader\lib\index.js:59:71
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.1

C:\Users\Sonal.D\runner\krushna_m-runner_web_admin-1241444b7c08>export NODE_OPTIONS=--openssl-legacy-provider
'export' is not recognized as an internal or external command,
operable program or batch file.

I tried these:-

Node version uninstall and install.

cli version uninstall and install.

The following commands are used:-

npm install -g @angular/cli
npm install -g @angular/cli@latest

If you try ng --version with angular cli 14, you will get that error. Please use ng version instead.


问:
Guile can't find Module
I've just installed guile-lib-0.2.7.tar.gz, and checking post-install, found it
at /usr/share/guile/site—which I believe is correct given:

```<code>scheme@(guile-user)> (list (%library-dir) (%site-dir) (%global-site-dir) (%package-data-dir))
$1 = ("/usr/share/guile/3.0" "/usr/share/guile/site/3.0" "/usr/share/guile/site" "/usr/share/guile")
</code>```

That said, the following bread crumbs my problem:

```<code>scheme@(guile-user)> (use-modules (guile-lib))
While compiling expression:
no code for module (guile-lib)
scheme@(guile-user)> (use-modules (math))
While compiling expression:
no code for module (math)
scheme@(guile-user)> (add-to-load-path "/usr/share/guile/site")
scheme@(guile-user)> (use-modules (math))
While compiling expression:
no code for module (math)
scheme@(guile-user)> (use-modules (primes.scm))
While compiling expression:
no code for module (primes.scm)
</code>```

I next tried brute force:

```<code>scheme@(guile-user)> (primitive-load-path "/usr/share/guile/site/math/primes.scm")
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /usr/share/guile/site/math/primes.scm
;;; compiled /home/hsmyers/.cache/guile/ccache/3.0-LE-8-4.2/usr/share/guile/site/math/primes.scm.go
scheme@(math primes)> (prime? 3)
$2 = #t
</code>```

While it's nice that this approach works, it doesn't seem like the correct way to do things.

Obviously, I'm doing something wrong here, but I'm (as usual) completely clueless
as to what is wrong. My question is—what do I need to fix the connection between
Guile and Library location?

Title: Guile can't find Module

Body:
I've just installed guile-lib-0.2.7.tar.gz, and checking post-install, found it
at /usr/share/guile/site—which I believe is correct given:

scheme@(guile-user)> (list (%library-dir) (%site-dir) (%global-site-dir) (%package-data-dir))
$1 = ("/usr/share/guile/3.0" "/usr/share/guile/site/3.0" "/usr/share/guile/site" "/usr/share/guile")

That said, the following bread crumbs my problem:

scheme@(guile-user)> (use-modules (guile-lib))
While compiling expression:
no code for module (guile-lib)
scheme@(guile-user)> (use-modules (math))
While compiling expression:
no code for module (math)
scheme@(guile-user)> (add-to-load-path "/usr/share/guile/site")
scheme@(guile-user)> (use-modules (math))
While compiling expression:
no code for module (math)
scheme@(guile-user)> (use-modules (primes.scm))
While compiling expression:
no code for module (primes.scm)

I next tried brute force:

scheme@(guile-user)> (primitive-load-path "/usr/share/guile/site/math/primes.scm")
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /usr/share/guile/site/math/primes.scm
;;; compiled /home/hsmyers/.cache/guile/ccache/3.0-LE-8-4.2/usr/share/guile/site/math/primes.scm.go
scheme@(math primes)> (prime? 3)
$2 = #t

While it's nice that this approach works, it doesn't seem like the correct way to do things.

Obviously, I'm doing something wrong here, but I'm (as usual) completely clueless
as to what is wrong. My question is—what do I need to fix the connection between
Guile and Library location?


问:
Java String some characters not showing
I have a problem about not showing some characters in Java.
I use Intellij to implement an example.

I have a team object shown below

```<code>public class Team {

    private String name;
    private int points;
    private int goalsScored;
    private int goalsAgainst;
    private int goalDifference;
}
</code>```

I assigned some values through this code snippets shown below.

private static List getTeamStats() {
List plTeams = new ArrayList<>();

```<code>    plTeams.add(new Team("Team ç", 33, 27, 12));
    plTeams.add(new Team("Team ü", 32, 40, 16));
    plTeams.add(new Team("Team ğ", 30, 24, 16));
    return plTeams;
</code>```

}

When I try to interate each one through this code shown below

plTeams.forEach(System.out::println);

I get this result.

```<code>Team �  ...
Team �  ...
Team �  ...
</code>```

I also tried to use Locale.setDefault(Locale.forLanguageTag("tr-TR")); but it didn't help me fix  the issue.

I also tried this but nothing changed.

Help --> Edit Custom VM Options

```<code>-Duser.language=tr
-Duser.country=TR
-Duser.variant=TR
</code>```

How can I fix it?

Title: Java String some characters not showing

Body:
I have a problem about not showing some characters in Java.
I use Intellij to implement an example.

I have a team object shown below

public class Team {

    private String name;
    private int points;
    private int goalsScored;
    private int goalsAgainst;
    private int goalDifference;
}

I assigned some values through this code snippets shown below.

private static List getTeamStats() {
List plTeams = new ArrayList<>();

    plTeams.add(new Team("Team ç", 33, 27, 12));
    plTeams.add(new Team("Team ü", 32, 40, 16));
    plTeams.add(new Team("Team ğ", 30, 24, 16));
    return plTeams;

}

When I try to interate each one through this code shown below

plTeams.forEach(System.out::println);

I get this result.

Team �  ...
Team �  ...
Team �  ...

I also tried to use Locale.setDefault(Locale.forLanguageTag("tr-TR")); but it didn't help me fix  the issue.

I also tried this but nothing changed.

Help --> Edit Custom VM Options

-Duser.language=tr
-Duser.country=TR
-Duser.variant=TR

How can I fix it?


问:
Conditional in zsh scripting - comparing strings
Currently I'm learning about shell scripting in zsh but I have the next issue. I am tryng to compare an input string to an specific character ("A" in this case). Here is my code.

```<code>#!/bin/zsh
# Author: Cristhian Rodriguez
# Conditional statement

OPTION=""
read OPTION\?"Input an option (A or B): "

if [[ $OPTION -eq "A" ]]; then
  echo "Correct answer!!"
else
  echo "Wrong answer!!"
fi
</code>```

When I input some values, look at the outputs:

```<code>Input an option (A or B): A // Correct answer!!
Input an option (A or B): B // Wrong answer!!
Input an option (A or B): C // Correct answer!!
Input an option (A or B): f // Correct answer!!
</code>```

The point is: when I type a different value from A or B, the output is always Correct answer!!, but the program should return Wrong answer!!. Could you tell me if I am wrong in the code.

Thank you so much :)

Body:
Currently I'm learning about shell scripting in zsh but I have the next issue. I am tryng to compare an input string to an specific character ("A" in this case). Here is my code.

#!/bin/zsh
# Author: Cristhian Rodriguez
# Conditional statement

OPTION=""
read OPTION\?"Input an option (A or B): "

if [[ $OPTION -eq "A" ]]; then
  echo "Correct answer!!"
else
  echo "Wrong answer!!"
fi

When I input some values, look at the outputs:

Input an option (A or B): A // Correct answer!!
Input an option (A or B): B // Wrong answer!!
Input an option (A or B): C // Correct answer!!
Input an option (A or B): f // Correct answer!!

The point is: when I type a different value from A or B, the output is always Correct answer!!, but the program should return Wrong answer!!. Could you tell me if I am wrong in the code.

Thank you so much :)