问:
How to keep cookie when redirecting to different domain?
I am trying to make use of the Spotify API in an express.js application. I am running into some issues when following the authorization flow that can be found on the Spotify Api docs.

Spotify actually links this guide for authentication using express that I have mainly been following.

I have been able to successfully request and gain authorization with the following route:

app.get('/login', function(req, res) {

  var state = generateRandomString(16); // state parameter I provide Spotify API
  console.log('Original state (generated in /login): ', state);  // Original state (generated in /login):  UzLczCmKIKuzvIMP

  let options = {
    maxAge: 24 * 60 * 60 * 1000,
    sameSite: 'lax',
    overwrite: true,
  }

  res.cookie('spotify_auth_state', state, options);
  console.log(`Cookie before redirecting to Oauth: ${JSON.stringify(res.cookies)}`);   // Cookie before redirecting to Oauth: undefined

  // your application requests authorization
  var scope = 'user-read-private user-read-email';
  res.redirect('https://accounts.spotify.com/authorize?' +
    querystring.stringify({
      response_type: 'code',
      client_id: client_id,
      scope: scope,
      redirect_uri: redirect_uri,
      state: state
    }));
});
```
<p>Make note of the state variable that I am storing in the cookies as <code>spotify_auth_state</code>.</p>
<p>Once authorization has been granted, the Spotify API redirects the client to a link that you provide in the Developer portal. In this case I use <code>localhost:3000/request_tokens</code> to redirect the client to my route to request tokens to actually make use of the API.</p>
<p>This is the following route that the Spotify Oauth redirects to:</p>
<pre class="lang-js prettyprint-override"><code>app.get('/request_tokens', function(req, res) {
  console.log();
  // your application requests refresh and access tokens
  // after checking the state parameter

  var code = req.query.code || null;
  var state = req.query.state || null;
  var storedState = req.cookies ? req.cookies['spotify_auth_state'] : null;
  console.log(`State sent from spotify (should match): ${state}`);   // State sent from spotify (should match): UzLczCmKIKuzvIMP
  console.log(`Saved state (as cookie): ${storedState}`);  // Saved state (as cookie): undefined
  console.log(`Cookies when redirected to /request_tokens: ${JSON.stringify(req.cookies)}`);  // Cookies when redirected to /request_tokens: {}

  if (state === null || state !== storedState) {
    res.redirect('/#' +
      querystring.stringify({
        error: 'state_mismatch',
        state: state,
        stored_state: storedState
      }));
  } else {
</code>```

My issue is that I never get the `else' statement which is the goal. This is because, per Spotify documentation, my app should compare the state parameter that it received in the redirection URI with the state parameter it originally provided to Spotify in the authorization URI. If there is a mismatch then your app should reject the request and stop the authentication flow

The guide saves the 'state' variable in a cookie in the /login route when it is generated and then pulls it from the cookies once Spotify redirects to my /request_tokens route. However, when trying to find the cookie with I keep finding that it is undefined.

I assume it gets cleared because I am redirecting to a different domain (Spotify's authorization) so it is no longer there when Spotify redirects back to my local host. Can this 'state' variable be saved and checked via cookies or is there a better way to do this?

Body:
I am trying to make use of the Spotify API in an express.js application. I am running into some issues when following the authorization flow that can be found on the Spotify Api docs.

Spotify actually links this guide for authentication using express that I have mainly been following.

I have been able to successfully request and gain authorization with the following route:

app.get('/login', function(req, res) {

  var state = generateRandomString(16); // state parameter I provide Spotify API
  console.log('Original state (generated in /login): ', state);  // Original state (generated in /login):  UzLczCmKIKuzvIMP

  let options = {
    maxAge: 24 * 60 * 60 * 1000,
    sameSite: 'lax',
    overwrite: true,
  }

  res.cookie('spotify_auth_state', state, options);
  console.log(`Cookie before redirecting to Oauth: ${JSON.stringify(res.cookies)}`);   // Cookie before redirecting to Oauth: undefined

  // your application requests authorization
  var scope = 'user-read-private user-read-email';
  res.redirect('https://accounts.spotify.com/authorize?' +
    querystring.stringify({
      response_type: 'code',
      client_id: client_id,
      scope: scope,
      redirect_uri: redirect_uri,
      state: state
    }));
});

Make note of the state variable that I am storing in the cookies as spotify_auth_state.

Once authorization has been granted, the Spotify API redirects the client to a link that you provide in the Developer portal. In this case I use localhost:3000/request_tokens to redirect the client to my route to request tokens to actually make use of the API.

This is the following route that the Spotify Oauth redirects to:

app.get('/request_tokens', function(req, res) {
  console.log();
  // your application requests refresh and access tokens
  // after checking the state parameter

  var code = req.query.code || null;
  var state = req.query.state || null;
  var storedState = req.cookies ? req.cookies['spotify_auth_state'] : null;
  console.log(`State sent from spotify (should match): ${state}`);   // State sent from spotify (should match): UzLczCmKIKuzvIMP
  console.log(`Saved state (as cookie): ${storedState}`);  // Saved state (as cookie): undefined
  console.log(`Cookies when redirected to /request_tokens: ${JSON.stringify(req.cookies)}`);  // Cookies when redirected to /request_tokens: {}

  if (state === null || state !== storedState) {
    res.redirect('/#' +
      querystring.stringify({
        error: 'state_mismatch',
        state: state,
        stored_state: storedState
      }));
  } else {

My issue is that I never get the `else' statement which is the goal. This is because, per Spotify documentation, my app should compare the state parameter that it received in the redirection URI with the state parameter it originally provided to Spotify in the authorization URI. If there is a mismatch then your app should reject the request and stop the authentication flow

The guide saves the 'state' variable in a cookie in the /login route when it is generated and then pulls it from the cookies once Spotify redirects to my /request_tokens route. However, when trying to find the cookie with I keep finding that it is undefined.

