问:
Spring boot IllegalArgumentException: Not a managed type
I get this error on the startup. It seems as if it doesnt use the @EntityScan at all

My Code is from Spring JPA but just using this example doesn't work for me since i get this error

Stacktrace:

```<code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in com.kotlination.repo.CustomerRepository defined in @EnableJpaRepositories declared on KotlinSpringJpaPostgresqlApplication: Not a managed type: class com.kotlination.model.Customer
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:915) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.0.jar:3.0.0]
    at com.kotlination.main.KotlinSpringJpaPostgresqlApplicationKt.main(KotlinSpringJpaPostgresqlApplication.kt:20) ~[classes/:na]
Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.kotlination.model.Customer
    at org.hibernate.metamodel.model.domain.internal.JpaMetamodelImpl.managedType(JpaMetamodelImpl.java:181) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
    at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.managedType(MappingMetamodelImpl.java:496) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
    at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.managedType(MappingMetamodelImpl.java:99) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
    at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:77) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaEntityInformationSupport.getEntityInformation(JpaEntityInformationSupport.java:69) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getEntityInformation(JpaRepositoryFactory.java:246) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:211) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:194) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:81) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:317) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:279) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.util.Lazy.getNullable(Lazy.java:229) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.util.Lazy.get(Lazy.java:113) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:285) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:132) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[spring-beans-6.0.2.jar:6.0.2]
    ... 16 common frames omitted
</code>```

I have a Controller in com.kotlination.controller
main in com.kotlination.main
model in com.kotlination.model
and repo in com.kotlination.repo

Currently my main class looks like this:

```<code>@SpringBootApplication
@ComponentScan(basePackages = ["com.kotlination"])
@EnableJpaRepositories("com.kotlination.repo")
@EntityScan(basePackages = ["com.kotlination.model"])
class KotlinSpringJpaPostgresqlApplication

fun main(args: Array<String>) {
    runApplication<KotlinSpringJpaPostgresqlApplication>(*args)
}
</code>```

I hope somebody can help me figure out the issue

I also am aware that there are already quite a few similar questions, yet none of those helped me in this case Example

I have tried it without @EntityScan, with @EntityScan

As per request from devskillup
Spring Boot version is 3.0.0 and the imports:

```<code>import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.boot.runApplication
import org.springframework.context.annotation.ComponentScan
import org.springframework.data.jpa.repository.config.EnableJpaRepositories
</code>```

pom.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.kotlination</groupId>
    <artifactId>spring-jpa-postgresql-spring-boot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>KotlinSpringJpaPostgresql</name>
    <description>KotlinSpringJpaPostgresql</description>
    <properties>
        <java.version>17</java.version>
        <kotlin.version>1.7.21</kotlin.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jre8</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>javax.persistence-api</artifactId>
            <version>2.2</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <configuration>
                    <args>
                        <arg>-Xjsr305=strict</arg>
                    </args>
                    <compilerPlugins>
                        <plugin>spring</plugin>
                    </compilerPlugins>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-allopen</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

</project>

</code>```

I was able to fix the issue but i dont know the cause of the error...
Instead of customer i just copied it and renamed it to a different Jar

When i use the Repository with Jar it works, with Customer if creates the error

Is Customer a protected word or something?

Just in case code of the 2 models:

```<code>package com.kotlination.model

import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.Id

@Entity
class Customer(
    val firstName: String,
    val lastName: String) {

    @Id
    @GeneratedValue
    val id: Long = -1

    constructor() : this("", "")
}
</code>```
```<code>package com.kotlination.model

import jakarta.persistence.Entity
import jakarta.persistence.GeneratedValue
import jakarta.persistence.Id

