问:
application with springboot closes connections to the database after 1 hour, how do I configure the connection time in a spring boot project?
I have an application that queries a lot of data and then inserts it into specific tables. Due to the fact that there are many records, the application is taking a long time to complete. The funny thing is that the times it has been executed, it always ends after 1 hour showing SpringApplicationShutdownHook, this It causes not all the records to be processed and many need to be added.

I leave some screenshots of the log , please help.

aplication starts at 16:08:14

shutdown message on log at 17:08:13

#Java8, #Springboot, #Postgree , #Oracle

I tried to review the configuration files, but I only found default hikari configuration with times but they are not 1 hour.

[aplication.properties]

```<code>logging.config=classpath:logback.xml
spring.config.location=D:/sise/dev/config.properties
postgre.jpa.show-sql=false
postgre.jpa.hibernate.ddl-auto=update
postgre.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
</code>```

log of database connection is closing after 1 hour:

```<code>2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-3 - Shutdown initiated...
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-3 - Shutdown completed.
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Shutdown initiated...
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Shutdown completed.
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated...
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed.
</code>```

[com.zaxxer.hikari.HikariConfig]

```<code>/*
 * Copyright (C) 2013, 2014 Brett Wooldridge
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.zaxxer.hikari;

import com.codahale.metrics.health.HealthCheckRegistry;
import com.zaxxer.hikari.metrics.MetricsTrackerFactory;
import com.zaxxer.hikari.util.PropertyElf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.security.AccessControlException;
import java.sql.Connection;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadLocalRandom;

import static com.zaxxer.hikari.util.UtilityElf.getNullIfEmpty;
import static com.zaxxer.hikari.util.UtilityElf.safeIsAssignableFrom;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;

@SuppressWarnings({"SameParameterValue"})
public class HikariConfig implements HikariConfigMXBean
{
   private static final Logger LOGGER = LoggerFactory.getLogger(HikariConfig.class);

   private static final char[] ID_CHARACTERS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
   private static final long CONNECTION_TIMEOUT = SECONDS.toMillis(30);
   private static final long VALIDATION_TIMEOUT = SECONDS.toMillis(5);
   private static final long SOFT_TIMEOUT_FLOOR = Long.getLong("com.zaxxer.hikari.timeoutMs.floor", 250L);
   private static final long IDLE_TIMEOUT = MINUTES.toMillis(10);
   private static final long MAX_LIFETIME = MINUTES.toMillis(30);
   private static final long DEFAULT_KEEPALIVE_TIME = 0L;
   private static final int DEFAULT_POOL_SIZE = 10;

   private static boolean unitTest = false;

   // Properties changeable at runtime through the HikariConfigMXBean
   //
   private volatile String catalog;
   private volatile long connectionTimeout;
   private volatile long validationTimeout;
   private volatile long idleTimeout;
   private volatile long leakDetectionThreshold;
   private volatile long maxLifetime;
   private volatile int maxPoolSize;
   private volatile int minIdle;
   private volatile String username;
   private volatile String password;

   // Properties NOT changeable at runtime
   //
   private long initializationFailTimeout;
   private String connectionInitSql;
   private String connectionTestQuery;
   private String dataSourceClassName;
   private String dataSourceJndiName;
   private String driverClassName;
   private String exceptionOverrideClassName;
   private String jdbcUrl;
   private String poolName;
   private String schema;
   private String transactionIsolationName;
   private boolean isAutoCommit;
   private boolean isReadOnly;
   private boolean isIsolateInternalQueries;
   private boolean isRegisterMbeans;
   private boolean isAllowPoolSuspension;
   private DataSource dataSource;
   private Properties dataSourceProperties;
   private ThreadFactory threadFactory;
   private ScheduledExecutorService scheduledExecutor;
   private MetricsTrackerFactory metricsTrackerFactory;
   private Object metricRegistry;
   private Object healthCheckRegistry;
   private Properties healthCheckProperties;

   private long keepaliveTime;

   private volatile boolean sealed;

   /**
    * Default constructor
    */
   public HikariConfig()
   {
      dataSourceProperties = new Properties();
      healthCheckProperties = new Properties();

      minIdle = -1;
      maxPoolSize = -1;
      maxLifetime = MAX_LIFETIME;
      connectionTimeout = CONNECTION_TIMEOUT;
      validationTimeout = VALIDATION_TIMEOUT;
      idleTimeout = IDLE_TIMEOUT;
      initializationFailTimeout = 1;
      isAutoCommit = true;
      keepaliveTime = DEFAULT_KEEPALIVE_TIME;

      String systemProp = System.getProperty("hikaricp.configurationFile");
      if (systemProp != null) {
         loadProperties(systemProp);
      }
   }

   /**
    * Construct a HikariConfig from the specified properties object.
    *
    * @param properties the name of the property file
    */
   public HikariConfig(Properties properties)
   {
      this();
      PropertyElf.setTargetFromProperties(this, properties);
   }

   /**
    * Construct a HikariConfig from the specified property file name.  <code>propertyFileName</code>
    * will first be treated as a path in the file-system, and if that fails the
    * Class.getResourceAsStream(propertyFileName) will be tried.
    *
    * @param propertyFileName the name of the property file
    */
   public HikariConfig(String propertyFileName)
   {
      this();

      loadProperties(propertyFileName);
   }

   // ***********************************************************************
   //                       HikariConfigMXBean methods
   // ***********************************************************************

   /** {@inheritDoc} */
   @Override
   public String getCatalog()
   {
      return catalog;
   }

   /** {@inheritDoc} */
   @Override
   public void setCatalog(String catalog)
   {
      this.catalog = catalog;
   }

   /** {@inheritDoc} */
   @Override
   public long getConnectionTimeout()
   {
      return connectionTimeout;
   }

   /** {@inheritDoc} */
   @Override
   public void setConnectionTimeout(long connectionTimeoutMs)
   {
      if (connectionTimeoutMs == 0) {
         this.connectionTimeout = Integer.MAX_VALUE;
      }
      else if (connectionTimeoutMs < SOFT_TIMEOUT_FLOOR) {
         throw new IllegalArgumentException("connectionTimeout cannot be less than " + SOFT_TIMEOUT_FLOOR + "ms");
      }
      else {
         this.connectionTimeout = connectionTimeoutMs;
      }
   }

   /** {@inheritDoc} */
   @Override
   public long getIdleTimeout()
   {
      return idleTimeout;
   }

   /** {@inheritDoc} */
   @Override
   public void setIdleTimeout(long idleTimeoutMs)
   {
      if (idleTimeoutMs < 0) {
         throw new IllegalArgumentException("idleTimeout cannot be negative");
      }
      this.idleTimeout = idleTimeoutMs;
   }

   /** {@inheritDoc} */
   @Override
   public long getLeakDetectionThreshold()
   {
      return leakDetectionThreshold;
   }

   /** {@inheritDoc} */
   @Override
   public void setLeakDetectionThreshold(long leakDetectionThresholdMs)
   {
      this.leakDetectionThreshold = leakDetectionThresholdMs;
   }

   /** {@inheritDoc} */
   @Override
   public long getMaxLifetime()
   {
      return maxLifetime;
   }

   /** {@inheritDoc} */
   @Override
   public void setMaxLifetime(long maxLifetimeMs)
   {
      this.maxLifetime = maxLifetimeMs;
   }

   /** {@inheritDoc} */
   @Override
   public int getMaximumPoolSize()
   {
      return maxPoolSize;
   }

   /** {@inheritDoc} */
   @Override
   public void setMaximumPoolSize(int maxPoolSize)
   {
      if (maxPoolSize < 1) {
         throw new IllegalArgumentException("maxPoolSize cannot be less than 1");
      }
      this.maxPoolSize = maxPoolSize;
   }

   /** {@inheritDoc} */
   @Override
   public int getMinimumIdle()
   {
      return minIdle;
   }

   /** {@inheritDoc} */
   @Override
   public void setMinimumIdle(int minIdle)
   {
      if (minIdle < 0) {
         throw new IllegalArgumentException("minimumIdle cannot be negative");
      }
      this.minIdle = minIdle;
   }

   /**
    * Get the default password to use for DataSource.getConnection(username, password) calls.
    * @return the password
    */
   public String getPassword()
   {
      return password;
   }

   /**
    * Set the default password to use for DataSource.getConnection(username, password) calls.
    * @param password the password
    */
   @Override
   public void setPassword(String password)
   {
      this.password = password;
   }

   /**
    * Get the default username used for DataSource.getConnection(username, password) calls.
    *
    * @return the username
    */
   public String getUsername()
   {
      return username;
   }

   /**
    * Set the default username used for DataSource.getConnection(username, password) calls.
    *
    * @param username the username
    */
   @Override
   public void setUsername(String username)
   {
      this.username = username;
   }

   /** {@inheritDoc} */
   @Override
   public long getValidationTimeout()
   {
      return validationTimeout;
   }

   /** {@inheritDoc} */
   @Override
   public void setValidationTimeout(long validationTimeoutMs)
   {
      if (validationTimeoutMs < SOFT_TIMEOUT_FLOOR) {
         throw new IllegalArgumentException("validationTimeout cannot be less than " + SOFT_TIMEOUT_FLOOR + "ms");
      }

      this.validationTimeout = validationTimeoutMs;
   }

</code>```