I assume it gets cleared because I am redirecting to a different domain (Spotify's authorization) so it is no longer there when Spotify redirects back to my local host. Can this 'state' variable be saved and checked via cookies or is there a better way to do this?


来源: stackexchange

问:
How to do a reverse proxy for application behind port and directory?
Hi i've an application of that i hosted in docker, that is an openfire (xmpp) server , the openfire has several feature like web client and located in port localhost:7443/inverse for example

in my server that contain docker I've managed several application to use reverse proxy and working fine, but I cannot do on localhost:7443/inverse to https://webapp.localhost

Please give me some advice how to do it on apache2 webserver

ContentLicense: CC BY-SA 4.0


问:
Python, tkinter, multiprocessing Variable name not defined problem
```<code>from multiprocessing import Process
from tkinter import *

def th():
    p = Process(target=Button1)
    p.start()

class Button1:
    def __init__(self):
        btn1.config(state="disabled")
        btn1.update()

if __name__ == "__main__":
    root = Tk()
    root.title("test")
    root.resizable(False, False)

    btn1 = Button(root, text="시작", width=10, height=5, command=th)
    btn1.grid(row=0, column=0, sticky=N+E+W+S, padx=5, pady=5)

    root.mainloop()

</code>```

btn1.config(state="disabled")
NameError: name 'btn1' is not defined

I would appreciate it if you could tell me how to solve it.

I want the button to be disabled when pressed using multi processing.

Body:
from multiprocessing import Process
from tkinter import *

def th():
    p = Process(target=Button1)
    p.start()

class Button1:
    def __init__(self):
        btn1.config(state="disabled")
        btn1.update()

if __name__ == "__main__":
    root = Tk()
    root.title("test")
    root.resizable(False, False)

    btn1 = Button(root, text="시작", width=10, height=5, command=th)
    btn1.grid(row=0, column=0, sticky=N+E+W+S, padx=5, pady=5)

    root.mainloop()

btn1.config(state="disabled")
NameError: name 'btn1' is not defined

I would appreciate it if you could tell me how to solve it.

I want the button to be disabled when pressed using multi processing.


问:
Apache Cassandra and Spring - org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type
I am getting the ConverterNotFoundException when trying to save the data in Apache Cassandra using the Spring/Spring Boot application. The following is the complete exception stack trace.

```<code>Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [com.xxxxx.scenario.model.entity.EventMetadata] to type [com.datastax.oss.driver.api.core.data.UdtValue]
    at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:322) ~[spring-core-5.3.22.jar!/:5.3.22]
    at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:195) ~[spring-core-5.3.22.jar!/:5.3.22]
    at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:175) ~[spring-core-5.3.22.jar!/:5.3.22]
    at org.springframework.data.mapping.model.ConvertingPropertyAccessor.convertIfNecessary(ConvertingPropertyAccessor.java:121) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.mapping.model.ConvertingPropertyAccessor.getProperty(ConvertingPropertyAccessor.java:92) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.getWriteValue(MappingCassandraConverter.java:909) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.writeInternal(MappingCassandraConverter.java:654) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.write(MappingCassandraConverter.java:620) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.StatementFactory.insert(StatementFactory.java:307) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.CassandraTemplate.doInsert(CassandraTemplate.java:674) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.CassandraTemplate.insert(CassandraTemplate.java:664) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.repository.support.SimpleCassandraRepository.save(SimpleCassandraRepository.java:96) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at jdk.internal.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) ~[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:566) ~[na:na]
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:289) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:530) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:286) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:640) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:139) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at datadog.trace.instrumentation.springdata.RepositoryInterceptor.invoke(RepositoryInterceptor.java:41) ~[na:na]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at com.sun.proxy.$Proxy283.save(Unknown Source) ~[na:na]
    at com.xxxxxxx.scenario.service.ScenarioResultServiceImpl.saveProductPrice(ScenarioResultServiceImpl.java:94) ~[lib-product-price-scenario-1.1.125.jar!/:na]
    ... 61 common frames omitted
</code>```

I have the cassandra types defined as follows for the field but it's failing to save it in the cassandra tables.

```<code>    @CassandraType(
            type = CassandraType.Name.UDT,
            userTypeName = "scenario_calculated_values"
    )
    @Column("calculated_values")
    private ScenarioCalculatedValues calculatedValues;
</code>```

The following are the versions used in the application.
spring-core-5.3.22.jar!
spring-data-commons-2.7.2.jar!
spring-data-cassandra-3.4.6.jar!
DataStax Java Driver 4.14.1!

Here is the ScenarioCalcuatedValues class for reference:

```<code>import java.math.BigDecimal;

import org.springframework.data.cassandra.core.mapping.Column;
import org.springframework.data.cassandra.core.mapping.UserDefinedType;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@UserDefinedType("scenario_calculated_values")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ScenarioCalculatedValues {
    @Column("ltv")
    private BigDecimal ltv;
    @Column("combined_ltv")
    private BigDecimal combinedLtv;
    @Column("high_combined_ltv")
    private BigDecimal highCombinedLtv;
}
</code>```

Here is the EventMetaData class for reference:

```<code>import java.util.Set;

import org.springframework.data.cassandra.core.mapping.Column;
import org.springframework.data.cassandra.core.mapping.UserDefinedType;

import com.google.common.collect.Sets;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@UserDefinedType("metadata_response")
public class EventMetadata {
    @Column("event_source")
    private String eventSource;

    @Column("reasons")
    private Set<Reason> reasons = Sets.newHashSet();
}
</code>```

Body:
I am getting the ConverterNotFoundException when trying to save the data in Apache Cassandra using the Spring/Spring Boot application. The following is the complete exception stack trace.

Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [com.xxxxx.scenario.model.entity.EventMetadata] to type [com.datastax.oss.driver.api.core.data.UdtValue]
    at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:322) ~[spring-core-5.3.22.jar!/:5.3.22]
    at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:195) ~[spring-core-5.3.22.jar!/:5.3.22]
    at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:175) ~[spring-core-5.3.22.jar!/:5.3.22]
    at org.springframework.data.mapping.model.ConvertingPropertyAccessor.convertIfNecessary(ConvertingPropertyAccessor.java:121) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.mapping.model.ConvertingPropertyAccessor.getProperty(ConvertingPropertyAccessor.java:92) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.getWriteValue(MappingCassandraConverter.java:909) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.writeInternal(MappingCassandraConverter.java:654) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.write(MappingCassandraConverter.java:620) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.StatementFactory.insert(StatementFactory.java:307) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.CassandraTemplate.doInsert(CassandraTemplate.java:674) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.core.CassandraTemplate.insert(CassandraTemplate.java:664) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at org.springframework.data.cassandra.repository.support.SimpleCassandraRepository.save(SimpleCassandraRepository.java:96) ~[spring-data-cassandra-3.4.6.jar!/:3.4.6]
    at jdk.internal.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) ~[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:566) ~[na:na]
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:289) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:530) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:286) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:640) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:164) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:139) ~[spring-data-commons-2.7.2.jar!/:2.7.2]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at datadog.trace.instrumentation.springdata.RepositoryInterceptor.invoke(RepositoryInterceptor.java:41) ~[na:na]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.22.jar!/:5.3.22]
    at com.sun.proxy.$Proxy283.save(Unknown Source) ~[na:na]
    at com.xxxxxxx.scenario.service.ScenarioResultServiceImpl.saveProductPrice(ScenarioResultServiceImpl.java:94) ~[lib-product-price-scenario-1.1.125.jar!/:na]
    ... 61 common frames omitted

I have the cassandra types defined as follows for the field but it's failing to save it in the cassandra tables.

    @CassandraType(
            type = CassandraType.Name.UDT,
            userTypeName = "scenario_calculated_values"
    )
    @Column("calculated_values")
    private ScenarioCalculatedValues calculatedValues;

The following are the versions used in the application.
spring-core-5.3.22.jar!
spring-data-commons-2.7.2.jar!
spring-data-cassandra-3.4.6.jar!
DataStax Java Driver 4.14.1!

Here is the ScenarioCalcuatedValues class for reference:

import java.math.BigDecimal;

import org.springframework.data.cassandra.core.mapping.Column;
import org.springframework.data.cassandra.core.mapping.UserDefinedType;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@UserDefinedType("scenario_calculated_values")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ScenarioCalculatedValues {
    @Column("ltv")
    private BigDecimal ltv;
    @Column("combined_ltv")
    private BigDecimal combinedLtv;
    @Column("high_combined_ltv")
    private BigDecimal highCombinedLtv;
}

Here is the EventMetaData class for reference:

import java.util.Set;

import org.springframework.data.cassandra.core.mapping.Column;
import org.springframework.data.cassandra.core.mapping.UserDefinedType;

import com.google.common.collect.Sets;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@UserDefinedType("metadata_response")
public class EventMetadata {
    @Column("event_source")
    private String eventSource;

    @Column("reasons")
    private Set<Reason> reasons = Sets.newHashSet();
}


问:
App fails Typescript typecheck when rn-range-slider installed
I'm using rn-range-slider 2.2.2 with react-native 0.68.3

Here's my tsconfig.json file:

```<code>{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "lib": ["es2017"],
    "baseUrl": "./src",
    "allowJs": true,
    "jsx": "react-native",
    "noEmit": true,
    "isolatedModules": true,
    "strict": true,
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "experimentalDecorators": true
  }
}
</code>```

Typecheck fails as follows. My attempts to ask Typecheck to ignore this library have yet to be successful.

NOTE: Adding "skipLibCheck": true, has nothing to do with this. Contrary to numerous sources, this is for ignoring *.d.ts files and you will see my errors are from .tsx files.

NOTE ALSO: adding exclude: [ "node_modules" ] also has no effect. Under normal circumstances, and contrary to numerous sources, this is an unnecessary redundancy.