@Entity
class Jar(
    val firstName: String,
    val lastName: String) {

    @Id
    @GeneratedValue
    val id: Long = -1

    constructor() : this("", "")
}
</code>```

Body:
I get this error on the startup. It seems as if it doesnt use the @EntityScan at all

My Code is from Spring JPA but just using this example doesn't work for me since i get this error

Stacktrace:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in com.kotlination.repo.CustomerRepository defined in @EnableJpaRepositories declared on KotlinSpringJpaPostgresqlApplication: Not a managed type: class com.kotlination.model.Customer
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:915) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.0.jar:3.0.0]
    at com.kotlination.main.KotlinSpringJpaPostgresqlApplicationKt.main(KotlinSpringJpaPostgresqlApplication.kt:20) ~[classes/:na]
Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.kotlination.model.Customer
    at org.hibernate.metamodel.model.domain.internal.JpaMetamodelImpl.managedType(JpaMetamodelImpl.java:181) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
    at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.managedType(MappingMetamodelImpl.java:496) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
    at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.managedType(MappingMetamodelImpl.java:99) ~[hibernate-core-6.1.5.Final.jar:6.1.5.Final]
    at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:77) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaEntityInformationSupport.getEntityInformation(JpaEntityInformationSupport.java:69) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getEntityInformation(JpaRepositoryFactory.java:246) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:211) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:194) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:81) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:317) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:279) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.util.Lazy.getNullable(Lazy.java:229) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.util.Lazy.get(Lazy.java:113) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:285) ~[spring-data-commons-3.0.0.jar:3.0.0]
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:132) ~[spring-data-jpa-3.0.0.jar:3.0.0]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[spring-beans-6.0.2.jar:6.0.2]
    ... 16 common frames omitted

I have a Controller in com.kotlination.controller
main in com.kotlination.main
model in com.kotlination.model
and repo in com.kotlination.repo

Currently my main class looks like this:

@SpringBootApplication
@ComponentScan(basePackages = ["com.kotlination"])
@EnableJpaRepositories("com.kotlination.repo")
@EntityScan(basePackages = ["com.kotlination.model"])
class KotlinSpringJpaPostgresqlApplication

fun main(args: Array<String>) {
    runApplication<KotlinSpringJpaPostgresqlApplication>(*args)
}

I hope somebody can help me figure out the issue

I also am aware that there are already quite a few similar questions, yet none of those helped me in this case Example

I have tried it without @EntityScan, with @EntityScan

As per request from devskillup
Spring Boot version is 3.0.0 and the imports:

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.boot.runApplication
import org.springframework.context.annotation.ComponentScan
import org.springframework.data.jpa.repository.config.EnableJpaRepositories

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath/>
    </parent>
    <groupId>com.kotlination</groupId>
    <artifactId>spring-jpa-postgresql-spring-boot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>KotlinSpringJpaPostgresql</name>
    <description>KotlinSpringJpaPostgresql</description>
    <properties>
        <java.version>17</java.version>
        <kotlin.version>1.7.21</kotlin.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jre8</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>javax.persistence-api</artifactId>
            <version>2.2</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <configuration>
                    <args>
                        <arg>-Xjsr305=strict</arg>
                    </args>
                    <compilerPlugins>
                        <plugin>spring</plugin>
                    </compilerPlugins>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-allopen</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

</project>

I was able to fix the issue but i dont know the cause of the error...
Instead of customer i just copied it and renamed it to a different Jar

When i use the Repository with Jar it works, with Customer if creates the error

Is Customer a protected word or something?

Just in case code of the 2 models:

package com.kotlination.model

import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.Id

@Entity
class Customer(
    val firstName: String,
    val lastName: String) {

    @Id
    @GeneratedValue
    val id: Long = -1

    constructor() : this("", "")
}

package com.kotlination.model

import jakarta.persistence.Entity
import jakarta.persistence.GeneratedValue
import jakarta.persistence.Id

@Entity
class Jar(
    val firstName: String,
    val lastName: String) {

    @Id
    @GeneratedValue
    val id: Long = -1

    constructor() : this("", "")
}


来源: stackexchange

问:
How do you get the distance between each particle and its source in Unity VFX graph?
I am trying to use the distance of each particle from the source as a parameter to determinate its color through a gradient.
This is how I am using the nodes in Unity's VFX Graph

However, even if I use the result of the "lenght" node directly into "Set size" node nothing is being rendered. I assume that the substract operation returns (0,0,0). If thats the case, then how this operation should be done? Is there a node that already does the job?

ContentLicense: CC BY-SA 4.0


问:
How does a JIT compiler compile a function that contains a call to another non-jitted function or virtual call
I understand what JIT compilers do, it uses counters to detect hot codes and compiles them, and stores them in the code cache, so that next time the function won't need to be interpreted. But this brings me to two questions:

How does a JIT compiler compile a function that contains calls to other non-jitted functions. Calls to other non-jitted functions need to let the jitted function, which is the native code, calls the outside function that is still supposed to be executed through the interpreter of the JIT compiler.

The second one is a variant of the first one. How does a JIT compiler compile a function that contains a virtual call? it seems that it has to hard-code the vtable lookup procedure into the native code, but what will happen if the vtable is living in the virtual machine, then there must be a way to access the vtable inside the generated native code, but how could this be done, if the virtual machine is implemented using a language like C or C++ maybe you can hard-code the memory address of the vtable into the native code, but how can I do the same if the virtual machine is implemented in some managed language that its users are not encouraged to, or simply cannot access the address of an object, and even if I can access the address the object might be moved during the compact phase of the garbage collector.


问:
How do I get JavaScript to load different sections of JSON data upon clicks on a nav bar
I am trying to create a program where you can click on a nav bar and it takes your to different pages with different content depending on what button the user clicks. For example if I pressed on books it would only load info about books and if I clicked games it would only load info about games.

Here is what the page should look like.

Here is my code.

```<code>function displayBooks () {
            let html = '<span> Filter: </span>';

            categories.forEach(category => {
                let htmlPlaceholder = `<label>
                    <input type="radio" name="category" onclick="displayBooksItems(${category.id});">
                    ${category.name} </label>`;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayBooksItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `<label>

                    ${item.categoryId}</label>`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;
        }

        displayBooks ();

        function displayMusic () {
            let html = '<span> Filter: </span>';

            categories.forEach(category => {
                let htmlPlaceholder = `<label>
                    <input type="radio" name="category" onclick="displayMusicItems(${category.id});">
                    ${category.name} </label>`;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayMusicItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `<label>

                    ${item.image}</label>`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;
        }

        displayMusic ();

        function displayGames () {
            let html = '<span> Filter: </span>';

            categories.forEach(category => {
                let htmlPlaceholder = `<label>
                    <input type="radio" name="category" onclick="displayGamesItems(${category.id});">
                    ${category.name} </label>`;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayGamesItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `<label>

                    ${item.price}</label>`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;
        }

        displayGames ();

        function displayShoes () {
            let html = '<span> Filter: </span>';

            categories.forEach(category => {
                let htmlPlaceholder = `<label>
                    <input type="radio" name="category" onclick="displayShoesItems(${category.id});">
                    ${category.name} </label>`;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayShoesItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `<label>

                    ${item.itemBrief}</label>`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;
        }
        displayShoes ();

        function displayFurniture () {
            let html = '<span> Filter: </span>';

            categories.forEach(category => {
                let htmlPlaceholder = `<label>
                    <input type="radio" name="category" onclick="displayFurnitureItems(${category.id});">
                    ${category.name} </label>`;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayFurnitureItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `<label>
                    ${item.itemName}</label>`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;

        }
        displayFurniture ();
</code>```

Body:
I am trying to create a program where you can click on a nav bar and it takes your to different pages with different content depending on what button the user clicks. For example if I pressed on books it would only load info about books and if I clicked games it would only load info about games.

Here is what the page should look like.

Here is my code.

function displayBooks () {
            let html = ' Filter: ';

            categories.forEach(category => {
                let htmlPlaceholder = `
                    <input type="radio" name="category" onclick="displayBooksItems(${category.id});">
                    ${category.name} `;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayBooksItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `

                    ${item.categoryId}`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;
        }

        displayBooks ();

        function displayMusic () {
            let html = ' Filter: ';

            categories.forEach(category => {
                let htmlPlaceholder = `
                    <input type="radio" name="category" onclick="displayMusicItems(${category.id});">
                    ${category.name} `;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayMusicItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `

                    ${item.image}`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;
        }

        displayMusic ();

        function displayGames () {
            let html = ' Filter: ';

            categories.forEach(category => {
                let htmlPlaceholder = `
                    <input type="radio" name="category" onclick="displayGamesItems(${category.id});">
                    ${category.name} `;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayGamesItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `

                    ${item.price}`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;
        }

        displayGames ();

        function displayShoes () {
            let html = ' Filter: ';

            categories.forEach(category => {
                let htmlPlaceholder = `
                    <input type="radio" name="category" onclick="displayShoesItems(${category.id});">
                    ${category.name} `;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayShoesItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `

                    ${item.itemBrief}`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;
        }
        displayShoes ();

        function displayFurniture () {
            let html = ' Filter: ';

            categories.forEach(category => {
                let htmlPlaceholder = `
                    <input type="radio" name="category" onclick="displayFurnitureItems(${category.id});">
                    ${category.name} `;
                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('nav');
            categoryContainer.innerHTML = html;
        }

        function displayFurnitureItems() {

            let html = '';
            items.forEach(item => {

                let htmlPlaceholder =
                `
                    ${item.itemName}`;

                html += htmlPlaceholder;
            });
            let categoryContainer = document.querySelector('table');
            categoryContainer.innerHTML = html;

        }
        displayFurniture ();


问:
Parquet file format errors and getting warning for few rows of data
Dec 16, 2022 6:51:18 PM WARNING: parquet.hadoop.ParquetRecordReader: Can not initialize counter due to context is not a instance of TaskInputOutputContext, but is org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl
Dec 16, 2022 6:51:18 PM INFO: parquet.hadoop.InternalParquetRecordReader: RecordReader initialized will read a total of 1 records.
Dec 16, 2022 6:51:18 PM INFO: parquet.hadoop.InternalParquetRecordReader: at row 0. reading next block
Dec 16, 2022 6:51:18 PM INFO: parquet.hadoop.InternalParquetRecordReader: block read in memory in 0 ms. row count = 1

Above error occured while quering the table

only few rows are fetched and other rows has the above error


问:
503 Backend Error when accessing /games/v1management/applications over REST
Trying to hide a user's score in my game, OAUTH working, but then I get the following:

```<code>{
  "error": {
    "message": "Backend Error",
    "code": 503,
    "errors": [
      {
        "reason": "backendError",
        "message": "Backend Error",
        "domain": "global"
      }
    ]
  }
}`
</code>```

My intital request:

https://www.googleapis.com/games/v1management/applications/X/players/hidden/X

I've replaced X with my correct application ID and the user to hide.

Body:
Trying to hide a user's score in my game, OAUTH working, but then I get the following:

{
  "error": {
    "message": "Backend Error",
    "code": 503,
    "errors": [
      {
        "reason": "backendError",
        "message": "Backend Error",
        "domain": "global"
      }
    ]
  }
}`

My intital request:

https://www.googleapis.com/games/v1management/applications/X/players/hidden/X

I've replaced X with my correct application ID and the user to hide.


问:
Why does this template syntax produce different results in Clang/GCC/MSVC
Background info

I am in the process of writing a simple container over function pointers to make calling pointers from other modules in memory easier (for things like video game modding, api hooking, etc.)

Currently, I am using a partial specialization to pattern match user provided tags (empty structures) to help the compiler to know what the potential calling convention of the function is. (stdcall, cdecl, etc.)

The templates look similar in implementation to these two minimal reproductions.

#if defined(__GNUC__) || defined(__clang__)
#define CC_CDECL __attribute__((cdecl))
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
#define CC_CDECL __cdecl
#endif

template<typename RT, typename ...A>
struct T1 { using type = RT (CC_CDECL) (A...); };

template<typename RT, typename ...A>
struct T2 { using type = RT CC_CDECL (A...); };

template<typename RT, typename ...A>
struct T3 { using type = CC_CDECL RT (A...); };
```
<p>which are used similarly to this<br />
<strong>Test cases</strong></p>
<pre class="lang-cpp prettyprint-override"><code>void example_function() {}
int main()
{
    T1<void>::type* test;
    T2<void>::type* test2;
    T3<void>::type* test3;
    auto test4 = example_function;
    std::cout << typeid(test).name() << "\n";
    std::cout << typeid(test2).name() << "\n";
    std::cout << typeid(test3).name() << "\n";
    std::cout << typeid(test4).name() << "\n";
}
</code>```

When using T1 MSVC and GCC both produce typeids of PFvvE and void (__cdecl*)(void) respectively for both the ::type* and for the raw pointer to the function. It fails to compile on Clang.

When using T2 MSVC, GCC, and Clang all compile, however GCC produces the typeid for ::type* with a typeid of PU5cdeclFvvE instead of PFvvE. Clang and MSVC both produce typeids of PFvvE and void (__cdecl*)(void) respectively for both the ::type* and for the raw pointer to the function.  This means either GCC has the wrong typeid or MSVC and Clang both have the wrong typeid for this test case.

The same strange behavior in GCC that happened in T2 happens when using T3; However, MSVC will now fail to compile. Clang produces expected results in this test case.

Question

Why do these various syntactical changes affect each compiler so differently, and so drastically?

Additionally, are these compiler rejections defects in the compiler? Why does GCC accept all of them but throw out different typeids for syntax that produces congruent typeids on other compilers?

Reproduction Steps/Godbolt

All four test cases, comment out each one as needed for the respective compiler that rejects a particular test case noted above.

https://godbolt.org/z/jear9c675

Edit

Test case 2 seems to produce congruent types, even when GCC shows PU5cdeclFvvEinstead of PFvvE (tested with std::is_same and by retrieving the target of std::function.)

What this tells me is that these are probably small AST/Code generation bugs and I'll probably have to reach out to all three organizations to see what should be legal and what the final expected behavior is.

Addendum (In case anyone is asking about why this syntax)

I understand that using T (calling convention*) (A...) is the syntax for the type of a function pointer; In this context the point of using T (calling convention) (A...) is it will be utilized as such

    using X = T(calling convention)(A...);
    X* ptr;
```
<p>similar to</p>
<pre class="lang-cpp prettyprint-override"><code>    using X = void;
    X* ptr;
</code>```

As-is, I can work-around this issue between the compilers with macros; I don't need any solutions to the "problem" itself.

Body:
Background info

I am in the process of writing a simple container over function pointers to make calling pointers from other modules in memory easier (for things like video game modding, api hooking, etc.)

Currently, I am using a partial specialization to pattern match user provided tags (empty structures) to help the compiler to know what the potential calling convention of the function is. (stdcall, cdecl, etc.)

The templates look similar in implementation to these two minimal reproductions.

#if defined(__GNUC__) || defined(__clang__)
#define CC_CDECL __attribute__((cdecl))
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
#define CC_CDECL __cdecl
#endif

template<typename RT, typename ...A>
struct T1 { using type = RT (CC_CDECL) (A...); };

template<typename RT, typename ...A>
struct T2 { using type = RT CC_CDECL (A...); };

template<typename RT, typename ...A>
struct T3 { using type = CC_CDECL RT (A...); };

which are used similarly to this

Test cases

void example_function() {}
int main()
{
    T1<void>::type* test;
    T2<void>::type* test2;
    T3<void>::type* test3;
    auto test4 = example_function;
    std::cout << typeid(test).name() << "\n";
    std::cout << typeid(test2).name() << "\n";
    std::cout << typeid(test3).name() << "\n";
    std::cout << typeid(test4).name() << "\n";
}

When using T1 MSVC and GCC both produce typeids of PFvvE and void (__cdecl*)(void) respectively for both the ::type* and for the raw pointer to the function. It fails to compile on Clang.

When using T2 MSVC, GCC, and Clang all compile, however GCC produces the typeid for ::type* with a typeid of PU5cdeclFvvE instead of PFvvE. Clang and MSVC both produce typeids of PFvvE and void (__cdecl*)(void) respectively for both the ::type* and for the raw pointer to the function.  This means either GCC has the wrong typeid or MSVC and Clang both have the wrong typeid for this test case.

The same strange behavior in GCC that happened in T2 happens when using T3; However, MSVC will now fail to compile. Clang produces expected results in this test case.

Question

Why do these various syntactical changes affect each compiler so differently, and so drastically?

Additionally, are these compiler rejections defects in the compiler? Why does GCC accept all of them but throw out different typeids for syntax that produces congruent typeids on other compilers?

Reproduction Steps/Godbolt

All four test cases, comment out each one as needed for the respective compiler that rejects a particular test case noted above.

https://godbolt.org/z/jear9c675

Edit

Test case 2 seems to produce congruent types, even when GCC shows PU5cdeclFvvEinstead of PFvvE (tested with std::is_same and by retrieving the target of std::function.)

What this tells me is that these are probably small AST/Code generation bugs and I'll probably have to reach out to all three organizations to see what should be legal and what the final expected behavior is.

Addendum (In case anyone is asking about why this syntax)

I understand that using T (calling convention*) (A...) is the syntax for the type of a function pointer; In this context the point of using T (calling convention) (A...) is it will be utilized as such

    using X = T(calling convention)(A...);
    X* ptr;

similar to

    using X = void;
    X* ptr;

As-is, I can work-around this issue between the compilers with macros; I don't need any solutions to the "problem" itself.


问:
Sequelize FN Count returns NULL
I am executing a COUNT() function in Sequelize and returns null.

The SQL query that Sequelize produces is the following:

```<code>SELECT `Book`.`id`, COUNT(`Book`.`id`) AS `total`, `location`.`id`, `location`.`site` FROM `Book` AS `Book` LEFT OUTER JOIN `BookLocation` AS `location` ON `Book`.`id` = `location`.`bookId` GROUP BY `location`.`site`;
</code>```

When I execute this query in the DB it returns the right values with an integer in "total"

But when I get the value from the GraphQL query total returns Null. If I add raw=true to the query I get the value for total but not the other fields I am querying are null.

The resolver is as follows:

```<code>const options = {
                attributes: [
                    [Sequelize.fn('COUNT', Sequelize.col('Book.id')), "total"],
                ],
                group: "location.site",
                include: [
                {   model: models.BookLocation,
                    as: "location",
                }]
}
const result = models.Books.findAll(options);
</code>```

Why I am not getting the total if I can see it when I print the constant result, and also the SQL query is correct. For some reason, Sequelize is not associating my Schema Int variable "total" with the value returned by Sequelize.

Any ideas?

Thanks

Title: Sequelize FN Count returns NULL

Body:
I am executing a COUNT() function in Sequelize and returns null.

The SQL query that Sequelize produces is the following:

SELECT `Book`.`id`, COUNT(`Book`.`id`) AS `total`, `location`.`id`, `location`.`site` FROM `Book` AS `Book` LEFT OUTER JOIN `BookLocation` AS `location` ON `Book`.`id` = `location`.`bookId` GROUP BY `location`.`site`;

When I execute this query in the DB it returns the right values with an integer in "total"

But when I get the value from the GraphQL query total returns Null. If I add raw=true to the query I get the value for total but not the other fields I am querying are null.

The resolver is as follows:

const options = {
                attributes: [
                    [Sequelize.fn('COUNT', Sequelize.col('Book.id')), "total"],
                ],
                group: "location.site",
                include: [
                {   model: models.BookLocation,
                    as: "location",
                }]
}
const result = models.Books.findAll(options);

Why I am not getting the total if I can see it when I print the constant result, and also the SQL query is correct. For some reason, Sequelize is not associating my Schema Int variable "total" with the value returned by Sequelize.

Any ideas?

Thanks


问:
Flutter Formz is validating a textfield with text as empty unless textfield is changed
Please, I have been having this issue for a while. I use flutter formz with bloc. I have the username and password textfields. If a user enters a wrong password, but with a correct username, i want the user to only change the password and not have to change the username or touch the username textfield. But formz seems to need both textfields to be edited on error. Please how do I solve this?

I am using the flutter_bloc login example from the felaangel repo.
For the login Bloc:

```<code>  void _onUsernameChanged(
    LoginUsernameChanged event,
    Emitter<LoginState> emit,
  ) {
    final username = LoginUsername.dirty(event.username);
    emit(
      state.copyWith(
        username: username,
        status: Formz.validate([username]),
      ),
    );
  }

  void _onPasswordChanged(
    LoginPasswordChanged event,
    Emitter<LoginState> emit,
  ) {
    final password = LoginPassword.dirty(event.password);
    emit(
      state.copyWith(
        password: password,
        status: Formz.validate([password]),
      ),
    );
  }

  Future<void> _onSubmitted(
    LoginSubmitted event,
    Emitter<LoginState> emit,
  ) async {
    final username = LoginUsername.dirty(state.username.value);
    final password = LoginPassword.dirty(state.password.value);
    final status = Formz.validate([username, password]);
    emit(
        state.copyWith(username: username, password: password, status: status));
    if (state.status.isValidated) {
      emit(state.copyWith(status: FormzStatus.submissionInProgress));
      try {
        final token = await _authenticationRepository.loginUser(
          username: state.username.value,

          password: state.password.value,
        );
        emit(state.copyWith(status: FormzStatus.submissionSuccess));
        emit(LoginLoading());
        emit(LoggedIn(token: token));
      } catch (e) {
        emit(state.copyWith(status: FormzStatus.submissionFailure));
        emit(LoginFailure(error: e.toString()));
      }
    }
  }
</code>```

For the login State

```<code>class LoginState extends Equatable {
  const LoginState({
    this.status = FormzStatus.pure,
    this.username = const LoginUsername.pure(),
    this.password = const LoginPassword.pure(),
  });

  final FormzStatus status;
  final LoginUsername username;
  final LoginPassword password;

  LoginState copyWith({
    FormzStatus? status,
    LoginUsername? username,
    LoginPassword? password,
  }) {
    return LoginState(
      status: status ?? this.status,
      username: username ?? this.username,
      password: password ?? this.password,
    );
  }

  @override
  List<Object> get props => [status, username, password];
}
</code>```

Does anyone know how to make the textfield validate the text inside the username automatically without requiring that the user touch the textfield?

Body:
Please, I have been having this issue for a while. I use flutter formz with bloc. I have the username and password textfields. If a user enters a wrong password, but with a correct username, i want the user to only change the password and not have to change the username or touch the username textfield. But formz seems to need both textfields to be edited on error. Please how do I solve this?

I am using the flutter_bloc login example from the felaangel repo.
For the login Bloc:

  void _onUsernameChanged(
    LoginUsernameChanged event,
    Emitter<LoginState> emit,
  ) {
    final username = LoginUsername.dirty(event.username);
    emit(
      state.copyWith(
        username: username,
        status: Formz.validate([username]),
      ),
    );
  }

  void _onPasswordChanged(
    LoginPasswordChanged event,
    Emitter<LoginState> emit,
  ) {
    final password = LoginPassword.dirty(event.password);
    emit(
      state.copyWith(
        password: password,
        status: Formz.validate([password]),
      ),
    );
  }

  Future<void> _onSubmitted(
    LoginSubmitted event,
    Emitter<LoginState> emit,
  ) async {
    final username = LoginUsername.dirty(state.username.value);
    final password = LoginPassword.dirty(state.password.value);
    final status = Formz.validate([username, password]);
    emit(
        state.copyWith(username: username, password: password, status: status));
    if (state.status.isValidated) {
      emit(state.copyWith(status: FormzStatus.submissionInProgress));
      try {
        final token = await _authenticationRepository.loginUser(
          username: state.username.value,

          password: state.password.value,
        );
        emit(state.copyWith(status: FormzStatus.submissionSuccess));
        emit(LoginLoading());
        emit(LoggedIn(token: token));
      } catch (e) {
        emit(state.copyWith(status: FormzStatus.submissionFailure));
        emit(LoginFailure(error: e.toString()));
      }
    }
  }

For the login State

class LoginState extends Equatable {
  const LoginState({
    this.status = FormzStatus.pure,
    this.username = const LoginUsername.pure(),
    this.password = const LoginPassword.pure(),
  });

  final FormzStatus status;
  final LoginUsername username;
  final LoginPassword password;

  LoginState copyWith({
    FormzStatus? status,
    LoginUsername? username,
    LoginPassword? password,
  }) {
    return LoginState(
      status: status ?? this.status,
      username: username ?? this.username,
      password: password ?? this.password,
    );
  }

  @override
  List<Object> get props => [status, username, password];
}

Does anyone know how to make the textfield validate the text inside the username automatically without requiring that the user touch the textfield?


问:
How to save the result of EXEC(@SQL) in a variable
Could someone please help me out on how can I save the result of EXEC (@SQL) In a variable so that I can use it in a update statement

```<code>--Using SQL SERVER 2018
DECLARE
@MasterID   NVARCHAR(30),
@INPUTXML   XML

SET @MasterID = 't_Product'

BEGIN
    SET NOCOUNT ON
    DECLARE @SharedOn   DateTime,
            @TypeID     XML ,
            @SQL        NVARCHAR(500),
            @ErrMsg     NVARCHAR(200)

    CREATE TABLE #TypeID
    (
        ID  NVARCHAR(50)
    )

    SELECT  @SharedOn   = SharedOn,
            @TypeID     = TypeID
    FROM    t_MasterDataShareControl
    WHERE   MasterID    = @MasterID

    INSERT INTO #TypeID
    (
        ID
    )
    SELECT
            NULLIF(TypeID.x.value('ID[1]','nvarchar(250)'),'')
    FROM    @TypeID.nodes('/dt_TypeID/dt_ID') AS TypeID(x)

    IF @MasterID IN ('t_Product','t_WFAdvRule') AND @TypeID IS NULL
    BEGIN
        SET @SQL =  'SELECT *
                     FROM ' + @MasterID +
                    ' WHERE ISNULL(ModifiedOn,CreatedOn)'+ '>' + concat(char(39),@SharedOn,char(39))
    END
    IF @MasterID IN ('t_SystemCodeDetail','t_UserCodeDetail','t_BankUserCode','t_BranchUserCode' ) AND @TypeID IS NOT NULL
    BEGIN
    SET @SQL =  'SELECT *
                 FROM ' + @MasterID +
                ' WHERE ISNULL(ModifiedOn,CreatedOn) >' + concat(char(39),@SharedOn,char(39)) +
                'AND    ID IN ( SELECT  *
                                FROM    #TypeID )'
    END

    SET @SQL = @SQL + ' FOR XML PATH('+ concat(char(39),@MasterID,char(39)) + '),ROOT(''InputXML'')'

    EXEC (@SQL)

    ENDSTMT:

    DROP TABLE #TypeID
    SET NOCOUNT OFF
END
</code>```

I tried it , but no results

```<code>SET @SQL =  'SET @myVar = ( SELECT * FROM ' + @MasterID +
                    ' WHERE ISNULL(ModifiedOn,CreatedOn)'+ '>' + concat(char(39),@SharedOn,char(39)) +' )'

EXEC sp_executesql @SQL, N'@myVar NVARCHAR(MAX) OUT', @myVar OUT

SELECT @myVar
</code>```

I also tried inserting in temp table, but then I get:

The FOR XML clause is not allowed in a INSERT statement.

Body:
Could someone please help me out on how can I save the result of EXEC (@SQL) In a variable so that I can use it in a update statement

--Using SQL SERVER 2018
DECLARE
@MasterID   NVARCHAR(30),
@INPUTXML   XML

SET @MasterID = 't_Product'

BEGIN
    SET NOCOUNT ON
    DECLARE @SharedOn   DateTime,
            @TypeID     XML ,
            @SQL        NVARCHAR(500),
            @ErrMsg     NVARCHAR(200)

    CREATE TABLE #TypeID
    (
        ID  NVARCHAR(50)
    )

    SELECT  @SharedOn   = SharedOn,
            @TypeID     = TypeID
    FROM    t_MasterDataShareControl
    WHERE   MasterID    = @MasterID

    INSERT INTO #TypeID
    (
        ID
    )
    SELECT
            NULLIF(TypeID.x.value('ID[1]','nvarchar(250)'),'')
    FROM    @TypeID.nodes('/dt_TypeID/dt_ID') AS TypeID(x)

    IF @MasterID IN ('t_Product','t_WFAdvRule') AND @TypeID IS NULL
    BEGIN
        SET @SQL =  'SELECT *
                     FROM ' + @MasterID +
                    ' WHERE ISNULL(ModifiedOn,CreatedOn)'+ '>' + concat(char(39),@SharedOn,char(39))
    END
    IF @MasterID IN ('t_SystemCodeDetail','t_UserCodeDetail','t_BankUserCode','t_BranchUserCode' ) AND @TypeID IS NOT NULL
    BEGIN
    SET @SQL =  'SELECT *
                 FROM ' + @MasterID +
                ' WHERE ISNULL(ModifiedOn,CreatedOn) >' + concat(char(39),@SharedOn,char(39)) +
                'AND    ID IN ( SELECT  *
                                FROM    #TypeID )'
    END

    SET @SQL = @SQL + ' FOR XML PATH('+ concat(char(39),@MasterID,char(39)) + '),ROOT(''InputXML'')'

    EXEC (@SQL)

    ENDSTMT:

    DROP TABLE #TypeID
    SET NOCOUNT OFF
END

I tried it , but no results

SET @SQL =  'SET @myVar = ( SELECT * FROM ' + @MasterID +
                    ' WHERE ISNULL(ModifiedOn,CreatedOn)'+ '>' + concat(char(39),@SharedOn,char(39)) +' )'

EXEC sp_executesql @SQL, N'@myVar NVARCHAR(MAX) OUT', @myVar OUT

SELECT @myVar

I also tried inserting in temp table, but then I get:

The FOR XML clause is not allowed in a INSERT statement.


问:
Saml2 authentication on Laravel and Azure not firing the Authenticated method
As the title says, I have a hard time to get the LoginController::authenticated method to fire up.

Totally new to this Saml stuff and trying to get it to work in Rest-API environment where additional process has to take place after authenticating the user correctly as per my client specific environment.

I installed the "24Slides/laravel-saml2" package and added the "SignedIn" event listener to the EventServiceProvider (see code below).  All work good when firing the login process with Azure, but when calling the Auth::login($user) method, it doesn't fully execute the loging process (i.e. not executing the AuthenticatesUsers::sendLoginResponse method).

```<code>/**
 * Register any events for your application.
 *
 * @return void
 */
public function boot() {
    parent::boot();

    Event::listen(SignedIn::class, function (SignedIn $event) {

        $samlUser = $event->getSaml2User();
        $userEmail = $samlUser->getAttributes()['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'];

        $user = Navigator::getModel('user')::where('email', $userEmail)->first();

        // Login a user.
        Auth::login($user);  // <--- Need this process to fire up the authenticated method from the LoginController class
    });
}
</code>```

What am I missing?

Using Laravel 6.20 on PHP 7.2.

Body:
As the title says, I have a hard time to get the LoginController::authenticated method to fire up.

Totally new to this Saml stuff and trying to get it to work in Rest-API environment where additional process has to take place after authenticating the user correctly as per my client specific environment.

I installed the "24Slides/laravel-saml2" package and added the "SignedIn" event listener to the EventServiceProvider (see code below).  All work good when firing the login process with Azure, but when calling the Auth::login($user) method, it doesn't fully execute the loging process (i.e. not executing the AuthenticatesUsers::sendLoginResponse method).

/**
 * Register any events for your application.
 *
 * @return void
 */
public function boot() {
    parent::boot();

    Event::listen(SignedIn::class, function (SignedIn $event) {

        $samlUser = $event->getSaml2User();
        $userEmail = $samlUser->getAttributes()['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'];

        $user = Navigator::getModel('user')::where('email', $userEmail)->first();

        // Login a user.
        Auth::login($user);  // <--- Need this process to fire up the authenticated method from the LoginController class
    });
}

What am I missing?

Using Laravel 6.20 on PHP 7.2.


问:
yahoo_fin get_balance_sheet() doesn't return any data
I am using yahoo_fin to get some fundamental data and it is working fine for PE, PS ratio etc. but when using get_balance_sheet(), it return no data. Any suggestion? Thanks

```<code>import yahoo_fin.stock_info as si
sheet = si.get_balance_sheet("AAPL")
</code>```

Get PE ratio is fine

```<code>quote = si.get_quote_table("aapl")
quote["PE Ratio (TTM)"]
22.01
</code>```

Body:
I am using yahoo_fin to get some fundamental data and it is working fine for PE, PS ratio etc. but when using get_balance_sheet(), it return no data. Any suggestion? Thanks

import yahoo_fin.stock_info as si
sheet = si.get_balance_sheet("AAPL")

Get PE ratio is fine

quote = si.get_quote_table("aapl")
quote["PE Ratio (TTM)"]
22.01


问:
Saving Jenkins console logs
We've been using the following method to save Jenkins console logs:

```<code>ByteArrayOutputStream stream = new ByteArrayOutputStream()
currentBuild.rawBuild.getLogText().writeLogTo(0, stream)
writeFile file: "archive/${jobName}-log.txt", text: stream.toString()
</code>```

However, I noticed that about half of the logs was getting cut off.

I tried using a different method, and the full log is getting saved correctly:

```<code>sh""" curl ${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_NUMBER}/consoleText -o archive/${JOB_NAME}-log.txt """
</code>```

So I started wondering what is wrong with the first method where only 1.2-1.5 MB is getting saved out of 3.5 MB?
I know that this line:

```<code>    ByteArrayOutputStream stream = new ByteArrayOutputStream()
</code>```

means that the buffer size is initially 32 bytes and it will increase if needed.
What could go wrong here that the buffer supposedly would not increase?

Please help me solve this puzzle. Even thinking out loud in the comments will help.

Title: Saving Jenkins console logs

Body:
We've been using the following method to save Jenkins console logs:

ByteArrayOutputStream stream = new ByteArrayOutputStream()
currentBuild.rawBuild.getLogText().writeLogTo(0, stream)
writeFile file: "archive/${jobName}-log.txt", text: stream.toString()

However, I noticed that about half of the logs was getting cut off.

I tried using a different method, and the full log is getting saved correctly:

sh""" curl ${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_NUMBER}/consoleText -o archive/${JOB_NAME}-log.txt """

So I started wondering what is wrong with the first method where only 1.2-1.5 MB is getting saved out of 3.5 MB?
I know that this line:

    ByteArrayOutputStream stream = new ByteArrayOutputStream()

means that the buffer size is initially 32 bytes and it will increase if needed.
What could go wrong here that the buffer supposedly would not increase?

Please help me solve this puzzle. Even thinking out loud in the comments will help.


问:
Servo/Ipc_channel trivial example doesn't work
I'm attempting to get the ipc-channel package to work and I can't get a trivial example to run.

I have a rust cargo called process_handler that creates an IpcOneShotServer and then spawns a server. (NOTE: most of the code comes from the examples as shown in the test.rs file linked in the repo).

```<code>use std::process::Command;
use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender, IpcReceiver};

fn main() {

    let datavec = vec![("Peter".to_string(), "36".to_string())];

    let guiserver = spawn_server(
                  "/Users/peterweyand/Code/rustprojects/project1.1/project1_1/process_handler/src/rungui.sh".to_string(),
                  // &server_args
                  &server_name0
              );
}

pub fn spawn_server(address:String, test_name: &str) -> std::process::Child {
    Command::new(address)
        .arg(test_name)
        .spawn()
        .expect("failed to execute server process")
}
</code>```

Which calls the following bash file.

#!/bin/bash

echo "inside rungui.sh"
echo "First Parameter of the script is $1"

cd /Users/peterweyand/Code/rustprojects/project1.1/project1_1
cargo build && cargo run -- $1
```
<p>Which calls my crate that I want to access the <code>IpcSender</code> on:</p>
```use iced::widget::{button, container, row, column, text, text_input};
use iced::{executor, Application, Command, Length, Settings};
use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender, IpcReceiver};
use iced::Color;
// use iced::widget::column;
use self::theme::Theme;
use self::widget::Element;
use std::collections::HashMap;
use std::process::Command as ProcessCommand;
use std::env;
use std::io;
use std::{thread, time};

fn main() {
    println!("&cloned_string: {:?}", args[1].clone());
    let tx2 = IpcSender::<Vec<(String, String)>>::connect(args[1].clone()).unwrap();
}
```
<p>Which produces the following result -</p>
```&cloned_string: "org.rust-lang.ipc-channel.8687042407079962014"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: Unknown(1102) }', src/main.rs:59:76
```

According to the official rust error index there is no error code 1102.

So, why is this failing? I would expect that since the latter cargo is a child process it should be able to access the IpcSender. This isn't fancy at all, just accessing the messages between processes. I'm not wrapping one channel or server in another or anything like that.

I've also asked the question in their github issues

Here is a link to my repo. cd into the process handler folder and cargo run.

(EDIT: The most trivial example I can make is here. There are no extraneous dependencies or commented out code. Just run sudo cargo build && sudo cargo run. It outputs the same error as the other repo.)

I have as trivial an example as I can make and it doesn't appear to work. It may be something stupid, but I thought I'd put it here in case someone comes along and is debugging their code.

Body:
I'm attempting to get the ipc-channel package to work and I can't get a trivial example to run.

I have a rust cargo called process_handler that creates an IpcOneShotServer and then spawns a server. (NOTE: most of the code comes from the examples as shown in the test.rs file linked in the repo).

use std::process::Command;
use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender, IpcReceiver};

fn main() {

    let datavec = vec![("Peter".to_string(), "36".to_string())];

    let guiserver = spawn_server(
                  "/Users/peterweyand/Code/rustprojects/project1.1/project1_1/process_handler/src/rungui.sh".to_string(),
                  // &server_args
                  &server_name0
              );
}

pub fn spawn_server(address:String, test_name: &str) -> std::process::Child {
    Command::new(address)
        .arg(test_name)
        .spawn()
        .expect("failed to execute server process")
}

Which calls the following bash file.

#!/bin/bash

echo "inside rungui.sh"
echo "First Parameter of the script is $1"

cd /Users/peterweyand/Code/rustprojects/project1.1/project1_1
cargo build && cargo run -- $1

Which calls my crate that I want to access the IpcSender on:

use iced::widget::{button, container, row, column, text, text_input};
use iced::{executor, Application, Command, Length, Settings};
use ipc_channel::ipc::{self, IpcOneShotServer, IpcSender, IpcReceiver};
use iced::Color;
// use iced::widget::column;
use self::theme::Theme;
use self::widget::Element;
use std::collections::HashMap;
use std::process::Command as ProcessCommand;
use std::env;
use std::io;
use std::{thread, time};

fn main() {
    println!("&cloned_string: {:?}", args[1].clone());
    let tx2 = IpcSender::<Vec<(String, String)>>::connect(args[1].clone()).unwrap();
}

Which produces the following result -

&cloned_string: "org.rust-lang.ipc-channel.8687042407079962014"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: Unknown(1102) }', src/main.rs:59:76

According to the official rust error index there is no error code 1102.

So, why is this failing? I would expect that since the latter cargo is a child process it should be able to access the IpcSender. This isn't fancy at all, just accessing the messages between processes. I'm not wrapping one channel or server in another or anything like that.

I've also asked the question in their github issues

Here is a link to my repo. cd into the process handler folder and cargo run.

(EDIT: The most trivial example I can make is here. There are no extraneous dependencies or commented out code. Just run sudo cargo build && sudo cargo run. It outputs the same error as the other repo.)

I have as trivial an example as I can make and it doesn't appear to work. It may be something stupid, but I thought I'd put it here in case someone comes along and is debugging their code.


问:
Why do I get this error when installing Pygame, and how can I fix it?
I get this error downloading Pygame:

```<code>C:\Users\<USERNAME>\Desktop\stuff\Playground>pip install pygame
Collecting pygame
  Using cached pygame-2.1.2.tar.gz (10.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [74 lines of output]

      WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
      Using WINDOWS configuration...

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\setup.py", line 359, in <module>
          buildconfig.config.main(AUTO_CONFIG)
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\config.py", line 225, in main
          deps = CFG.main(**kwds)
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\config_win.py", line 511, in main
          return setup_prebuilt_sdl2(prebuilt_dir)
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\config_win.py", line 471, in setup_prebuilt_sdl2
          DEPS.configure()
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\config_win.py", line 336, in configure
          from . import vstools
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\vstools.py", line 11, in <module>
          compiler.initialize()
        File "C:\msys64\mingw64\lib\python3.9\distutils\msvccompiler.py", line 259, in initialize
          self.__paths = self.get_msvc_paths("path")
        File "C:\msys64\mingw64\lib\python3.9\distutils\msvccompiler.py", line 602, in get_msvc_paths
          r"\Win32 (%s)\Directories" % (self.__root, platform))
      AttributeError: 'MSVCCompiler' object has no attribute '_MSVCCompiler__root'
      Making dir :prebuilt_downloads:
      Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip ed561079ec622b0bab5a9e02976f5d540b0622da
      Unzipping :prebuilt_downloads\SDL2-devel-2.0.18-VC.zip:
      Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
      Unzipping :prebuilt_downloads\SDL2_image-devel-2.0.5-VC.zip:
      Downloading... https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.15-VC.zip 1436df41ebc47ac36e02ec9bda5699e80ff9bd27
      Unzipping :prebuilt_downloads\SDL2_ttf-devel-2.0.15-VC.zip:
      Downloading... https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-VC.zip 9097148f4529cf19f805ccd007618dec280f0ecc
      Unzipping :prebuilt_downloads\SDL2_mixer-devel-2.0.4-VC.zip:
      Downloading... https://www.pygame.org/ftp/jpegsr9d.zip ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99
      Unzipping :prebuilt_downloads\jpegsr9d.zip:
      Downloading... https://pygame.org/ftp/prebuilt-x64-pygame-1.9.2-20150922.zip 3a5af3427b3aa13a0aaf5c4cb08daaed341613ed
      Unzipping :prebuilt_downloads\prebuilt-x64-pygame-1.9.2-20150922.zip:
      copying into .\prebuilt-x64
      Path for SDL: prebuilt-x64\SDL2-2.0.18
      ...Library directory for SDL: prebuilt-x64/SDL2-2.0.18/lib/x64
      ...Include directory for SDL: prebuilt-x64/SDL2-2.0.18/include
      Path for FONT: prebuilt-x64\SDL2_ttf-2.0.15
      ...Library directory for FONT: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64
      ...Include directory for FONT: prebuilt-x64/SDL2_ttf-2.0.15/include
      Path for IMAGE: prebuilt-x64\SDL2_image-2.0.5
      ...Library directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/lib/x64
      ...Include directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/include
      Path for MIXER: prebuilt-x64\SDL2_mixer-2.0.4
      ...Library directory for MIXER: prebuilt-x64/SDL2_mixer-2.0.4/lib/x64
      ...Include directory for MIXER: prebuilt-x64/SDL2_mixer-2.0.4/include
      Path for PORTMIDI: prebuilt-x64
      ...Library directory for PORTMIDI: prebuilt-x64/lib
      ...Include directory for PORTMIDI: prebuilt-x64/include
      DLL for SDL2: prebuilt-x64/SDL2-2.0.18/lib/x64/SDL2.dll
      DLL for SDL2_ttf: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64/SDL2_ttf.dll
      DLL for SDL2_image: prebuilt-x64/SDL2_image-2.0.5/lib/x64/SDL2_image.dll
      DLL for SDL2_mixer: prebuilt-x64/SDL2_mixer-2.0.4/lib/x64/SDL2_mixer.dll
      DLL for portmidi: prebuilt-x64/lib/portmidi.dll
      Path for FREETYPE not found.
      ...Found include dir but no library dir in prebuilt-x64.
      Path for PNG not found.
      ...Found include dir but no library dir in prebuilt-x64.
      Path for JPEG not found.
      ...Found include dir but no library dir in prebuilt-x64.
      DLL for freetype: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64/libfreetype-6.dll

      ---
      For help with compilation see:
          https://www.pygame.org/wiki/CompileWindows
      To contribute to pygame development see:
          https://www.pygame.org/contribute.html
      ---

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
</code>```

The error apparently said that the problem wasn't with pip, it was with the module itself. I'm using the Python interpreter 3.10.9 on VS Code. I'm downloading it using VS Code's integrated terminal.

How can I fix this error?

I tried doing "pip install pygame --pre" and got the same results.

Body:
I get this error downloading Pygame:

C:\Users\<USERNAME>\Desktop\stuff\Playground>pip install pygame
Collecting pygame
  Using cached pygame-2.1.2.tar.gz (10.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [74 lines of output]

      WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
      Using WINDOWS configuration...

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\setup.py", line 359, in <module>
          buildconfig.config.main(AUTO_CONFIG)
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\config.py", line 225, in main
          deps = CFG.main(**kwds)
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\config_win.py", line 511, in main
          return setup_prebuilt_sdl2(prebuilt_dir)
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\config_win.py", line 471, in setup_prebuilt_sdl2
          DEPS.configure()
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\config_win.py", line 336, in configure
          from . import vstools
        File "C:\Users\<USERNAME>\AppData\Local\Temp\pip-install-duqf4ri6\pygame_afbf8900edd144e7bffd76514f197ea9\buildconfig\vstools.py", line 11, in <module>
          compiler.initialize()
        File "C:\msys64\mingw64\lib\python3.9\distutils\msvccompiler.py", line 259, in initialize
          self.__paths = self.get_msvc_paths("path")
        File "C:\msys64\mingw64\lib\python3.9\distutils\msvccompiler.py", line 602, in get_msvc_paths
          r"\Win32 (%s)\Directories" % (self.__root, platform))
      AttributeError: 'MSVCCompiler' object has no attribute '_MSVCCompiler__root'
      Making dir :prebuilt_downloads:
      Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip ed561079ec622b0bab5a9e02976f5d540b0622da
      Unzipping :prebuilt_downloads\SDL2-devel-2.0.18-VC.zip:
      Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
      Unzipping :prebuilt_downloads\SDL2_image-devel-2.0.5-VC.zip:
      Downloading... https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.15-VC.zip 1436df41ebc47ac36e02ec9bda5699e80ff9bd27
      Unzipping :prebuilt_downloads\SDL2_ttf-devel-2.0.15-VC.zip:
      Downloading... https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-VC.zip 9097148f4529cf19f805ccd007618dec280f0ecc
      Unzipping :prebuilt_downloads\SDL2_mixer-devel-2.0.4-VC.zip:
      Downloading... https://www.pygame.org/ftp/jpegsr9d.zip ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99
      Unzipping :prebuilt_downloads\jpegsr9d.zip:
      Downloading... https://pygame.org/ftp/prebuilt-x64-pygame-1.9.2-20150922.zip 3a5af3427b3aa13a0aaf5c4cb08daaed341613ed
      Unzipping :prebuilt_downloads\prebuilt-x64-pygame-1.9.2-20150922.zip:
      copying into .\prebuilt-x64
      Path for SDL: prebuilt-x64\SDL2-2.0.18
      ...Library directory for SDL: prebuilt-x64/SDL2-2.0.18/lib/x64
      ...Include directory for SDL: prebuilt-x64/SDL2-2.0.18/include
      Path for FONT: prebuilt-x64\SDL2_ttf-2.0.15
      ...Library directory for FONT: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64
      ...Include directory for FONT: prebuilt-x64/SDL2_ttf-2.0.15/include
      Path for IMAGE: prebuilt-x64\SDL2_image-2.0.5
      ...Library directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/lib/x64
      ...Include directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/include
      Path for MIXER: prebuilt-x64\SDL2_mixer-2.0.4
      ...Library directory for MIXER: prebuilt-x64/SDL2_mixer-2.0.4/lib/x64
      ...Include directory for MIXER: prebuilt-x64/SDL2_mixer-2.0.4/include
      Path for PORTMIDI: prebuilt-x64
      ...Library directory for PORTMIDI: prebuilt-x64/lib
      ...Include directory for PORTMIDI: prebuilt-x64/include
      DLL for SDL2: prebuilt-x64/SDL2-2.0.18/lib/x64/SDL2.dll
      DLL for SDL2_ttf: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64/SDL2_ttf.dll
      DLL for SDL2_image: prebuilt-x64/SDL2_image-2.0.5/lib/x64/SDL2_image.dll
      DLL for SDL2_mixer: prebuilt-x64/SDL2_mixer-2.0.4/lib/x64/SDL2_mixer.dll
      DLL for portmidi: prebuilt-x64/lib/portmidi.dll
      Path for FREETYPE not found.
      ...Found include dir but no library dir in prebuilt-x64.
      Path for PNG not found.
      ...Found include dir but no library dir in prebuilt-x64.
      Path for JPEG not found.
      ...Found include dir but no library dir in prebuilt-x64.
      DLL for freetype: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64/libfreetype-6.dll

      ---
      For help with compilation see:
          https://www.pygame.org/wiki/CompileWindows
      To contribute to pygame development see:
          https://www.pygame.org/contribute.html
      ---

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

The error apparently said that the problem wasn't with pip, it was with the module itself. I'm using the Python interpreter 3.10.9 on VS Code. I'm downloading it using VS Code's integrated terminal.

How can I fix this error?

I tried doing "pip install pygame --pre" and got the same results.


问:
Why is my AppendStructuredBuffer giving nonsense results for everything but its first Append?
I'm using DX12 in Unity3d, and I'm using an AppendStructuredBuffer in the compute shader. It seems to be giving the correct answer mathematically for the first time it appends to the buffer, but every subsequent time it appends, it gives extremely tiny numbers, 0, or [NaN] results that don't match up with the computation that I'm running in parallel on the CPU.

This is the code of the Compute Shader:

```<code>
// Each #kernel tells which function to compile; you can have many kernels
#pragma kernel Forward
#pragma kernel LayerResults
#pragma use_dxc
#include "UnityCG.cginc"

StructuredBuffer<float> _biases;
StructuredBuffer<float> _weights;
StructuredBuffer<float> _inputs;
AppendStructuredBuffer<float> _layerOutput;
[numthreads(4, 1, 1)]
void Forward(uint3 id : SV_DispatchThreadID)
{
    uint2 biasNum;
    uint2 inputNum;
    _biases.GetDimensions(biasNum.x, biasNum.y);
    _inputs.GetDimensions(inputNum.x, inputNum.y);
    float weightIndex = 0;
    for (int i = 0; i < biasNum.x; i++) {
        float sum = 0;
        for (int j = 0; j < inputNum.x; j++) {
            sum = sum + _inputs[j] * _weights[weightIndex];
            weightIndex++;
        }
        sum = sum + _biases[i];
        _layerOutput.Append(sum);
    }
}
[numthreads(4, 1, 1)]
void LayerResults(uint3 id : SV_DispatchThreadID)
{

}

</code>```

The math is right for calculating what number should be added but it only gets the first number right. What would be causing this? The c# is rather large, but this is the relevant parts:

```<code>ComputeBuffer layerOutput = new(layerBiases.Length, sizeof(float) * (layerWeights.Length), ComputeBufferType.Append);

c.SetBuffer(kernelIndex, "_layerOutput", layerOutput);

c.Dispatch(kernelIndex, 4, 1, 1);

layerOutput.GetData(layerEnd);
</code>```

It's storing the right number of items, but everything after the first result is nonsense.

I'm trying to get the results from the compute buffer to match the results from the CPU. The math is done in exactly the same way.

Body:
I'm using DX12 in Unity3d, and I'm using an AppendStructuredBuffer in the compute shader. It seems to be giving the correct answer mathematically for the first time it appends to the buffer, but every subsequent time it appends, it gives extremely tiny numbers, 0, or [NaN] results that don't match up with the computation that I'm running in parallel on the CPU.

This is the code of the Compute Shader:

// Each #kernel tells which function to compile; you can have many kernels
#pragma kernel Forward
#pragma kernel LayerResults
#pragma use_dxc
#include "UnityCG.cginc"

StructuredBuffer<float> _biases;
StructuredBuffer<float> _weights;
StructuredBuffer<float> _inputs;
AppendStructuredBuffer<float> _layerOutput;
[numthreads(4, 1, 1)]
void Forward(uint3 id : SV_DispatchThreadID)
{
    uint2 biasNum;
    uint2 inputNum;
    _biases.GetDimensions(biasNum.x, biasNum.y);
    _inputs.GetDimensions(inputNum.x, inputNum.y);
    float weightIndex = 0;
    for (int i = 0; i < biasNum.x; i++) {
        float sum = 0;
        for (int j = 0; j < inputNum.x; j++) {
            sum = sum + _inputs[j] * _weights[weightIndex];
            weightIndex++;
        }
        sum = sum + _biases[i];
        _layerOutput.Append(sum);
    }
}
[numthreads(4, 1, 1)]
void LayerResults(uint3 id : SV_DispatchThreadID)
{

}

The math is right for calculating what number should be added but it only gets the first number right. What would be causing this? The c# is rather large, but this is the relevant parts:

ComputeBuffer layerOutput = new(layerBiases.Length, sizeof(float) * (layerWeights.Length), ComputeBufferType.Append);

c.SetBuffer(kernelIndex, "_layerOutput", layerOutput);

c.Dispatch(kernelIndex, 4, 1, 1);

layerOutput.GetData(layerEnd);

It's storing the right number of items, but everything after the first result is nonsense.

I'm trying to get the results from the compute buffer to match the results from the CPU. The math is done in exactly the same way.


问:
Shortcut works however the program doesn't?
The shortcut I created runs the program fine like such in the bottom right, however when I run it through VSCODE it gives me an error saying that it cannot find the file which is strange because this program worked fine both ways until I moved the file location. <<REFERENCE PICTURE FOR MORE INFO>>enter image description here

I have tried copying every type of path and modifying it in the open('stats.txt') however nothing works any ideas? I can post the full code if necessary however I really do not think this is a code issue.


问:
Problem trying to visualize 3 way interaction in R. Trouble with adding rawdata to ggpredict plot (using ggeffects package)

I am trying to overlay the raw data points onto my line graph with two panels. I have added a picture of the graph I am getting (incorrectly) below, I am trying to generate only 2 graphs (by overlaying the top row with the bottom).

I am using the ggeffects package, with ggpredict and plot() functions. For reference, my linear model is as follows:
lm(LS ~ gender*age*sleep + sample_2 + sample_3 + sample_5, data = data)
Note: gender is binary here.

The issue arises when I use the plot function, specifically when rawdata = TRUE . Based on the documentation, this should overlay the raw data onto the graphs. However, I get 4 graphs instead: 2 with the ggpredict line graphs (split into 2 facets for each gender ), and 2 scatter plots with the raw data (also split by gender). I would like to combine these by gender.

https://cran.r-project.org/web/packages/ggeffects/ggeffects.pdf

IMAGE: Incorrect Graph Example

Below is the code:

```<code>model <- lm(LS ~ gender*age*sleep + sample_2 + sample_3 + sample_5, data = data)
gpd_terms <- ggpredict(model, terms=c("age","sleep","gender")) # no problems with `the output here
gp <- plot(gpd_terms, ci = TRUE,
rawdata = TRUE,
dot.alpha = 0.5,
jitter = TRUE,
colors = "gs")
</code>```

As an alternative, I have also tried this with ggplot2 (below), using these instructions https://github.com/strengejacke/ggeffects/issues/110. However, I cannot get this to work when using the geom_point argument. I get the error "Continuous value supplied to discrete scale". I suspect this has to do with my use of gender groupings.

```<code>gp <- ggplot(as.data.frame(gpd_terms), aes(x = x, y = predicted, colour = group)) +
stat_smooth(method = "lm") +
geom_point(data = attr(gm, "rawdata"), aes(x = jitter(x), y = jitter(response)),alpha = 0.6) +
facet_wrap(\~facet, ncol = 2) +
geom_ribbon(aes(ymin = conf.low, ymax = conf.high), color = FALSE, alpha = 0.2) +
labs(
x = get_x_title(gm),
y = get_y_title(gm),
colour = get_legend_title(gm))
</code>```

THANK YOU!

Body:
I am trying to overlay the raw data points onto my line graph with two panels. I have added a picture of the graph I am getting (incorrectly) below, I am trying to generate only 2 graphs (by overlaying the top row with the bottom).

I am using the ggeffects package, with ggpredict and plot() functions. For reference, my linear model is as follows:
lm(LS ~ gender*age*sleep + sample_2 + sample_3 + sample_5, data = data)
Note: gender is binary here.

The issue arises when I use the plot function, specifically when rawdata = TRUE . Based on the documentation, this should overlay the raw data onto the graphs. However, I get 4 graphs instead: 2 with the ggpredict line graphs (split into 2 facets for each gender ), and 2 scatter plots with the raw data (also split by gender). I would like to combine these by gender.

https://cran.r-project.org/web/packages/ggeffects/ggeffects.pdf

IMAGE: Incorrect Graph Example

Below is the code:

model <- lm(LS ~ gender*age*sleep + sample_2 + sample_3 + sample_5, data = data)
gpd_terms <- ggpredict(model, terms=c("age","sleep","gender")) # no problems with `the output here
gp <- plot(gpd_terms, ci = TRUE,
rawdata = TRUE,
dot.alpha = 0.5,
jitter = TRUE,
colors = "gs")

As an alternative, I have also tried this with ggplot2 (below), using these instructions https://github.com/strengejacke/ggeffects/issues/110. However, I cannot get this to work when using the geom_point argument. I get the error "Continuous value supplied to discrete scale". I suspect this has to do with my use of gender groupings.

gp <- ggplot(as.data.frame(gpd_terms), aes(x = x, y = predicted, colour = group)) +
stat_smooth(method = "lm") +
geom_point(data = attr(gm, "rawdata"), aes(x = jitter(x), y = jitter(response)),alpha = 0.6) +
facet_wrap(\~facet, ncol = 2) +
geom_ribbon(aes(ymin = conf.low, ymax = conf.high), color = FALSE, alpha = 0.2) +
labs(
x = get_x_title(gm),
y = get_y_title(gm),
colour = get_legend_title(gm))

THANK YOU!


问:
CMake Error at CMakeLists.txt:152 (project):
I am trying to the AWS SDK for C++. Currently, I installed cmake, and clang. I am following the documentation listed here: https://github.com/aws/aws-sdk-cpp

I am at the building from source stage. When I cd to the directory I created, and run the build command, I get the following message:

```<code>CMake Error at CMakeLists.txt:152 (project):
  Running

   'nmake' '-?'

  failed with:

   The system cannot find the file specified

-- Configuring incomplete, errors occurred!
</code>```

How do I fix this and why is this error message occurring? Thank you for any help in advance.

error message

I tried to search online for the error message. I found results related to configuring the path, or ensuring that gcc and g++ were installed.

Body:
I am trying to the AWS SDK for C++. Currently, I installed cmake, and clang. I am following the documentation listed here: https://github.com/aws/aws-sdk-cpp

I am at the building from source stage. When I cd to the directory I created, and run the build command, I get the following message:

CMake Error at CMakeLists.txt:152 (project):
  Running

   'nmake' '-?'

  failed with:

   The system cannot find the file specified

-- Configuring incomplete, errors occurred!

How do I fix this and why is this error message occurring? Thank you for any help in advance.

error message

I tried to search online for the error message. I found results related to configuring the path, or ensuring that gcc and g++ were installed.


问:
How to add on click active class and remove class
If I click on .m_nice_select then .active_shade will be an additional class active and If I again click on .m_nice_select then will remove the class active from .active_shade</p>
```<code>$('.m_nice_select').on('click', function(){
  $('.active_shade').addClass('active');
  $(this).removeClass('active');
});
</code>```

Body:
If I click on .m_nice_select then .active_shade will be an additional class active and If I again click on .m_nice_select then will remove the class active from .active_shade

$('.m_nice_select').on('click', function(){
  $('.active_shade').addClass('active');
  $(this).removeClass('active');
});


问:
Expanding a Series of QVBoxLayouts to fill a Outer Layout
I am trying to expand the table in grey to fill the entire space on the bottom (ie remove the gap between the table in grey and the label "Total: 0 ...". See image:

I am currently building the table by adding a bunch of custom widget buttons. I have tried setting the stretch multiple times in the vbox layout, but have not achieved any success. I attached the code here:

```<code>    def buildLeftLayout(self):
        leftLayout = QVBoxLayout()
        leftLayout.setContentsMargins(70, 70, 70, 0)
        leftLayout.addLayout(self.buildButtonLayout())
        leftLayout.addStretch()
        leftLayout.addLayout(self.buildPercentageLabelLayout())
        return leftLayout
</code>```
```<code>    def buildPercentageLabelLayout(self):
        self.percentLabel = QLabel(alignment=Qt.AlignLeft)
        self.percentLabel.setText("Total: 0     Raise: 0      Call: 0      Fold: 100")
        percentLabel = QHBoxLayout()
        percentLabel.addWidget(self.percentLabel)
        percentLabel.setContentsMargins(0, 20, 0, 0)
        return percentLabel
</code>```
```<code>    def buildButtonLayout(self):
        buttonMainLayout = QHBoxLayout()
        buttonMainLayout.setSpacing(0)

        # Build out button matrix
        self.firstButton = None
        for i in range(13):
            buttonSubLayout = QVBoxLayout()
            buttonArr = []
            for j in range(13):
                button = DrawRangeButton("#36454F", self.comboMap[i][j])
                button.setFont(self.font(30))
                buttonSubLayout.addWidget(button)
                button.clicked.connect(partial(self.fillButton, (button, [i, j])))
                buttonArr.append(button)
            buttonMainLayout.addLayout(buttonSubLayout)
            self.buttonPushMap.append(buttonArr)
        return buttonMainLayout

</code>```

Body:
I am trying to expand the table in grey to fill the entire space on the bottom (ie remove the gap between the table in grey and the label "Total: 0 ...". See image:

I am currently building the table by adding a bunch of custom widget buttons. I have tried setting the stretch multiple times in the vbox layout, but have not achieved any success. I attached the code here:

    def buildLeftLayout(self):
        leftLayout = QVBoxLayout()
        leftLayout.setContentsMargins(70, 70, 70, 0)
        leftLayout.addLayout(self.buildButtonLayout())
        leftLayout.addStretch()
        leftLayout.addLayout(self.buildPercentageLabelLayout())
        return leftLayout

    def buildPercentageLabelLayout(self):
        self.percentLabel = QLabel(alignment=Qt.AlignLeft)
        self.percentLabel.setText("Total: 0     Raise: 0      Call: 0      Fold: 100")
        percentLabel = QHBoxLayout()
        percentLabel.addWidget(self.percentLabel)
        percentLabel.setContentsMargins(0, 20, 0, 0)
        return percentLabel

    def buildButtonLayout(self):
        buttonMainLayout = QHBoxLayout()
        buttonMainLayout.setSpacing(0)

        # Build out button matrix
        self.firstButton = None
        for i in range(13):
            buttonSubLayout = QVBoxLayout()
            buttonArr = []
            for j in range(13):
                button = DrawRangeButton("#36454F", self.comboMap[i][j])
                button.setFont(self.font(30))
                buttonSubLayout.addWidget(button)
                button.clicked.connect(partial(self.fillButton, (button, [i, j])))
                buttonArr.append(button)
            buttonMainLayout.addLayout(buttonSubLayout)
            self.buttonPushMap.append(buttonArr)
        return buttonMainLayout


问:
Overflow scroll not working table rows in a React component
I am rendering these Ticket components inside the table body. I have wrapped the columns in divs to make them block level so the overflow property will work but as you can see they are still visible and overflowing their container at the bottom.

Ticket.jsx:

```<code>import React from "react";
import styles from "./Ticket.module.css";

const Ticket = (props) => {
  return (
    <tr className={styles.ticket}>
      <td className={styles["ticket-col"]}>
        <div>
        {props.ticket.task}
        </div>
        </td>
      <td className={styles["ticket-col"]}>
        <div>
        {props.ticket.assignee}
        </div>
        </td>
      <td className={styles["ticket-col"]}>
        <div>
        {props.ticket.time}
        </div>
        </td>
    </tr>
  );
};

export default Ticket;
</code>```

Ticket.module.css:

```<code>.ticket {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    text-transform: capitalize;
    padding: 0.5rem 0;
    border-bottom: solid 1px black;
}
.ticket-col{
    display: flex;
    justify-content: center;
}
.ticket-col div {
    overflow: hidden;
}
</code>```

Body:
I am rendering these Ticket components inside the table body. I have wrapped the columns in divs to make them block level so the overflow property will work but as you can see they are still visible and overflowing their container at the bottom.

Ticket.jsx:

import React from "react";
import styles from "./Ticket.module.css";

const Ticket = (props) => {
  return (

        {props.ticket.task}

        {props.ticket.assignee}

        {props.ticket.time}

  );
};

export default Ticket;

Ticket.module.css:

.ticket {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    text-transform: capitalize;
    padding: 0.5rem 0;
    border-bottom: solid 1px black;
}
.ticket-col{
    display: flex;
    justify-content: center;
}
.ticket-col div {
    overflow: hidden;
}


问:
Co-pilot suddenly missing and not working in VSCode
I have been using Github Copilot successfuly in VSCode for python scripts and within jupyter notebooks for the past week until today when it stopped working. The "activate icon" no longer appears in the bottom right hand corner, in-line suggestions no longer appear, and when I go to Output, Github Copilot is no longer in the drop-down menu.

I have tried:

Uninstalling, restarting, and re-installing the co-pilot extension

Signing in and out of github

Completely uninstalling/deleting VSCode and reinstalling

My free-trial has not expired. My VSCode is up-to-date.

When reinstalling the Github Copilot extension, I am no longer asked to authorize the extension.

I've tried searching the internet and trying everything I can find. Please help if you can.


问:
Execute jupyter notebook within function
I have a jupyter notebook which contains a function called 'func'. Inside this function, I would like to call another notebook named SUM.ipynb in a way that the argument 'x' of my function will be considered by SUM.ipynb .

```<code>def func(x):
   %run SUM.ipynb
   return result
</code>```

The SUM.ipynb notebook contains a single line of code:

```<code>result = x + 10
</code>```

However, when I run func(1), I receive the following error:

NameError: name 'x' is not defined

Is there a way to make the SUM.ipynb notebook recognize the x variable?

Thanks in advance

Body:
I have a jupyter notebook which contains a function called 'func'. Inside this function, I would like to call another notebook named SUM.ipynb in a way that the argument 'x' of my function will be considered by SUM.ipynb .

def func(x):
   %run SUM.ipynb
   return result

The SUM.ipynb notebook contains a single line of code:

result = x + 10

However, when I run func(1), I receive the following error:

NameError: name 'x' is not defined

Is there a way to make the SUM.ipynb notebook recognize the x variable?

Thanks in advance


问:
compare a png logo with video except png's transparent background pixels
I want to find frames with the logo image from video, and to concat theses frames without commercials for getting ad-free video.
I tried this first by using ffmpeg & jpg logo image.

```<code>ffmpeg -i input.mp4 -loop 1 -i logo.jpg -an -filter_complex crop=47:25:639:24,"blend=difference:shortest=1,blackframe=95:60" -f null -
</code>```

And it works, but in the case by case, less accurate with blackframe setting number.
So, for getting more accuracy I tried png logo image with transeparent background.

```<code>ffmpeg -i input.mp4 -loop 1 -i logo.png -an -filter_complex crop=47:25:639:24,"blend=difference:shortest=1,blackframe=95:60" -f null -
</code>```

But on the contrary of my idea, the results came out worse than jpg logo. It seems that the cause is why ffmpeg compare the png's transparent background part pixels too with video.

Is there a way to compare png logo with video except png logo's transparent part pixels ?

I'd appreciate your advice, thank you.

Body:
I want to find frames with the logo image from video, and to concat theses frames without commercials for getting ad-free video.
I tried this first by using ffmpeg & jpg logo image.

ffmpeg -i input.mp4 -loop 1 -i logo.jpg -an -filter_complex crop=47:25:639:24,"blend=difference:shortest=1,blackframe=95:60" -f null -

And it works, but in the case by case, less accurate with blackframe setting number.
So, for getting more accuracy I tried png logo image with transeparent background.

ffmpeg -i input.mp4 -loop 1 -i logo.png -an -filter_complex crop=47:25:639:24,"blend=difference:shortest=1,blackframe=95:60" -f null -

But on the contrary of my idea, the results came out worse than jpg logo. It seems that the cause is why ffmpeg compare the png's transparent background part pixels too with video.

Is there a way to compare png logo with video except png logo's transparent part pixels ?

I'd appreciate your advice, thank you.