问:
Failed to initialize JPA EntityManagerFactory: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
I'm new with Kotlin and I'm trying to use it to make an app with Spring boot.I have just done the entities and anything else yet because I want to know if the app runs but I tried running it and it gives me the following exception "Failed to initialize JPA EntityManagerFactory: Could not determine recommended JdbcType for ar.com.school.management.models.entity.Subject"

Career Entity:

```<code>package ar.com.school.management.models.entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import jakarta.persistence.*
@Entity
data class Career(@Id
              @GeneratedValue(strategy =
              GenerationType.IDENTITY)
              @Column(name = "career_id")
              var id: Long?,

              var name: String?,

              @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
              @JoinTable(name = "career_subject",
                  joinColumns = [JoinColumn(name = "career_id", referencedColumnName = "career_id")],
                  inverseJoinColumns = [JoinColumn(name = "subject_id", referencedColumnName = "subject_id")])
              @JsonIgnoreProperties("subjectCareers")
              var subjects: List<Subject>? = mutableListOf(),

              @OneToMany(mappedBy = "career")
              var students: List<Student>? = mutableListOf(),

              @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
              @JoinTable(name = "career_teacher",
                  joinColumns = [JoinColumn(name = "career_id", referencedColumnName = "career_id")],
                  inverseJoinColumns = [JoinColumn(name = "teacher_id", referencedColumnName = "teacher_id")])
              @JsonIgnoreProperties("careers")
              var teachers: List<Teacher>? = mutableListOf()) {
constructor(): this(null,null,null, null, null)
}
</code>```

Student Entity:

```<code>package ar.com.school.management.models.entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import jakarta.persistence.*

@Entity
data class Student(@Id
                   @GeneratedValue(strategy = GenerationType.IDENTITY)
                   @Column(name = "student_id")
                   var id: Long?,

                   @Column(name = "social_security_number")
                   val socialSecurityNumber: Int?,

                   var name: String?,
                   var surname: String?,
                   var address: String? ,
                   var age: Int?,

                   @ManyToOne
                   @JoinColumn(name = "career_id")
                   var career: Career?,

                   @ManyToMany(mappedBy = "students")
                   @JsonIgnoreProperties("students")
                   var subjects: List<Subject>? = mutableListOf(),

                   @Column(name = "finished_subjects")
                   var finishedSubjects: List<Subject>? = mutableListOf(),

                   @Column(name = "subjects_marks")
                   var subjectsMarks: Map<Subject, Double>? = mutableMapOf()) {
    constructor(): this(null,null,null,null,null,
        null,null, null,null,null)
}
</code>```

Subject Entity:

```<code>package ar.com.school.management.models.entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import jakarta.persistence.*

@Entity
data class Subject(@Id
                   @GeneratedValue(strategy = GenerationType.IDENTITY)
                   @Column(name = "subject_id")
                   var id: Long?,

                   var name: String?,

                   @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
                   @JoinTable(name = "subject_student",
                       joinColumns = [JoinColumn(name = "subject_id", referencedColumnName = "subject_id")],
                       inverseJoinColumns = [JoinColumn(name = "student_id", referencedColumnName = "student_id")])
                   @JsonIgnoreProperties("subjects")
                   var students: List<Student>? = mutableListOf(),

                   @ManyToMany(mappedBy = "subjects")
                   @JsonIgnoreProperties("subjects")
                   @Column(name = "careers")
                   var subjectCareers: List<Career>? = mutableListOf(),

                   @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
                   @JoinTable(name = "subject_teacher",
                       joinColumns = [JoinColumn(name = "subject_id", referencedColumnName = "subject_id")],
                       inverseJoinColumns = [JoinColumn(name = "teacher_id", referencedColumnName = "teacher_id")])
                   @JsonIgnoreProperties("subjects")
                   var subjectTeachers: List<Teacher>? = mutableListOf(),

                   @Column(name = "correlative_subjects")
                   @ElementCollection
                   var correlativeSubjects: List<String>? = mutableListOf()) {
    constructor(): this(null, null, null, null, null, null)
}
</code>```

Teacher Entity:

```<code>package ar.com.school.management.models.entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import jakarta.persistence.*

@Entity
data class Teacher(@Id
                   @GeneratedValue(strategy = GenerationType.IDENTITY)
                   @Column(name = "teacher_id")
                   var id: Long?,

                   @Column(name = "social_security_number")
                   val socialSecurityNumber: Int?,

                   var name: String?,
                   var surname: String?,
                   var address: String? ,
                   var age: Int?,

                   @ManyToMany(mappedBy = "subjectTeachers")
                   @JsonIgnoreProperties("subjectTeachers")
                   var subjects: List<Subject>? = mutableListOf(),

                   @ManyToMany(mappedBy = "teachers")
                   @JsonIgnoreProperties("teachers")
                   var careers: List<Career>? = mutableListOf())             {

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

Track:

```<code>2023-01-09T00:56:17.957-03:00  INFO 43310 --- [  restartedMain] ar.com.school.management.ApplicationKt   : Starting ApplicationKt using Java 17.0.5 with PID 43310 (/home/beniko/IdeaProjects/-Spring-boot-Kotlin-School-Management/build/classes/kotlin/main started by beniko in /home/beniko/IdeaProjects/-Spring-boot-Kotlin-School-Management)
2023-01-09T00:56:17.960-03:00  INFO 43310 --- [  restartedMain] ar.com.school.management.ApplicationKt   : No active profile set, falling back to 1 default profile: "default"
2023-01-09T00:56:17.998-03:00  INFO 43310 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-01-09T00:56:17.999-03:00  INFO 43310 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-01-09T00:56:18.379-03:00  INFO 43310 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-01-09T00:56:18.389-03:00  INFO 43310 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 JPA repository interfaces.
2023-01-09T00:56:18.678-03:00  INFO 43310 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-01-09T00:56:18.684-03:00  INFO 43310 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-01-09T00:56:18.684-03:00  INFO 43310 --- [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.4]
2023-01-09T00:56:18.715-03:00  INFO 43310 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-01-09T00:56:18.716-03:00  INFO 43310 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 716 ms
2023-01-09T00:56:18.797-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2023-01-09T00:56:18.902-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@361fd59
2023-01-09T00:56:18.903-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2023-01-09T00:56:18.927-03:00  INFO 43310 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-01-09T00:56:18.949-03:00  INFO 43310 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.1.6.Final
2023-01-09T00:56:19.026-03:00  WARN 43310 --- [  restartedMain] org.hibernate.orm.deprecation            : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
2023-01-09T00:56:19.099-03:00  INFO 43310 --- [  restartedMain] SQL dialect                              : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2023-01-09T00:56:19.206-03:00 ERROR 43310 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
2023-01-09T00:56:19.206-03:00  WARN 43310 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
2023-01-09T00:56:19.207-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2023-01-09T00:56:19.267-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2023-01-09T00:56:19.269-03:00  INFO 43310 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-01-09T00:56:19.277-03:00  INFO 43310 --- [  restartedMain] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-01-09T00:56:19.286-03:00 ERROR 43310 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130) ~[spring-context-6.0.3.jar:6.0.3]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905) ~[spring-context-6.0.3.jar:6.0.3]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.3.jar:6.0.3]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.1.jar:3.0.1]
    at ar.com.school.management.ApplicationKt.main(Application.kt:13) ~[main/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-3.0.1.jar:3.0.1]
Caused by: org.hibernate.type.descriptor.java.spi.JdbcTypeRecommendationException: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
    at org.hibernate.type.descriptor.java.spi.UnknownBasicJavaType.getRecommendedJdbcType(UnknownBasicJavaType.java:37) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.type.descriptor.java.spi.BasicCollectionJavaType.getRecommendedJdbcType(BasicCollectionJavaType.java:70) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.boot.model.process.internal.InferredBasicValueResolver.from(InferredBasicValueResolver.java:222) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.mapping.BasicValue.buildResolution(BasicValue.java:507) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.mapping.BasicValue.resolve(BasicValue.java:315) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.mapping.BasicValue.resolve(BasicValue.java:305) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.lambda$processValueResolvers$4(InFlightMetadataCollectorImpl.java:1767) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at java.base/java.util.ArrayList.removeIf(ArrayList.java:1682) ~[na:na]
    at java.base/java.util.ArrayList.removeIf(ArrayList.java:1660) ~[na:na]
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processValueResolvers(InFlightMetadataCollectorImpl.java:1766) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1752) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:300) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[spring-beans-6.0.3.jar:6.0.3]
    ... 21 common frames omitted

Process finished with exit code 0