Body:
I have an application that queries a lot of data and then inserts it into specific tables. Due to the fact that there are many records, the application is taking a long time to complete. The funny thing is that the times it has been executed, it always ends after 1 hour showing SpringApplicationShutdownHook, this It causes not all the records to be processed and many need to be added.

I leave some screenshots of the log , please help.

aplication starts at 16:08:14

shutdown message on log at 17:08:13

#Java8, #Springboot, #Postgree , #Oracle

I tried to review the configuration files, but I only found default hikari configuration with times but they are not 1 hour.

[aplication.properties]

logging.config=classpath:logback.xml
spring.config.location=D:/sise/dev/config.properties
postgre.jpa.show-sql=false
postgre.jpa.hibernate.ddl-auto=update
postgre.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect

log of database connection is closing after 1 hour:

2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-3 - Shutdown initiated...
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-3 - Shutdown completed.
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Shutdown initiated...
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Shutdown completed.
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated...
2023-01-09 17:08:13 [SpringApplicationShutdownHook] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed.

[com.zaxxer.hikari.HikariConfig]

/*
 * Copyright (C) 2013, 2014 Brett Wooldridge
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.zaxxer.hikari;

import com.codahale.metrics.health.HealthCheckRegistry;
import com.zaxxer.hikari.metrics.MetricsTrackerFactory;
import com.zaxxer.hikari.util.PropertyElf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.security.AccessControlException;
import java.sql.Connection;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadLocalRandom;

import static com.zaxxer.hikari.util.UtilityElf.getNullIfEmpty;
import static com.zaxxer.hikari.util.UtilityElf.safeIsAssignableFrom;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;

@SuppressWarnings({"SameParameterValue"})
public class HikariConfig implements HikariConfigMXBean
{
   private static final Logger LOGGER = LoggerFactory.getLogger(HikariConfig.class);

   private static final char[] ID_CHARACTERS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
   private static final long CONNECTION_TIMEOUT = SECONDS.toMillis(30);
   private static final long VALIDATION_TIMEOUT = SECONDS.toMillis(5);
   private static final long SOFT_TIMEOUT_FLOOR = Long.getLong("com.zaxxer.hikari.timeoutMs.floor", 250L);
   private static final long IDLE_TIMEOUT = MINUTES.toMillis(10);
   private static final long MAX_LIFETIME = MINUTES.toMillis(30);
   private static final long DEFAULT_KEEPALIVE_TIME = 0L;
   private static final int DEFAULT_POOL_SIZE = 10;

   private static boolean unitTest = false;

   // Properties changeable at runtime through the HikariConfigMXBean
   //
   private volatile String catalog;
   private volatile long connectionTimeout;
   private volatile long validationTimeout;
   private volatile long idleTimeout;
   private volatile long leakDetectionThreshold;
   private volatile long maxLifetime;
   private volatile int maxPoolSize;
   private volatile int minIdle;
   private volatile String username;
   private volatile String password;

   // Properties NOT changeable at runtime
   //
   private long initializationFailTimeout;
   private String connectionInitSql;
   private String connectionTestQuery;
   private String dataSourceClassName;
   private String dataSourceJndiName;
   private String driverClassName;
   private String exceptionOverrideClassName;
   private String jdbcUrl;
   private String poolName;
   private String schema;
   private String transactionIsolationName;
   private boolean isAutoCommit;
   private boolean isReadOnly;
   private boolean isIsolateInternalQueries;
   private boolean isRegisterMbeans;
   private boolean isAllowPoolSuspension;
   private DataSource dataSource;
   private Properties dataSourceProperties;
   private ThreadFactory threadFactory;
   private ScheduledExecutorService scheduledExecutor;
   private MetricsTrackerFactory metricsTrackerFactory;
   private Object metricRegistry;
   private Object healthCheckRegistry;
   private Properties healthCheckProperties;

   private long keepaliveTime;

   private volatile boolean sealed;

   /**
    * Default constructor
    */
   public HikariConfig()
   {
      dataSourceProperties = new Properties();
      healthCheckProperties = new Properties();

      minIdle = -1;
      maxPoolSize = -1;
      maxLifetime = MAX_LIFETIME;
      connectionTimeout = CONNECTION_TIMEOUT;
      validationTimeout = VALIDATION_TIMEOUT;
      idleTimeout = IDLE_TIMEOUT;
      initializationFailTimeout = 1;
      isAutoCommit = true;
      keepaliveTime = DEFAULT_KEEPALIVE_TIME;

      String systemProp = System.getProperty("hikaricp.configurationFile");
      if (systemProp != null) {
         loadProperties(systemProp);
      }
   }

   /**
    * Construct a HikariConfig from the specified properties object.
    *
    * @param properties the name of the property file
    */
   public HikariConfig(Properties properties)
   {
      this();
      PropertyElf.setTargetFromProperties(this, properties);
   }

   /**
    * Construct a HikariConfig from the specified property file name.  propertyFileName
    * will first be treated as a path in the file-system, and if that fails the
    * Class.getResourceAsStream(propertyFileName) will be tried.
    *
    * @param propertyFileName the name of the property file
    */
   public HikariConfig(String propertyFileName)
   {
      this();

      loadProperties(propertyFileName);
   }

   // ***********************************************************************
   //                       HikariConfigMXBean methods
   // ***********************************************************************

   /** {@inheritDoc} */
   @Override
   public String getCatalog()
   {
      return catalog;
   }

   /** {@inheritDoc} */
   @Override
   public void setCatalog(String catalog)
   {
      this.catalog = catalog;
   }

   /** {@inheritDoc} */
   @Override
   public long getConnectionTimeout()
   {
      return connectionTimeout;
   }

   /** {@inheritDoc} */
   @Override
   public void setConnectionTimeout(long connectionTimeoutMs)
   {
      if (connectionTimeoutMs == 0) {
         this.connectionTimeout = Integer.MAX_VALUE;
      }
      else if (connectionTimeoutMs < SOFT_TIMEOUT_FLOOR) {
         throw new IllegalArgumentException("connectionTimeout cannot be less than " + SOFT_TIMEOUT_FLOOR + "ms");
      }
      else {
         this.connectionTimeout = connectionTimeoutMs;
      }
   }

   /** {@inheritDoc} */
   @Override
   public long getIdleTimeout()
   {
      return idleTimeout;
   }

   /** {@inheritDoc} */
   @Override
   public void setIdleTimeout(long idleTimeoutMs)
   {
      if (idleTimeoutMs < 0) {
         throw new IllegalArgumentException("idleTimeout cannot be negative");
      }
      this.idleTimeout = idleTimeoutMs;
   }

   /** {@inheritDoc} */
   @Override
   public long getLeakDetectionThreshold()
   {
      return leakDetectionThreshold;
   }

   /** {@inheritDoc} */
   @Override
   public void setLeakDetectionThreshold(long leakDetectionThresholdMs)
   {
      this.leakDetectionThreshold = leakDetectionThresholdMs;
   }

   /** {@inheritDoc} */
   @Override
   public long getMaxLifetime()
   {
      return maxLifetime;
   }

   /** {@inheritDoc} */
   @Override
   public void setMaxLifetime(long maxLifetimeMs)
   {
      this.maxLifetime = maxLifetimeMs;
   }

   /** {@inheritDoc} */
   @Override
   public int getMaximumPoolSize()
   {
      return maxPoolSize;
   }

   /** {@inheritDoc} */
   @Override
   public void setMaximumPoolSize(int maxPoolSize)
   {
      if (maxPoolSize < 1) {
         throw new IllegalArgumentException("maxPoolSize cannot be less than 1");
      }
      this.maxPoolSize = maxPoolSize;
   }

   /** {@inheritDoc} */
   @Override
   public int getMinimumIdle()
   {
      return minIdle;
   }

   /** {@inheritDoc} */
   @Override
   public void setMinimumIdle(int minIdle)
   {
      if (minIdle < 0) {
         throw new IllegalArgumentException("minimumIdle cannot be negative");
      }
      this.minIdle = minIdle;
   }

   /**
    * Get the default password to use for DataSource.getConnection(username, password) calls.
    * @return the password
    */
   public String getPassword()
   {
      return password;
   }

   /**
    * Set the default password to use for DataSource.getConnection(username, password) calls.
    * @param password the password
    */
   @Override
   public void setPassword(String password)
   {
      this.password = password;
   }

   /**
    * Get the default username used for DataSource.getConnection(username, password) calls.
    *
    * @return the username
    */
   public String getUsername()
   {
      return username;
   }

   /**
    * Set the default username used for DataSource.getConnection(username, password) calls.
    *
    * @param username the username
    */
   @Override
   public void setUsername(String username)
   {
      this.username = username;
   }

   /** {@inheritDoc} */
   @Override
   public long getValidationTimeout()
   {
      return validationTimeout;
   }

   /** {@inheritDoc} */
   @Override
   public void setValidationTimeout(long validationTimeoutMs)
   {
      if (validationTimeoutMs < SOFT_TIMEOUT_FLOOR) {
         throw new IllegalArgumentException("validationTimeout cannot be less than " + SOFT_TIMEOUT_FLOOR + "ms");
      }

      this.validationTimeout = validationTimeoutMs;
   }


