问:
How do I to access the t.card(id)? I keep getting an iframe error (per the console)
Sorry for the long post, I've tried to include as much relevant information as possible.

I'm trying to display a card's ID in a card-back-section but it isn't working correctly. I can get the card-back-section to display with static text but I cannot get any variables out of it. When I look at the console (Chrome), there are at least a dozen errors but the one which I think is affecting me is:

section.html:20 Uncaught TypeError: Cannot read properties of undefined (reading 'iframe') at section.html:20:30

What I think is happening is that Trello can't load the t variable for me to get the t.card('id') out of it.

My project in Glitch is extremely simple. It's just these four files:

public/index.html

public/section.html

public/js/client.js

public/js/section.js

index.html contains:

<!DOCTYPE html>

     <meta charset="utf-8">

  ```
</div>
</div>
</p>
<ul>
<li><strong>client.js</strong> contains:</li>
</ul>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var BLACK_ROCKET_ICON = 'https://cdn.glitch.com/1b42d7fe-bda8-4af8-a6c8-eff0cea9e08a%2Frocket-`ship.png?1494946700421';

TrelloPowerUp.initialize({

  'card-back-section': function(t, options){
    return {
      title: 'Parts List',
      icon: BLACK_ROCKET_ICON, // Must be a gray icon, colored icons not allowed.
      content: {
        type: 'iframe',
        url: t.signUrl('./section.html'),
        height: 150, // Max height is 1500.
      };
    };
  },

  'card-buttons': function(t, options) {
    return[{
      icon: BLACK_ROCKET_ICON,
      text: 'Card ID',
      callback: function(t){
      return t.card('id').then(card=>alert(card.id))
      }
    }];
  };

          });</code>```

A section called Parts List is indeed displayed on the card which displays the content from section.html. Right now it looks like this:

Parts List:

Line above ID

Line below ID

(The card-button function exists for the sole purpose of testing to see if I could get the t.card('id') that way, and it does work.)

section.html contains:

<!DOCTYPE html>

  <meta charset="utf-8">

Line above card ID

Line below ID

```
</div>
</div>
</p>
<ul>
<li><strong>section.js</strong> contains:</li>
</ul>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>/* global TrelloPowerUp */

var t=window.TrelloPowerUp.iframe();
// you can access arguments passed to your iframe like so
// unlike logic that lives inside t.render() this will only
// be passed once, so don't rely on this for information that
// could change, for example what attachments you want to show
// in this section
var arg=t.arg('arg');
var getCardId=function(t) {
  return t.card('id') .get('id') .then(function(cardID) {
    console.log('The card\'s ID is: ' + cardID); //Display in the console
    document.getElementById("card_id").innerHTML=cardID; // Display in section.html
  }
  );
}

;</code>```

The Iframe connector URL points to the root of my Glitch project.

card-back-section and card-buttons capabilities are turned on in Trello Power-Ups & Integrations admin page.

trelloAPIKey and token are both filled out in the .env section in Glitch, however I don't think I'm using them for anything yet.

I've tried moving the var t = window.TrelloPowerUp.iframe(); to each of the different files in the project with no success. Sometimes I get an "undefined" error for t.card(id) depending on which file it's located inside.

My two questions at this point are:

Why is my browser complaining about the iframe?

Is that the problem I'm having trying to pass/display the t.card(id) variable in section.html?

Body:
Sorry for the long post, I've tried to include as much relevant information as possible.

I'm trying to display a card's ID in a card-back-section but it isn't working correctly. I can get the card-back-section to display with static text but I cannot get any variables out of it. When I look at the console (Chrome), there are at least a dozen errors but the one which I think is affecting me is:

section.html:20 Uncaught TypeError: Cannot read properties of undefined (reading 'iframe') at section.html:20:30

What I think is happening is that Trello can't load the t variable for me to get the t.card('id') out of it.

My project in Glitch is extremely simple. It's just these four files:

public/index.html

public/section.html

public/js/client.js

public/js/section.js

index.html contains:

<!DOCTYPE html>

     <meta charset="utf-8">

client.js contains:

var BLACK_ROCKET_ICON = 'https://cdn.glitch.com/1b42d7fe-bda8-4af8-a6c8-eff0cea9e08a%2Frocket-`ship.png?1494946700421';

TrelloPowerUp.initialize({

  'card-back-section': function(t, options){
    return {
      title: 'Parts List',
      icon: BLACK_ROCKET_ICON, // Must be a gray icon, colored icons not allowed.
      content: {
        type: 'iframe',
        url: t.signUrl('./section.html'),
        height: 150, // Max height is 1500.
      };
    };
  },

  'card-buttons': function(t, options) {
    return[{
      icon: BLACK_ROCKET_ICON,
      text: 'Card ID',
      callback: function(t){
      return t.card('id').then(card=>alert(card.id))
      }
    }];
  };

          });

A section called Parts List is indeed displayed on the card which displays the content from section.html. Right now it looks like this:

Parts List:

Line above ID

Line below ID

(The card-button function exists for the sole purpose of testing to see if I could get the t.card('id') that way, and it does work.)

section.html contains:

<!DOCTYPE html>

  <meta charset="utf-8">

Line above card ID

Line below ID

section.js contains:

/* global TrelloPowerUp */

var t=window.TrelloPowerUp.iframe();
// you can access arguments passed to your iframe like so
// unlike logic that lives inside t.render() this will only
// be passed once, so don't rely on this for information that
// could change, for example what attachments you want to show
// in this section
var arg=t.arg('arg');
var getCardId=function(t) {
  return t.card('id') .get('id') .then(function(cardID) {
    console.log('The card\'s ID is: ' + cardID); //Display in the console
    document.getElementById("card_id").innerHTML=cardID; // Display in section.html
  }
  );
}

;

The Iframe connector URL points to the root of my Glitch project.

card-back-section and card-buttons capabilities are turned on in Trello Power-Ups & Integrations admin page.

trelloAPIKey and token are both filled out in the .env section in Glitch, however I don't think I'm using them for anything yet.

I've tried moving the var t = window.TrelloPowerUp.iframe(); to each of the different files in the project with no success. Sometimes I get an "undefined" error for t.card(id) depending on which file it's located inside.

My two questions at this point are:

Why is my browser complaining about the iframe?

Is that the problem I'm having trying to pass/display the t.card(id) variable in section.html?


来源: stackexchange

问:
Is there a way to convert Moment Date to Javascript Date object along with locale?
I have the following function, which receives the date string and then checks if it is v alid moment date and then converts it to a JavaScript Date object.

```<code>const dateFromString = (value, locale) => {
  if (typeof value === 'string') {
    const dateMoment = moment(value, ['L LTS'], locale);
    return dateMoment.isValid() ? dateMoment.toDate() : null;
  }
  return value;
};
</code>```

I also have a function which converts the Moment Date to String,

```<code>const dateToString = (value, locale) => {
  const dateMoment = moment(value);
  return dateMoment.isValid() ? dateMoment.format(currentDateFormat(locale, true)) : '';
};
</code>```

Now, I need a function that can convert moment date to javascript date considering the locale,
is there a way to do it?

ContentLicense: CC BY-SA 4.0

Body:
I have the following function, which receives the date string and then checks if it is v alid moment date and then converts it to a JavaScript Date object.

const dateFromString = (value, locale) => {
  if (typeof value === 'string') {
    const dateMoment = moment(value, ['L LTS'], locale);
    return dateMoment.isValid() ? dateMoment.toDate() : null;
  }
  return value;
};

I also have a function which converts the Moment Date to String,

const dateToString = (value, locale) => {
  const dateMoment = moment(value);
  return dateMoment.isValid() ? dateMoment.format(currentDateFormat(locale, true)) : '';
};

Now, I need a function that can convert moment date to javascript date considering the locale,
is there a way to do it?


问:
Did Google Sheets stop supporting import of .xlsm files?
I cannot import a .xlsm file any more to Google Sheets. I can convert to a .xls and then upload it.  Anyone else seeing this issue?


问:
Persistence provider error after updating to spring boot 3
My application always fail on runtime only, after updating to spring boot 3.0.0.
I try to run the application with developpement properties on my local machine.
I use gradle 7.6, and Java 17.0.4.

```<code>2022-12-11T23:21:54.136+01:00  WARN 17936 --- [  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]: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider
2022-12-11T23:21:54.142+01:00  INFO 17936 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2022-12-11T23:21:54.171+01:00  INFO 17936 --- [  restartedMain] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2022-12-11T23:21:54.202+01:00 ERROR 17936 --- [  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]: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.0.jar:3.0.0]
    at com.muqel.api.MuqelApi.main(MuqelApi.java:30) ~[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.0.jar:3.0.0]
Caused by: java.lang.IncompatibleClassChangeError: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.2.jar:6.0.2]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.2.jar:6.0.2]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.2.jar:6.0.2]
Caused by: java.lang.IncompatibleClassChangeError: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider
</code>```

Used application properties :

application.yml