</code>```

Body:
I'm new with Kotlin and I'm trying to use it to make an app with Spring boot.I have just done the entities and anything else yet because I want to know if the app runs but I tried running it and it gives me the following exception "Failed to initialize JPA EntityManagerFactory: Could not determine recommended JdbcType for ar.com.school.management.models.entity.Subject"

Career Entity:

package ar.com.school.management.models.entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import jakarta.persistence.*
@Entity
data class Career(@Id
              @GeneratedValue(strategy =
              GenerationType.IDENTITY)
              @Column(name = "career_id")
              var id: Long?,

              var name: String?,

              @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
              @JoinTable(name = "career_subject",
                  joinColumns = [JoinColumn(name = "career_id", referencedColumnName = "career_id")],
                  inverseJoinColumns = [JoinColumn(name = "subject_id", referencedColumnName = "subject_id")])
              @JsonIgnoreProperties("subjectCareers")
              var subjects: List<Subject>? = mutableListOf(),

              @OneToMany(mappedBy = "career")
              var students: List<Student>? = mutableListOf(),

              @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
              @JoinTable(name = "career_teacher",
                  joinColumns = [JoinColumn(name = "career_id", referencedColumnName = "career_id")],
                  inverseJoinColumns = [JoinColumn(name = "teacher_id", referencedColumnName = "teacher_id")])
              @JsonIgnoreProperties("careers")
              var teachers: List<Teacher>? = mutableListOf()) {
constructor(): this(null,null,null, null, null)
}

Student Entity:

package ar.com.school.management.models.entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import jakarta.persistence.*

@Entity
data class Student(@Id
                   @GeneratedValue(strategy = GenerationType.IDENTITY)
                   @Column(name = "student_id")
                   var id: Long?,

                   @Column(name = "social_security_number")
                   val socialSecurityNumber: Int?,

                   var name: String?,
                   var surname: String?,
                   var address: String? ,
                   var age: Int?,

                   @ManyToOne
                   @JoinColumn(name = "career_id")
                   var career: Career?,

                   @ManyToMany(mappedBy = "students")
                   @JsonIgnoreProperties("students")
                   var subjects: List<Subject>? = mutableListOf(),

                   @Column(name = "finished_subjects")
                   var finishedSubjects: List<Subject>? = mutableListOf(),

                   @Column(name = "subjects_marks")
                   var subjectsMarks: Map<Subject, Double>? = mutableMapOf()) {
    constructor(): this(null,null,null,null,null,
        null,null, null,null,null)
}

Subject Entity:

package ar.com.school.management.models.entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import jakarta.persistence.*

@Entity
data class Subject(@Id
                   @GeneratedValue(strategy = GenerationType.IDENTITY)
                   @Column(name = "subject_id")
                   var id: Long?,

                   var name: String?,

                   @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
                   @JoinTable(name = "subject_student",
                       joinColumns = [JoinColumn(name = "subject_id", referencedColumnName = "subject_id")],
                       inverseJoinColumns = [JoinColumn(name = "student_id", referencedColumnName = "student_id")])
                   @JsonIgnoreProperties("subjects")
                   var students: List<Student>? = mutableListOf(),

                   @ManyToMany(mappedBy = "subjects")
                   @JsonIgnoreProperties("subjects")
                   @Column(name = "careers")
                   var subjectCareers: List<Career>? = mutableListOf(),

                   @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
                   @JoinTable(name = "subject_teacher",
                       joinColumns = [JoinColumn(name = "subject_id", referencedColumnName = "subject_id")],
                       inverseJoinColumns = [JoinColumn(name = "teacher_id", referencedColumnName = "teacher_id")])
                   @JsonIgnoreProperties("subjects")
                   var subjectTeachers: List<Teacher>? = mutableListOf(),

                   @Column(name = "correlative_subjects")
                   @ElementCollection
                   var correlativeSubjects: List<String>? = mutableListOf()) {
    constructor(): this(null, null, null, null, null, null)
}

Teacher Entity:

package ar.com.school.management.models.entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import jakarta.persistence.*

@Entity
data class Teacher(@Id
                   @GeneratedValue(strategy = GenerationType.IDENTITY)
                   @Column(name = "teacher_id")
                   var id: Long?,

                   @Column(name = "social_security_number")
                   val socialSecurityNumber: Int?,

                   var name: String?,
                   var surname: String?,
                   var address: String? ,
                   var age: Int?,

                   @ManyToMany(mappedBy = "subjectTeachers")
                   @JsonIgnoreProperties("subjectTeachers")
                   var subjects: List<Subject>? = mutableListOf(),

                   @ManyToMany(mappedBy = "teachers")
                   @JsonIgnoreProperties("teachers")
                   var careers: List<Career>? = mutableListOf())             {

    constructor(): this(null,null,null,null,null,null,null, null)
}

Track:

2023-01-09T00:56:17.957-03:00  INFO 43310 --- [  restartedMain] ar.com.school.management.ApplicationKt   : Starting ApplicationKt using Java 17.0.5 with PID 43310 (/home/beniko/IdeaProjects/-Spring-boot-Kotlin-School-Management/build/classes/kotlin/main started by beniko in /home/beniko/IdeaProjects/-Spring-boot-Kotlin-School-Management)
2023-01-09T00:56:17.960-03:00  INFO 43310 --- [  restartedMain] ar.com.school.management.ApplicationKt   : No active profile set, falling back to 1 default profile: "default"
2023-01-09T00:56:17.998-03:00  INFO 43310 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-01-09T00:56:17.999-03:00  INFO 43310 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-01-09T00:56:18.379-03:00  INFO 43310 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-01-09T00:56:18.389-03:00  INFO 43310 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 JPA repository interfaces.
2023-01-09T00:56:18.678-03:00  INFO 43310 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-01-09T00:56:18.684-03:00  INFO 43310 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-01-09T00:56:18.684-03:00  INFO 43310 --- [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.4]
2023-01-09T00:56:18.715-03:00  INFO 43310 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-01-09T00:56:18.716-03:00  INFO 43310 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 716 ms
2023-01-09T00:56:18.797-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2023-01-09T00:56:18.902-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@361fd59
2023-01-09T00:56:18.903-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2023-01-09T00:56:18.927-03:00  INFO 43310 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-01-09T00:56:18.949-03:00  INFO 43310 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.1.6.Final
2023-01-09T00:56:19.026-03:00  WARN 43310 --- [  restartedMain] org.hibernate.orm.deprecation            : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
2023-01-09T00:56:19.099-03:00  INFO 43310 --- [  restartedMain] SQL dialect                              : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2023-01-09T00:56:19.206-03:00 ERROR 43310 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
2023-01-09T00:56:19.206-03:00  WARN 43310 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
2023-01-09T00:56:19.207-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2023-01-09T00:56:19.267-03:00  INFO 43310 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2023-01-09T00:56:19.269-03:00  INFO 43310 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-01-09T00:56:19.277-03:00  INFO 43310 --- [  restartedMain] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-01-09T00:56:19.286-03:00 ERROR 43310 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130) ~[spring-context-6.0.3.jar:6.0.3]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905) ~[spring-context-6.0.3.jar:6.0.3]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.3.jar:6.0.3]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.1.jar:3.0.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.1.jar:3.0.1]
    at ar.com.school.management.ApplicationKt.main(Application.kt:13) ~[main/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-3.0.1.jar:3.0.1]
Caused by: org.hibernate.type.descriptor.java.spi.JdbcTypeRecommendationException: Could not determine recommended JdbcType for `ar.com.school.management.models.entity.Subject`
    at org.hibernate.type.descriptor.java.spi.UnknownBasicJavaType.getRecommendedJdbcType(UnknownBasicJavaType.java:37) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.type.descriptor.java.spi.BasicCollectionJavaType.getRecommendedJdbcType(BasicCollectionJavaType.java:70) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.boot.model.process.internal.InferredBasicValueResolver.from(InferredBasicValueResolver.java:222) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.mapping.BasicValue.buildResolution(BasicValue.java:507) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.mapping.BasicValue.resolve(BasicValue.java:315) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.mapping.BasicValue.resolve(BasicValue.java:305) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.lambda$processValueResolvers$4(InFlightMetadataCollectorImpl.java:1767) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at java.base/java.util.ArrayList.removeIf(ArrayList.java:1682) ~[na:na]
    at java.base/java.util.ArrayList.removeIf(ArrayList.java:1660) ~[na:na]
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processValueResolvers(InFlightMetadataCollectorImpl.java:1766) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1752) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:300) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421) ~[hibernate-core-6.1.6.Final.jar:6.1.6.Final]
    at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[spring-beans-6.0.3.jar:6.0.3]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[spring-beans-6.0.3.jar:6.0.3]
    ... 21 common frames omitted

Process finished with exit code 0


来源: stackexchange

问:
`pd.compare` when dataframes have different shape
I want to compare two dataframes using pd.compare(). The method works really well if the shapes of the dataframes are the same, ie, df1.shape == df2.shape.

For example:

```<code>In [75]: df1
Out[75]:
  NAME INTERFACE_NAME     INTERFACE_IP
0    A           Pipo       7.7.7.8/32
1    A        loop210     1.1.1.210/32
2    A        loop245     1.1.1.246/32
3    B        loop230     1.1.1.230/32
4    B        loop231     1.1.1.231/32
5    B          loop8   11.11.11.29/32
6    B      loopback0  10.204.64.55/32

In [76]: df2
Out[76]:
  NAME INTERFACE_NAME     INTERFACE_IP
0    A           Pipo       7.7.7.8/32
1    A        loop210     1.1.1.210/32
2    A        loop245     1.1.1.245/32
3    B        loop230     1.1.1.230/32
4    B        loop231     1.1.1.231/32
5    B          loop8   11.11.11.29/32
6    B      loopback0  10.204.64.55/32
</code>```

If I want to see what has changed between df1 and df2 I would do ...

```<code>In [79]: df1.compare(df2, result_names=('pre','post'), keep_shape=True)
Out[79]:
  NAME      INTERFACE_NAME       INTERFACE_IP
   pre post            pre post           pre          post