来源: stackexchange

问:
how to distribute data approximately in a table so that the counts remain close to the given value
I've a table TEST with 14.5 million records(columns id and created_date).The end goal is to split this table into approximately N number of splits. Let's assume 15 in this case, close to a million records. I'm using created_date to split this data.

I've come up with the below query.

```<code>with cte as (
    select created_date,
           ntile(15) over (order by created_date) as created_date_range
    from TEST
)
select created_date_range ,min(created_date),max(created_date),count(*)
from cte
group by created_date_range
order by created_date_range ;
</code>```

i get the desired result with the table being split into 15 equal parts. Here's an example of the date i get

created_date_range A
min(created_date)
min(created_date)
count(*)

1
2022-04-14 00:00:02
2022-05-02 22:56:40
946455

2
2022-05-02 22:56:40
2022-05-21 17:10:20
946455

3
2022-05-21 17:10:21
2022-06-15 20:16:47
946455

.

.

.

14
2022-10-24 18:55:22
2022-11-04 17:12:26
946454

15
2022-11-04 17:12:26
2022-11-18 06:01:08
946454

How can i avoid the same date data to be distributed into two different ranges?

Am i doing this correct? Is there another way of achieving the result?

I tried to use the ceil function but i had issues with group by statement.

ContentLicense: CC BY-SA 4.0