```<code>spring:
  datasource:
    driver-class-name: org.postgresql.Driver
  jpa:
    hibernate:
      ddl-auto: update
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    properties:
      hibernate:
        jdbc.lob.non_contextual_creation: true
        dialect: org.hibernate.dialect.PostgreSQLDialect
</code>```

application-dev.yml

```<code>spring:
  config:
    activate:
      on-profile: "dev"
  datasource:
#    url: jdbc:postgresql://localhost:5433/muqel_db?user=postgres&password=admin
    url: jdbc:postgresql://localhost:5432/muqel_db
    username: postgres
    password: admin
  jpa:
    show-sql: true
  jackson:
    serialization:
      fail-on-empty-beans: false

server:
  port: 8889
</code>```

Body:
My application always fail on runtime only, after updating to spring boot 3.0.0.
I try to run the application with developpement properties on my local machine.
I use gradle 7.6, and Java 17.0.4.

2022-12-11T23:21:54.136+01:00  WARN 17936 --- [  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]: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider
2022-12-11T23:21:54.142+01:00  INFO 17936 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2022-12-11T23:21:54.171+01:00  INFO 17936 --- [  restartedMain] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2022-12-11T23:21:54.202+01:00 ERROR 17936 --- [  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]: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.2.jar:6.0.2]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[spring-boot-3.0.0.jar:3.0.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[spring-boot-3.0.0.jar:3.0.0]
    at com.muqel.api.MuqelApi.main(MuqelApi.java:30) ~[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.0.jar:3.0.0]
Caused by: java.lang.IncompatibleClassChangeError: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.2.jar:6.0.2]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.2.jar:6.0.2]
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.2.jar:6.0.2]
Caused by: java.lang.IncompatibleClassChangeError: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider

Used application properties :

application.yml

spring:
  datasource:
    driver-class-name: org.postgresql.Driver
  jpa:
    hibernate:
      ddl-auto: update
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    properties:
      hibernate:
        jdbc.lob.non_contextual_creation: true
        dialect: org.hibernate.dialect.PostgreSQLDialect

application-dev.yml

spring:
  config:
    activate:
      on-profile: "dev"
  datasource:
#    url: jdbc:postgresql://localhost:5433/muqel_db?user=postgres&password=admin
    url: jdbc:postgresql://localhost:5432/muqel_db
    username: postgres
    password: admin
  jpa:
    show-sql: true
  jackson:
    serialization:
      fail-on-empty-beans: false

server:
  port: 8889


问:
Retrieve any "active" layers / overlays in a folium project
Was wondering if there was any way of retrieving active layers/ overlays. I have found an existing solution in leaflet https://github.com/vogdb/Leaflet.ActiveLayers but can't find any implementation of this in folium.

Using folium's layer controller I can retrieve the names of the layers but cant see any boolean information such as if they're active or not.

```<code>layerController = folium.LayerControl().add_to(m)

print(layerController.overlays.items())
</code>```

Current output:
list of names

The desired outcome would be that same list of names but with ', True' or ', False'

Body:
Was wondering if there was any way of retrieving active layers/ overlays. I have found an existing solution in leaflet https://github.com/vogdb/Leaflet.ActiveLayers but can't find any implementation of this in folium.

Using folium's layer controller I can retrieve the names of the layers but cant see any boolean information such as if they're active or not.

layerController = folium.LayerControl().add_to(m)

print(layerController.overlays.items())

Current output:
list of names

The desired outcome would be that same list of names but with ', True' or ', False'


问:
Im evoking funtion too many times inside directive *ngFor, is there anything i can do better?
In directive *ngFor I iterate through map (tour_id -> number of reserved tours). As you can see, I am envoking function getTour multiple times.
Can I do better?

    {{getTour(object.key).name}}
    {{getTour(object.key).country}}
    {{getTour(object.key).price * object.value}} USD
    {{getTour(object.key).startDate}}
    {{getTour(object.key).endDate}}
    {{object.value}}
```
<p>Tour is object that has properties like id, price, ...</p>
<pre class="lang-js prettyprint-override"><code>  getTour(_id: string): Tour{
    return this.tours.find((tour: Tour) => tour._id === _id)
  }

</code>```

Body:
In directive *ngFor I iterate through map (tour_id -> number of reserved tours). As you can see, I am envoking function getTour multiple times.
Can I do better?

    {{getTour(object.key).name}}
    {{getTour(object.key).country}}
    {{getTour(object.key).price * object.value}} USD
    {{getTour(object.key).startDate}}
    {{getTour(object.key).endDate}}
    {{object.value}}

Tour is object that has properties like id, price, ...

  getTour(_id: string): Tour{
    return this.tours.find((tour: Tour) => tour._id === _id)
  }


问:
Is there a 3D scan application that is able to differentiate objects between others?
For a school project, I have been searching 3D scan applications in order to make a model out of a kitchen using an IPhone with LiDAR and I tried Polycam, Metascan, CamToPlan-3D Scanner, Widar and Modelar.

But with all of these, the scan of the kitchen comes out as a single object and anything that is in it like a refrigerator or any bag that is laying around, etc... gets treated as if it were part of the kitchen and not objects of their own.

Is there any 3D scan application that is able to recognize when an object has for example, drawers, silverware, etc... and treats them as a separated object during the scan instead of merging it all in one model?

I ask this question because I plan on making animations out of these objects and it's not really possible to do that if they are literally merged with the kitchen.


问:
Entity Framework ConceptualModels start tag does not match the end tag
I am migrating from Visual Studio 2017 to Visual Studio 2022 and got an EF error about "Value cannot be null. Parameter name: type", so I updated my Entity Framework 6.2.0 to EF 6.4.4. Now I get this error that the ConceptualModels tag does not match (when trying to update my database). How can I check my ConceptualModels and fix this issue?

(CodeFirst project)

Error:

```<code>  at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Load(Stream stream, LoadOptions options)
   at System.Data.Entity.Migrations.Edm.ModelCompressor.Decompress(Byte[] bytes)
   at System.Data.Entity.Migrations.DbMigration.GetModel(Func`2 modelAccessor)
   at System.Data.Entity.Migrations.DbMigrator.ApplyMigration(DbMigration migration, DbMigration lastMigration)
   at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.ApplyMigration(DbMigration migration, DbMigration lastMigration)
   at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
   at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
   at System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration)
   at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
   at System.Data.Entity.Infrastructure.Design.Executor.Update.<>c__DisplayClass0_0.<.ctor>b__0()
   at System.Data.Entity.Infrastructure.Design.Executor.OperationBase.Execute(Action action)
The 'ConceptualModels' start tag on line 4 position 6 does not match the end tag of 'ConceptualModessociationSet'. Line 1747, position 7.
</code>```

My DB context:

```<code>namespace GMM.Repository.Context
{
    public class GMMDbContext : IdentityDbContext<ApplicationUser, AppRole, string, IdentityUserLogin, IdentityUserRole, IdentityUserClaim>
    {
        public static string ConnectionString { get; set; }
        static GMMDbContext()
        {
#if DEBUG
            ConnectionString = "GMMConnection";
#endif
        }
        public static GMMDbContext Create()
        {
            return new GMMDbContext();
        }

        public GMMDbContext()
            : base(ConnectionString)
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<GMMDbContext, GMM.Repository.Migrations.Configuration>());
            DbInterception.Add(new FtsInterceptor());
        }

        #region AccessControl
        public IDbSet<GroupRole> GroupRoles { get; set; }
        public IDbSet<RoleGroup> RoleGroups { get; set; }
        public IDbSet<UserRoleGroup> UserRoleGroups { get; set; }
        #endregion

        #region BaseInformation
        public IDbSet<Department> Departments { get; set; }
        #endregion

        #region General
        public IDbSet<Location> Locations { get; set; }

        public IDbSet<Setting> Settings { get; set; }

        #endregion

        public int SaveChanges(string currentUserIp)
        {
            AddTimestamps(currentUserIp);
            return base.SaveChanges();
        }

        public Task<int> SaveChangesAsync(string userIp)
        {
            AddTimestamps(userIp);
            return base.SaveChangesAsync();
        }

        public override int SaveChanges()
        {
            AddTimestamps();
            return base.SaveChanges();
        }

        private void AddTimestamps(string currentUserId, string currentUserIp)
        {
            if (currentUserId == null)
            {
                throw new NullReferenceException("CurrentUserId");
            }

            var entities = ChangeTracker.Entries().Where(x => x.Entity is IBaseEntity && (x.State == EntityState.Added || x.State == EntityState.Modified));
            foreach (var entity in entities)
            {
                if (entity.State == EntityState.Added)
                {
                    ((BaseGuidEntity)entity.Entity).DateCreated = DateTime.Now;
                    ((BaseGuidEntity)entity.Entity).CreatedBy_Id = currentUserId;
                    ((BaseGuidEntity)entity.Entity).CreatedByIp = currentUserIp;
                }

                ((BaseGuidEntity)entity.Entity).DateModified = DateTime.Now;
                ((BaseGuidEntity)entity.Entity).ModifiedBy_Id = currentUserId;
                ((BaseGuidEntity)entity.Entity).ModifiedByIp = currentUserIp;
            }
        }

        private void AddTimestamps()
        {
            var entities = ChangeTracker.Entries().Where(x => x.Entity is IBaseEntity && (x.State == EntityState.Added || x.State == EntityState.Modified));
            foreach (var entity in entities)
            {
                if (entity.State == EntityState.Added)
                {
                    ((BaseGuidEntity)entity.Entity).DateCreated = DateTime.UtcNow;

                }
                ((BaseGuidEntity)entity.Entity).DateModified = DateTime.UtcNow;
            }
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

            #region Message
            modelBuilder.Configurations.Add(new PrivacyConfig());
            modelBuilder.Configurations.Add(new ResultConfig());
            modelBuilder.Configurations.Add(new SubjectConfig());
            modelBuilder.Configurations.Add(new PriorityConfig());
            modelBuilder.Configurations.Add(new CategoryConfig());
            modelBuilder.Configurations.Add(new MessageConfig());
            modelBuilder.Configurations.Add(new MessageFeedbackConfig());
            modelBuilder.Configurations.Add(new ReferConfig());
            #endregion

            base.OnModelCreating(modelBuilder);
        }
    }
}
</code>```

My model diagram:

Body:
I am migrating from Visual Studio 2017 to Visual Studio 2022 and got an EF error about "Value cannot be null. Parameter name: type", so I updated my Entity Framework 6.2.0 to EF 6.4.4. Now I get this error that the ConceptualModels tag does not match (when trying to update my database). How can I check my ConceptualModels and fix this issue?

(CodeFirst project)

Error:

  at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Load(Stream stream, LoadOptions options)
   at System.Data.Entity.Migrations.Edm.ModelCompressor.Decompress(Byte[] bytes)
   at System.Data.Entity.Migrations.DbMigration.GetModel(Func`2 modelAccessor)
   at System.Data.Entity.Migrations.DbMigrator.ApplyMigration(DbMigration migration, DbMigration lastMigration)
   at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.ApplyMigration(DbMigration migration, DbMigration lastMigration)
   at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
   at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
   at System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration)
   at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
   at System.Data.Entity.Infrastructure.Design.Executor.Update.<>c__DisplayClass0_0.<.ctor>b__0()
   at System.Data.Entity.Infrastructure.Design.Executor.OperationBase.Execute(Action action)