0  NaN  NaN            NaN  NaN           NaN           NaN
1  NaN  NaN            NaN  NaN           NaN           NaN
2  NaN  NaN            NaN  NaN  1.1.1.246/32  1.1.1.245/32
3  NaN  NaN            NaN  NaN           NaN           NaN
4  NaN  NaN            NaN  NaN           NaN           NaN
5  NaN  NaN            NaN  NaN           NaN           NaN
6  NaN  NaN            NaN  NaN           NaN           NaN
</code>```

However, let's say df1 has more records that have disappeared in df2...

```<code>In [86]: df1_more
Out[86]:
  NAME INTERFACE_NAME     INTERFACE_IP
0    A           Pipo       7.7.7.8/32
1    A        loop210     1.1.1.210/32
2    A        loop245     1.1.1.245/32
3    A        loop246     1.1.1.246/32
4    A         test88      10.0.0.5/32
5    B        loop230     1.1.1.230/32
6    B        loop231     1.1.1.231/32
7    B          loop8   11.11.11.29/32
8    B      loopback0  10.204.64.55/32
</code>```

... then I get an exception when trying to compare:

```<code>In [87]: df1_more.compare(df2)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[87], line 1
----> 1 df1_more.compare(df2)

[ .... ]

    293     # axis=1 is default for DataFrame-with-Series op
    294     axis = left._get_axis_number(axis) if axis is not None else 1

ValueError: Can only compare identically-labeled DataFrame objects
</code>```

How can I fix this? I mean, I'm particularly interested in using pd.compare() because I can easily spot which variable/column is the one that has changed.

I could use, for example, pd.merge(indicator='change', how='outer') but in that case I get to see all the columns regardless of their change and I'm only interested specifically in the changed columns. Let's say I have a 10-column dataFrame, the pd.merge() will output all the columns even if only one has a difference between df1 and df2.

thanks.

ContentLicense: CC BY-SA 4.0

Body:
I want to compare two dataframes using pd.compare(). The method works really well if the shapes of the dataframes are the same, ie, df1.shape == df2.shape.

For example:

In [75]: df1
Out[75]:
  NAME INTERFACE_NAME     INTERFACE_IP
0    A           Pipo       7.7.7.8/32
1    A        loop210     1.1.1.210/32
2    A        loop245     1.1.1.246/32
3    B        loop230     1.1.1.230/32
4    B        loop231     1.1.1.231/32
5    B          loop8   11.11.11.29/32
6    B      loopback0  10.204.64.55/32

In [76]: df2
Out[76]:
  NAME INTERFACE_NAME     INTERFACE_IP
0    A           Pipo       7.7.7.8/32
1    A        loop210     1.1.1.210/32
2    A        loop245     1.1.1.245/32
3    B        loop230     1.1.1.230/32
4    B        loop231     1.1.1.231/32
5    B          loop8   11.11.11.29/32
6    B      loopback0  10.204.64.55/32

If I want to see what has changed between df1 and df2 I would do ...

In [79]: df1.compare(df2, result_names=('pre','post'), keep_shape=True)
Out[79]:
  NAME      INTERFACE_NAME       INTERFACE_IP
   pre post            pre post           pre          post
0  NaN  NaN            NaN  NaN           NaN           NaN
1  NaN  NaN            NaN  NaN           NaN           NaN
2  NaN  NaN            NaN  NaN  1.1.1.246/32  1.1.1.245/32
3  NaN  NaN            NaN  NaN           NaN           NaN
4  NaN  NaN            NaN  NaN           NaN           NaN
5  NaN  NaN            NaN  NaN           NaN           NaN
6  NaN  NaN            NaN  NaN           NaN           NaN

However, let's say df1 has more records that have disappeared in df2...

In [86]: df1_more
Out[86]:
  NAME INTERFACE_NAME     INTERFACE_IP
0    A           Pipo       7.7.7.8/32
1    A        loop210     1.1.1.210/32
2    A        loop245     1.1.1.245/32
3    A        loop246     1.1.1.246/32
4    A         test88      10.0.0.5/32
5    B        loop230     1.1.1.230/32
6    B        loop231     1.1.1.231/32
7    B          loop8   11.11.11.29/32
8    B      loopback0  10.204.64.55/32

... then I get an exception when trying to compare:

In [87]: df1_more.compare(df2)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[87], line 1
----> 1 df1_more.compare(df2)

[ .... ]

    293     # axis=1 is default for DataFrame-with-Series op
    294     axis = left._get_axis_number(axis) if axis is not None else 1

ValueError: Can only compare identically-labeled DataFrame objects

How can I fix this? I mean, I'm particularly interested in using pd.compare() because I can easily spot which variable/column is the one that has changed.

I could use, for example, pd.merge(indicator='change', how='outer') but in that case I get to see all the columns regardless of their change and I'm only interested specifically in the changed columns. Let's say I have a 10-column dataFrame, the pd.merge() will output all the columns even if only one has a difference between df1 and df2.

thanks.


问:
I Have stored my products in subcollection as supplier Products but i am not able to update Quantity for products as i confurm order buy pay button
```<code>onPressed: () async {
  for (var item in context.read<Cart>().getItems) {
    CollectionReference orderRef =
        FirebaseFirestore.instance
            .collection('orders');
    orderId = const Uuid().v4();
    await orderRef
        .doc(orderId)
        .set({
      'cid': data['cid'],
      'customer': data['name'],
      'email': data['email'],
      'address': data['address'],
      'phone': data['phone'],
      'profileimage':
          data['profileimage'],
      'sid': item.suppId,
      'proid': item.documentId,
      'orderid': orderId,
      'orderimage':
          item.imagesUrl.first,
      'orderqty': item.qty,
      'orderprice':
          item.qty * item.price,
      'deliverystatus':
          'preparing',
      'deliverydate': '',
      'orderdate': DateTime.now(),
      'paymentstatus':
          'cash on delivery',
      'orderreview': false,
    }).whenComplete(() async {
      await FirebaseFirestore
          .instance
          .runTransaction((Transaction
              transaction) async {
        DocumentReference
            documentReference =
            FirebaseFirestore
                .instance
                .collection(
                    'grocerysupplier')
                .doc(FirebaseAuth.instance.currentUser!.uid)
                .collection(
                    'grocery products')
                .doc(item
                    .documentId);

        DocumentSnapshot
            snapshot2 =
            await transaction.get(
                documentReference);

        transaction.update(
            documentReference, {
          'instock': snapshot2[
                  'instock'] -
              item.qty,
        });
      });
    });
  }
}
</code>```

I want it like when i click the button to confurn the pay then the orders placed in firebaseStore and the qunatity on instock key inside collection 'grocerysupplier' where the subcollection of 'grocery products'. get updated in docs where the instock key is and get updated.

Body:
onPressed: () async {
  for (var item in context.read<Cart>().getItems) {
    CollectionReference orderRef =
        FirebaseFirestore.instance
            .collection('orders');
    orderId = const Uuid().v4();
    await orderRef
        .doc(orderId)
        .set({
      'cid': data['cid'],
      'customer': data['name'],
      'email': data['email'],
      'address': data['address'],
      'phone': data['phone'],
      'profileimage':
          data['profileimage'],
      'sid': item.suppId,
      'proid': item.documentId,
      'orderid': orderId,
      'orderimage':
          item.imagesUrl.first,
      'orderqty': item.qty,
      'orderprice':
          item.qty * item.price,
      'deliverystatus':
          'preparing',
      'deliverydate': '',
      'orderdate': DateTime.now(),
      'paymentstatus':
          'cash on delivery',
      'orderreview': false,
    }).whenComplete(() async {
      await FirebaseFirestore
          .instance
          .runTransaction((Transaction
              transaction) async {
        DocumentReference
            documentReference =
            FirebaseFirestore
                .instance
                .collection(
                    'grocerysupplier')
                .doc(FirebaseAuth.instance.currentUser!.uid)
                .collection(
                    'grocery products')
                .doc(item
                    .documentId);

        DocumentSnapshot
            snapshot2 =
            await transaction.get(
                documentReference);

        transaction.update(
            documentReference, {
          'instock': snapshot2[
                  'instock'] -
              item.qty,
        });
      });
    });
  }
}

I want it like when i click the button to confurn the pay then the orders placed in firebaseStore and the qunatity on instock key inside collection 'grocerysupplier' where the subcollection of 'grocery products'. get updated in docs where the instock key is and get updated.


问:
Debugging moduletest.sh script to process long and short command line options
I am trying to improve a script called moduletest.sh such that it can process both long and short command lines options.

```<code>#!/bin/bash

# Initialize variables
nsamps=""
scenario=""
pyear_start=""
pyear_end=""
pyear_step=""
baseyear=""

# Parse command line arguments
while getopts ":h-:n--:s--:p--:e--:t--:b--" opt; do
  case $opt in
    h) # Display help message and exit
       cat <<EOF

usage: moduletest.sh [-h] [-n NSAMPS] [-s SCENARIO] [-p PYEAR_START]
                      [-e PYEAR_END] [-t PYEAR_STEP] [-b BASEYEAR]
                      modules.txt

optional arguments:
  -h, --help            show this help message and exit
  -n NSAMPS, --nsamps NSAMPS
                        number of samples (default: 500)
  -s SCENARIO, --scenario SCENARIO
                        scenario (default: ssp585)
  -p PYEAR_START, --pyear_start PYEAR_START
                        projection year start (default: 2020)
  -e PYEAR_END, --pyear_end PYEAR_END
                        projection year end (default: 2100)
  -t PYEAR_STEP, --pyear_step PYEAR_STEP
                        projection year step (default: 10)
  -b BASEYEAR, --baseyear BASEYEAR
                        base year (default: 2005)

positional arguments:
  modules.txt           file with module_set and module values