```<code>node_modules/rn-range-slider/hooks.tsx:141:9 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): LabelContainer', gave the following error.
    Type '{ onLayout: ({ nativeEvent }: any) => void; ref: MutableRefObject<LabelContainer | null>; renderContent: (value: number) => ReactNode; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<LabelContainer> & Readonly<{}> & Readonly<{ children?: ReactNode; }>'.
      Property 'onLayout' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<LabelContainer> & Readonly<{}> & Readonly<{ children?: ReactNode; }>'.
  Overload 2 of 2, '(props: {}, context: any): LabelContainer', gave the following error.
    Type '{ onLayout: ({ nativeEvent }: any) => void; ref: MutableRefObject<LabelContainer | null>; renderContent: (value: number) => ReactNode; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<LabelContainer> & Readonly<{}> & Readonly<{ children?: ReactNode; }>'.
      Property 'onLayout' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<LabelContainer> & Readonly<{}> & Readonly<{ children?: ReactNode; }>'.

141         onLayout={handleLayout}
            ~~~~~~~~

node_modules/rn-range-slider/index.tsx:116:5 - error TS2349: This expression is not callable.
  Not all constituents of type '{ position: string; left: Value; right: Value; } | (() => void)' are callable.
    Type '{ position: string; left: Value; right: Value; }' has no call signatures.

116     updateSelectedRail();
        ~~~~~~~~~~~~~~~~~~

node_modules/rn-range-slider/index.tsx:260:13 - error TS2349: This expression is not callable.
  Not all constituents of type 'Element | ((thumbPositionInView: any, value: any) => void)' are callable.
    Type 'Element' has no call signatures.

260             labelUpdate(gestureStateRef.current.lastPosition, value);
                ~~~~~~~~~~~

node_modules/rn-range-slider/index.tsx:262:13 - error TS2349: This expression is not callable.
  Not all constituents of type 'Element | ((thumbPositionInView: any, value: any) => void)' are callable.
    Type 'Element' has no call signatures.

262             notchUpdate(gestureStateRef.current.lastPosition, value);
                ~~~~~~~~~~~

node_modules/rn-range-slider/index.tsx:263:13 - error TS2349: This expression is not callable.
  Not all constituents of type '{ position: string; left: Value; right: Value; } | (() => void)' are callable.
    Type '{ position: string; left: Value; right: Value; }' has no call signatures.

263             updateSelectedRail();
                ~~~~~~~~~~~~~~~~~~

node_modules/rn-range-slider/index.tsx:307:26 - error TS2322: Type '{ position: string; left: Value; right: Value; } | (() => void)' is not assignable to type 'false | RegisteredStyle<ViewStyle> | Value | AnimatedInterpolation<string | number> | WithAnimatedObject<ViewStyle> | WithAnimatedArray<...> | null | undefined'.
  Type '{ position: string; left: Animated.Value; right: Animated.Value; }' is not assignable to type 'false | RegisteredStyle<ViewStyle> | Value | AnimatedInterpolation<string | number> | WithAnimatedObject<ViewStyle> | WithAnimatedArray<...> | null | undefined'.
    Type '{ position: string; left: Animated.Value; right: Animated.Value; }' is not assignable to type 'WithAnimatedObject<ViewStyle>'.
      Types of property 'position' are incompatible.
        Type 'string' is not assignable to type '"absolute" | "relative" | Value | AnimatedInterpolation<string | number> | undefined'.

307           <Animated.View style={selectedRailStyle}>
                             ~~~~~

  node_modules/@types/react-native/index.d.ts:2621:5
    2621     style?: StyleProp<ViewStyle> | undefined;
             ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & AnimatedProps<ViewProps & RefAttributes<View>> & { children?: ReactNode; }'

node_modules/rn-range-slider/LabelContainer.tsx:10:14 - error TS7006: Parameter 'value' implicitly has an 'any' type.

10   setValue = value => {
                ~~~~~

node_modules/rn-range-slider/LabelContainer.tsx:15:13 - error TS2339: Property 'renderContent' does not exist on type 'Readonly<{}> & Readonly<{ children?: ReactNode; }>'.

15     const { renderContent, ...restProps } = this.props;
               ~~~~~~~~~~~~~

Found 8 errors in 3 files.

Errors  Files
     1  node_modules/rn-range-slider/hooks.tsx:141
     5  node_modules/rn-range-slider/index.tsx:116
     2  node_modules/rn-range-slider/LabelContainer.tsx:10
</code>```

Posted to issue in library https://github.com/githuboftigran/rn-range-slider/issues/141

Body:
I'm using rn-range-slider 2.2.2 with react-native 0.68.3

Here's my tsconfig.json file:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "lib": ["es2017"],
    "baseUrl": "./src",
    "allowJs": true,
    "jsx": "react-native",
    "noEmit": true,
    "isolatedModules": true,
    "strict": true,
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "experimentalDecorators": true
  }
}

Typecheck fails as follows. My attempts to ask Typecheck to ignore this library have yet to be successful.

NOTE: Adding "skipLibCheck": true, has nothing to do with this. Contrary to numerous sources, this is for ignoring *.d.ts files and you will see my errors are from .tsx files.

NOTE ALSO: adding exclude: [ "node_modules" ] also has no effect. Under normal circumstances, and contrary to numerous sources, this is an unnecessary redundancy.

node_modules/rn-range-slider/hooks.tsx:141:9 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: {} | Readonly<{}>): LabelContainer', gave the following error.
    Type '{ onLayout: ({ nativeEvent }: any) => void; ref: MutableRefObject<LabelContainer | null>; renderContent: (value: number) => ReactNode; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<LabelContainer> & Readonly<{}> & Readonly<{ children?: ReactNode; }>'.
      Property 'onLayout' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<LabelContainer> & Readonly<{}> & Readonly<{ children?: ReactNode; }>'.
  Overload 2 of 2, '(props: {}, context: any): LabelContainer', gave the following error.
    Type '{ onLayout: ({ nativeEvent }: any) => void; ref: MutableRefObject<LabelContainer | null>; renderContent: (value: number) => ReactNode; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<LabelContainer> & Readonly<{}> & Readonly<{ children?: ReactNode; }>'.
      Property 'onLayout' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<LabelContainer> & Readonly<{}> & Readonly<{ children?: ReactNode; }>'.

141         onLayout={handleLayout}
            ~~~~~~~~

node_modules/rn-range-slider/index.tsx:116:5 - error TS2349: This expression is not callable.
  Not all constituents of type '{ position: string; left: Value; right: Value; } | (() => void)' are callable.
    Type '{ position: string; left: Value; right: Value; }' has no call signatures.

116     updateSelectedRail();
        ~~~~~~~~~~~~~~~~~~

node_modules/rn-range-slider/index.tsx:260:13 - error TS2349: This expression is not callable.
  Not all constituents of type 'Element | ((thumbPositionInView: any, value: any) => void)' are callable.
    Type 'Element' has no call signatures.

260             labelUpdate(gestureStateRef.current.lastPosition, value);
                ~~~~~~~~~~~

node_modules/rn-range-slider/index.tsx:262:13 - error TS2349: This expression is not callable.
  Not all constituents of type 'Element | ((thumbPositionInView: any, value: any) => void)' are callable.
    Type 'Element' has no call signatures.

262             notchUpdate(gestureStateRef.current.lastPosition, value);
                ~~~~~~~~~~~

node_modules/rn-range-slider/index.tsx:263:13 - error TS2349: This expression is not callable.
  Not all constituents of type '{ position: string; left: Value; right: Value; } | (() => void)' are callable.
    Type '{ position: string; left: Value; right: Value; }' has no call signatures.

263             updateSelectedRail();
                ~~~~~~~~~~~~~~~~~~

node_modules/rn-range-slider/index.tsx:307:26 - error TS2322: Type '{ position: string; left: Value; right: Value; } | (() => void)' is not assignable to type 'false | RegisteredStyle<ViewStyle> | Value | AnimatedInterpolation<string | number> | WithAnimatedObject<ViewStyle> | WithAnimatedArray<...> | null | undefined'.
  Type '{ position: string; left: Animated.Value; right: Animated.Value; }' is not assignable to type 'false | RegisteredStyle<ViewStyle> | Value | AnimatedInterpolation<string | number> | WithAnimatedObject<ViewStyle> | WithAnimatedArray<...> | null | undefined'.
    Type '{ position: string; left: Animated.Value; right: Animated.Value; }' is not assignable to type 'WithAnimatedObject<ViewStyle>'.
      Types of property 'position' are incompatible.
        Type 'string' is not assignable to type '"absolute" | "relative" | Value | AnimatedInterpolation<string | number> | undefined'.

307           <Animated.View style={selectedRailStyle}>
                             ~~~~~

  node_modules/@types/react-native/index.d.ts:2621:5
    2621     style?: StyleProp<ViewStyle> | undefined;
             ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & AnimatedProps<ViewProps & RefAttributes<View>> & { children?: ReactNode; }'

node_modules/rn-range-slider/LabelContainer.tsx:10:14 - error TS7006: Parameter 'value' implicitly has an 'any' type.