Body:
I've a table TEST with 14.5 million records(columns id and created_date).The end goal is to split this table into approximately N number of splits. Let's assume 15 in this case, close to a million records. I'm using created_date to split this data.

I've come up with the below query.

with cte as (
    select created_date,
           ntile(15) over (order by created_date) as created_date_range
    from TEST
)
select created_date_range ,min(created_date),max(created_date),count(*)
from cte
group by created_date_range
order by created_date_range ;

i get the desired result with the table being split into 15 equal parts. Here's an example of the date i get

created_date_range A
min(created_date)
min(created_date)
count(*)

1
2022-04-14 00:00:02
2022-05-02 22:56:40
946455

2
2022-05-02 22:56:40
2022-05-21 17:10:20
946455

3
2022-05-21 17:10:21
2022-06-15 20:16:47
946455

.

.

.

14
2022-10-24 18:55:22
2022-11-04 17:12:26
946454

15
2022-11-04 17:12:26
2022-11-18 06:01:08
946454

How can i avoid the same date data to be distributed into two different ranges?

Am i doing this correct? Is there another way of achieving the result?

I tried to use the ceil function but i had issues with group by statement.


问:
Code coverage for Python using Bazel 6.0.0
I want to generate a code coverage report using Bazel for a Python project (my environment: macOS Ventura, M1 arm64, Python 3.10, Bazel 6.0).

The documentation states that for this task Bazel 6.0 and a modified version of coverage.py should work.

It suggest to create a requiremnts.txt with the follwing content:

```<code>git+https://github.com/ulfjack/coveragepy.git@lcov-support
</code>```

extend the WORKSPACE file this way:

```<code>load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_python",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz",
    sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332",
)

load("@rules_python//python:pip.bzl", "pip_install")

pip_install(
   name = "python_deps",
   requirements = "//:requirements.txt",
)
</code>```

And modify py_tests this way:

load("@python_deps//:requirements.bzl", "entry_point")

```<code>alias(
    name = "python_coverage_tools",
    actual = entry_point("coverage"),
)

py_test(
    name = "test",
    srcs = ["test.py"],
    env = {
        "PYTHON_COVERAGE": "$(location :python_coverage_tools)",
    },
    deps = [
        ":main",
        ":python_coverage_tools",
    ],
)
</code>```

I followed this approach but get this error message:

```<code>ERROR: An error occurred during the fetch of repository 'python_deps':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/pip_repository.bzl", line 345, column 13, in _pip_repository_impl
                fail("rules_python failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: rules_python failed:  (Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 322, in <module>
    main(requirement_file)
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 309, in main
    generate_parsed_requirements_contents(
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 114, in generate_parsed_requirements_contents
    repo_names_and_reqs = repo_names_and_requirements(
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 69, in repo_names_and_requirements
    return [
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 71, in <listcomp>
    bazel.sanitise_name(ir.name, prefix=repo_prefix),
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/bazel.py", line 25, in sanitise_name
    return prefix + name.replace("-", "_").replace(".", "_").lower()
AttributeError: 'NoneType' object has no attribute 'replace'
</code>```

Any ideas how to get proper code coverage for a Bazel based Python project are welcome.

I tried also to run the code coverage command this way:

```<code>bazel coverage --test_env=PYTHON_COVERAGE=/Users/vertexahn/dev/coveragepy/__main__.py //tests:test_main
</code>```

This results in:

```<code>exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //tests:test_main
-----------------------------------------------------------------------------
Unrecognized option '[run] relative_files=' in config file /private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/sandbox/darwin-sandbox/79/execroot/__main__/bazel-out/darwin_arm64-fastbuild/testlogs/_coverage/tests/test_main/test/.coveragerc
Unknown command: 'lcov'
Use 'coverage help' for help.
--
Coverage runner: Not collecting coverage for failed test.
The following commands failed with status 1
/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/sandbox/darwin-sandbox/79/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/tests/test_main.runfiles/__main__/tests/test_main
</code>```

Similar questions on StackOverflow with no answer:

How do you generate Python coverage in bazel?

How to get code coverage for python using Bazel

Body:
I want to generate a code coverage report using Bazel for a Python project (my environment: macOS Ventura, M1 arm64, Python 3.10, Bazel 6.0).

The documentation states that for this task Bazel 6.0 and a modified version of coverage.py should work.

It suggest to create a requiremnts.txt with the follwing content:

git+https://github.com/ulfjack/coveragepy.git@lcov-support

extend the WORKSPACE file this way:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_python",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz",
    sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332",
)

load("@rules_python//python:pip.bzl", "pip_install")

pip_install(
   name = "python_deps",
   requirements = "//:requirements.txt",
)

And modify py_tests this way:

load("@python_deps//:requirements.bzl", "entry_point")

alias(
    name = "python_coverage_tools",
    actual = entry_point("coverage"),
)

py_test(
    name = "test",
    srcs = ["test.py"],
    env = {
        "PYTHON_COVERAGE": "$(location :python_coverage_tools)",
    },
    deps = [
        ":main",
        ":python_coverage_tools",
    ],
)

I followed this approach but get this error message:

ERROR: An error occurred during the fetch of repository 'python_deps':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/pip_repository.bzl", line 345, column 13, in _pip_repository_impl
                fail("rules_python failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: rules_python failed:  (Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 322, in <module>
    main(requirement_file)
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 309, in main
    generate_parsed_requirements_contents(
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 114, in generate_parsed_requirements_contents
    repo_names_and_reqs = repo_names_and_requirements(
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 69, in repo_names_and_requirements
    return [
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/parse_requirements_to_bzl.py", line 71, in <listcomp>
    bazel.sanitise_name(ir.name, prefix=repo_prefix),
  File "/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/external/rules_python/python/pip_install/extract_wheels/bazel.py", line 25, in sanitise_name
    return prefix + name.replace("-", "_").replace(".", "_").lower()
AttributeError: 'NoneType' object has no attribute 'replace'

Any ideas how to get proper code coverage for a Bazel based Python project are welcome.

I tried also to run the code coverage command this way:

bazel coverage --test_env=PYTHON_COVERAGE=/Users/vertexahn/dev/coveragepy/__main__.py //tests:test_main

This results in:

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //tests:test_main
-----------------------------------------------------------------------------
Unrecognized option '[run] relative_files=' in config file /private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/sandbox/darwin-sandbox/79/execroot/__main__/bazel-out/darwin_arm64-fastbuild/testlogs/_coverage/tests/test_main/test/.coveragerc
Unknown command: 'lcov'
Use 'coverage help' for help.
--
Coverage runner: Not collecting coverage for failed test.
The following commands failed with status 1
/private/var/tmp/_bazel_vertexwahn/401174f4ee3f8d1aff86fa2a0c8c5dbe/sandbox/darwin-sandbox/79/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/tests/test_main.runfiles/__main__/tests/test_main

Similar questions on StackOverflow with no answer:

How do you generate Python coverage in bazel?

How to get code coverage for python using Bazel


问:
ErrorCode 1 while merging 2 videos
I am trying to merge two videos but have an error code 1.

My command is as follows:

  final command =
        '-y $commandPaths -filter_complex \'[0:0][1:0]concat=n=${paths.length}:v=1:a=0[out]\' -map \'[out]\' $outputPath';
```
<p>I see the following error:</p>
<blockquote>
<p>I/flutter (17343): Stream specifier ':0' in filtergraph description [0:0][1:0]concat=n=2:v=1:a=0[out] matches no streams.</p>
</blockquote>
<p>Not easy to understand what caused this as I am not familiar with the lib.</p>
<p>I saw in a so that someone had the issue caused by the tw videos not having the same size.</p>
<p>The logs are as follows:</p>
```I/flutter (17343): Duration: 2.9345
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 exists?: true
I/flutter (17343): Duration: 3.0677
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 exists?: true
I/flutter (17343): Output duration; 6.0022

I/flutter (17343): About to executing: -y -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4  -filter_complex '[0:0][1:0]concat=n=2:v=1:a=0[out]' -map '[out]' /data/user/0/com.example.shokaze/app_flutter/output.mp4

I/flutter (17343): ffmpeg version n5.1.2
I/flutter (17343):  Copyright (c) 2000-2022 the FFmpeg developers
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
I/flutter (17343):
I/flutter (17343):   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disab
I/flutter (17343):
I/flutter (17343):   libavutil      57. 28.100 / 57. 28.100
I/flutter (17343):
I/flutter (17343):   libavcodec     59. 37.100 / 59. 37.100
I/flutter (17343):
I/flutter (17343):   libavformat    59. 27.100 / 59. 27.100
I/flutter (17343):
I/flutter (17343):   libavdevice    59.  7.100 / 59.  7.100
I/flutter (17343):
I/flutter (17343):   libavfilter     8. 44.100 /  8. 44.100
I/flutter (17343):
I/flutter (17343):   libswscale      6.  7.100 /  6.  7.100
I/flutter (17343):
I/flutter (17343):   libswresample   4.  7.100 /  4.  7.100
I/flutter (17343):
I/flutter (17343): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4':
I/flutter (17343):
I/flutter (17343):   Metadata:
I/flutter (17343):
I/flutter (17343):     major_brand     :
I/flutter (17343): isom
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     minor_version   :
I/flutter (17343): 131072
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     compatible_brands:
I/flutter (17343): isomiso2mp41
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location        :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location-eng    :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     com.android.capture.fps:
I/flutter (17343): 30.000000
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Duration:
I/flutter (17343): 00:00:02.93
I/flutter (17343): , start:
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate:
I/flutter (17343): 19691 kb/s
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 53 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): SoundHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19436 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): ,
I/flutter (17343): 29.99 fps,
I/flutter (17343): 30 tbr,
I/flutter (17343): 90k tbn
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): VideoHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4':
I/flutter (17343):
I/flutter (17343):   Metadata:
I/flutter (17343):
I/flutter (17343):     major_brand     :
I/flutter (17343): isom
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     minor_version   :
I/flutter (17343): 131072
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     compatible_brands:
I/flutter (17343): isomiso2mp41
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location        :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location-eng    :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     com.android.capture.fps:
I/flutter (17343): 30.000000
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Duration:
I/flutter (17343): 00:00:03.07
I/flutter (17343): , start:
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate:
I/flutter (17343): 20104 kb/s
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 54 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): SoundHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19848 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): ,
I/flutter (17343): 29.99 fps,
I/flutter (17343): 30 tbr,
I/flutter (17343): 90k tbn
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): VideoHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Side data:
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): displaymatrix: rotation of -90.00 degrees
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): Stream specifier ':0' in filtergraph description [0:0][1:0]concat=n=2:v=1:a=0[out] matches no streams.
I/flutter (17343):
I/flutter (17343): executing: -y -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4  -filter_complex '[0:0][1:0]concat=n=2:v=1:a=0[out]' -map '[out]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): error 1
```
<p>Therefore I tried to add a resize in the command without success as follows:.</p>
<pre class="lang-dart prettyprint-override"><code>    final command =
        '$commandPaths -filter_complex \'[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=${paths.length}:v=1:a=1[v][a]\' -map \'[v]\' -map \'[a]\' $outputPath';

</code>```

This time the logs say:

I/flutter (17343): [AVFilterGraph @ 0xb4000074ea6265f0] No output pad can be associated to link label '1:v'.

The logs are as follows:

```<code>I/flutter (17343): Duration: 2.9345
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 exists?: true
I/flutter (17343): Duration: 3.0677
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 exists?: true
I/flutter (17343): Output duration; 6.0022
I/flutter (17343): About to executing: -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4  -filter_complex '[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=2:v=1:a=1[v][a]' -map '[v]' -map '[a]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): ffmpeg version n5.1.2
I/flutter (17343):  Copyright (c) 2000-2022 the FFmpeg developers
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
I/flutter (17343):
I/flutter (17343):   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disab
I/flutter (17343):
I/flutter (17343):   libavutil      57. 28.100 / 57. 28.100
I/flutter (17343):
I/flutter (17343):   libavcodec     59. 37.100 / 59. 37.100
I/flutter (17343):
I/flutter (17343):   libavformat    59. 27.100 / 59. 27.100
I/flutter (17343):
I/flutter (17343):   libavdevice    59.  7.100 / 59.  7.100
I/flutter (17343):
I/flutter (17343):   libavfilter     8. 44.100 /  8. 44.100
I/flutter (17343):
I/flutter (17343):   libswscale      6.  7.100 /  6.  7.100
I/flutter (17343):
I/flutter (17343):   libswresample   4.  7.100 /  4.  7.100
I/flutter (17343):
I/flutter (17343): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4':
I/flutter (17343):
I/flutter (17343):   Metadata:
I/flutter (17343):
I/flutter (17343):     major_brand     :
I/flutter (17343): isom
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     minor_version   :
I/flutter (17343): 131072
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     compatible_brands:
I/flutter (17343): isomiso2mp41
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location        :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location-eng    :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     com.android.capture.fps:
I/flutter (17343): 30.000000
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Duration:
I/flutter (17343): 00:00:02.93
I/flutter (17343): , start:
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate:
I/flutter (17343): 19691 kb/s
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 53 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): SoundHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19436 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): ,
I/flutter (17343): 29.99 fps,
I/flutter (17343): 30 tbr,
I/flutter (17343): 90k tbn
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): VideoHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4':
I/flutter (17343):
I/flutter (17343):   Metadata:
I/flutter (17343):
I/flutter (17343):     major_brand     :
I/flutter (17343): isom
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     minor_version   :
I/flutter (17343): 131072
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     compatible_brands:
I/flutter (17343): isomiso2mp41
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location        :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location-eng    :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     com.android.capture.fps:
I/flutter (17343): 30.000000
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Duration:
I/flutter (17343): 00:00:03.07
I/flutter (17343): , start:
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate:
I/flutter (17343): 20104 kb/s
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 54 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): SoundHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19848 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): ,
I/flutter (17343): 29.99 fps,
I/flutter (17343): 30 tbr,
I/flutter (17343): 90k tbn
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): VideoHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Side data:
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): displaymatrix: rotation of -90.00 degrees
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): [AVFilterGraph @ 0xb4000074ea6265f0] No output pad can be associated to link label '1:v'.
I/flutter (17343):
I/flutter (17343): Error initializing complex filters.
I/flutter (17343):
I/flutter (17343): Invalid argument
I/flutter (17343):
I/flutter (17343): Conversion failed!
I/flutter (17343):
I/flutter (17343): executing: -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4  -filter_complex '[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=2:v=1:a=1[v][a]' -map '[v]' -map '[a]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): error 1
</code>```

Title: ErrorCode 1 while merging 2 videos

Body:
I am trying to merge two videos but have an error code 1.

My command is as follows:

  final command =
        '-y $commandPaths -filter_complex \'[0:0][1:0]concat=n=${paths.length}:v=1:a=0[out]\' -map \'[out]\' $outputPath';

I see the following error:

I/flutter (17343): Stream specifier ':0' in filtergraph description [0:0][1:0]concat=n=2:v=1:a=0[out] matches no streams.

Not easy to understand what caused this as I am not familiar with the lib.

I saw in a so that someone had the issue caused by the tw videos not having the same size.

The logs are as follows:

I/flutter (17343): Duration: 2.9345
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 exists?: true
I/flutter (17343): Duration: 3.0677
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 exists?: true
I/flutter (17343): Output duration; 6.0022

I/flutter (17343): About to executing: -y -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4  -filter_complex '[0:0][1:0]concat=n=2:v=1:a=0[out]' -map '[out]' /data/user/0/com.example.shokaze/app_flutter/output.mp4

I/flutter (17343): ffmpeg version n5.1.2
I/flutter (17343):  Copyright (c) 2000-2022 the FFmpeg developers
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
I/flutter (17343):
I/flutter (17343):   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disab
I/flutter (17343):
I/flutter (17343):   libavutil      57. 28.100 / 57. 28.100
I/flutter (17343):
I/flutter (17343):   libavcodec     59. 37.100 / 59. 37.100
I/flutter (17343):
I/flutter (17343):   libavformat    59. 27.100 / 59. 27.100
I/flutter (17343):
I/flutter (17343):   libavdevice    59.  7.100 / 59.  7.100
I/flutter (17343):
I/flutter (17343):   libavfilter     8. 44.100 /  8. 44.100
I/flutter (17343):
I/flutter (17343):   libswscale      6.  7.100 /  6.  7.100
I/flutter (17343):
I/flutter (17343):   libswresample   4.  7.100 /  4.  7.100
I/flutter (17343):
I/flutter (17343): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4':
I/flutter (17343):
I/flutter (17343):   Metadata:
I/flutter (17343):
I/flutter (17343):     major_brand     :
I/flutter (17343): isom
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     minor_version   :
I/flutter (17343): 131072
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     compatible_brands:
I/flutter (17343): isomiso2mp41
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location        :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location-eng    :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     com.android.capture.fps:
I/flutter (17343): 30.000000
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Duration:
I/flutter (17343): 00:00:02.93
I/flutter (17343): , start:
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate:
I/flutter (17343): 19691 kb/s
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 53 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): SoundHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19436 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): ,
I/flutter (17343): 29.99 fps,
I/flutter (17343): 30 tbr,
I/flutter (17343): 90k tbn
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): VideoHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4':
I/flutter (17343):
I/flutter (17343):   Metadata:
I/flutter (17343):
I/flutter (17343):     major_brand     :
I/flutter (17343): isom
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     minor_version   :
I/flutter (17343): 131072
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     compatible_brands:
I/flutter (17343): isomiso2mp41
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location        :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location-eng    :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     com.android.capture.fps:
I/flutter (17343): 30.000000
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Duration:
I/flutter (17343): 00:00:03.07
I/flutter (17343): , start:
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate:
I/flutter (17343): 20104 kb/s
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 54 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): SoundHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19848 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): ,
I/flutter (17343): 29.99 fps,
I/flutter (17343): 30 tbr,
I/flutter (17343): 90k tbn
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): VideoHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Side data:
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): displaymatrix: rotation of -90.00 degrees
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): Stream specifier ':0' in filtergraph description [0:0][1:0]concat=n=2:v=1:a=0[out] matches no streams.
I/flutter (17343):
I/flutter (17343): executing: -y -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4  -filter_complex '[0:0][1:0]concat=n=2:v=1:a=0[out]' -map '[out]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): error 1

Therefore I tried to add a resize in the command without success as follows:.

    final command =
        '$commandPaths -filter_complex \'[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=${paths.length}:v=1:a=1[v][a]\' -map \'[v]\' -map \'[a]\' $outputPath';

This time the logs say:

I/flutter (17343): [AVFilterGraph @ 0xb4000074ea6265f0] No output pad can be associated to link label '1:v'.

The logs are as follows:

I/flutter (17343): Duration: 2.9345
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 exists?: true
I/flutter (17343): Duration: 3.0677
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 exists?: true
I/flutter (17343): Output duration; 6.0022
I/flutter (17343): About to executing: -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4  -filter_complex '[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=2:v=1:a=1[v][a]' -map '[v]' -map '[a]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): ffmpeg version n5.1.2
I/flutter (17343):  Copyright (c) 2000-2022 the FFmpeg developers
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
I/flutter (17343):
I/flutter (17343):   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disab
I/flutter (17343):
I/flutter (17343):   libavutil      57. 28.100 / 57. 28.100
I/flutter (17343):
I/flutter (17343):   libavcodec     59. 37.100 / 59. 37.100
I/flutter (17343):
I/flutter (17343):   libavformat    59. 27.100 / 59. 27.100
I/flutter (17343):
I/flutter (17343):   libavdevice    59.  7.100 / 59.  7.100
I/flutter (17343):
I/flutter (17343):   libavfilter     8. 44.100 /  8. 44.100
I/flutter (17343):
I/flutter (17343):   libswscale      6.  7.100 /  6.  7.100
I/flutter (17343):
I/flutter (17343):   libswresample   4.  7.100 /  4.  7.100
I/flutter (17343):
I/flutter (17343): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4':
I/flutter (17343):
I/flutter (17343):   Metadata:
I/flutter (17343):
I/flutter (17343):     major_brand     :
I/flutter (17343): isom
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     minor_version   :
I/flutter (17343): 131072
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     compatible_brands:
I/flutter (17343): isomiso2mp41
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location        :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location-eng    :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     com.android.capture.fps:
I/flutter (17343): 30.000000
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Duration:
I/flutter (17343): 00:00:02.93
I/flutter (17343): , start:
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate:
I/flutter (17343): 19691 kb/s
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 53 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): SoundHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19436 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): ,
I/flutter (17343): 29.99 fps,
I/flutter (17343): 30 tbr,
I/flutter (17343): 90k tbn
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): VideoHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #0:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4':
I/flutter (17343):
I/flutter (17343):   Metadata:
I/flutter (17343):
I/flutter (17343):     major_brand     :
I/flutter (17343): isom
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     minor_version   :
I/flutter (17343): 131072
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     compatible_brands:
I/flutter (17343): isomiso2mp41
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location        :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     location-eng    :
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     com.android.capture.fps:
I/flutter (17343): 30.000000
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Duration:
I/flutter (17343): 00:00:03.07
I/flutter (17343): , start:
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate:
I/flutter (17343): 20104 kb/s
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 54 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): SoundHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19848 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): ,
I/flutter (17343): 29.99 fps,
I/flutter (17343): 30 tbr,
I/flutter (17343): 90k tbn
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): VideoHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       vendor_id       :
I/flutter (17343): [0][0][0][0]
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Side data:
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): displaymatrix: rotation of -90.00 degrees
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):   Stream #1:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343):  (default)
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):     Metadata:
I/flutter (17343):
I/flutter (17343):       creation_time   :
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343):
I/flutter (17343):
I/flutter (17343):       handler_name    :
I/flutter (17343): MetaHandle
I/flutter (17343):
I/flutter (17343):
I/flutter (17343): [AVFilterGraph @ 0xb4000074ea6265f0] No output pad can be associated to link label '1:v'.
I/flutter (17343):
I/flutter (17343): Error initializing complex filters.
I/flutter (17343):
I/flutter (17343): Invalid argument
I/flutter (17343):
I/flutter (17343): Conversion failed!
I/flutter (17343):
I/flutter (17343): executing: -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4  -filter_complex '[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=2:v=1:a=1[v][a]' -map '[v]' -map '[a]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): error 1


问:
How can I Log In user automatically after checking comparing user.email_verification_token?
My idea is to call LoginUser after checking user.email_verification_token == token and pass user's email and password, but there is a problem because I don't how to pass them as instance of django.http.HttpRequest.

Could you help me guys?

```<code>    @api_view(['POST'])
def verify_email(request, pk, token):
    try:
        user = User.objects.get(id=pk)
    except User.DoesNotExist:
        raise AuthenticationFailed('User not found!')

    if user.expiration_date < timezone.now():
        return AuthenticationFailed('expired_token')

    if user.email_verification_token == token:
        user.is_email_verified = True
        user.save()

        return Response('message: success')
    return Response('message: Verification Rejected')

    @api_view(['POST'])
def LoginUser(request):
    email = request.data['email']
    password = request.data['password']

    user = User.objects.filter(email=email).first()

    if user is None:
        raise AuthenticationFailed('User not found!')

    if not user.check_password(password):
        raise AuthenticationFailed('Incorrect password!')
     ........
     ........
</code>```

Body:
My idea is to call LoginUser after checking user.email_verification_token == token and pass user's email and password, but there is a problem because I don't how to pass them as instance of django.http.HttpRequest.

Could you help me guys?

    @api_view(['POST'])
def verify_email(request, pk, token):
    try:
        user = User.objects.get(id=pk)
    except User.DoesNotExist:
        raise AuthenticationFailed('User not found!')

    if user.expiration_date < timezone.now():
        return AuthenticationFailed('expired_token')

    if user.email_verification_token == token:
        user.is_email_verified = True
        user.save()

        return Response('message: success')
    return Response('message: Verification Rejected')

    @api_view(['POST'])
def LoginUser(request):
    email = request.data['email']
    password = request.data['password']

    user = User.objects.filter(email=email).first()

    if user is None:
        raise AuthenticationFailed('User not found!')

    if not user.check_password(password):
        raise AuthenticationFailed('Incorrect password!')
     ........
     ........


问:
How to bin values in python based on dynamic ranges?
I have the following datafame, df1:

```<code>       ID     Min_Value      Max_Value
---------------------------------------
0    ID_1           100            150
1    ID_1           150            170
2    ID_2            80            105
3    ID_2           105            120
</code>```

I then have another dataframe, df2, with data that looks like:

```<code>         ID     Value
----------------------
  0    ID_1       102
  1    ID_1       101
  2    ID_1       155
  3    ID_1       165
  4    ID_1       162
  5    ID_1       159
...
 55    ID_1       105
 56    ID_1       121
 57    ID_1       143
 58    ID_1       137
 59    ID_1       155
 60    ID_1       165
...
100    ID_2        95
101    ID_2        81
102    ID_2        91
103    ID_2       101
104    ID_2       115
105    ID_2       117
...
165    ID_2        91
166    ID_2        90
167    ID_2       105
168    ID_2       119
169    ID_2        84
170    ID_2        86
...
</code>```