EOF
       exit 0
       ;;
    n) nsamps="$OPTARG"
       ;;
    s) scenario="$OPTARG"
       ;;
    p) pyear_start="$OPTARG"
       ;;
    e) pyear_end="$OPTARG"
       ;;
    t) pyear_step="$OPTARG"
       ;;
    b) baseyear="$OPTARG"
       ;;
    :) # Display error message and exit for missing required argument
       echo "Error: Option -$OPTARG requires an argument." >&2
       exit 1
       ;;
    \?) # Display error message and exit for invalid option
       echo "Error: Invalid option -$OPTARG" >&2
       exit 1
       ;;
  esac
  shift # Shift positional arguments to the left
done

# Shift positional arguments
shift $((OPTIND-1))

# Get the remaining positional arguments
modules_file="$1"

# Check for required modules.txt file
if [ -z "$modules_file" ]; then
  echo "Error: Missing required modules.txt file" >&2
  exit 1
fi

# Set default values if not specified by user
nsamps=${nsamps:-500}
scenario=${scenario:-ssp585}
pyear_start=${pyear_start:-2020}
pyear_end=${pyear_end:-2100}
pyear_step=${pyear_step:-10}
baseyear=${baseyear:-2005}

# Print options
echo "NSAMPS = $nsamps"
echo "SCENARIO = $scenario"
echo "PYEAR_START = $pyear_start"
echo "PYEAR_END = $pyear_end"
echo "PYEAR_STEP = $pyear_step"
echo "BASEYEAR = $baseyear"
echo "MODULES_FILE = $modules_file"
</code>```

However, the options are not applied to the script. For example,

./moduletest.sh --nsamps 1000 modules.txt gives the same output as
./moduletest.sh modules.txt

```<code>./moduletest.sh.sh -n 1000 modules.txt
NSAMPS = 500
SCENARIO = ssp585
PYEAR_START = 2020
PYEAR_END = 2100
PYEAR_STEP = 10
BASEYEAR = 2005
</code>```
```<code>./moduletest.sh.sh.sh --nsamps 1000 modules.txt
NSAMPS = 500
SCENARIO = ssp585
PYEAR_START = 2020
PYEAR_END = 2100
PYEAR_STEP = 10
BASEYEAR = 2005
MODULES_FILE = modules.txt
</code>```
```<code>./moduletest.sh.sh.sh modules.txt
NSAMPS = 500
SCENARIO = ssp585
PYEAR_START = 2020
PYEAR_END = 2100
PYEAR_STEP = 10
BASEYEAR = 2005
MODULES_FILE = modules.txt
</code>```

It looks like there is an issue with the way the command line arguments are being parsed. Any idea how to fix this? Ideally, /moduletest.sh should recognize both a single dash (e.g., -n 1000) or double dash (e.g., --nsamps 1000). Thank you for any advice!

To modify the moduletest.sh script to accept optional keywords that allow the user to overwrite the default values that are hard-coded in the script file. My approach was to use the getopts builtin command to parse the command line arguments.

Body:
I am trying to improve a script called moduletest.sh such that it can process both long and short command lines options.

#!/bin/bash

# Initialize variables
nsamps=""
scenario=""
pyear_start=""
pyear_end=""
pyear_step=""
baseyear=""

# Parse command line arguments
while getopts ":h-:n--:s--:p--:e--:t--:b--" opt; do
  case $opt in
    h) # Display help message and exit
       cat <<EOF

usage: moduletest.sh [-h] [-n NSAMPS] [-s SCENARIO] [-p PYEAR_START]
                      [-e PYEAR_END] [-t PYEAR_STEP] [-b BASEYEAR]
                      modules.txt

optional arguments:
  -h, --help            show this help message and exit
  -n NSAMPS, --nsamps NSAMPS
                        number of samples (default: 500)
  -s SCENARIO, --scenario SCENARIO
                        scenario (default: ssp585)
  -p PYEAR_START, --pyear_start PYEAR_START
                        projection year start (default: 2020)
  -e PYEAR_END, --pyear_end PYEAR_END
                        projection year end (default: 2100)
  -t PYEAR_STEP, --pyear_step PYEAR_STEP
                        projection year step (default: 10)
  -b BASEYEAR, --baseyear BASEYEAR
                        base year (default: 2005)

positional arguments:
  modules.txt           file with module_set and module values
EOF
       exit 0
       ;;
    n) nsamps="$OPTARG"
       ;;
    s) scenario="$OPTARG"
       ;;
    p) pyear_start="$OPTARG"
       ;;
    e) pyear_end="$OPTARG"
       ;;
    t) pyear_step="$OPTARG"
       ;;
    b) baseyear="$OPTARG"
       ;;
    :) # Display error message and exit for missing required argument
       echo "Error: Option -$OPTARG requires an argument." >&2
       exit 1
       ;;
    \?) # Display error message and exit for invalid option
       echo "Error: Invalid option -$OPTARG" >&2
       exit 1
       ;;
  esac
  shift # Shift positional arguments to the left
done

# Shift positional arguments
shift $((OPTIND-1))

# Get the remaining positional arguments
modules_file="$1"

# Check for required modules.txt file
if [ -z "$modules_file" ]; then
  echo "Error: Missing required modules.txt file" >&2
  exit 1
fi

# Set default values if not specified by user
nsamps=${nsamps:-500}
scenario=${scenario:-ssp585}
pyear_start=${pyear_start:-2020}
pyear_end=${pyear_end:-2100}
pyear_step=${pyear_step:-10}
baseyear=${baseyear:-2005}

# Print options
echo "NSAMPS = $nsamps"
echo "SCENARIO = $scenario"
echo "PYEAR_START = $pyear_start"
echo "PYEAR_END = $pyear_end"
echo "PYEAR_STEP = $pyear_step"
echo "BASEYEAR = $baseyear"
echo "MODULES_FILE = $modules_file"

However, the options are not applied to the script. For example,

./moduletest.sh --nsamps 1000 modules.txt gives the same output as
./moduletest.sh modules.txt

./moduletest.sh.sh -n 1000 modules.txt
NSAMPS = 500
SCENARIO = ssp585
PYEAR_START = 2020
PYEAR_END = 2100
PYEAR_STEP = 10
BASEYEAR = 2005

./moduletest.sh.sh.sh --nsamps 1000 modules.txt
NSAMPS = 500
SCENARIO = ssp585
PYEAR_START = 2020
PYEAR_END = 2100
PYEAR_STEP = 10
BASEYEAR = 2005
MODULES_FILE = modules.txt

./moduletest.sh.sh.sh modules.txt
NSAMPS = 500
SCENARIO = ssp585
PYEAR_START = 2020
PYEAR_END = 2100
PYEAR_STEP = 10
BASEYEAR = 2005
MODULES_FILE = modules.txt

It looks like there is an issue with the way the command line arguments are being parsed. Any idea how to fix this? Ideally, /moduletest.sh should recognize both a single dash (e.g., -n 1000) or double dash (e.g., --nsamps 1000). Thank you for any advice!

To modify the moduletest.sh script to accept optional keywords that allow the user to overwrite the default values that are hard-coded in the script file. My approach was to use the getopts builtin command to parse the command line arguments.


问:
For loop and if statement not working when comparing value from a HashMap in java
```<code>import java.util.HashMap;

public class Rtoi{

    private HashMap<Character,Integer> rn = new HashMap<Character,Integer>();
    Character[] input;
    Integer result;
    //constructor
    public Rtoi(){
        rn.put('I', 1);
        rn.put('V', 5);
        rn.put('X', 10);
        rn.put('L', 50);
        rn.put('C', 100);
        rn.put('D', 500);
        rn.put('M', 1000);
    }
    public Integer convert(String num){

        //read frm right to left
        for(int i=num.length()-1;i<0;i--){
            Character current =num.charAt(i);
            Character next =num.charAt(i-1);
            if(rn.get(current)<=rn.get(next)){
                result += rn.get(current);
            }
            else{
                result -= rn.get(current);
            }
        }
        return result;

    }
}
</code>```

The method convert get a string of roman num to convert to integer but it return a default value result

tested using the string = "MMXVIII"

Body:
import java.util.HashMap;

public class Rtoi{

    private HashMap<Character,Integer> rn = new HashMap<Character,Integer>();
    Character[] input;
    Integer result;
    //constructor
    public Rtoi(){
        rn.put('I', 1);
        rn.put('V', 5);
        rn.put('X', 10);
        rn.put('L', 50);
        rn.put('C', 100);
        rn.put('D', 500);
        rn.put('M', 1000);
    }
    public Integer convert(String num){

        //read frm right to left
        for(int i=num.length()-1;i<0;i--){
            Character current =num.charAt(i);
            Character next =num.charAt(i-1);
            if(rn.get(current)<=rn.get(next)){
                result += rn.get(current);
            }
            else{
                result -= rn.get(current);
            }
        }
        return result;

    }
}

The method convert get a string of roman num to convert to integer but it return a default value result

tested using the string = "MMXVIII"


问:
get calculated color of label within formatter callback
In Apache Echarts, the label formatter callback provides a "params" object as argument with helpful properties, including "color" which is the color of the item. In my case, in a pie chart, that's the color of the slice of the pie being labelled.

But the color of the label itself, if not overridden, is automatically calculated as either nearly black (on lighter colors) or nearly white (on darker colors). Using Richtext for a part of my label (amt and pct below), I would like to use a lighter shade of black/gray when the rest of the label is black, but a darker shade of white/gray if the rest of the label is white**.

So, I need to know what color ECharts is planning on making my label in order to override a piece of it to a different shade. Is it going to be white? Or black? But there is no "labelColor" property in the params object. Is there a way to programmatically obtain this? Or is there an algorithm that mimics how ECharts decides whether to make the label black or white that I can anticipate?

```<code> formatter: (params) => {
    return params.name + "\n" + "{amt|" + params.value.formatter(params.value.value) + "} ({pct|" + params.percent + "}%)"
  },
  rich: {
    pct: {
      color: '#999' // needs to vary based on main label color
    },
    amt: {
      color: '#999' // needs to vary based on main label color
    }
  }