The 'ConceptualModels' start tag on line 4 position 6 does not match the end tag of 'ConceptualModessociationSet'. Line 1747, position 7.

My DB context:

namespace GMM.Repository.Context
{
    public class GMMDbContext : IdentityDbContext<ApplicationUser, AppRole, string, IdentityUserLogin, IdentityUserRole, IdentityUserClaim>
    {
        public static string ConnectionString { get; set; }
        static GMMDbContext()
        {
#if DEBUG
            ConnectionString = "GMMConnection";
#endif
        }
        public static GMMDbContext Create()
        {
            return new GMMDbContext();
        }

        public GMMDbContext()
            : base(ConnectionString)
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<GMMDbContext, GMM.Repository.Migrations.Configuration>());
            DbInterception.Add(new FtsInterceptor());
        }

        #region AccessControl
        public IDbSet<GroupRole> GroupRoles { get; set; }
        public IDbSet<RoleGroup> RoleGroups { get; set; }
        public IDbSet<UserRoleGroup> UserRoleGroups { get; set; }
        #endregion

        #region BaseInformation
        public IDbSet<Department> Departments { get; set; }
        #endregion

        #region General
        public IDbSet<Location> Locations { get; set; }

        public IDbSet<Setting> Settings { get; set; }

        #endregion

        public int SaveChanges(string currentUserIp)
        {
            AddTimestamps(currentUserIp);
            return base.SaveChanges();
        }

        public Task<int> SaveChangesAsync(string userIp)
        {
            AddTimestamps(userIp);
            return base.SaveChangesAsync();
        }

        public override int SaveChanges()
        {
            AddTimestamps();
            return base.SaveChanges();
        }

        private void AddTimestamps(string currentUserId, string currentUserIp)
        {
            if (currentUserId == null)
            {
                throw new NullReferenceException("CurrentUserId");
            }

            var entities = ChangeTracker.Entries().Where(x => x.Entity is IBaseEntity && (x.State == EntityState.Added || x.State == EntityState.Modified));
            foreach (var entity in entities)
            {
                if (entity.State == EntityState.Added)
                {
                    ((BaseGuidEntity)entity.Entity).DateCreated = DateTime.Now;
                    ((BaseGuidEntity)entity.Entity).CreatedBy_Id = currentUserId;
                    ((BaseGuidEntity)entity.Entity).CreatedByIp = currentUserIp;
                }

                ((BaseGuidEntity)entity.Entity).DateModified = DateTime.Now;
                ((BaseGuidEntity)entity.Entity).ModifiedBy_Id = currentUserId;
                ((BaseGuidEntity)entity.Entity).ModifiedByIp = currentUserIp;
            }
        }

        private void AddTimestamps()
        {
            var entities = ChangeTracker.Entries().Where(x => x.Entity is IBaseEntity && (x.State == EntityState.Added || x.State == EntityState.Modified));
            foreach (var entity in entities)
            {
                if (entity.State == EntityState.Added)
                {
                    ((BaseGuidEntity)entity.Entity).DateCreated = DateTime.UtcNow;

                }
                ((BaseGuidEntity)entity.Entity).DateModified = DateTime.UtcNow;
            }
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

            #region Message
            modelBuilder.Configurations.Add(new PrivacyConfig());
            modelBuilder.Configurations.Add(new ResultConfig());
            modelBuilder.Configurations.Add(new SubjectConfig());
            modelBuilder.Configurations.Add(new PriorityConfig());
            modelBuilder.Configurations.Add(new CategoryConfig());
            modelBuilder.Configurations.Add(new MessageConfig());
            modelBuilder.Configurations.Add(new MessageFeedbackConfig());
            modelBuilder.Configurations.Add(new ReferConfig());
            #endregion

            base.OnModelCreating(modelBuilder);
        }
    }
}

My model diagram:


问:
Time serie forecasting without target history
Hello i'm trying to identify the different time serie forecasting methods i could use according to my specific problem:

I would like to perform:

A Multi-Step

Multi-Variate (some covariates with seasonality)

Forecasting problem

without knowing previous values of the target (= no history of the target available prior to prediction point)

On a target with trend but no seasonality

I'm considering LSTM/attention models but would like to know if a simplier model would be useful.
I think the auto-regression part of SARIMAX implies that previous target values are needed for training the model.
Any others advices?
Thanks!


问:
Hooking to override Settings.Global.* values
I'm using the app DevOptsHide to make other apps think the developer mode is disabled. To summarize, we are hooking into Settings.Global.getInt() and Settings.Secure.getInt(), and override values of Settings.Global/Secure.ADB_ENABLED and Settings.Global/Secure.DEVELOPMENT_SETTINGS_ENABLED constants.

I found some points of interest, but I'm not an Android developer, and the app author isn't willing to spend much time working on the app anymore, thus I'm asking the questions here in hope to find some insights.

The originating discussion can be found on DevOptsHide issue #17. The main code is at HideDevOpts.kt.

My questions are:

I am right when I spotted that when hooking into Settings.Secure.getInt(), in the hook param equals Settings.Secure.* thus detection of access to the desired constants fails, as currently the only checked names are Settings.Global.*?

I am right when I pointed out that as handleLoadPackage() is executed for each and every package loaded, Settings.Global.getInt() and Settings.Secure.getInt() end up with a huge stack of registered hooks?

But maybe there is some singleton mechanism?

On the other hand, if you confirm there is an issue, how could it be fixed? Could initZygote() be used instead (maybe it runs too soon)?


问:
cannot import name '__version__' from partially initialized module 'keras' (most likely due to a circular import)
I am trying to use mrcnn.model and am running into a circular import error. How do I fix this?

Traceback:

```<code>Traceback (most recent call last):
File "C:/Users/rinat/PycharmProjects/DSTI_CV_project/Helper functions.py", line 3, in <module>
    import mrcnn.model
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\mrcnn\model.py", line 16, in <module>
   import tensorflow.keras as keras
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\api\_v2\keras\__init__.py", line 12, in <module>
    from keras import __version__
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\__init__.py", line 21, in <module>
    from keras import models
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\models\__init__.py", line 24, in <module>
    from keras.models.cloning import _clone_functional_model
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\models\cloning.py", line 25, in <module>
    from keras.engine import training_v1
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\engine\training_v1.py", line 47, in <module>
    from tensorflow.keras.optimizers import SGD
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\api\_v2\keras\optimizers\__init__.py", line 11, in <module>
    from keras.api._v2.keras.optimizers import experimental
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\api\__init__.py",
    line 8, in <module>
    from keras.api import keras
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\api\keras\__init__.py", line 12, in <module>
    from keras import __version__
ImportError: cannot import name '__version__' from partially initialized module 'keras' (most likely due to a circular import) (C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\__init__.py)
</code>```