10   setValue = value => {
                ~~~~~

node_modules/rn-range-slider/LabelContainer.tsx:15:13 - error TS2339: Property 'renderContent' does not exist on type 'Readonly<{}> & Readonly<{ children?: ReactNode; }>'.

15     const { renderContent, ...restProps } = this.props;
               ~~~~~~~~~~~~~

Found 8 errors in 3 files.

Errors  Files
     1  node_modules/rn-range-slider/hooks.tsx:141
     5  node_modules/rn-range-slider/index.tsx:116
     2  node_modules/rn-range-slider/LabelContainer.tsx:10

Posted to issue in library https://github.com/githuboftigran/rn-range-slider/issues/141


问:
Combo box can't find date if month is < 12
A column is a list of Dates in dd/mm/yyyy format.
I populate a combo box with the column
I select a date and pass it to a variable.
I want to select the date chosen in the list and populate a number of text boxes on userform with values in the dates row.
If the dates day is less than 12 i.e  11/3/2022 it errors. If the day is greater than 12 it finds the cell.
rowplace = cmbDate.Value

```<code>' Format(rowplace, "dd/mm/yyyy")

Columns("A:A").Select
Selection.Find(What:=rowplace, After:=ActiveCell, LookIn:=xlFormulas2 _
    , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate
</code>```

I reverts back to mm/dd/yyyy somewhere  and I nee to know how to change it. I have tried formatting the variable.
Any suggestions ?

I tried changing the format of the combo box
I tried changing the format of the variable
it seem to revert to mm/dd/yyyy in the Find What part

Body:
A column is a list of Dates in dd/mm/yyyy format.
I populate a combo box with the column
I select a date and pass it to a variable.
I want to select the date chosen in the list and populate a number of text boxes on userform with values in the dates row.
If the dates day is less than 12 i.e  11/3/2022 it errors. If the day is greater than 12 it finds the cell.
rowplace = cmbDate.Value

' Format(rowplace, "dd/mm/yyyy")

Columns("A:A").Select
Selection.Find(What:=rowplace, After:=ActiveCell, LookIn:=xlFormulas2 _
    , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

I reverts back to mm/dd/yyyy somewhere  and I nee to know how to change it. I have tried formatting the variable.
Any suggestions ?

I tried changing the format of the combo box
I tried changing the format of the variable
it seem to revert to mm/dd/yyyy in the Find What part


问:
expand looping a href inside div jquery javascript
I'm struggling with expanding each a href inside a div tag in a loop state. i want each a href to expand and hide dynamically on click event.

Here is what I have:

```<code> jQuery(document).ready(function($){
                $("#author_bio_wrap_toggle").click(function($)
                {
                    $("#author_bio_wrap").slideToggle( "slow");

                });
            });

<div class="divTable">
            <div class="bs-example">
                    <div  class="list-group">
                    <a href="#" class="list-group-item list-group-item-action active">
                        <i class="fa fa-home gihombing"></i> List Template Expertisi
                    </a>
                ';

                while ($rr = $rh->fetchRow())

                {

$html .='
                        <a href="#"   id="author_bio_wrap_toggle" class="list-group-item list-group-item-action">
                            <div  class="d-flex w-100 justify-content-between">
                                <h4>'.$rr['nmpasien'].'</h4>
                                <small>1 hari lalu </small>
                            </div>
                            <p>No MR : '.$rr['ps_mrn'].' , Tindakan : '.$rr['jnisdiit'].'</p>
                            <div id="author_bio_wrap" style="display: none;">
                            <input type="button" class="button111" id="soundOffbutton"  name="soundOffbutton" value="Isi Hasil"   style="width:100px; height:30px; " onclick="silent();" >
                            <input type="button" class="button111" id="soundOffbutton"  name="soundOffbutton" value="Re-Schedule"   style="width:100px; height:30px; " onclick="silent();" >
                            </div>
                        </a>

        ';

                }

$html .='
            </div>
</code>```

thank you verymuch

Body:
I'm struggling with expanding each a href inside a div tag in a loop state. i want each a href to expand and hide dynamically on click event.

Here is what I have:

 jQuery(document).ready(function($){
                $("#author_bio_wrap_toggle").click(function($)
                {
                    $("#author_bio_wrap").slideToggle( "slow");

                });
            });

                         List Template Expertisi

                ';

                while ($rr = $rh->fetchRow())

                {

$html .='

'.$rr['nmpasien'].'

                                1 hari lalu

No MR : '.$rr['ps_mrn'].' , Tindakan : '.$rr['jnisdiit'].'

                            <input type="button" class="button111" id="soundOffbutton"  name="soundOffbutton" value="Isi Hasil"   style="width:100px; height:30px; " onclick="silent();" >
                            <input type="button" class="button111" id="soundOffbutton"  name="soundOffbutton" value="Re-Schedule"   style="width:100px; height:30px; " onclick="silent();" >

        ';

                }

$html .='

thank you verymuch


问:
How to connect Azure Cloud from local computer
I am new to azure, I am doing a mobile application project and I want to connect azure cloud from my local computer. I have created an API and I want to sync data to azure from a local computer. I used visual studio to write the API and I have put the API into the IIS server. It works in the IIS server, I was trying to sync data to Azure cloud. I used ios xcode to write the mobile application I don't know which services should i use in Azure to make it works, it can collect and send data to mobile too.

The service can let me use my own API to sync data to Azure Cloud, it also is able to send and collect data between mobile and Azure Cloud.


问:
What ways are there to do an individual hover on elements that were iterated in React?
I'm rendering elements with the map function in react, the problem is that when hovering, the effect is applied to all the elements and what I'm looking for is an individual effect for each card.

This is my code:

```<code>const Card = () => {

    const [isHovering, setIsHovering] = useState(false);

    const handleMouseOver = () => {
        setIsHovering(true);
    };

    const handleMouseOut = () => {
        setIsHovering(false);
    };

    return (
        <>
            {productsList.map((product) => (
            <div key={product.id}>
                <div className="relative mb-4" onMouseOver={handleMouseOver} onMouseOut={handleMouseOut}>
                    <img src={product.img} alt="product" className="w-fit h-fit jshover cursor-pointer" />
                    {isHovering ? <CardOptions /> : ""}
                </div>
                <div className="flex justify-center flex-col px-3">
                    <h3 className="captialize font-sans font-bold text-black mb-3">Adicolor Classics Joggers</h3>
                    <div className="flex justify-between ">
                        <span className="capitalize font-normal font-sans text-[#777777]">Dress</span>
                        <span className="font-sans font-bold">$63.85</span>
                    </div>
                </div>
            </div>
            ))}
        </>
    )
}
</code>```

I am iterating an external array of objects with the information of each card.

As seen in the image, I hover my mouse over a card and the "shop now" box appears on all cards.

What would be the best way to do it?

Without iteration of course it worked, but then using React is pointless.

Edit: [SOLVED] The state has to have the index of the iteration of the function. So the conditional rendering has to be conditioned on the index and not on a boolean value.

Like this:

```<code>const Card = () => {

const [isHovering, setIsHovering] = useState(-1);
const handleMouseOver = (item) => {
    setIsHovering(item);
};

const handleMouseOut = () => {
    setIsHovering(-1);
};

return (
    <>
        {productsList.map((product, index) => (
            <div key={product.id}>
                <div className="relative mb-4" onMouseOver={() => {
                    handleMouseOver(index);
                }} onMouseOut={handleMouseOut}>
                    <img src={product.img} alt="product" className="w-fit h-fit jshover cursor-pointer" />
                    {isHovering === index ? <CardOptions /> : ""}
                </div>
                <div className="flex justify-center flex-col px-3">
                    <h3 className="captialize font-sans font-bold text-black mb-3">{product.title}</h3>
                    <div className="flex justify-between ">
                        <span className="capitalize font-normal font-sans text-[#777777]">{product.category}</span>
                        <span className="font-sans font-bold">{product.price}</span>
                    </div>
                </div>
            </div>
        ))}
    </>
)
</code>```

Body:
I'm rendering elements with the map function in react, the problem is that when hovering, the effect is applied to all the elements and what I'm looking for is an individual effect for each card.

This is my code:

const Card = () => {

    const [isHovering, setIsHovering] = useState(false);

    const handleMouseOver = () => {
        setIsHovering(true);
    };

    const handleMouseOut = () => {
        setIsHovering(false);
    };

    return (
        <>
            {productsList.map((product) => (

                    {isHovering ? <CardOptions /> : ""}

Adicolor Classics Joggers

                        Dress
                        $63.85

            ))}
        </>
    )
}

I am iterating an external array of objects with the information of each card.

As seen in the image, I hover my mouse over a card and the "shop now" box appears on all cards.

What would be the best way to do it?

Without iteration of course it worked, but then using React is pointless.

Edit: [SOLVED] The state has to have the index of the iteration of the function. So the conditional rendering has to be conditioned on the index and not on a boolean value.

Like this:

const Card = () => {

const [isHovering, setIsHovering] = useState(-1);
const handleMouseOver = (item) => {
    setIsHovering(item);
};

const handleMouseOut = () => {
    setIsHovering(-1);
};

return (
    <>
        {productsList.map((product, index) => (

 {
                    handleMouseOver(index);
                }} onMouseOut={handleMouseOut}>

                    {isHovering === index ? <CardOptions /> : ""}

{product.title}

                        {product.category}
                        {product.price}

        ))}
    </>
)


问:
The max-workers parameter takes no effect on gradle parallel building
I would have liked to limit the number of cpu cores used during compilation by max-workers.

But I found that it doesn't work, it always uses up all my cpu cores.

Here is my command.

. /gradlew assembleDebug --parallel --max-workers=4
```
<p>Version.</p>
<pre class="lang-bash prettyprint-override"><code>$ . /gradlew --version

------------------------------------------------------------
Gradle 7.4
------------------------------------------------------------

Build time: 2022-02-08 09:58:38 UTC
Revision: f0d9291c04b90b59445041eaa75b2ee744162586

Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 11.0.11 (Ubuntu 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OS: Linux 5.15.74-1-pve amd64
</code>```

Body:
I would have liked to limit the number of cpu cores used during compilation by max-workers.

But I found that it doesn't work, it always uses up all my cpu cores.

Here is my command.

. /gradlew assembleDebug --parallel --max-workers=4

Version.

$ . /gradlew --version

------------------------------------------------------------
Gradle 7.4
------------------------------------------------------------

Build time: 2022-02-08 09:58:38 UTC
Revision: f0d9291c04b90b59445041eaa75b2ee744162586

Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 11.0.11 (Ubuntu 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OS: Linux 5.15.74-1-pve amd64


问:
How to know if an image dataset is learnable/trainable?
I did some research, most of the reponses only answered the question "How is the images get learned", and the answer is through learning hidden features. But I wonder how to determine if a set of images can be learned by a machine learning model, such as a DNN. I understand that the convolutional layers for the current DNN can learn the images and try to extract only useful feature, but is there any study showing a metrics or evaluation of the dataset itself? So that we can say after satisfying some condition, one dataset is learnable.

I tried to search for some papers aiming at this, but I did not find any useful answers for this question.


问:
Python Django settings.py Module Not Found Error (module is just local .py file)

Background info

Background Info can be found on my last post - Cannot import .py file into settings.py

Problem

When attempting to import a python file into settings.py I get an error

The code:

```<code>import test
Password = test.Password
</code>```

The Error:

```<code>[wsgi:error] [pid 3908:tid 1496]    import test\r
[wsgi:error] [pid 3908:tid 1496]  ModuleNotFoundError: No module named 'test'\r
</code>```

WSGIPythonPath  set

In my D:\Apache24\conf\httpd.conf I have the WSGIPythonPath line set:

```<code>WSGIPythonPath D:\PythonEnvs\myenv\Lib\site-packages
</code>```

However, test is just a python file I created titled test.py located in the same directory as settings.py. It does NOT exist in the folder site-packages like the other modules.

Note

I can import test into other python files. However, when I try and import test.py into settings.py I get an error 500 when restarting my Apache server and get the error above from the Problem section in my error logs.

Body:
Background info

Background Info can be found on my last post - Cannot import .py file into settings.py

Problem

When attempting to import a python file into settings.py I get an error

The code:

import test
Password = test.Password

The Error:

[wsgi:error] [pid 3908:tid 1496]    import test\r
[wsgi:error] [pid 3908:tid 1496]  ModuleNotFoundError: No module named 'test'\r

WSGIPythonPath  set

In my D:\Apache24\conf\httpd.conf I have the WSGIPythonPath line set:

WSGIPythonPath D:\PythonEnvs\myenv\Lib\site-packages

However, test is just a python file I created titled test.py located in the same directory as settings.py. It does NOT exist in the folder site-packages like the other modules.

Note

I can import test into other python files. However, when I try and import test.py into settings.py I get an error 500 when restarting my Apache server and get the error above from the Problem section in my error logs.


问:
Typescript - Including declarations in prod build
It sounds like including .d.ts files in the production build is the way to go (vs creating a separate @types/my-lib package).

For example

```<code>dist/
  index.js
  index.d.ts
</code>```

Adding to the prod payload feels irresponsible but it makes development easier so ok.

However, I'm in a situation where that library is using the type from another library that uses a separate @types/lib package. In my situation I'm using nodemailer, so for example:

```<code>// my-lib
import { someFunc } from "nodemailer"
type FooType = ReturnType< typeof someFunc >
</code>```

That means I have to move @types/nodemailer from "devDependencies" to "dependencies" otherwise I'm forced to install "@types/nodemailer"  when developing from a new library that uses nodemailer.

Am I missing something? Adding nodemailer's entire @type pkg in prod feels excessive.

Body:
It sounds like including .d.ts files in the production build is the way to go (vs creating a separate @types/my-lib package).

For example

dist/
  index.js
  index.d.ts

Adding to the prod payload feels irresponsible but it makes development easier so ok.

However, I'm in a situation where that library is using the type from another library that uses a separate @types/lib package. In my situation I'm using nodemailer, so for example:

// my-lib
import { someFunc } from "nodemailer"
type FooType = ReturnType< typeof someFunc >

That means I have to move @types/nodemailer from "devDependencies" to "dependencies" otherwise I'm forced to install "@types/nodemailer"  when developing from a new library that uses nodemailer.

Am I missing something? Adding nodemailer's entire @type pkg in prod feels excessive.


问:
Error when connecting to oracle database in pyspark
This is my code when run in pyspark env(version spark 3.1.2):

jdbcDF = spark.read \

```<code>.format("jdbc") \

.option("url", "jdbc:oracle:thin:@10.0.1.1:1521/sbank") \

.option("dbtable", "sa.a") \

.option("user", "g") \

.option("password", "zxc") \

.option("driver", "oracle.jdbc.driver.OracleDriver") \

.load()
</code>```

But shows the announcement below as:

```<code>Py4JJavaError                             Traceback (most recent call last)
/tmp/ipykernel_29/4076487584.py in <module>
----> 1 jdbcDF = spark.read \
      2     .format("jdbc") \
      3     .option("url", "jdbc:oracle:thin:@10.0.1.1:1521/sbank") \
      4     .option("dbtable", "sa.a") \
      5     .option("user", "g") \

/usr/local/spark/python/pyspark/sql/readwriter.py in load(self, path, format, schema, **options)
    208             return self._df(self._jreader.load(self._spark._sc._jvm.PythonUtils.toSeq(path)))
    209         else:
--> 210             return self._df(self._jreader.load())
    211
    212     def json(self, path, schema=None, primitivesAsString=None, prefersDecimal=None,

/usr/local/spark/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py in __call__(self, *args)
   1302
   1303         answer = self.gateway_client.send_command(command)
-> 1304         return_value = get_return_value(
   1305             answer, self.gateway_client, self.target_id, self.name)
   1306

/usr/local/spark/python/pyspark/sql/utils.py in deco(*a, **kw)
    109     def deco(*a, **kw):
    110         try:
--> 111             return f(*a, **kw)
    112         except py4j.protocol.Py4JJavaError as e:
    113             converted = convert_exception(e.java_exception)

/usr/local/spark/python/lib/py4j-0.10.9-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
    324             value = OUTPUT_CONVERTER[type](answer[2:], gateway_client)
    325             if answer[1] == REFERENCE_TYPE:
--> 326                 raise Py4JJavaError(
    327                     "An error occurred while calling {0}{1}{2}.\n".
    328                     format(target_id, ".", name), value)

Py4JJavaError: An error occurred while calling o137.load
</code>```

Can anyone help me to solve that? Thank you in advance.

I add ojdbc11.jar into jars forder of spark

Body:
This is my code when run in pyspark env(version spark 3.1.2):

jdbcDF = spark.read \

.format("jdbc") \

.option("url", "jdbc:oracle:thin:@10.0.1.1:1521/sbank") \

.option("dbtable", "sa.a") \

.option("user", "g") \

.option("password", "zxc") \

.option("driver", "oracle.jdbc.driver.OracleDriver") \

.load()

But shows the announcement below as:

Py4JJavaError                             Traceback (most recent call last)
/tmp/ipykernel_29/4076487584.py in <module>
----> 1 jdbcDF = spark.read \
      2     .format("jdbc") \
      3     .option("url", "jdbc:oracle:thin:@10.0.1.1:1521/sbank") \
      4     .option("dbtable", "sa.a") \
      5     .option("user", "g") \

/usr/local/spark/python/pyspark/sql/readwriter.py in load(self, path, format, schema, **options)
    208             return self._df(self._jreader.load(self._spark._sc._jvm.PythonUtils.toSeq(path)))
    209         else:
--> 210             return self._df(self._jreader.load())
    211
    212     def json(self, path, schema=None, primitivesAsString=None, prefersDecimal=None,

/usr/local/spark/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py in __call__(self, *args)
   1302
   1303         answer = self.gateway_client.send_command(command)
-> 1304         return_value = get_return_value(
   1305             answer, self.gateway_client, self.target_id, self.name)
   1306

/usr/local/spark/python/pyspark/sql/utils.py in deco(*a, **kw)
    109     def deco(*a, **kw):
    110         try:
--> 111             return f(*a, **kw)
    112         except py4j.protocol.Py4JJavaError as e:
    113             converted = convert_exception(e.java_exception)

/usr/local/spark/python/lib/py4j-0.10.9-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
    324             value = OUTPUT_CONVERTER[type](answer[2:], gateway_client)
    325             if answer[1] == REFERENCE_TYPE:
--> 326                 raise Py4JJavaError(
    327                     "An error occurred while calling {0}{1}{2}.\n".
    328                     format(target_id, ".", name), value)

Py4JJavaError: An error occurred while calling o137.load

Can anyone help me to solve that? Thank you in advance.

I add ojdbc11.jar into jars forder of spark


问:
CPU Info Not Showing On Roku BrightScript Profiler Tool
I need to check CPU usage(CPU consuption) on Roku brightScript Profiler Tool.

Once i clcik on cpu tab on tool, its showing No data matching found every time.

I have enterd all manifest entry as per documentation,

[https://developer.roku.com/en-gb/docs/developer-program/dev-tools/brightscript-profiler.md#manifest-entries]

```<code>title=CPU Usage POC
major_version=1
minor_version=0
build_version=0

mm_icon_focus_hd=pkg:/images/rsgde_mm_focus_hd.jpg

mm_icon_focus_sd=pkg:/images/rde_mm_focus_sd.png

splash_screen_sd=pkg:/images/rde_splash_sd.jpg

splash_screen_hd=pkg:/images/rsgde_splash_hd.jpg

splash_screen_fhd=pkg:/images/rde_splash_fhd.jpg

splash_color=#662D91
splash_min_time=1000

ui_resolutions = hd

rsg_version=1.2

run_as_process=1

bsprof_data_dest = Network
bsprof_enable = 1
bsprof_enable_lines = 1
bsprof_enable_mem = 1
bsprof_sample_ratio = 1.0
bsprof_pause_on_start = 0

supports_input_launch=1

</code>```

But still no matching found message i am getting.

Body:
I need to check CPU usage(CPU consuption) on Roku brightScript Profiler Tool.

Once i clcik on cpu tab on tool, its showing No data matching found every time.

I have enterd all manifest entry as per documentation,

[https://developer.roku.com/en-gb/docs/developer-program/dev-tools/brightscript-profiler.md#manifest-entries]

title=CPU Usage POC
major_version=1
minor_version=0
build_version=0

mm_icon_focus_hd=pkg:/images/rsgde_mm_focus_hd.jpg

mm_icon_focus_sd=pkg:/images/rde_mm_focus_sd.png

splash_screen_sd=pkg:/images/rde_splash_sd.jpg

splash_screen_hd=pkg:/images/rsgde_splash_hd.jpg

splash_screen_fhd=pkg:/images/rde_splash_fhd.jpg

splash_color=#662D91
splash_min_time=1000

ui_resolutions = hd

rsg_version=1.2

run_as_process=1

bsprof_data_dest = Network
bsprof_enable = 1
bsprof_enable_lines = 1
bsprof_enable_mem = 1
bsprof_sample_ratio = 1.0
bsprof_pause_on_start = 0

supports_input_launch=1

But still no matching found message i am getting.


问:
Background Image is showing multiple times
enter image description hereI am copying one image and pasting in some config location and same displaying using Clable in our application. When I browse image and save it. It is showing correctly. But when again I am trying to view the image is coming multiple time.
CLabel clabel=new CLabel(group, SWT.NONE) ;
clabel. SetLayoutData(new GridData(SWT.FILL, SWT. FULL, true, true, 10,60) ;

And during image reset I am using below code
Clabel. SetBound(7, 45,imgData.width, imgData.height);
Clabel. SetBackgoundImage (image) ;

enter image description here


问:
Hidden filed return null exception when I call a property of another user control (.ascx) from a user control page (.ascx)
I have calling a property from a user control, and it return me an exception -  object reference not set to an instance of an object

Below is part of my code

This is my property Max_Pocket_Value from a user control

```<code>Public Property Max_Pocket_Value_() As Integer
        Get
            Dim MAXIMUM_VALUE As Integer
            Try

                Dim MAXIMUM_VALUE1 As String = Me.hf_MaxPocketNumber.Value
                Integer.TryParse(Me.hf_MaxPocketNumber.Value, MAXIMUM_VALUE)
                Dim B As Integer = MAXIMUM_VALUE
                If MAXIMUM_VALUE < 0 Then
                    MAXIMUM_VALUE = -1
                End If
            Catch ex As Exception
                MsgBox("Can't load Web page" & vbCrLf & ex.Message)
            End Try

            Return MAXIMUM_VALUE

        End Get
        Set(max_Pocket_Number As Integer)
            hf_MaxPocketNumber.Value = max_Pocket_Number.ToString()
        End Set
    End Property
</code>```

I set the property value on Page_Init. dataPiece(0).Max_Pocket_ have value of : 9 during debug session

```<code>    Private Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init

        data_Grabber_()
        Me.Max_Pocket_Value_ = dataPiece(0).Max_Pocket_
    End Sub`
</code>```

I call the property on current ascx apge in page_load, and I did tried call the propery in page_init.It result me same exception

```<code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim pocketControl As New GridTableUserControl()
    Dim abc As Integer = pocketControl.Max_Pocket_Value_

End Sub
</code>```

The exception is catch on line below

```<code>Public Property Max_Pocket_Value_() As Integer
    Get
        Dim MAXIMUM_VALUE As Integer
        Try

            Dim MAXIMUM_VALUE1 As String = Me.hf_MaxPocketNumber.Value
   **here -->** Integer.TryParse(Me.hf_MaxPocketNumber.Value, MAXIMUM_VALUE)
            Dim B As Integer = MAXIMUM_VALUE
            If MAXIMUM_VALUE < 0 Then
                MAXIMUM_VALUE = -1
            End If
        Catch ex As Exception
            MsgBox("Can't load Web page" & vbCrLf & ex.Message)
        End Try

        Return MAXIMUM_VALUE

    End Get
    Set(max_Pocket_Number As Integer)
        hf_MaxPocketNumber.Value = max_Pocket_Number.ToString()
    End Set
End Property
</code>```

Is anyone know what is the issue? Would highly appreciated if I can find some idea here. Thanks!

Body:
I have calling a property from a user control, and it return me an exception -  object reference not set to an instance of an object

Below is part of my code

This is my property Max_Pocket_Value from a user control

Public Property Max_Pocket_Value_() As Integer
        Get
            Dim MAXIMUM_VALUE As Integer
            Try

                Dim MAXIMUM_VALUE1 As String = Me.hf_MaxPocketNumber.Value
                Integer.TryParse(Me.hf_MaxPocketNumber.Value, MAXIMUM_VALUE)
                Dim B As Integer = MAXIMUM_VALUE
                If MAXIMUM_VALUE < 0 Then
                    MAXIMUM_VALUE = -1
                End If
            Catch ex As Exception
                MsgBox("Can't load Web page" & vbCrLf & ex.Message)
            End Try

            Return MAXIMUM_VALUE

        End Get
        Set(max_Pocket_Number As Integer)
            hf_MaxPocketNumber.Value = max_Pocket_Number.ToString()
        End Set
    End Property

I set the property value on Page_Init. dataPiece(0).Max_Pocket_ have value of : 9 during debug session

    Private Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init

        data_Grabber_()
        Me.Max_Pocket_Value_ = dataPiece(0).Max_Pocket_
    End Sub`

I call the property on current ascx apge in page_load, and I did tried call the propery in page_init.It result me same exception

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim pocketControl As New GridTableUserControl()
    Dim abc As Integer = pocketControl.Max_Pocket_Value_

End Sub

The exception is catch on line below

Public Property Max_Pocket_Value_() As Integer
    Get
        Dim MAXIMUM_VALUE As Integer
        Try

            Dim MAXIMUM_VALUE1 As String = Me.hf_MaxPocketNumber.Value
   **here -->** Integer.TryParse(Me.hf_MaxPocketNumber.Value, MAXIMUM_VALUE)
            Dim B As Integer = MAXIMUM_VALUE
            If MAXIMUM_VALUE < 0 Then
                MAXIMUM_VALUE = -1
            End If
        Catch ex As Exception
            MsgBox("Can't load Web page" & vbCrLf & ex.Message)
        End Try

        Return MAXIMUM_VALUE

    End Get
    Set(max_Pocket_Number As Integer)
        hf_MaxPocketNumber.Value = max_Pocket_Number.ToString()
    End Set
End Property

Is anyone know what is the issue? Would highly appreciated if I can find some idea here. Thanks!


问:
Server data transfer from static folder to client
I have a server with a static folder that contains some images for the public to preview.

I use Nodejs Express to serve the static folder.

I have 1TB data transfer each month.

Let's say an image is 1MB in size.
So, if a user used an image's link to view it does my server upload the image to the user? and 1MB is consumed from the 1TB?

Or the user who has to download it?

For example, opening google images and a bunch of images is loaded on your screen, does google upload all these images?

I need some explanations, thank you in advance :)


问:
jquery datatables always remove last column after rendering finished
This is a frustrating problem for me, i have configured a table to use 5 column with the last column for buttons. However after the datatables finished rendering, it suddenly removed the last column from it.

This is the table:

```<code><table id="grid-data" class="table table-striped dataTable" width="100%">
    <thead>
       <tr>
          <th>Role Name</th>
          <th>Activity Name</th>
          <th>Start Date</th>
          <th>End Date</th>
          <th>Action</th>
       </tr>
    </thead>
  <tbody></tbody>
</table>
</code>```

This is the default view:

This is the datatables configuration:

```<code>$('#grid-data').DataTable({
    "language": {
        "emptyTable": '<i class="bi bi-table"></i><br>No Data Found',
        "paginate": {
            "previous": '<i class="fa fa-angle-left"></i>',
            "next": '<i class="fa fa-angle-right"></i>',
        },
        "searchPlaceholder": 'Search',
        "search": '<i class="bi bi-search"></i>',
    },
    'processing': true,
    'serverSide': true,
    'ordering': true,
    'autoWidth': false,
    'aLengthMenu': [[5, 10, 25, 50], [5, 10, 25, 50]],
    'iDisplayLength': 5,
    'ajax': {
        'url': "../Master/GetList",
        'type': "POST",
        'data': function (data) {
            //data.FilterGroup = $("#FilterGroup option:selected").val();
            return data;
        }
    },
    'columns': [
        { 'data': "roleName" },
        { 'data': "activityName" },
        {
            'data': "startDate",
            'render': function (dt) {
                return `<span>${moment(dt).format("DD/MM/YYYY")}</span>`
            }
        },
        {
            'data': "endDate",
            'render': function (dt) {
                return `<span>${moment(dt).format("DD/MM/YYYY")}</span>`
            }
        },
        {
            'data': null,
            'render': function (dt) {
                return `<a href="javascript:;" type="button" title="Edit" class="text-secondary editButton"><i class="bi bi-pencil-square"></i></a>`
            }
        }
    ],
    "columnDefs": [{
        "targets": -1,
        "visible": true,
    }],
    'initComplete': function (data) {
        console.log(data.aoColumns)
        console.log(data.aoColumns[4].sTitle)
    }
});

</code>```

This is the result after rendering:

See how the last column is missing? when i inspect it the last column was somehow removed from the html.

When trying to debug the cause, i find out that in the datatables data itself the column is still intact:

I've tried doing things like adding class all to the th element or setting individual width on the column but none of those worked.

What could be the cause for this?

Body:
This is a frustrating problem for me, i have configured a table to use 5 column with the last column for buttons. However after the datatables finished rendering, it suddenly removed the last column from it.

This is the table:

          Role Name
          Activity Name
          Start Date
          End Date
          Action

This is the default view:

This is the datatables configuration:

$('#grid-data').DataTable({
    "language": {
        "emptyTable": '
No Data Found',
        "paginate": {
            "previous": '',
            "next": '',
        },
        "searchPlaceholder": 'Search',
        "search": '',
    },
    'processing': true,
    'serverSide': true,
    'ordering': true,
    'autoWidth': false,
    'aLengthMenu': [[5, 10, 25, 50], [5, 10, 25, 50]],
    'iDisplayLength': 5,
    'ajax': {
        'url': "../Master/GetList",
        'type': "POST",
        'data': function (data) {
            //data.FilterGroup = $("#FilterGroup option:selected").val();
            return data;
        }
    },
    'columns': [
        { 'data': "roleName" },
        { 'data': "activityName" },
        {
            'data': "startDate",
            'render': function (dt) {
                return `<span>${moment(dt).format("DD/MM/YYYY")}</span>`
            }
        },
        {
            'data': "endDate",
            'render': function (dt) {
                return `<span>${moment(dt).format("DD/MM/YYYY")}</span>`
            }
        },
        {
            'data': null,
            'render': function (dt) {
                return `<a href="javascript:;" type="button" title="Edit" class="text-secondary editButton"><i class="bi bi-pencil-square"></i></a>`
            }
        }
    ],
    "columnDefs": [{
        "targets": -1,
        "visible": true,
    }],
    'initComplete': function (data) {
        console.log(data.aoColumns)
        console.log(data.aoColumns[4].sTitle)
    }
});

This is the result after rendering:

See how the last column is missing? when i inspect it the last column was somehow removed from the html.

When trying to debug the cause, i find out that in the datatables data itself the column is still intact:

I've tried doing things like adding class all to the th element or setting individual width on the column but none of those worked.

What could be the cause for this?


问:
How can I add padding to a TextClip caption in moviepy
I would like to know how I can add padding so that it does not touch the edges of the video.
This is my current code.

```<code>            text_clip = TextClip(text, size=[1080, 1920], fontsize=70,
                                 stroke_color='black', stroke_width=2, color='white',
                                 method='caption', font='Copper')
            text_clip = text_clip.set_start(t)
            text_clip = text_clip.set_pos(('center', 'top')).set_duration(AudioFileClip(f"assets/temp/{id}/mp3/{i}.mp3").duration)
            t += AudioFileClip(f"assets/temp/{id}/mp3/{i}.mp3").duration
            text_clips.append(text_clip)
</code>```

Also another issue I have is that it the 'set_pos' does not work

Body:
I would like to know how I can add padding so that it does not touch the edges of the video.
This is my current code.

            text_clip = TextClip(text, size=[1080, 1920], fontsize=70,
                                 stroke_color='black', stroke_width=2, color='white',
                                 method='caption', font='Copper')
            text_clip = text_clip.set_start(t)
            text_clip = text_clip.set_pos(('center', 'top')).set_duration(AudioFileClip(f"assets/temp/{id}/mp3/{i}.mp3").duration)
            t += AudioFileClip(f"assets/temp/{id}/mp3/{i}.mp3").duration
            text_clips.append(text_clip)

Also another issue I have is that it the 'set_pos' does not work


问:
GitHub action workflow not triggering
I have created a new YAML file and that flow not triggering. Whereas I have other workflows that are working as expected.

I want to assign a label on the project card moved from to-do to in progress.

Not Working flow:

name: Update Label on Project Card Move
on:
  project_card:
    types: [moved]

jobs:
  update_label:
    if: ${{ github.event.project_card.column_id == '192285912' }}
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - uses: actions/github-script@v6
        with:
          script: |
            // this gets the number at the end of the content URL, which should be the issue/PR number
            const issue_num = context.payload.project_card.content_url.split('/').pop()
            github.rest.issues.addLabels({
              issue_number: issue_num,
              owner: context.repo.owner,
              repo: context.repo.repo,
              name: ["in progress"]
            })
```

Title: GitHub action workflow not triggering


问:
How do I resolve "os-release rdepends on os-release-dev [dev-deps]"
I'm trying to add "perf" to my Yocto dev distribution and getting the following error:

```<code>ERROR: os-release-1.0-r0 do_package_qa: QA Issue: os-release rdepends on os-release-dev [dev-deps]
ERROR: os-release-1.0-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: Logfile of failure stored in: /workdir/build-XXXX-dev/tmp/work/all-XXXX-linux/os-release/1.0-r0/temp/log.do_package_qa.1073312
ERROR: Task (/workdir/layers/poky/meta/recipes-core/os-release/os-release.bb:do_package_qa) failed with exit code '1'
</code>```

I've tried adding dev-pkg and dbg-pkg using IMAGE_INSTALL:append in the top-level recipe as well as adding to EXTRA_IMAGE_FEATURES without any luck.

My current set of changes includes adding the following lines to local.conf.sample:

```<code>INHIBIT_PACKAGE_STRIP = "1"
PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
FILES:${PN} += "${debugsrcdir}/*"
FILES:${PN}-dev = "${debugsrcdir}/* ${includedir} ${libdir}"

</code>```

and the following lines added to my top-level recipe:

```<code>EXTRA_IMAGE_FEATURES += "debug-tweaks tools-profile dev-pkgs"
</code>```

I've read the description of the error here for " rdepends on <dev_packagename> [dev-deps]" which does explain
what's happening but not how to go about fixing it.

I believe the dependency is either being created automatically or by the following line
in bitbake.conf:

```<code>RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
</code>```

Does anyone have suggestions on how to resolve this?

Body:
I'm trying to add "perf" to my Yocto dev distribution and getting the following error:

ERROR: os-release-1.0-r0 do_package_qa: QA Issue: os-release rdepends on os-release-dev [dev-deps]
ERROR: os-release-1.0-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: Logfile of failure stored in: /workdir/build-XXXX-dev/tmp/work/all-XXXX-linux/os-release/1.0-r0/temp/log.do_package_qa.1073312
ERROR: Task (/workdir/layers/poky/meta/recipes-core/os-release/os-release.bb:do_package_qa) failed with exit code '1'

I've tried adding dev-pkg and dbg-pkg using IMAGE_INSTALL:append in the top-level recipe as well as adding to EXTRA_IMAGE_FEATURES without any luck.

My current set of changes includes adding the following lines to local.conf.sample:

INHIBIT_PACKAGE_STRIP = "1"
PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
FILES:${PN} += "${debugsrcdir}/*"
FILES:${PN}-dev = "${debugsrcdir}/* ${includedir} ${libdir}"

and the following lines added to my top-level recipe:

EXTRA_IMAGE_FEATURES += "debug-tweaks tools-profile dev-pkgs"

I've read the description of the error here for " rdepends on <dev_packagename> [dev-deps]" which does explain
what's happening but not how to go about fixing it.

I believe the dependency is either being created automatically or by the following line
in bitbake.conf:

RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"

Does anyone have suggestions on how to resolve this?


问:
WebView in react-native-webview: camera not working
```<code>import React from "react";
import { WebView } from "react-native-webview";
import { StyleSheet } from "react-native";

export default function HealthCheck({ route }) {
    return (
        <WebView
            style={styles.webViewContainer}
            source={{ uri: route.params.url }}
            originWhitelist={["*"]}
            allowsInlineMediaPlayback
            javaScriptEnabled
            scalesPageToFit
            mediaPlaybackRequiresUserAction={false}
            startInLoadingState
            javaScriptEnabledAndroid
        />
    );
}
</code>```

This is my code on the webview.

The link I am trying to access needs permission to access the camera, but the problem is that the allow button on the web is not appearing on the webview.

How can I enable the camera on the webview on android? I'm using expo BTW.

Body:
import React from "react";
import { WebView } from "react-native-webview";
import { StyleSheet } from "react-native";

export default function HealthCheck({ route }) {
    return (
        <WebView
            style={styles.webViewContainer}
            source={{ uri: route.params.url }}
            originWhitelist={["*"]}
            allowsInlineMediaPlayback
            javaScriptEnabled
            scalesPageToFit
            mediaPlaybackRequiresUserAction={false}
            startInLoadingState
            javaScriptEnabledAndroid
        />
    );
}

This is my code on the webview.

The link I am trying to access needs permission to access the camera, but the problem is that the allow button on the web is not appearing on the webview.

How can I enable the camera on the webview on android? I'm using expo BTW.


问:
Electron Builder Error: Cannot find module 'Sequelize'
I'm using vitejs and react and sequelize with sqlite3 to make my electron application work

When I'm in the dev environment, everything works fine.
When I build with electron-forge the application works very well.

But when I build with electron-builder I have this error

```<code>A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'Sequelize'
Require stack:
- /Applications/YourAppName.app/Contents/Resources/app.asar/dist-electron/main.js
-
at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
at n._resolveFilename (node:electron/js2c/browser_init:2:109416)
at Module._load (node:internal/modules/cjs/loader:811:27)
at f._load (node:electron/js2c/asar_bundle:2:13328)
at Module.require (node:internal/modules/cjs/loader:1035:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Applications/YourAppName.app/Contents/Resources/app.asar/dist-electron/main.js:78:292411)
at Module._compile (node:internal/modules/cjs/loader:1141:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
at Module.load (node:internal/modules/cjs/loader:1011:32)
</code>```

Body:
I'm using vitejs and react and sequelize with sqlite3 to make my electron application work

When I'm in the dev environment, everything works fine.
When I build with electron-forge the application works very well.

But when I build with electron-builder I have this error

A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'Sequelize'
Require stack:
- /Applications/YourAppName.app/Contents/Resources/app.asar/dist-electron/main.js
-
at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
at n._resolveFilename (node:electron/js2c/browser_init:2:109416)
at Module._load (node:internal/modules/cjs/loader:811:27)
at f._load (node:electron/js2c/asar_bundle:2:13328)
at Module.require (node:internal/modules/cjs/loader:1035:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Applications/YourAppName.app/Contents/Resources/app.asar/dist-electron/main.js:78:292411)
at Module._compile (node:internal/modules/cjs/loader:1141:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
at Module.load (node:internal/modules/cjs/loader:1011:32)


问:
How to generate Release compilation tasks in Gradle for one given flavor?
Suppose I have two dimessions of flavor:

Edition: Free/Buss

Region: Eu/Us

Together with the default Release/Debug, I now have a total of 8 product configurations.

FreeEuDebug;

FreeEuRelease;

FreeUsDebug;

FreeUsRelease;

BussEuDebug;

BussEuRelease;

BussUsDebug;

BussUsRelease;

By default, android's Gradle plugin generates the above 8 compiled tasks for me. it also generates the following categories that are considered.

assembleDebug(1,3,5,7)

assembleRelease(2,4,6,8)

assembeFree (1,2,3,4)

assembeBuss (5,6,7,8)

assembeEu (1,2,5,6)

assembeUs (3,4,7,8)

If I want to get the following classification.

assembleEuRelease(2,6);

assembleUsRelease(4,8);

assembleFreeRelease(2,4);

assembleBussRelease(6,8);

How do I change the configuration file?