</code>```

sample params value:

```<code>{
    "componentType": "series",
    "componentSubType": "pie",
    "componentIndex": 0,
    "seriesType": "pie",
    "seriesIndex": 0,
    "seriesId": "\u0000inner\u00000",
    "seriesName": "inner",
    "name": "OS Overhead",
    "dataIndex": 5,
    "data": {
        "name": "OS Overhead",
        "value": 5113741824
    },
    "value": {
        "name": "OS Overhead",
        "value": 5113741824
    },
    "color": "#3ba272",          // color of item/pie-slice, not of label
    "dimensionNames": [],
    "encode": {
        "value": [
            1
        ]
    },
    "$vars": [
        "seriesName",
        "name",
        "value",
        "percent"
    ],
    "percent": 0.01,
    "status": "normal"
}
</code>```

Update: I did manage to accomplish the contrast requirement by calculating luminescence and setting both colors manually. But it would still be nice to work with ECharts auto-calculated label colors.

```<code>export const hex2RGB = (hex) => {
  const safeHex = hex.replace("#","")

  return {
    r: parseInt(safeHex.slice(0,2),16),
    g: parseInt(safeHex.slice(2,4),16),
    b: parseInt(safeHex.slice(4,6),16)
  }
}

export const getLuminescence = (hex) => {
  const color = hex2RGB(hex)
  return color.r * 0.299 + color.g * 0.587 + color.b * 0.114 // perceived brightness
}