Body:
I am trying to use mrcnn.model and am running into a circular import error. How do I fix this?

Traceback:

Traceback (most recent call last):
File "C:/Users/rinat/PycharmProjects/DSTI_CV_project/Helper functions.py", line 3, in <module>
    import mrcnn.model
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\mrcnn\model.py", line 16, in <module>
   import tensorflow.keras as keras
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\api\_v2\keras\__init__.py", line 12, in <module>
    from keras import __version__
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\__init__.py", line 21, in <module>
    from keras import models
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\models\__init__.py", line 24, in <module>
    from keras.models.cloning import _clone_functional_model
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\models\cloning.py", line 25, in <module>
    from keras.engine import training_v1
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\engine\training_v1.py", line 47, in <module>
    from tensorflow.keras.optimizers import SGD
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\api\_v2\keras\optimizers\__init__.py", line 11, in <module>
    from keras.api._v2.keras.optimizers import experimental
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\api\__init__.py",
    line 8, in <module>
    from keras.api import keras
File "C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\api\keras\__init__.py", line 12, in <module>
    from keras import __version__
ImportError: cannot import name '__version__' from partially initialized module 'keras' (most likely due to a circular import) (C:\Users\rinat\PycharmProjects\SE_2\venv\lib\site-packages\keras\__init__.py)


问:
object of type 'NoneType' has no len() - importing env variables within selenium project
I'm currently building out a program that logs into a website and checks the orders that have come in for the day.

I want to handle the sensitive information required (username and password) using a .env file.

In my .env file I have the following;

```<code>username=user
password=pass
</code>```

the code I'm using for the login is as follows;

```<code>load_dotenv()

username = os.getenv('username')
password = os.getenv('password')

username_input = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[contains(@id, 'username')]")))
password_input = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[contains(@id, 'login')]")))

username_input.send_keys(username)
password_input.send_keys(password)
</code>```

The code works and logs in successfully when storing the username and password directly in the function as below;

```<code>username_input.send_keys("user")
password_input.send_keys("pass")
</code>```

but when trying to import the variables from the .env file, the username is input correctly but the password returns me the error;

```<code>object of type 'NoneType' has no len()
</code>```

really struggling to see the issue, thanks in advance for any help!

Body:
I'm currently building out a program that logs into a website and checks the orders that have come in for the day.

I want to handle the sensitive information required (username and password) using a .env file.

In my .env file I have the following;

username=user
password=pass

the code I'm using for the login is as follows;

load_dotenv()

username = os.getenv('username')
password = os.getenv('password')

username_input = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[contains(@id, 'username')]")))
password_input = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[contains(@id, 'login')]")))

username_input.send_keys(username)
password_input.send_keys(password)

The code works and logs in successfully when storing the username and password directly in the function as below;

username_input.send_keys("user")
password_input.send_keys("pass")

but when trying to import the variables from the .env file, the username is input correctly but the password returns me the error;

object of type 'NoneType' has no len()

really struggling to see the issue, thanks in advance for any help!


问:
How to create a user following/subscribe script
Users should have the opportunity to follow other users whenever they visit a user's profile page. However, I am unsure as to how I should link it all together. I have a users table that includes two columns named following and followers:

```<code>table users
CREATE TABLE IF NOT EXISTS `users` (
  "I have more columns in this table"
  `followers` int(11) NOT NULL,
  `following` int(11) NOT NULL
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;
</code>```

My first question is if I should add another table to ease the process, something similar like this:

```<code>CREATE TABLE IF NOT EXISTS `user_follow` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `follower` int(11) NOT NULL,
  `following` int(11) NOT NULL,
  `subscribed` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `follow_unique` (`follower`,`following`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;
</code>```

and left join the columns from users table, or if this is not needed at all.

My next question is if the action form is valid considering that I will have to take the input values from the currently logged in user $_SESSION["userid"] as well as the user on the profile page $userurl = $_GET['user']; which maybe would mix post and get methods? And either way, I have a placeholder now for the form buttons and input but unsure how to make use of the subscriber text.

profile.php

```<code><div class="userprofilecontainer">
<?php

$userurl = $_GET['user'];
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$stmt = $conn->prepare('SELECT * FROM users WHERE users_username = ?;');
$stmt->bind_param('s', $userurl);
$stmt->execute();
$result = $stmt->get_result();

while($row = $result->fetch_array()){
$username = $row['users_username'];
$registered = $row['create_datetime'];
$description = $row['users_about'];
$followers = $row['followers'];
$id = $row['users_id'];

if(isset($_SESSION["userid"]) && $_SESSION["userid"] != $id) {
?>
<form action="<?php echo htmlspecialchars("includes/followuser.inc.php");?>" id="followform" method="post">
<input name="action" type="hidden" value="<?php echo $subscribe_status; ?>"/>
<button name="subject" id ="followbutton" type="submit" value="<?php echo $subscribe_text.' '.$username; ?>">
<?php echo $subscribe_text.' '.$username; ?></button>
</form>
<?php
}
</code>```

My third question is how I should go about making two queries for following and unfollowing, and as you already know it depends on the tables part as well as knowing when someone is following or not.

followuser.inc.php

```<code><?php
require_once 'dbh.inc.php';
require_once 'functions.inc.php';
if ($_POST['action'] == "Follow"){
$sub = false;
//Perform Unfollow Query to Database
$subject = $_POST['following']; //Is this correct? Considering that I have following and followers column

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$stmt = $conn->prepare('UPDATE users SET following =following+? WHERE users_id = ?');
$following--;
$stmt->bind_param('s', $subject;
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$sub = true;
if($sub){
    $subscribe_status = "Follow";
    $subscribe_text = "Unfollow";
}else{
    $subscribe_status = "Unfollow";
    $subscribe_text = "Follow";
}
}
$stmt->close();

} else if ($_POST['action'] == "Unfollow"){
//Perform Follow Query to Database
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$stmt = $conn->prepare('UPDATE users SET following =following+? WHERE users_id = ?');
$following++;
$stmt->bind_param('s', $subject);
$stmt->execute();

$stmt->close();
}

</code>```

Any help would be much appreciated as I'm sitting here confused trying to list out what approach I can go with.

Body:
Users should have the opportunity to follow other users whenever they visit a user's profile page. However, I am unsure as to how I should link it all together. I have a users table that includes two columns named following and followers:

table users
CREATE TABLE IF NOT EXISTS `users` (
  "I have more columns in this table"
  `followers` int(11) NOT NULL,
  `following` int(11) NOT NULL
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;

My first question is if I should add another table to ease the process, something similar like this:

CREATE TABLE IF NOT EXISTS `user_follow` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `follower` int(11) NOT NULL,
  `following` int(11) NOT NULL,
  `subscribed` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `follow_unique` (`follower`,`following`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;

and left join the columns from users table, or if this is not needed at all.

My next question is if the action form is valid considering that I will have to take the input values from the currently logged in user $_SESSION["userid"] as well as the user on the profile page $userurl = $_GET['user']; which maybe would mix post and get methods? And either way, I have a placeholder now for the form buttons and input but unsure how to make use of the subscriber text.

profile.php

<?php

$userurl = $_GET['user'];
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$stmt = $conn->prepare('SELECT * FROM users WHERE users_username = ?;');
$stmt->bind_param('s', $userurl);
$stmt->execute();
$result = $stmt->get_result();

while($row = $result->fetch_array()){
$username = $row['users_username'];
$registered = $row['create_datetime'];
$description = $row['users_about'];
$followers = $row['followers'];
$id = $row['users_id'];

if(isset($_SESSION["userid"]) && $_SESSION["userid"] != $id) {
?>
<form action="<?php echo htmlspecialchars("includes/followuser.inc.php");?>" id="followform" method="post">
<input name="action" type="hidden" value="<?php echo $subscribe_status; ?>"/>
<button name="subject" id ="followbutton" type="submit" value="<?php echo $subscribe_text.' '.$username; ?>">
<?php echo $subscribe_text.' '.$username; ?></button>
</form>
<?php
}

My third question is how I should go about making two queries for following and unfollowing, and as you already know it depends on the tables part as well as knowing when someone is following or not.

followuser.inc.php

<?php
require_once 'dbh.inc.php';
require_once 'functions.inc.php';
if ($_POST['action'] == "Follow"){
$sub = false;
//Perform Unfollow Query to Database
$subject = $_POST['following']; //Is this correct? Considering that I have following and followers column

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$stmt = $conn->prepare('UPDATE users SET following =following+? WHERE users_id = ?');
$following--;
$stmt->bind_param('s', $subject;
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$sub = true;
if($sub){
    $subscribe_status = "Follow";
    $subscribe_text = "Unfollow";
}else{
    $subscribe_status = "Unfollow";
    $subscribe_text = "Follow";
}
}
$stmt->close();

} else if ($_POST['action'] == "Unfollow"){
//Perform Follow Query to Database
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$stmt = $conn->prepare('UPDATE users SET following =following+? WHERE users_id = ?');
$following++;
$stmt->bind_param('s', $subject);
$stmt->execute();

$stmt->close();
}

Any help would be much appreciated as I'm sitting here confused trying to list out what approach I can go with.


问:
Updating my live project to python 3.10 - ERROR python setup.py bdist_wheel did not run successfully
I've been having some trouble when trying to install certain packages on my live version of my project and realized its because its running version 3.7 instead of my up to date version 3.10 on Windows 10.
Wheels and setup are both up to date.

When I try to pip install -r requirements.txt I get a number of errors which I'm having no luck in fixing.

installing mysql seems to be the reason for these errors appearing.

ERROR1:
python setup.py bdist_wheel did not run successfully.

ERROR2:
Running setup.py install for mysqlclient did not run successfully.

ERROR3:
error: command '/opt/rh/gcc-toolset-9/root/bin/gcc' failed: No such file or directory
error: legacy-install-failure


问:
Python Pandas 1.5.x takes too long to retrieve dict values, when the values are serieses using DatetimeIndex with TZ
This was not an issue prior to Pandas 1.5.x.

Last version working fast as expected: 1.4.4.

The below tests demonstrate a conversion of a dict to a dataframe (df = pd.DataFrame(dict)), however, the issue exists also when performing a simple value retrieval via print(dict.values()).

The dict used for testing is a simple one where the keys are integers 0-999, and the values are pandas serieses, where each series' index is a DatetimeIndex with a 'US/Eastern' TZ and each series' values are all zeros.

The cause of the slowness is the TZ.

Tested on both Python 3.10.x and 3.11.x.

Here are the test results:

```<code>import pandas as pd
from timeit import default_timer as timer

dict = {}
index = pd.date_range(start='2020-01-01', end='2020-12-31', freq='D')

for i in range(1000):
    dict[i] = pd.Series(0, index=index)

start = timer()
df = pd.DataFrame(dict)
print(f"Pandas > 1.4.4, no TZ: {timer() - start} seconds.")
</code>```

Pandas > 1.4.4, no TZ: 0.014551600441336632 seconds.

```<code>import pandas as pd
from timeit import default_timer as timer

dict = {}
index = pd.date_range(start='2020-01-01', end='2020-12-31', freq='D', tz='US/Eastern')

for i in range(1000):
    dict[i] = pd.Series(0, index=index)

start = timer()
df = pd.DataFrame(dict)
print(f"Pandas > 1.4.4, with TZ: {timer() - start} seconds.")
</code>```

Pandas > 1.4.4, with TZ: 28.93334749992937 seconds.

```<code>import pandas as pd
from timeit import default_timer as timer

dict = {}
index = pd.date_range(start='2020-01-01', end='2020-12-31', freq='D')

for i in range(1000):
    dict[i] = pd.Series(0, index=index)

start = timer()
df = pd.DataFrame(dict)
print(f"Pandas 1.4.4, no TZ: {timer() - start} seconds.")
</code>```

Pandas 1.4.4, no TZ: 0.023447500076144934 seconds.

```<code>import pandas as pd
from timeit import default_timer as timer

dict = {}
index = pd.date_range(start='2020-01-01', end='2020-12-31', freq='D', tz='US/Eastern')

for i in range(1000):
    dict[i] = pd.Series(0, index=index)

start = timer()
df = pd.DataFrame(dict)
print(f"Pandas 1.4.4, with TZ: {timer() - start} seconds.")
</code>```

Pandas 1.4.4, with TZ: 0.06350550008937716 seconds.

Body:
This was not an issue prior to Pandas 1.5.x.

Last version working fast as expected: 1.4.4.

The below tests demonstrate a conversion of a dict to a dataframe (df = pd.DataFrame(dict)), however, the issue exists also when performing a simple value retrieval via print(dict.values()).

The dict used for testing is a simple one where the keys are integers 0-999, and the values are pandas serieses, where each series' index is a DatetimeIndex with a 'US/Eastern' TZ and each series' values are all zeros.

The cause of the slowness is the TZ.

Tested on both Python 3.10.x and 3.11.x.

Here are the test results:

import pandas as pd
from timeit import default_timer as timer

dict = {}
index = pd.date_range(start='2020-01-01', end='2020-12-31', freq='D')

for i in range(1000):
    dict[i] = pd.Series(0, index=index)

start = timer()
df = pd.DataFrame(dict)
print(f"Pandas > 1.4.4, no TZ: {timer() - start} seconds.")

Pandas > 1.4.4, no TZ: 0.014551600441336632 seconds.

import pandas as pd
from timeit import default_timer as timer

dict = {}
index = pd.date_range(start='2020-01-01', end='2020-12-31', freq='D', tz='US/Eastern')

for i in range(1000):
    dict[i] = pd.Series(0, index=index)

start = timer()
df = pd.DataFrame(dict)
print(f"Pandas > 1.4.4, with TZ: {timer() - start} seconds.")

Pandas > 1.4.4, with TZ: 28.93334749992937 seconds.

import pandas as pd
from timeit import default_timer as timer

dict = {}
index = pd.date_range(start='2020-01-01', end='2020-12-31', freq='D')

for i in range(1000):
    dict[i] = pd.Series(0, index=index)

start = timer()
df = pd.DataFrame(dict)
print(f"Pandas 1.4.4, no TZ: {timer() - start} seconds.")

Pandas 1.4.4, no TZ: 0.023447500076144934 seconds.

import pandas as pd
from timeit import default_timer as timer

dict = {}
index = pd.date_range(start='2020-01-01', end='2020-12-31', freq='D', tz='US/Eastern')

for i in range(1000):
    dict[i] = pd.Series(0, index=index)

start = timer()
df = pd.DataFrame(dict)
print(f"Pandas 1.4.4, with TZ: {timer() - start} seconds.")

Pandas 1.4.4, with TZ: 0.06350550008937716 seconds.


问:
Shutil not copying files when run without idle
I am trying to do a very simple operation, I am trying to copy a png over to another directory from a choice on an input, with a desktop shortcut that runs the file

The code works perfectly in the shell, copies files no problem. but when I just double click on the file, the window pops up, and I enter the input, It does not do anything. The code straight up stops.
This is my code:

```<code>import shutil
import time

choice = int(input('''1. or  2.
'''))

if choice == 1:
    src = 'C:\\directory\\image.png'
    print("chosen 1!")

elif choice == 2:
    src = 'C:\\different directory\\image.png'
    print("chosen 2!")

dst = 'C:\\directory\\destination_image.png'

print("Trying to copy...")
shutil.copy2(src, dst)
print("File copied successfully.")
time.sleep(3)

</code>```

It never prints the "trying to copy..." piece of code

Body:
I am trying to do a very simple operation, I am trying to copy a png over to another directory from a choice on an input, with a desktop shortcut that runs the file

The code works perfectly in the shell, copies files no problem. but when I just double click on the file, the window pops up, and I enter the input, It does not do anything. The code straight up stops.
This is my code:

import shutil
import time

choice = int(input('''1. or  2.
'''))

if choice == 1:
    src = 'C:\\directory\\image.png'
    print("chosen 1!")

elif choice == 2:
    src = 'C:\\different directory\\image.png'
    print("chosen 2!")

dst = 'C:\\directory\\destination_image.png'

print("Trying to copy...")
shutil.copy2(src, dst)
print("File copied successfully.")
time.sleep(3)

It never prints the "trying to copy..." piece of code


问:
TextMeshPro not working - Need Help assignment due tomorrow
I need help solving these issues they all happened at once and havent changed anything?enter image description here

I have tried looking for a solution but there is no answer anywhere


问:
Multiple imports from other directory not working Python
I'm trying to import a single class from other directory, but the other class inside the directory are not automatically being imported.

This is the example of the main function

```<code>from dict.cad import Cad

if __name__ == '__main__':
   Cad()
</code>```

This are the other classes of the directory class that is been used in the class Cad

```<code>from a import A:
from b import B:
from c import C:

class Cad:
   def __init__(self):
       self.a = A()
       self.b = B()
       self.c = C()
</code>```

The problem is in the import from main, it says that the imports of the files a,b and c don't exist. I tried to use in the main the import from dict.a import A, but still the error that it does not exist the file a.
I also tried to change in the second function from .a import A, but it gave the same error in main and another error in the file cad.

Body:
I'm trying to import a single class from other directory, but the other class inside the directory are not automatically being imported.

This is the example of the main function

from dict.cad import Cad

if __name__ == '__main__':
   Cad()

This are the other classes of the directory class that is been used in the class Cad

from a import A:
from b import B:
from c import C:

class Cad:
   def __init__(self):
       self.a = A()
       self.b = B()
       self.c = C()

The problem is in the import from main, it says that the imports of the files a,b and c don't exist. I tried to use in the main the import from dict.a import A, but still the error that it does not exist the file a.
I also tried to change in the second function from .a import A, but it gave the same error in main and another error in the file cad.


问:
RStudio find in files a complete line
I have a series of roxygen commands that have not been completed in my package which I want to remove every instance of their occurrence.

One such example is the line #' @return. I want to remove all cases using the find and replace functionality with regular expressions to not include instances where a value is given.

I have tried using #' @return$ as the regular expression and #' @return\n but both return 'No results found'.

Title: RStudio find in files a complete line


问:
Trying to read the contents of a directory with fs-extra
I am trying to map the max value of a slider to the number of pictures in a directory. I am trying to do that using fs-extra but I am not sure what I am doing wrong. I am getting errors when trying to import the function. I cannot download it through the terminal and I am working in a .html file.

Here is the code I am using.

```<code><script type="module">
import fs from './node-fs-extra/lib/output-file/index.js';

// Use the fs module to read the contents of a directory
const directoryPath = '/path/to/directory';
const files = fs.readdirSync(directoryPath);
const imageFiles = files.filter(file => file.endsWith('.jpg') || file.endsWith('.png'));
const numImages = imageFiles.length;

// Set the maximum value of the slider to the number of images
const slider2 = document.getElementById('slider');
slider2.setAttribute('max', numImages);
            </script>
</code>```


问:
Not getting value in input field on clicking button in jquery
Simple problem. I have id and a variable I want to concatenate. However when I click on edit button it shows id in input field but not showing correspondant department name in department input field. No errors are popping up either. What is wrong?  I have problem in this line. $('#depName' + departmentId).html();</p>
```<code><table width="100%" border="0" id="tblUpdate">
    <tr>
    <td>
          Department Id:
        <input name="txtDepUpdateId" readonly type="text" id="txtDepUpdateId"  />
</td>
  </tr>
  <tr>
    <td>
          Department Name:
        <input name="txtDepUpdateName" type="text" id="txtDepUpdateName"  />
</td>
  </tr>

  <tr>
    <td colspan="2">
  <button type="submit" class="btn btn-dark" id="btnUpdate">Update Data</button>
</td>
  </tr>
</table>
</code>```
```<code><script>
    var srN=0;
$(document).ready(function() {

    //post
    $('#btnSubmit').click(function() {
        var DepartmentName = $('#txtDepName').val();
        var obj = { "departmentName": DepartmentName };
        $.ajax({
            url: '/api/Department/InsertDepartment',
            type: "POST",
            'contentType': 'application/json',
            dataType: "json",
            data: JSON.stringify(obj),
            success: function(data) {
                alert(data.result);
                if (data.result == "Inserted Successfully") {
                    srN += 1;

                    $('#tblData').append("<tr><td>" + srN + "</td><td id='depName"+ data.objectData.id +"'>" + data.objectData.departmentName + "</td><td> <button  class='btn  btn-danger btnDelete' id='delData " + data.objectData.id + "'>Delete</button> <button class='btn  btn-warning btnEdit' id='btnEdit " + data.objectData.id + "'>Edit</button> </td></tr>")
                    $('#txtDepName').val('');
                    $('#txtDepName').focus();

                }
                else {
                    alert(data.result);
                }
            }
        });
    })

    //update
    $('#tblUpdate').hide();

    $(document).on('click', '.btnEdit', function() {
        var departmentId = $(this).attr('id');
        departmentId = departmentId.replace('btnEdit', '');
        var departmentName = $('#depName' + departmentId).html();
        $('#tblUpdate').show();
        $('#tblInsert').hide();

        $('#txtDepUpdateId').val(departmentId);
        $('#txtDepUpdateName').val(departmentName);
        console.log(departmentName);
    });

    //get
    $.ajax({
        url: '/api/Department/GetAllDepartment',
        type: 'GET',
        dataType: "json",
        success: function(data) {
            var trData = "";
            $.each(data, function(index, obj) {
                srN+=1;
                trData += "<tr><td>" + srN + "</td><td id='depName"+ obj.id +"'>" + obj.departmentName + "</td><td> <button  class='btn  btn-danger btnDelete' id='delData "+obj.id+"'>Delete</button> <button class='btn  btn-warning btnEdit' id='btnEdit "+obj.id+"'>Edit</button> </td></tr>"
                $('#tblData').html(trData);
            })
        }
    });

    });

</script>
</code>```

Body:
Simple problem. I have id and a variable I want to concatenate. However when I click on edit button it shows id in input field but not showing correspondant department name in department input field. No errors are popping up either. What is wrong?  I have problem in this line. $('#depName' + departmentId).html();

          Department Id:
        <input name="txtDepUpdateId" readonly type="text" id="txtDepUpdateId"  />

          Department Name:
        <input name="txtDepUpdateName" type="text" id="txtDepUpdateName"  />

  <button type="submit" class="btn btn-dark" id="btnUpdate">Update Data</button>


问:
How to list user as file owner when user belongs to group on Windows 7/Windows Server 2008
When our IT person added my Domain User Account to a Group Account, files which I created listed Group Account Name as Owner instead of my User Account Name. Is there a way to attach user to file ownership even if the user is in a group?</p>

ContentLicense: CC BY-SA 3.0


问:
how to add alert into a trading strategy buy and sell actions in alert
I'm trying to figure out how to add an alert for "buy" and "sell" on my strategy script. I want to be able to select buy or sell in the alert window. I need to use the message area to send a message to cornix bot. So I can't use the message area in the alert window. Is there a way I can input the alerts in the Trading View alert popup to show buy and sell, and not use the message area? As shown in the picture?

enter image description here

note: I don't understand the pin script coding can you edit it for me Please

strategy code :

```<code>//@version=2

strategy("Heikin Ashi Strategy", shorttitle="HA Strategy", overlay=true)

res = input(title="Heikin Ashi Candle Time Frame", type=resolution, defval="60")
hshift = input(1,title="Heikin Ashi Candle Time Frame Shift")
res1 = input(title="Heikin Ashi EMA Time Frame", type=resolution, defval="180")
mhshift = input(0,title="Heikin Ashi EMA Time Frame Shift")
fama = input(1,"Heikin Ashi EMA Period")
test = input(1,"Heikin Ashi EMA Shift")
sloma = input(30,"Slow EMA Period")
slomas = input(1,"Slow EMA Shift")
logtransform = input(false, "Log Transform")
stoploss = input(true, "Stop Loss")
showplots = input(true, "Show Plots")

ha_t = heikinashi(tickerid)
ha_close = security(ha_t, res, logtransform ? log(close[hshift]) : close[hshift])
mha_close = security(ha_t, res1, logtransform ? log(close[mhshift]) : close[mhshift])

fma = ema(mha_close[test], fama)
sma = ema(ha_close[slomas], sloma)

plot(showplots ? (logtransform ? exp(fma) : fma) : na, title="MA", color=#0094ff, linewidth=2, style=line)
plot(showplots ? (logtransform ? exp(sma) : sma) : na, title="SMA", color=#ff6a00, linewidth=2, style=line)

golong = crossover(fma, sma)
goshort = crossunder(fma, sma)

strategy.entry("Buy", strategy.long, when=golong, stop=(stoploss ? high+syminfo.mintick : na))
strategy.entry("Sell", strategy.short, when=goshort, stop=(stoploss ? low-syminfo.mintick : na))
</code>```

i added this

```<code>alertcondition(condition=crossover(fma, sma) > close,
     message="long")

plot(series=cross)

alertcondition(condition=crossunder(fma, sma) > close,
     message="Short")

plot(series=cross)
</code>```

but nothing in alert
enter image description here

Body:
I'm trying to figure out how to add an alert for "buy" and "sell" on my strategy script. I want to be able to select buy or sell in the alert window. I need to use the message area to send a message to cornix bot. So I can't use the message area in the alert window. Is there a way I can input the alerts in the Trading View alert popup to show buy and sell, and not use the message area? As shown in the picture?

enter image description here

note: I don't understand the pin script coding can you edit it for me Please

strategy code :

//@version=2

strategy("Heikin Ashi Strategy", shorttitle="HA Strategy", overlay=true)

res = input(title="Heikin Ashi Candle Time Frame", type=resolution, defval="60")
hshift = input(1,title="Heikin Ashi Candle Time Frame Shift")
res1 = input(title="Heikin Ashi EMA Time Frame", type=resolution, defval="180")
mhshift = input(0,title="Heikin Ashi EMA Time Frame Shift")
fama = input(1,"Heikin Ashi EMA Period")
test = input(1,"Heikin Ashi EMA Shift")
sloma = input(30,"Slow EMA Period")
slomas = input(1,"Slow EMA Shift")
logtransform = input(false, "Log Transform")
stoploss = input(true, "Stop Loss")
showplots = input(true, "Show Plots")

ha_t = heikinashi(tickerid)
ha_close = security(ha_t, res, logtransform ? log(close[hshift]) : close[hshift])
mha_close = security(ha_t, res1, logtransform ? log(close[mhshift]) : close[mhshift])

fma = ema(mha_close[test], fama)
sma = ema(ha_close[slomas], sloma)

plot(showplots ? (logtransform ? exp(fma) : fma) : na, title="MA", color=#0094ff, linewidth=2, style=line)
plot(showplots ? (logtransform ? exp(sma) : sma) : na, title="SMA", color=#ff6a00, linewidth=2, style=line)

golong = crossover(fma, sma)
goshort = crossunder(fma, sma)

strategy.entry("Buy", strategy.long, when=golong, stop=(stoploss ? high+syminfo.mintick : na))
strategy.entry("Sell", strategy.short, when=goshort, stop=(stoploss ? low-syminfo.mintick : na))

i added this

alertcondition(condition=crossover(fma, sma) > close,
     message="long")

plot(series=cross)

alertcondition(condition=crossunder(fma, sma) > close,
     message="Short")

plot(series=cross)

but nothing in alert
enter image description here


问:
SvelteKit Node Adapter Build, __filename errors when getting files from firebase
I would like to ask if there is a solution to making a build work on a personal Linux server. When using Firebase storage to get media and display it, it prints out that __filename cannot be used withing the ES module. Which I of course tried to read into but found only fixes to other applications not something like svelte-kit builds. Any help or troubleshooting tips would be appreciated. Ive been trying to fix this issue for a while now.

I have tested my app on my local machine, running windows. Where it worked perfectly fine, but Linux seems to have a different way of dealing with stuff. So, when I ran it on my Linux server, it didn't work.


问:
Language Not Changing When Changed
So simply I got an app built based on flux store .. when I change the language simply the code included in config_ar does not change to config_en by example (so the products name, the banners, etc ..) does not change till I totally restart the app on the user side ..

I tried to do a thing where the app restarts when language change is captured but it didn't worked at .. Here is my main.dart, change_langauge_mixin.dart

main.dart `

```<code>   import 'dart:io' show HttpClient, SecurityContext;

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart' as foundation;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'package:responsive_builder/responsive_builder.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:universal_platform/universal_platform.dart';

import 'app.dart';

import 'common/config.dart';
import 'common/constants.dart';
import 'common/tools.dart';
import 'env.dart';
import 'modules/webview/index.dart';
import 'services/dependency_injection.dart';
import 'services/locale_service.dart';
import 'services/services.dart';

Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
  await Firebase.initializeApp();
  printLog('Handling a background message ${message.messageId}');
}

void main() {
  printLog('[main] ===== START main.dart =======');
  WidgetsFlutterBinding.ensureInitialized();
  Configurations().setConfigurationValues(environment);

  /// Fix issue android sdk version 22 can not run the app.
  if (UniversalPlatform.isAndroid) {
    SecurityContext.defaultContext
        .setTrustedCertificatesBytes(Uint8List.fromList(isrgRootX1.codeUnits));
  }
  runApp(
    RestartWidget(
      child: const MaterialApp(),
    ),
  );

  /// Support Webview (iframe) for Flutter Web. Requires this below header.
  /// Content-Security-Policy: frame-ancestors 'self' *.yourdomain.com
  registerWebViewWebImplementation();

  /// Update status bar color on Android
  if (isMobile) {
    SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
      statusBarColor: Colors.transparent,
      systemNavigationBarColor: Colors.black,
    ));
  }

  Provider.debugCheckInvalidValueType = null;
  var languageCode = kAdvanceConfig.defaultLanguage;

  LicenseRegistry.addLicense(() async* {
    final license = await rootBundle.loadString('google_fonts/OFL.txt');
    yield LicenseEntryWithLineBreaks(['google_fonts'], license);
  });
  FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
  runZonedGuarded(() async {
    if (!foundation.kIsWeb) {
      /// Enable network traffic logging.
      HttpClient.enableTimelineLogging = !foundation.kReleaseMode;

      /// Lock portrait mode.
      unawaited(SystemChrome.setPreferredOrientations(
          [DeviceOrientation.portraitUp]));
    }

    await GmsCheck().checkGmsAvailability(enableLog: foundation.kDebugMode);

    try {
      if (isMobile) {
        /// Init Firebase settings due to version 0.5.0+ requires to.
        /// Use await to prevent any usage until the initialization is completed.
        await Services().firebase.init();
        await Configurations().loadRemoteConfig();
      }
    } catch (e) {
      printLog(e);
      printLog(' Firebase init issue');
    }

    await DependencyInjection.inject();
    Services().setAppConfig(serverConfig);

    if (isMobile && kAdvanceConfig.autoDetectLanguage) {
      final language1 = injector<SharedPreferences>().getString('language');

      if (language1?.isEmpty ?? true) {
        languageCode = await LocaleService().getDeviceLanguage();
      } else {
        languageCode = language1.toString();
      }
    }

    if (serverConfig['type'] == 'vendorAdmin') {
      return runApp(Services()
          .getVendorAdminApp(languageCode: languageCode, isFromMV: false));
    }

    if (serverConfig['type'] == 'delivery') {
      return runApp(Services()
          .getDeliveryApp(languageCode: languageCode, isFromMV: false));
    }

    ResponsiveSizingConfig.instance.setCustomBreakpoints(
        const ScreenBreakpoints(desktop: 900, tablet: 600, watch: 100));
    runApp(App(languageCode: languageCode));
  }, printError);
}

class RestartWidget extends StatefulWidget {
  // ignore: prefer_const_constructors_in_immutables
  RestartWidget({required this.child});

  final Widget child;

  static void restartApp(BuildContext context) {
    context.findAncestorStateOfType<_RestartWidgetState>()?.restartApp();
  }

  @override
  // ignore: library_private_types_in_public_api
  _RestartWidgetState createState() => _RestartWidgetState();
}

class _RestartWidgetState extends State<RestartWidget> {
  Key key = UniqueKey();

  void restartApp() {
    setState(() {
      key = UniqueKey();
    });
  }

  @override
  Widget build(BuildContext context) {
    return KeyedSubtree(
      key: key,
      child: widget.child,
    );
  }
}
# ```

 `
```
<p>change_langauge_mixin.dart</p>
```import 'package:flutter/material.dart';
import 'package:inspireui/widgets/circle_button_text.dart';
import 'package:inspireui/widgets/radio_button.dart';
import 'package:provider/provider.dart';

import '../../common/config.dart';
import '../../main.dart';
import '../../models/index.dart';

mixin ChangeLanguage<T extends StatefulWidget> on State<T> {
  List<Map> get languages => getLanguages();

  AppModel get appModel => Provider.of<AppModel>(context, listen: false);

  void onTapChangeLanguage(Map langInfo) {
    appModel.changeLanguage(langInfo['code'], context);
    RestartWidget.restartApp(context);
  }

  void _showModel(context) {
    showModalBottomSheet(
      context: context,
      backgroundColor: Colors.transparent,
      builder: (context) {
        return Material(
          color: Colors.transparent,
          child: Container(
            decoration: const BoxDecoration(
              borderRadius: BorderRadius.only(
                topLeft: Radius.circular(15),
                topRight: Radius.circular(15),
              ),
              color: Colors.white,
            ),
            padding:
                const EdgeInsets.only(top: 10, bottom: 10, left: 16, right: 16),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisSize: MainAxisSize.min,
              children: [
                Align(
                  alignment: Alignment.centerRight,
                  child: GestureDetector(
                    onTap: () {
                      Navigator.of(context).pop();
                    },
                    child: Container(
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(18),
                        color: const Color(0xFF555555).withOpacity(0.1),
                      ),
                      child: const Padding(
                        padding: EdgeInsets.all(3.0),
                        child: Icon(Icons.close),
                      ),
                    ),
                  ),
                ),
                const Text(
                  'Change language',
                  style: TextStyle(
                    fontSize: 18,
                    fontWeight: FontWeight.w600,
                    color: Colors.black,
                  ),
                ),
                const Padding(
                  padding: EdgeInsets.only(top: 8, bottom: 16),
                  child: Text(
                    'Which language do you prefer?',
                    style: TextStyle(fontSize: 14),
                  ),
                ),
                Expanded(
                  child: ListView.builder(
                    key: const Key('changeLanguageList'),
                    itemCount: languages.length,
                    itemBuilder: (context, i) {
                      return GestureDetector(
                        key:
                            ValueKey('changeLanguageTo${languages[i]['text']}'),
                        onTap: () {
                          onTapChangeLanguage(languages[i]);
                          RestartWidget.restartApp(context);
                        },
                        child: Container(
                          color: Colors.white,
                          padding: const EdgeInsets.symmetric(vertical: 6),
                          child: Row(
                            children: [
                              Image.asset(
                                languages[i]['icon'],
                                width: 30,
                                height: 20,
                                fit: BoxFit.cover,
                              ),
                              Expanded(
                                child: Padding(
                                  padding: const EdgeInsets.only(left: 8.0),
                                  child: Text(
                                    languages[i]['text'],
                                    style: const TextStyle(
                                        fontSize: 16,
                                        fontWeight: FontWeight.w600),
                                  ),
                                ),
                              ),
                              RadioButton(
                                radius: 14,
                                isActive: languages[i]['code']
                                        .toString()
                                        .toLowerCase() ==
                                    appModel.langCode.toLowerCase(),
                              ),
                            ],
                          ),
                        ),
                      );
                    },
                  ),
                )
              ],
            ),
          ),
        );
      },
    );
  }

  Widget iconLanguage() {
    return Align(
      alignment: Alignment.topRight,
      child: SafeArea(
        child: Padding(
          padding: const EdgeInsets.only(right: 16.0, top: 16),
          child: GestureDetector(
            key: const Key('changeLanguageIconButton'),
            onTap: () => _showModel(context),
            child: Selector<AppModel, String>(
              selector: (_, model) => model.langCode,
              builder: (context, langCode, child) => CircleButtonText(
                langCode.toUpperCase(),
                radius: 16,
              ),
            ),
          ),
        ),
      ),
    );
  }
}
```

Title: Language Not Changing When Changed

Body:
So simply I got an app built based on flux store .. when I change the language simply the code included in config_ar does not change to config_en by example (so the products name, the banners, etc ..) does not change till I totally restart the app on the user side ..

I tried to do a thing where the app restarts when language change is captured but it didn't worked at .. Here is my main.dart, change_langauge_mixin.dart

main.dart `

   import 'dart:io' show HttpClient, SecurityContext;

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart' as foundation;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'package:responsive_builder/responsive_builder.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:universal_platform/universal_platform.dart';

import 'app.dart';

import 'common/config.dart';
import 'common/constants.dart';
import 'common/tools.dart';
import 'env.dart';
import 'modules/webview/index.dart';
import 'services/dependency_injection.dart';
import 'services/locale_service.dart';
import 'services/services.dart';

Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
  await Firebase.initializeApp();
  printLog('Handling a background message ${message.messageId}');
}

void main() {
  printLog('[main] ===== START main.dart =======');
  WidgetsFlutterBinding.ensureInitialized();
  Configurations().setConfigurationValues(environment);

  /// Fix issue android sdk version 22 can not run the app.
  if (UniversalPlatform.isAndroid) {
    SecurityContext.defaultContext
        .setTrustedCertificatesBytes(Uint8List.fromList(isrgRootX1.codeUnits));
  }
  runApp(
    RestartWidget(
      child: const MaterialApp(),
    ),
  );

  /// Support Webview (iframe) for Flutter Web. Requires this below header.
  /// Content-Security-Policy: frame-ancestors 'self' *.yourdomain.com
  registerWebViewWebImplementation();

  /// Update status bar color on Android
  if (isMobile) {
    SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
      statusBarColor: Colors.transparent,
      systemNavigationBarColor: Colors.black,
    ));
  }

  Provider.debugCheckInvalidValueType = null;
  var languageCode = kAdvanceConfig.defaultLanguage;

  LicenseRegistry.addLicense(() async* {
    final license = await rootBundle.loadString('google_fonts/OFL.txt');
    yield LicenseEntryWithLineBreaks(['google_fonts'], license);
  });
  FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
  runZonedGuarded(() async {
    if (!foundation.kIsWeb) {
      /// Enable network traffic logging.
      HttpClient.enableTimelineLogging = !foundation.kReleaseMode;

      /// Lock portrait mode.
      unawaited(SystemChrome.setPreferredOrientations(
          [DeviceOrientation.portraitUp]));
    }

    await GmsCheck().checkGmsAvailability(enableLog: foundation.kDebugMode);

    try {
      if (isMobile) {
        /// Init Firebase settings due to version 0.5.0+ requires to.
        /// Use await to prevent any usage until the initialization is completed.
        await Services().firebase.init();
        await Configurations().loadRemoteConfig();
      }
    } catch (e) {
      printLog(e);
      printLog(' Firebase init issue');
    }

    await DependencyInjection.inject();
    Services().setAppConfig(serverConfig);

    if (isMobile && kAdvanceConfig.autoDetectLanguage) {
      final language1 = injector<SharedPreferences>().getString('language');

      if (language1?.isEmpty ?? true) {
        languageCode = await LocaleService().getDeviceLanguage();
      } else {
        languageCode = language1.toString();
      }
    }

    if (serverConfig['type'] == 'vendorAdmin') {
      return runApp(Services()
          .getVendorAdminApp(languageCode: languageCode, isFromMV: false));
    }

    if (serverConfig['type'] == 'delivery') {
      return runApp(Services()
          .getDeliveryApp(languageCode: languageCode, isFromMV: false));
    }

    ResponsiveSizingConfig.instance.setCustomBreakpoints(
        const ScreenBreakpoints(desktop: 900, tablet: 600, watch: 100));
    runApp(App(languageCode: languageCode));
  }, printError);
}

class RestartWidget extends StatefulWidget {
  // ignore: prefer_const_constructors_in_immutables
  RestartWidget({required this.child});

  final Widget child;

  static void restartApp(BuildContext context) {
    context.findAncestorStateOfType<_RestartWidgetState>()?.restartApp();
  }

  @override
  // ignore: library_private_types_in_public_api
  _RestartWidgetState createState() => _RestartWidgetState();
}

class _RestartWidgetState extends State<RestartWidget> {
  Key key = UniqueKey();

  void restartApp() {
    setState(() {
      key = UniqueKey();
    });
  }

  @override
  Widget build(BuildContext context) {
    return KeyedSubtree(
      key: key,
      child: widget.child,
    );
  }
}
# ```

 `

change_langauge_mixin.dart

import 'package:flutter/material.dart';
import 'package:inspireui/widgets/circle_button_text.dart';
import 'package:inspireui/widgets/radio_button.dart';
import 'package:provider/provider.dart';

import '../../common/config.dart';
import '../../main.dart';
import '../../models/index.dart';

mixin ChangeLanguage<T extends StatefulWidget> on State<T> {
  List<Map> get languages => getLanguages();

  AppModel get appModel => Provider.of<AppModel>(context, listen: false);

  void onTapChangeLanguage(Map langInfo) {
    appModel.changeLanguage(langInfo['code'], context);
    RestartWidget.restartApp(context);
  }

  void _showModel(context) {
    showModalBottomSheet(
      context: context,
      backgroundColor: Colors.transparent,
      builder: (context) {
        return Material(
          color: Colors.transparent,
          child: Container(
            decoration: const BoxDecoration(
              borderRadius: BorderRadius.only(
                topLeft: Radius.circular(15),
                topRight: Radius.circular(15),
              ),
              color: Colors.white,
            ),
            padding:
                const EdgeInsets.only(top: 10, bottom: 10, left: 16, right: 16),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisSize: MainAxisSize.min,
              children: [
                Align(
                  alignment: Alignment.centerRight,
                  child: GestureDetector(
                    onTap: () {
                      Navigator.of(context).pop();
                    },
                    child: Container(
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(18),
                        color: const Color(0xFF555555).withOpacity(0.1),
                      ),
                      child: const Padding(
                        padding: EdgeInsets.all(3.0),
                        child: Icon(Icons.close),
                      ),
                    ),
                  ),
                ),
                const Text(
                  'Change language',
                  style: TextStyle(
                    fontSize: 18,
                    fontWeight: FontWeight.w600,
                    color: Colors.black,
                  ),
                ),
                const Padding(
                  padding: EdgeInsets.only(top: 8, bottom: 16),
                  child: Text(
                    'Which language do you prefer?',
                    style: TextStyle(fontSize: 14),
                  ),
                ),
                Expanded(
                  child: ListView.builder(
                    key: const Key('changeLanguageList'),
                    itemCount: languages.length,
                    itemBuilder: (context, i) {
                      return GestureDetector(
                        key:
                            ValueKey('changeLanguageTo${languages[i]['text']}'),
                        onTap: () {
                          onTapChangeLanguage(languages[i]);
                          RestartWidget.restartApp(context);
                        },
                        child: Container(
                          color: Colors.white,
                          padding: const EdgeInsets.symmetric(vertical: 6),
                          child: Row(
                            children: [
                              Image.asset(
                                languages[i]['icon'],
                                width: 30,
                                height: 20,
                                fit: BoxFit.cover,
                              ),
                              Expanded(
                                child: Padding(
                                  padding: const EdgeInsets.only(left: 8.0),
                                  child: Text(
                                    languages[i]['text'],
                                    style: const TextStyle(
                                        fontSize: 16,
                                        fontWeight: FontWeight.w600),
                                  ),
                                ),
                              ),
                              RadioButton(
                                radius: 14,
                                isActive: languages[i]['code']
                                        .toString()
                                        .toLowerCase() ==
                                    appModel.langCode.toLowerCase(),
                              ),
                            ],
                          ),
                        ),
                      );
                    },
                  ),
                )
              ],
            ),
          ),
        );
      },
    );
  }

  Widget iconLanguage() {
    return Align(
      alignment: Alignment.topRight,
      child: SafeArea(
        child: Padding(
          padding: const EdgeInsets.only(right: 16.0, top: 16),
          child: GestureDetector(
            key: const Key('changeLanguageIconButton'),
            onTap: () => _showModel(context),
            child: Selector<AppModel, String>(
              selector: (_, model) => model.langCode,
              builder: (context, langCode, child) => CircleButtonText(
                langCode.toUpperCase(),
                radius: 16,
              ),
            ),
          ),
        ),
      ),
    );
  }
}