And so df1 shows for each unique "ID" there are two ranges, or bins. For ID_1, we have a lower bin: 100-150, and an upper bin: 150-170. And then for ID_2, we have a lower bin: 80-105, and an upper bin: 105-120. And then I have df2, which contains hundreds of rows, showing a value for each ID, for where in this case there are only 2 IDs, ID_1 and ID_2.
What I want to do is bin the values of df2 to find out how many of its values fall within each of the bins for each ID in df1.

And so I want to create the following df3:

```<code>       ID     Bin_1      Bin_2     Proportion_Pop
-------------------------------------------------
0    ID_1        XX        XX               0.XX
1    ID_1        XX        XX               0.XX
2    ID_2        XX        XX               0.XX
3    ID_2        XX        XX               0.XX
</code>```

Where in this df3, I am finding out, for each unique ID, here ID_1 and ID_2, how many of the corresponding values fall within the lower bin - Bin_1, and then how many of the corresponding values fall within the upper bin-Bin_2? And then, what proportion of the total population of each ID_2 fall within each corresponding bin? These "Proportion_Pop" values for each ID should sum to 1.0.

I am having trouble figuring out how to approach this in a way that is dynamic and can accommodate if there perhaps happen to be more IDs, e.g. ID_3, ID_4, ID_5, etc., and as well more than 2 bins, e.g. Bin_3, Bin_4, Bin_5.

What I am thinking to do is capture the value ranges for each Bin for each ID, and then place them in a dictionary, and then after, loop through that dictionary for each ID, and then count the values in each bin via value_counts.() to derive the proportion of the total population, but this seems to be getting messy. Is there a straightforward way to accomplish this using '.value_counts()'?

Body:
I have the following datafame, df1:

       ID     Min_Value      Max_Value
---------------------------------------
0    ID_1           100            150
1    ID_1           150            170
2    ID_2            80            105
3    ID_2           105            120

I then have another dataframe, df2, with data that looks like:

         ID     Value
----------------------
  0    ID_1       102
  1    ID_1       101
  2    ID_1       155
  3    ID_1       165
  4    ID_1       162
  5    ID_1       159
...
 55    ID_1       105
 56    ID_1       121
 57    ID_1       143
 58    ID_1       137
 59    ID_1       155
 60    ID_1       165
...
100    ID_2        95
101    ID_2        81
102    ID_2        91
103    ID_2       101
104    ID_2       115
105    ID_2       117
...
165    ID_2        91
166    ID_2        90
167    ID_2       105
168    ID_2       119
169    ID_2        84
170    ID_2        86
...

And so df1 shows for each unique "ID" there are two ranges, or bins. For ID_1, we have a lower bin: 100-150, and an upper bin: 150-170. And then for ID_2, we have a lower bin: 80-105, and an upper bin: 105-120. And then I have df2, which contains hundreds of rows, showing a value for each ID, for where in this case there are only 2 IDs, ID_1 and ID_2.
What I want to do is bin the values of df2 to find out how many of its values fall within each of the bins for each ID in df1.

And so I want to create the following df3:

       ID     Bin_1      Bin_2     Proportion_Pop
-------------------------------------------------
0    ID_1        XX        XX               0.XX
1    ID_1        XX        XX               0.XX
2    ID_2        XX        XX               0.XX
3    ID_2        XX        XX               0.XX

Where in this df3, I am finding out, for each unique ID, here ID_1 and ID_2, how many of the corresponding values fall within the lower bin - Bin_1, and then how many of the corresponding values fall within the upper bin-Bin_2? And then, what proportion of the total population of each ID_2 fall within each corresponding bin? These "Proportion_Pop" values for each ID should sum to 1.0.

I am having trouble figuring out how to approach this in a way that is dynamic and can accommodate if there perhaps happen to be more IDs, e.g. ID_3, ID_4, ID_5, etc., and as well more than 2 bins, e.g. Bin_3, Bin_4, Bin_5.

What I am thinking to do is capture the value ranges for each Bin for each ID, and then place them in a dictionary, and then after, loop through that dictionary for each ID, and then count the values in each bin via value_counts.() to derive the proportion of the total population, but this seems to be getting messy. Is there a straightforward way to accomplish this using '.value_counts()'?


问:
Getting this error messages when starting the development server using 'yarn start' after 'npx create-react-app on Ubuntu
```<code>Starting the development server...

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
/home/akj/Desktop/Social-Media-App/client/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at /home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:452:10
    at /home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:323:13
    at /home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/akj/Desktop/Social-Media-App/client/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
</code>```

I used npx create-react-app and installed few dependencies and then when I try to start the react development server. I keep geeting this error message in CLI and on browser tab

Body:
Starting the development server...

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
/home/akj/Desktop/Social-Media-App/client/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at /home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:452:10
    at /home/akj/Desktop/Social-Media-App/client/node_modules/webpack/lib/NormalModule.js:323:13
    at /home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/akj/Desktop/Social-Media-App/client/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/akj/Desktop/Social-Media-App/client/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I used npx create-react-app and installed few dependencies and then when I try to start the react development server. I keep geeting this error message in CLI and on browser tab


问:
De-duplicate entries if they occur within a certain time frame in R
I want to remove cases that have a collection date within 14 days of each other. E.g., if the ID is the same and the collection date is within 14 days, that would be considered a duplicate.

```<code>df \<- data.frame(ID = c("1", "1", "2", "2", "3", "3"), collection_date = c("6/10/2010", "6/15/2010", "6/21/2010", "7/1/2010", "6/1/2010", "7/1/2010"))
</code>```

ID
collection_date

1
6/10/2010

1
6/15/2010

2
6/21/2010

2
7/1/2010

3
6/1/2010

3
7/1/2010

Would be:

ID
collection_date

1
6/10/2010

2
6/21/2010

3
6/1/2010

3
7/1/2010

I tried using strptime but can't figure it out. Thank you!

Body:
I want to remove cases that have a collection date within 14 days of each other. E.g., if the ID is the same and the collection date is within 14 days, that would be considered a duplicate.

df \<- data.frame(ID = c("1", "1", "2", "2", "3", "3"), collection_date = c("6/10/2010", "6/15/2010", "6/21/2010", "7/1/2010", "6/1/2010", "7/1/2010"))

ID
collection_date

1
6/10/2010

1
6/15/2010

2
6/21/2010

2
7/1/2010

3
6/1/2010

3
7/1/2010

Would be:

ID
collection_date

1
6/10/2010

2
6/21/2010

3
6/1/2010

3
7/1/2010

I tried using strptime but can't figure it out. Thank you!