//label option

  formatter: (params) => {
    const luminescence = getLuminescence(params.seriesName === "inner" ? params.color : "#ffffff")
    const styleTagSuffix = luminescence > 140 ? "Dark" : "Light"

    return "{name" + styleTagSuffix + "|" + params.name + "}\n" + "{value" + styleTagSuffix + "|" + params.value.formatter(params.value.value) + " (" + params.percent + "%)}"
  },
  rich: {
    valueDark: {
      align: "right",
      color: "#444444"
    },
    valueLight: {
      align: "right",
      color: "#bbbbbb"
    },
    nameDark: {
      align: "right",
      color: "#111111",
      fontWeight: "bold",
      fontSize: 16
    },
    nameLight: {
      align: "right",
      color: "#eeeeee",
      fontWeight: "bold",
      fontSize: 16
    },
</code>```

Body:
In Apache Echarts, the label formatter callback provides a "params" object as argument with helpful properties, including "color" which is the color of the item. In my case, in a pie chart, that's the color of the slice of the pie being labelled.

But the color of the label itself, if not overridden, is automatically calculated as either nearly black (on lighter colors) or nearly white (on darker colors). Using Richtext for a part of my label (amt and pct below), I would like to use a lighter shade of black/gray when the rest of the label is black, but a darker shade of white/gray if the rest of the label is white**.

So, I need to know what color ECharts is planning on making my label in order to override a piece of it to a different shade. Is it going to be white? Or black? But there is no "labelColor" property in the params object. Is there a way to programmatically obtain this? Or is there an algorithm that mimics how ECharts decides whether to make the label black or white that I can anticipate?

 formatter: (params) => {
    return params.name + "\n" + "{amt|" + params.value.formatter(params.value.value) + "} ({pct|" + params.percent + "}%)"
  },
  rich: {
    pct: {
      color: '#999' // needs to vary based on main label color
    },
    amt: {
      color: '#999' // needs to vary based on main label color
    }
  }

sample params value:

{
    "componentType": "series",
    "componentSubType": "pie",
    "componentIndex": 0,
    "seriesType": "pie",
    "seriesIndex": 0,
    "seriesId": "\u0000inner\u00000",
    "seriesName": "inner",
    "name": "OS Overhead",
    "dataIndex": 5,
    "data": {
        "name": "OS Overhead",
        "value": 5113741824
    },
    "value": {
        "name": "OS Overhead",
        "value": 5113741824
    },
    "color": "#3ba272",          // color of item/pie-slice, not of label
    "dimensionNames": [],
    "encode": {
        "value": [
            1
        ]
    },
    "$vars": [
        "seriesName",
        "name",
        "value",
        "percent"
    ],
    "percent": 0.01,
    "status": "normal"
}

Update: I did manage to accomplish the contrast requirement by calculating luminescence and setting both colors manually. But it would still be nice to work with ECharts auto-calculated label colors.

export const hex2RGB = (hex) => {
  const safeHex = hex.replace("#","")

  return {
    r: parseInt(safeHex.slice(0,2),16),
    g: parseInt(safeHex.slice(2,4),16),
    b: parseInt(safeHex.slice(4,6),16)
  }
}

export const getLuminescence = (hex) => {
  const color = hex2RGB(hex)
  return color.r * 0.299 + color.g * 0.587 + color.b * 0.114 // perceived brightness
}

//label option

  formatter: (params) => {
    const luminescence = getLuminescence(params.seriesName === "inner" ? params.color : "#ffffff")
    const styleTagSuffix = luminescence > 140 ? "Dark" : "Light"

    return "{name" + styleTagSuffix + "|" + params.name + "}\n" + "{value" + styleTagSuffix + "|" + params.value.formatter(params.value.value) + " (" + params.percent + "%)}"
  },
  rich: {
    valueDark: {
      align: "right",
      color: "#444444"
    },
    valueLight: {
      align: "right",
      color: "#bbbbbb"
    },
    nameDark: {
      align: "right",
      color: "#111111",
      fontWeight: "bold",
      fontSize: 16
    },
    nameLight: {
      align: "right",
      color: "#eeeeee",
      fontWeight: "bold",
      fontSize: 16
    },


问:
Windows form sizing issue
I tbh don't know, I got 1 butto. To extend the form width or bring it to normal, on my laptop at 100% screen scale I get it to work, at 125% scale it gets almost to the edge, 150% scale it won't go a few pixels.

At 150% me.width turned to 1087 not the 1389 programmed. Also if it helps maximize and close buttons on top right disappear.

```<code>If txt.textlength = 4 then
    If me.width = 1026 = true then
        Me.width = 1389
    Elseif me.width = 1389 then
        Me.width =1026
    End if
End if
</code>```

I'm stumped :/ ,

Title: Windows form sizing issue

Body:
I tbh don't know, I got 1 butto. To extend the form width or bring it to normal, on my laptop at 100% screen scale I get it to work, at 125% scale it gets almost to the edge, 150% scale it won't go a few pixels.

At 150% me.width turned to 1087 not the 1389 programmed. Also if it helps maximize and close buttons on top right disappear.

If txt.textlength = 4 then
    If me.width = 1026 = true then
        Me.width = 1389
    Elseif me.width = 1389 then
        Me.width =1026
    End if
End if

I'm stumped :/ ,


问:
How to change the bitbucket to Jenkins redirect URL?
While clicking on build status, I want to change the URL from "http://jenkins.abc.co:8080/job/Unittest/1509/display/redirect" to "http://localhost:8080/job/Unittest/1509/display/redirect".
How to achieve this? please Help</p>


问:
Open custom url through firebase notification in flutter_inappwebview
I am using flutter_inappwebview: ^5.7.2+3 and firebase push notifications in my app. When I click on the firebase notification my app is opening to the default page but I want to open the app to the chat page/custom url page.</p>


问:
Google Ad Manager COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSION [TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS]
I am trying to attain TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS from Google Ad Manager report service API, but am getting this error: [ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS @ columns; trigger:'TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS']

My code is as shown below:

```<code>ReportQuery reportQuery = new ReportQuery();
reportQuery.setDimensions(new Dimension[]
{
Dimension.DATE,
Dimension.ORDER_ID,
Dimension.ORDER_NAME,
Dimension.AD_UNIT_ID,
Dimension.AD_UNIT_NAME,
Dimension.LINE_ITEM_ID,
Dimension.LINE_ITEM_NAME,
Dimension.LINE_ITEM_TYPE
});
reportQuery.setDimensionAttributes(new DimensionAttribute[]
{DimensionAttribute.ORDER_START_DATE_TIME, DimensionAttribute.ORDER_END_DATE_TIME});
reportQuery.setColumns(new Column[] {Column.TOTAL_CODE_SERVED_COUNT, Column.TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS});
</code>```

Tried getting unfilled impression but unsure what dimension is supposed to be used, but get this error mesage:

Cannot invoke "java.lang.Long.longValue()" because the return value of "com.google.api.ads.admanager.axis.v202208.ReportJob.getId()" is null

Body:
I am trying to attain TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS from Google Ad Manager report service API, but am getting this error: [ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS @ columns; trigger:'TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS']

My code is as shown below:

ReportQuery reportQuery = new ReportQuery();
reportQuery.setDimensions(new Dimension[]
{
Dimension.DATE,
Dimension.ORDER_ID,
Dimension.ORDER_NAME,
Dimension.AD_UNIT_ID,
Dimension.AD_UNIT_NAME,
Dimension.LINE_ITEM_ID,
Dimension.LINE_ITEM_NAME,
Dimension.LINE_ITEM_TYPE
});
reportQuery.setDimensionAttributes(new DimensionAttribute[]
{DimensionAttribute.ORDER_START_DATE_TIME, DimensionAttribute.ORDER_END_DATE_TIME});
reportQuery.setColumns(new Column[] {Column.TOTAL_CODE_SERVED_COUNT, Column.TOTAL_INVENTORY_LEVEL_UNFILLED_IMPRESSIONS});

Tried getting unfilled impression but unsure what dimension is supposed to be used, but get this error mesage:

Cannot invoke "java.lang.Long.longValue()" because the return value of "com.google.api.ads.admanager.axis.v202208.ReportJob.getId()" is null


问:
Input type="datetime-local" is accepting 6 digits for year selection allow 4 digits

//current month and year
        var yearNow = new Date().getFullYear();
        var monthNow = new Date().getMonth() + 1;

        //set the start date's field value to current year
        document.getElementById('date-start').value = "01/01/" + yearNow;

        //set the value of the end date field to current date
        document.getElementById('date-end').value = monthNow + "/" + new Date().getDate() + "/" + yearNow;

        $(function () {
            $(".date-picker").datepicker();
        });```
<pre class="snippet-code-html lang-html prettyprint-override"><code><label for="date-start">Start Date</label>
                    <input class="date-picker" id="date-start">
                    <label for="end-date">End Date</label>
                    <input class="date-picker" id="date-end"></code>```

Input type="datetime-local" is accepting 6 digits for year selection allow only 4 digits for year selection.

Start Date
                    <input class="date-picker" id="date-start">
                    End Date
                    <input class="date-picker" id="date-end">```

Expected: It should only 4 digits for year selection instead of 6 digits using html, bootstrap, jQuery, JavaScript

Body:
//current month and year
        var yearNow = new Date().getFullYear();
        var monthNow = new Date().getMonth() + 1;

        //set the start date's field value to current year
        document.getElementById('date-start').value = "01/01/" + yearNow;

        //set the value of the end date field to current date
        document.getElementById('date-end').value = monthNow + "/" + new Date().getDate() + "/" + yearNow;

        $(function () {
            $(".date-picker").datepicker();
        });

Start Date
                    <input class="date-picker" id="date-start">
                    End Date
                    <input class="date-picker" id="date-end">

Input type="datetime-local" is accepting 6 digits for year selection allow only 4 digits for year selection.

Start Date
                    <input class="date-picker" id="date-start">
                    End Date
                    <input class="date-picker" id="date-end">

Expected: It should only 4 digits for year selection instead of 6 digits using html, bootstrap, jQuery, JavaScript


问:
Spring exception while creating Vaadin component: 'There is no UI available. UI scope is not active.'
I am quites new to spring boot and Vaadin respectively it is quite some time since I worked with it.
The application was restructured to a multi module project. The former Vaadin spring-boot project was splitted into modules foo-application, foo-data, foo-business and foo-ui.

The application module consists from the entry point main method of Application.java and the application properties. Vaadin version used is 23.3.2 and spring boot 2.7.7.

@Route annotation for root is a start view which redirects to another view.
The bean discovery and management seems to work well, application is annotated like this:

```<code>@EntityScan(basePackages = { "com.example.foo.data.entitiy" })
@ComponentScan(basePackages = { "com.example.foo"})
@EnableJpaRepositories(basePackages = { "com.example.foo.data.repository" })
@SpringBootApplication
@EnableVaadin("com.example.foo")
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
</code>```

The MainLayout looks like this:

```<code>@RolesAllowed("Admin")
@Theme(value = "my_theme")
@PWA(name = "Foo App", shortName = "Foo", offlineResources = { "icons/Logo-square.png" })
@NpmPackage(value = "line-awesome", version = "1.3.0")
@NpmPackage(value = "@vaadin-component-factory/vcf-nav", version = "1.0.6")
public class MainLayout extends AppLayout implements AppShellConfigurator {

    private BreadCrumb breadCrumb;
    private VersionInfo versionInfo;

    public MainLayout(BreadCrumb breadCrumb, VersionInfo versionInfo, SecurityService securityService) {
        this.breadCrumb = breadCrumb;
        this.versionInfo = versionInfo;

        buildLayout();
    } ...
</code>```

The two Components BreadCrumb and VersionInfo are UI scoped, when I run the application everything I get an Exception:

```<code>There was an unexpected error (type=Internal Server Error, status=500).
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.foo.ui.views.main.MainLayout': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.support.ScopeNotActiveException: Error creating bean with name 'breadCrumb': Scope 'vaadin-ui' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: There is no UI available. The UI scope is not active
com.vaadin.flow.server.ServiceException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.datagroup.csdb.ui.views.main.MainLayout': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.support.ScopeNotActiveException: Error creating bean with name 'breadCrumb': Scope 'vaadin-ui' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: There is no UI available. The UI scope is not active
    at com.vaadin.flow.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1613)
    at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1576)
    at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:369)
    at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)
</code>```

The component looks like this:

```<code>@UIScope
@SpringComponent
public class VersionInfo extends VerticalLayout {
...
}
</code>```

It seems the component is initialized way too early because the Vaadin Session or the UI is not ready and available yet. The error comes right away befoere the user even has logged in. Spring security is used for authentication and authorisation.

Any idea, how I can prevent this. If I yust remove the UIScope then the application starts as expected but then other exceptions are thrown that points that components are used with the wrong scope.

Thanks and regards
Matt

Body:
I am quites new to spring boot and Vaadin respectively it is quite some time since I worked with it.
The application was restructured to a multi module project. The former Vaadin spring-boot project was splitted into modules foo-application, foo-data, foo-business and foo-ui.

The application module consists from the entry point main method of Application.java and the application properties. Vaadin version used is 23.3.2 and spring boot 2.7.7.

@Route annotation for root is a start view which redirects to another view.
The bean discovery and management seems to work well, application is annotated like this:

@EntityScan(basePackages = { "com.example.foo.data.entitiy" })
@ComponentScan(basePackages = { "com.example.foo"})
@EnableJpaRepositories(basePackages = { "com.example.foo.data.repository" })
@SpringBootApplication
@EnableVaadin("com.example.foo")
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

The MainLayout looks like this:

@RolesAllowed("Admin")
@Theme(value = "my_theme")
@PWA(name = "Foo App", shortName = "Foo", offlineResources = { "icons/Logo-square.png" })
@NpmPackage(value = "line-awesome", version = "1.3.0")
@NpmPackage(value = "@vaadin-component-factory/vcf-nav", version = "1.0.6")
public class MainLayout extends AppLayout implements AppShellConfigurator {

    private BreadCrumb breadCrumb;
    private VersionInfo versionInfo;

    public MainLayout(BreadCrumb breadCrumb, VersionInfo versionInfo, SecurityService securityService) {
        this.breadCrumb = breadCrumb;
        this.versionInfo = versionInfo;

        buildLayout();
    } ...

The two Components BreadCrumb and VersionInfo are UI scoped, when I run the application everything I get an Exception:

There was an unexpected error (type=Internal Server Error, status=500).
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.foo.ui.views.main.MainLayout': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.support.ScopeNotActiveException: Error creating bean with name 'breadCrumb': Scope 'vaadin-ui' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: There is no UI available. The UI scope is not active
com.vaadin.flow.server.ServiceException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.datagroup.csdb.ui.views.main.MainLayout': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.support.ScopeNotActiveException: Error creating bean with name 'breadCrumb': Scope 'vaadin-ui' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: There is no UI available. The UI scope is not active
    at com.vaadin.flow.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1613)
    at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1576)
    at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:369)
    at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)

The component looks like this:

@UIScope
@SpringComponent
public class VersionInfo extends VerticalLayout {
...
}

It seems the component is initialized way too early because the Vaadin Session or the UI is not ready and available yet. The error comes right away befoere the user even has logged in. Spring security is used for authentication and authorisation.

Any idea, how I can prevent this. If I yust remove the UIScope then the application starts as expected but then other exceptions are thrown that points that components are used with the wrong scope.

Thanks and regards
Matt


问:
Receivers Email (to) should change based on drop-down selection in ASP.NET
PROBLEM:

I am trying to solve a problem where there are 5 towers and each has respective recipients' list.
When a particular tower is selected the form should auto-populate the respective email ids in the to textbox for user.

SOLUTION I TRIED:

I tried to add a new method 'Selection_Change' to dropdown for tower which contains the email ids for each tower respectively.

```<code> <asp:DropDownList ID="txtTowerValue" runat="server" SkinID="EmailTextbox" Font-Size="14px" Width="580px" Height="30px" BorderStyle="None">onselectedIndexchanged="Selection_Change">

 <asp:ListItem Value="--Please Select--">--Please Select--</asp:ListItem>
 <asp:ListItem Value="AO">AO</asp:ListItem>
 <asp:ListItem Value="MOD">MOD</asp:ListItem>
 <asp:ListItem Value="IO">IO</asp:ListItem>
 <asp:ListItem Value="SD">SD</asp:ListItem>
 <asp:ListItem Value="Security">Security</asp:ListItem>
 </asp:DropDownList></td>
</code>```

Selection_Change method code:

```<code>protected void Selection_Change(Object sender, EventArgs e)
{
    if (txtTowerValue.SelectedItem.Text == "AO")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToAO"].ToString();
    }
    if (txtTowerValue.SelectedItem.Text == "IO")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToIO"].ToString();
    }
    if (txtTowerValue.SelectedItem.Text == "MOD")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToMOD"].ToString();
    }
    if (txtTowerValue.SelectedItem.Text == "SD")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToSD"].ToString();
    }
    if (txtTowerValue.SelectedItem.Text == "Security")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToSecurity"].ToString();
    }
}
</code>```

I also went through few suggestions which mentioned adding Autopostback=true for the drop-down but in that case the page reloads and the pop-up form closes down which is not helpful for my problem. I was hoping if anyone has any suggestions to tackle this problem using jQuery/Javascript or can give input on the code that I have put out here.

Thanks in advance!

Body:
PROBLEM:

I am trying to solve a problem where there are 5 towers and each has respective recipients' list.
When a particular tower is selected the form should auto-populate the respective email ids in the to textbox for user.

SOLUTION I TRIED:

I tried to add a new method 'Selection_Change' to dropdown for tower which contains the email ids for each tower respectively.

 <asp:DropDownList ID="txtTowerValue" runat="server" SkinID="EmailTextbox" Font-Size="14px" Width="580px" Height="30px" BorderStyle="None">onselectedIndexchanged="Selection_Change">

 <asp:ListItem Value="--Please Select--">--Please Select--</asp:ListItem>
 <asp:ListItem Value="AO">AO</asp:ListItem>
 <asp:ListItem Value="MOD">MOD</asp:ListItem>
 <asp:ListItem Value="IO">IO</asp:ListItem>
 <asp:ListItem Value="SD">SD</asp:ListItem>
 <asp:ListItem Value="Security">Security</asp:ListItem>
 </asp:DropDownList>

Selection_Change method code:

protected void Selection_Change(Object sender, EventArgs e)
{
    if (txtTowerValue.SelectedItem.Text == "AO")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToAO"].ToString();
    }
    if (txtTowerValue.SelectedItem.Text == "IO")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToIO"].ToString();
    }
    if (txtTowerValue.SelectedItem.Text == "MOD")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToMOD"].ToString();
    }
    if (txtTowerValue.SelectedItem.Text == "SD")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToSD"].ToString();
    }
    if (txtTowerValue.SelectedItem.Text == "Security")
    {
        txtNotifTo.Text = ConfigurationManager.AppSettings["ToSecurity"].ToString();
    }
}

I also went through few suggestions which mentioned adding Autopostback=true for the drop-down but in that case the page reloads and the pop-up form closes down which is not helpful for my problem. I was hoping if anyone has any suggestions to tackle this problem using jQuery/Javascript or can give input on the code that I have put out here.

Thanks in advance!


问:
Python find Element error for a drop down list
My Script takes me to a page where a table (with filters is present) This is the code for the header bar which I need to identify and use to export the table present on the page:

```<code><td valign="top"><div class="menu-nav">
      <ul>
          <li><a href="window_data_columns_report.html" class="submodal-input2">
          <span class="icon-nav icon-columns"></span>
          Edit Columns</a></li>
         <li><a href="xxx" class="submodal-input2">
          <span id="id1" class="icon-nav icon-Task">
             </span>
          Task</a></li> <li>
                  </li>
        <li><a href="saveas" class="submodal-input2_1">
          <span class="icon-nav icon-save"></span>
          Save</a></li>
         <li id="export-menu"><a href="#">
          <span class="icon-nav icon-export"></span>
          Export</a>
          <ul class="sub">
             <li><a href="exportExcel.html?x" class="submodal-input2_3">Excel</a></li>
              <li><a href="exportCSV.html?x" class="submodal-input2_4">CSV</a></li>
          </ul>
          </li>
      </ul>
    </div>
    </td>
</code>```

I've tried:

```<code>WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//*[@id='export-menu']/a/text()")))
            expbuttn = driver.find_element(By.XPATH, "//*[@id='export-menu']/a/text()")
            actions.move_to_element(expbuttn).perform()
            expbuttn.click()
            WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//*[@id='export-menu']/ul/li[2]/a")))
            csvbuttn = driver.find_element(By.XPATH, "//*[@id='export-menu']/ul/li[2]/a")
            csvbuttn.click()
</code>```

But no success.

The dropdown menu for the export options is only available when hovering or clicking on the first export button

any help?

Body:
My Script takes me to a page where a table (with filters is present) This is the code for the header bar which I need to identify and use to export the table present on the page:

          Edit Columns

          Task

          Save

          Export

Excel

CSV

I've tried:

WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//*[@id='export-menu']/a/text()")))
            expbuttn = driver.find_element(By.XPATH, "//*[@id='export-menu']/a/text()")
            actions.move_to_element(expbuttn).perform()
            expbuttn.click()
            WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//*[@id='export-menu']/ul/li[2]/a")))
            csvbuttn = driver.find_element(By.XPATH, "//*[@id='export-menu']/ul/li[2]/a")
            csvbuttn.click()

But no success.

The dropdown menu for the export options is only available when hovering or clicking on the first export button

any help?


问:
How to dismiss TextEditor keyboard by clicking outside a List with SwiftUI?
I have a TextEditor inside a List row. I can't dismiss the keyboard of the TextEditor.
I want a click anywhere on the screen other than on the TextEditor to dismiss the keyboard.

Attaching the onTapGesture to the List will give the expected result, but clicking on TextEditor will also hide the keyboard. Attaching the onTapGesture to the Section of the List will give the expected result, but clicking on the List background will do nothing.

List {
    Section{
        TextField(
            "Type title",
            text: $title
        )
        TextField(
            "Type subtitle",
            text: $subtitle
        )
    }
    .onTapGesture {
        //background click do nothing of course
        hideKeyboard()
    }
    Section {
        TextEditor(
            text: $message
        )
    }
}
.onTapGesture {
    //click on TextEditor -> dismiss keyboard =(
    hideKeyboard()
}
```

Interface of that code for better understanding

Body:
I have a TextEditor inside a List row. I can't dismiss the keyboard of the TextEditor.
I want a click anywhere on the screen other than on the TextEditor to dismiss the keyboard.

Attaching the onTapGesture to the List will give the expected result, but clicking on TextEditor will also hide the keyboard. Attaching the onTapGesture to the Section of the List will give the expected result, but clicking on the List background will do nothing.

List {
    Section{
        TextField(
            "Type title",
            text: $title
        )
        TextField(
            "Type subtitle",
            text: $subtitle
        )
    }
    .onTapGesture {
        //background click do nothing of course
        hideKeyboard()
    }
    Section {
        TextEditor(
            text: $message
        )
    }
}
.onTapGesture {
    //click on TextEditor -> dismiss keyboard =(
    hideKeyboard()
}

Interface of that code for better understanding


问:
Converting Columns to Rows based on specific column value
I have a problem to fill a new column from a previous column where the values are calculated.

Current output:

date
column1

A
01.01.2022
0

A
02.01.2022
1

A
03.01.2022
2

A
04.01.2022
3

A
05.01.2022
4

B
01.01.2023
0

B
02.01.2023
1

B
03.01.2023
2

B
04.01.2023
3

C
01.01.2024
0

C
02.01.2024
1

C
03.01.2024
2

C
04.01.2024
3

C
05.01.2024
4

Required output:

date
column1
column2

A
01.01.2022
0
0

A
02.01.2022
1
1

A
03.01.2022
2
2

A
04.01.2022
3
3

A
05.01.2022
4
3

B
01.01.2023
0
0

B
02.01.2023
1
1

B
03.01.2023
2
2

B
04.01.2023
3
4

C
01.01.2024
0
etc

C
02.01.2024
1
etc

C
03.01.2024
2
etc

C
04.01.2024
3
etc

C
05.01.2024
4
etc

As you can see, when there is an accordance between previous year/month in column1 (weample 0, 1 etc.) it should display in the row in column2.

When we have in current year less days than in previous year (like A and B), the highest day from previous year in column1 (A) should have the highest number from column1 (B) in column2 (A).

When we have in current year more days than in previous year (like B and C), the highest day from previous year in column1 (B) would have the highest number from column1 (C) in column2 (A).

I tried to solve this issue with a substring and case syntax without a good result.


问:
Get nonce from Apple Pay and send to Magento REST API
I have a Cordova application connected to magento 2 via rest api.
Using this plugin cordova-plugin-applepay I am trying to add apple payments.
I did all the steps until I get the encrypted response data from apple

Looks like this:

```<code>            "paymentData": {
                "version": "EC_v1",
                "data": "kdHd..GQ==",
                "signature": "MIAGCSqGSIb3DQEH...AAA",
                "header": {
                    "applicationData": "94ee0..C2",
                    "transactionId": "d3b28af..f8",
                    "ephemeralPublicKey": "MFkwE..Q==",
                    "publicKeyHash": "dxCK..6o="
                }
            }
</code>```

How can I decrypt/decode it in order to send nonce, card type, last 4 chars to magento to complete transaction?

Some of the fields are sample base64, others like "data" is encrypted.

Body:
I have a Cordova application connected to magento 2 via rest api.
Using this plugin cordova-plugin-applepay I am trying to add apple payments.
I did all the steps until I get the encrypted response data from apple

Looks like this:

            "paymentData": {
                "version": "EC_v1",
                "data": "kdHd..GQ==",
                "signature": "MIAGCSqGSIb3DQEH...AAA",
                "header": {
                    "applicationData": "94ee0..C2",
                    "transactionId": "d3b28af..f8",
                    "ephemeralPublicKey": "MFkwE..Q==",
                    "publicKeyHash": "dxCK..6o="
                }
            }

How can I decrypt/decode it in order to send nonce, card type, last 4 chars to magento to complete transaction?

Some of the fields are sample base64, others like "data" is encrypted.


问:
Why does Wolfram introduce an unknown parameter in the solution to this initial value problem?
I am trying to get the solution of the problem inputted below. However, the solution to the differential equation given by Wolfram makes use of a parameter that was not part of the problem and seems to offer no explanation of what it would be.

What would  Csi be here? Where could I read more on that?

Link to the problem above on Wolfram


问:
Running and executing the (.sql) script file inside the dockerfile to execute the query in mysql database
I'm new to docker.

I'm trying to create a database seeder in a docker-compose.yml file that will execute an sql script file in another container. I just want to put this inside the dockerfile and will execute the script just like below.

'''docker exec -it mysql-database-container mysql -uroot -proot < /ScriptFolder/CreateDatabaseAndTableScript.sql'''

Thank you in advance.


问:
Using ARRAY of POINT-s (Point[]) in SQLModel, SQLAlchemy and PostgreSQL
I have just started working with SQLModel which is built on top of the SQLAlchemy. I want to create a Class Model for table to do selects and inserts. I have one column that is an Array of Points. The DDL for that table looks like that:

CREATE TABLE "public"."site_metrics" (
    "site_metric_id" integer DEFAULT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
    "site_id" integer NOT NULL,
    "metric_id" integer NOT NULL,
    "created_at" timestamp NOT NULL,
    "updated_at" timestamp NOT NULL,
    "n_value" double precision,
    "a_value" point[],
    "deleted_at" timestamp,
    CONSTRAINT "PK_f30bdeddd128eea8b65c72b3653" PRIMARY KEY ("site_metric_id")
)
```
<p>now I want to create a model in SQLModel that will represent that table, I have found some threads that uses geoalchemy for creating Point type of columns but I have not seen using them with SQLModel or with arrays. So I have tried this by looking all examples by far:</p>
<pre class="lang-py prettyprint-override"><code>from sqlmodel import Field, SQLModel, ARRAY
from geoalchemy2 import Geometry
from datetime import datetime

class SiteMetrics(SQLModel, table=True):
    site_metric_id: Optional[int] = Field(default=None, primary_key=True)
    site_id: int
    metric_id: int
    created_at: datetime
    updated_at: datetime
    n_value: float
    a_value: ARRAY(Geometry(geometry_type='POINT'))
    deleted_at: datetime
</code>```

but when I try this it thors this error:

```<code>error checking inheritance of ARRAY(Geometry(geometry_type='POINT', from_text='ST_GeomFromEWKT', name='geometry')) (type: ARRAY)
</code>```

is there anything else I can do? I am kinda stuck on that

UPDATE
I also tried this, with alchemy schemas:

from sqlmodel import Field, Session, SQLModel, create_engine, select, ARRAY, Integer, String, FLOAT
from geoalchemy2 import Geometry
from typing import Optional
from datetime import datetime
from urllib.parse import quote_plus
from typing import List, Optional, Set
from sqlalchemy.sql.schema import Column

class Site_Metrics(SQLModel, table=True):
    site_metric_id: Optional[int] = Field(default=None, primary_key=True)
    site_id: int
    metric_id: int
    created_at: datetime
    updated_at: datetime
    n_value: float
    a_value: Optional[List] = Field(default_factory=list, sa_column=Column(ARRAY(Geometry('POINT'))))
    deleted_at: datetime
```

With this code, I was able to at least create the class and now when I try to select. Now I am thinking about creating Type on my own, lets see if I will be able to

Body:
I have just started working with SQLModel which is built on top of the SQLAlchemy. I want to create a Class Model for table to do selects and inserts. I have one column that is an Array of Points. The DDL for that table looks like that:

CREATE TABLE "public"."site_metrics" (
    "site_metric_id" integer DEFAULT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
    "site_id" integer NOT NULL,
    "metric_id" integer NOT NULL,
    "created_at" timestamp NOT NULL,
    "updated_at" timestamp NOT NULL,
    "n_value" double precision,
    "a_value" point[],
    "deleted_at" timestamp,
    CONSTRAINT "PK_f30bdeddd128eea8b65c72b3653" PRIMARY KEY ("site_metric_id")
)

now I want to create a model in SQLModel that will represent that table, I have found some threads that uses geoalchemy for creating Point type of columns but I have not seen using them with SQLModel or with arrays. So I have tried this by looking all examples by far:

from sqlmodel import Field, SQLModel, ARRAY
from geoalchemy2 import Geometry
from datetime import datetime

class SiteMetrics(SQLModel, table=True):
    site_metric_id: Optional[int] = Field(default=None, primary_key=True)
    site_id: int
    metric_id: int
    created_at: datetime
    updated_at: datetime
    n_value: float
    a_value: ARRAY(Geometry(geometry_type='POINT'))
    deleted_at: datetime

but when I try this it thors this error:

error checking inheritance of ARRAY(Geometry(geometry_type='POINT', from_text='ST_GeomFromEWKT', name='geometry')) (type: ARRAY)

is there anything else I can do? I am kinda stuck on that

UPDATE
I also tried this, with alchemy schemas:

from sqlmodel import Field, Session, SQLModel, create_engine, select, ARRAY, Integer, String, FLOAT
from geoalchemy2 import Geometry
from typing import Optional
from datetime import datetime
from urllib.parse import quote_plus
from typing import List, Optional, Set
from sqlalchemy.sql.schema import Column

class Site_Metrics(SQLModel, table=True):
    site_metric_id: Optional[int] = Field(default=None, primary_key=True)
    site_id: int
    metric_id: int
    created_at: datetime
    updated_at: datetime
    n_value: float
    a_value: Optional[List] = Field(default_factory=list, sa_column=Column(ARRAY(Geometry('POINT'))))
    deleted_at: datetime

With this code, I was able to at least create the class and now when I try to select. Now I am thinking about creating Type on my own, lets see if I will be able to


Title: RYU Snort Integration. RYU snortlib.py event alert returns bytes instead of string from parsing unix domain socket file from SNORT

Body:
I have been attempting to integrate RYU with SNORT according to the docs and do this all on mininet.

However, after setting it all up i appear to get alert messages returned in bytes instead of the expected string.

I have had to amend my version to use alert_unixsock instead of unsock as that is the socket version in SNORT3

I got this:

I modified the code to display the bytes using b'' and it displayed this return

b'alertmsg: "Pinging..."\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

icmp(code=0,csum=57652,data=echo(data=array('B', [11, 22, 188, 99, 0, 0, 0, 0, 163, 68, 4, 0, 0, 0, 0, 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55]),id=61724,seq=29),type=0)

ipv4(csum=26730,dst='10.0.0.1',flags=0,header_length=5,identification=65084,offset=0,option=None,proto=1,src='10.0.0.2',tos=0,total_length=84,ttl=64,version=4)

ethernet(dst='00:00:00:00:00:01',ethertype=2048,src='00:00:00:00:00:02')

I should be seeing something like:

alertmsg: Pinging...
icmp(code=0,csum=19725,data=echo(data=array('B', [97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 97, 98, 99, 100, 101, 102, 103, 104, 105]),id=1,seq=78),type=8)

ipv4(csum=42562,dst='192.168.8.50',flags=0,header_length=5,identification=724,offset=0,option=None,proto=1,src='192.168.8.40',tos=0,total_length=60,ttl=128,version=4)

ethernet(dst='00:23:54:5a:05:14',ethertype=2048,src='00:23:54:6c:1d:17')

alertmsg: Pinging...
icmp(code=0,csum=21773,data=echo(data=array('B', [97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 97, 98, 99, 100, 101, 102, 103, 104, 105]),id=1,seq=78),type=0)

ipv4(csum=52095,dst='192.168.8.40',flags=0,header_length=5,identification=7575,offset=0,option=None,proto=1,src='192.168.8.50',tos=0,total_length=60,ttl=64,version=4)

I suspect an issue with parsing the alert_snort file in snortlib.py but i am unsure how to remedy this issue

EDIT: is this also maybe and issue with mininets packets?


问:
SSRS - Switch command ELSE 1=1?
I've inheritied some reports in SSRS and noticed that in some of the SWITCH statements there is a line that says 1=1 - but I can't find any documentation on this - is this an equivalent of an  ELSE?

I know that the switch syntax is like this:

```<code>= Switch(expr-1, value-1,)
</code>```

But I have a function that says:

```<code>=switch(    First(fields!cost.value,"FileInfo") = 0, "example 1 goes here",
            First(Fields!cost.value,"FileInfo") = 100, "example 2 goes here",
            1=1, "example 3 goes here"
)
</code>```

I'm assuming that 1=1 is a catch all \ ELSE?  Am I correct?

Title: SSRS - Switch command ELSE 1=1?

Body:
I've inheritied some reports in SSRS and noticed that in some of the SWITCH statements there is a line that says 1=1 - but I can't find any documentation on this - is this an equivalent of an  ELSE?

I know that the switch syntax is like this:

= Switch(expr-1, value-1,)

But I have a function that says:

=switch(    First(fields!cost.value,"FileInfo") = 0, "example 1 goes here",
            First(Fields!cost.value,"FileInfo") = 100, "example 2 goes here",
            1=1, "example 3 goes here"
)

I'm assuming that 1=1 is a catch all \ ELSE?  Am I correct?