kandi background
Explore Kits

exist | eXist Native XML Database and Application Platform

 by   eXist-db Java Version: eXist-6.0.1 License: LGPL-2.1

 by   eXist-db Java Version: eXist-6.0.1 License: LGPL-2.1

Download this library from

kandi X-RAY | exist Summary

exist is a Java library typically used in Utilities, MongoDB applications. exist has no bugs, it has no vulnerabilities, it has build file available, it has a Weak Copyleft License and it has low support. You can download it from GitHub.
eXist-db is a high-performance open source native XML database—a NoSQL document database and application platform built entirely around XML technologies. The main homepage for eXist-db can be found at exist-db.org. This is the GitHub repository of eXist source code, and this page links to resources for downloading, building, and contributing to eXist-db, below. The eXist-db community has adopted the Contributor Covenant Code of Conduct.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • exist has a low active ecosystem.
  • It has 344 star(s) with 173 fork(s). There are 62 watchers for this library.
  • There were 8 major release(s) in the last 12 months.
  • There are 429 open issues and 977 have been closed. On average issues are closed in 209 days. There are 41 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of exist is eXist-6.0.1
exist Support
Best in #Java
Average in #Java
exist Support
Best in #Java
Average in #Java

quality kandi Quality

  • exist has 0 bugs and 0 code smells.
exist Quality
Best in #Java
Average in #Java
exist Quality
Best in #Java
Average in #Java

securitySecurity

  • exist has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • exist code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
exist Security
Best in #Java
Average in #Java
exist Security
Best in #Java
Average in #Java

license License

  • exist is licensed under the LGPL-2.1 License. This license is Weak Copyleft.
  • Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.
exist License
Best in #Java
Average in #Java
exist License
Best in #Java
Average in #Java

buildReuse

  • exist releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • exist saves you 852259 person hours of effort in developing the same functionality from scratch.
  • It has 412225 lines of code, 25269 functions and 2905 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
exist Reuse
Best in #Java
Average in #Java
exist Reuse
Best in #Java
Average in #Java
Top functions reviewed by kandi - BETA

kandi has reviewed exist and discovered the below as its top functions. This is intended to give you an instant insight into exist implemented functionality, and help decide if they suit your requirements.

  • Process a single line .
    • Configures the configuration based on the current instance .
      • Posts an XQuery to a transaction .
        • Initialize the components .
          • Split a data page .
            • Analyze a picture string .
              • Initialize database instance .
                • This method is used to compare two nodes .
                  • Process an XInclude element .
                    • Creates the menu bar .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      exist Key Features

                      eXist Native XML Database and Application Platform

                      exist Examples and Code Snippets

                      See all related Code Snippets

                      psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory

                      copy iconCopydownload iconDownload
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      
                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      
                      port = 5432
                      
                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      
                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      
                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      
                      brew uninstall postgresql
                      brew install postgresql@13
                      brew services start postgresql@13
                      brew link postgresql@13 --force
                      
                      rm /opt/homebrew/var/postgres/postmaster.pid
                      brew services restart postgresql
                      
                      brew postgresql-upgrade-database
                      
                      brew install postgresql
                      brew postgresql-upgrade-database
                      
                      brew postgresql-upgrade-database
                      
                      brew install postgresql
                      brew postgresql-upgrade-database
                      

                      Unable to negotiate with 40.74.28.9 port 22: no matching host key type found. Their offer: ssh-rsa

                      copy iconCopydownload iconDownload
                      Host ssh.dev.azure.com
                          HostName ssh.dev.azure.com
                          User git
                          IdentityFile ~/.ssh/id_rsa
                          IdentitiesOnly yes
                          PubkeyAcceptedAlgorithms +ssh-rsa
                          HostkeyAlgorithms +ssh-rsa
                      
                      Host ssh.dev.azure.com
                          User git
                          PubkeyAcceptedAlgorithms +ssh-rsa
                          HostkeyAlgorithms +ssh-rsa
                      
                        HostkeyAlgorithms +ssh-rsa
                        PubkeyAcceptedAlgorithms +ssh-rsa
                      
                      Host your-azure-devops-domain
                        IdentityFile ~/.ssh/id_rsa
                        IdentitiesOnly yes
                        HostkeyAlgorithms +ssh-rsa
                        PubkeyAcceptedAlgorithms +ssh-rsa
                      
                        HostkeyAlgorithms +ssh-rsa
                        PubkeyAcceptedAlgorithms +ssh-rsa
                      
                      Host your-azure-devops-domain
                        IdentityFile ~/.ssh/id_rsa
                        IdentitiesOnly yes
                        HostkeyAlgorithms +ssh-rsa
                        PubkeyAcceptedAlgorithms +ssh-rsa
                      
                      programs.ssh.extraConfig = ''
                        PubkeyAcceptedAlgorithms +ssh-rsa
                        HostkeyAlgorithms +ssh-rsa
                      ''
                      
                      services.openssh.extraConfig = ''
                        PubkeyAcceptedAlgorithms +ssh-rsa
                        HostkeyAlgorithms +ssh-rsa
                      '';
                      
                      programs.ssh.extraConfig = ''
                        PubkeyAcceptedAlgorithms +ssh-rsa
                        HostkeyAlgorithms +ssh-rsa
                      ''
                      
                      services.openssh.extraConfig = ''
                        PubkeyAcceptedAlgorithms +ssh-rsa
                        HostkeyAlgorithms +ssh-rsa
                      '';
                      
                      Host YOUR-DOMAIN
                      Hostname YOUR-DOMAIN
                      IdentityFile ~/.ssh/id_rsa
                      IdentitiesOnly yes
                      HostKeyAlgorithms=+ssh-rsa
                      PubkeyAcceptedAlgorithms=+ssh-rsa
                      

                      zip_longest for the left list always

                      copy iconCopydownload iconDownload
                      from itertools import zip_longest
                      
                      def zip_first(a, b):
                          z = zip_longest(a, b)
                          for i, r in zip(range(len(a)), z):
                              yield r
                      
                      import itertools
                      
                      input1 = [['a', 'b', 'c'], [1, 2]]
                      input2 = [['a', 'b'], [1, 2, 3]]
                      
                      zip1 = itertools.zip_longest(input1[0], input1[1][:len(input1[0])])
                      zip2 = itertools.zip_longest(input2[0], input2[1][:len(input2[0])])
                      
                      print(list(zip1))
                      print(list(zip2))
                      
                      [('a', 1), ('b', 2), ('c', None)]
                      [('a', 1), ('b', 2)]
                      
                      import itertools
                      
                      def zip_first(lists):
                          equal_lists = [l[:len(lists[0])] for l in lists]
                          return itertools.zip_longest(*equal_lists)
                      
                      import itertools
                      
                      input1 = [['a', 'b', 'c'], [1, 2]]
                      input2 = [['a', 'b'], [1, 2, 3]]
                      
                      zip1 = itertools.zip_longest(input1[0], input1[1][:len(input1[0])])
                      zip2 = itertools.zip_longest(input2[0], input2[1][:len(input2[0])])
                      
                      print(list(zip1))
                      print(list(zip2))
                      
                      [('a', 1), ('b', 2), ('c', None)]
                      [('a', 1), ('b', 2)]
                      
                      import itertools
                      
                      def zip_first(lists):
                          equal_lists = [l[:len(lists[0])] for l in lists]
                          return itertools.zip_longest(*equal_lists)
                      
                      import itertools
                      
                      input1 = [['a', 'b', 'c'], [1, 2]]
                      input2 = [['a', 'b'], [1, 2, 3]]
                      
                      zip1 = itertools.zip_longest(input1[0], input1[1][:len(input1[0])])
                      zip2 = itertools.zip_longest(input2[0], input2[1][:len(input2[0])])
                      
                      print(list(zip1))
                      print(list(zip2))
                      
                      [('a', 1), ('b', 2), ('c', None)]
                      [('a', 1), ('b', 2)]
                      
                      import itertools
                      
                      def zip_first(lists):
                          equal_lists = [l[:len(lists[0])] for l in lists]
                          return itertools.zip_longest(*equal_lists)
                      
                      from itertools import zip_longest
                      
                      def zip_left(*iterables, fillvalue=None):
                          SENTINEL = object()
                          
                          for first, *others in zip_longest(*iterables, fillvalue=SENTINEL):
                              if first is SENTINEL:
                                  return
                              others = [i if i is not SENTINEL else fillvalue for i in others]
                              yield (first, *others)
                      
                      
                      print(list(zip_left(['a', 'b', 'c'], [1, 2])))
                      print(list(zip_left(['a', 'b'], [1, 2, 3])))
                      
                      [('a', 1), ('b', 2), ('c', None)]
                      [('a', 1), ('b', 2)]
                      
                      from itertools import zip_longest
                      
                      def zip_left(*iterables, fillvalue=None):
                          SENTINEL = object()
                          
                          for first, *others in zip_longest(*iterables, fillvalue=SENTINEL):
                              if first is SENTINEL:
                                  return
                              others = [i if i is not SENTINEL else fillvalue for i in others]
                              yield (first, *others)
                      
                      
                      print(list(zip_left(['a', 'b', 'c'], [1, 2])))
                      print(list(zip_left(['a', 'b'], [1, 2, 3])))
                      
                      [('a', 1), ('b', 2), ('c', None)]
                      [('a', 1), ('b', 2)]
                      
                      def zip_first(a, b):
                          ai, bi = iter(a), iter(b)
                          while True:
                              try:
                                  aa = next(ai)
                              except StopIteration:
                                  return           
                              try:
                                  bb = next(bi)
                              except StopIteration:
                                  bb = None
                              yield aa, bb
                      
                      from itertools import repeat
                      
                      def zip_by_first(*args, fillvalue=None):
                          # zip_by_first('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
                          # zip_by_first('ABC', 'xyzw', fillvalue='-') --> Ax By Cz
                          if not args:
                              return
                          iterators = [iter(it) for it in args]
                          while True:
                              values = []
                              for i, it in enumerate(iterators):
                                  try:
                                      value = next(it)
                                  except StopIteration:
                                      if i == 0:
                                          return
                                      iterators[i] = repeat(fillvalue)
                                      value = fillvalue
                                  values.append(value)
                              yield tuple(values)
                      
                      from itertools import islice, zip_longest
                      
                      def zip_first(a, b):
                          return islice(zip_longest(a, b), len(a))
                      
                      from itertools import chain, repeat
                      
                      def zip_first(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def zip_first(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      10 iterables of 10,000 to 90,000 elements, first has 50,000:
                      ────────────────────────────────────────────────────────────
                       2.2 ms   2.2 ms   2.3 ms  limit_cheat
                       2.6 ms   2.6 ms   2.6 ms  Kelly_Bundy_chain
                       3.3 ms   3.3 ms   3.3 ms  Kelly_Bundy_compress
                      50.2 ms  50.6 ms  50.7 ms  CrazyChucky
                      54.7 ms  55.0 ms  55.0 ms  Sven_Marnach
                      74.8 ms  74.9 ms  75.0 ms  Mad_Physicist
                       5.4 ms   5.4 ms   5.4 ms  Kelly_Bundy_3
                       5.9 ms   6.0 ms   6.0 ms  Kelly_Bundy_4
                       4.6 ms   4.7 ms   4.7 ms  Kelly_Bundy_5
                      
                      10,000 iterables of 0 to 100 elements, first has 50:
                      ────────────────────────────────────────────────────
                       4.6 ms   4.7 ms   4.8 ms  limit_cheat
                       4.8 ms   4.8 ms   4.8 ms  Kelly_Bundy_compress
                       8.4 ms   8.4 ms   8.4 ms  Kelly_Bundy_chain
                      27.1 ms  27.3 ms  27.5 ms  CrazyChucky
                      38.3 ms  38.5 ms  38.7 ms  Sven_Marnach
                      73.0 ms  73.0 ms  73.1 ms  Mad_Physicist
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_3
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_4
                       5.0 ms   5.0 ms   5.0 ms  Kelly_Bundy_5
                      
                      
                      def zip_first(first, second, third, fillvalue=None):
                          filler = repeat(fillvalue)
                          return zip(first,
                                     chain(second, filler),
                                     chain(third, filler))
                      
                      def limit_cheat(*iterables, fillvalue=None):
                          return islice(zip_longest(*iterables, fillvalue=fillvalue), cheat_length)
                      
                      def Kelly_Bundy_chain(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def Kelly_Bundy_compress(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      def CrazyChucky(*iterables, fillvalue=None):
                          SENTINEL = object()
                          
                          for first, *others in zip_longest(*iterables, fillvalue=SENTINEL):
                              if first is SENTINEL:
                                  return
                              others = [i if i is not SENTINEL else fillvalue for i in others]
                              yield (first, *others)
                      
                      def Sven_Marnach(first, *rest, fillvalue=None):
                          rest = [iter(r) for r in rest]
                          for x in first:
                              yield x, *(next(r, fillvalue) for r in rest)
                      
                      def Mad_Physicist(*args, fillvalue=None):
                          # zip_by_first('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
                          # zip_by_first('ABC', 'xyzw', fillvalue='-') --> Ax By Cz
                          if not args:
                              return
                          iterators = [iter(it) for it in args]
                          while True:
                              values = []
                              for i, it in enumerate(iterators):
                                  try:
                                      value = next(it)
                                  except StopIteration:
                                      if i == 0:
                                          return
                                      iterators[i] = repeat(fillvalue)
                                      value = fillvalue
                                  values.append(value)
                              yield tuple(values)
                      
                      def Kelly_Bundy_3(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return map(itemgetter(1), zip(a, zip_longest(b, *rest, fillvalue=fillvalue)))
                      
                      def Kelly_Bundy_4(first, *rest, fillvalue=None):
                          sentinel = object()
                          for z in zip_longest(chain(first, [sentinel]), *rest, fillvalue=fillvalue):
                              if z[0] is sentinel:
                                  break
                              yield z
                      
                      def Kelly_Bundy_5(first, *rest, fillvalue=None):
                          stopped = False
                          def stop():
                              nonlocal stopped
                              stopped = True
                              return
                              yield
                          for z in zip_longest(chain(first, stop()), *rest, fillvalue=fillvalue):
                              if stopped:
                                  break
                              yield z
                      
                      
                      import timeit
                      from itertools import chain, repeat, zip_longest, islice, tee, compress
                      from operator import itemgetter
                      from collections import deque
                      
                      funcs = [
                          limit_cheat,
                          Kelly_Bundy_chain,
                          Kelly_Bundy_compress,
                          CrazyChucky,
                          Sven_Marnach,
                          Mad_Physicist,
                          Kelly_Bundy_3,
                          Kelly_Bundy_4,
                          Kelly_Bundy_5,
                      ]
                      
                      def test(args_creator):
                      
                          # Correctness
                          expect = list(funcs[0](*args_creator()))
                          for func in funcs:
                              result = list(func(*args_creator()))
                              print(result == expect, func.__name__)
                          
                          # Speed
                          tss = [[] for _ in funcs]
                          for _ in range(5):
                              print()
                              print(args_creator.__name__)
                              for func, ts in zip(funcs, tss):
                                  t = min(timeit.repeat(lambda: deque(func(*args_creator()), 0), number=1))
                                  ts.append(t)
                                  print(*('%4.1f ms ' % (t * 1e3) for t in sorted(ts)[:3]), func.__name__)
                      
                      def args_few_but_long_iterables():
                          global cheat_length
                          cheat_length = 50_000
                          first = repeat(0, 50_000)
                          rest = [repeat(i, 10_000 * i) for i in range(1, 10)]
                          return first, *rest
                      
                      def args_many_but_short_iterables():
                          global cheat_length
                          cheat_length = 50
                          first = repeat(0, 50)
                          rest = [repeat(i, i % 101) for i in range(1, 10_000)]
                          return first, *rest
                      
                      test(args_few_but_long_iterables)
                      funcs[1:3] = funcs[1:3][::-1]
                      test(args_many_but_short_iterables)
                      
                      from itertools import chain, repeat
                      
                      def zip_first(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def zip_first(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      10 iterables of 10,000 to 90,000 elements, first has 50,000:
                      ────────────────────────────────────────────────────────────
                       2.2 ms   2.2 ms   2.3 ms  limit_cheat
                       2.6 ms   2.6 ms   2.6 ms  Kelly_Bundy_chain
                       3.3 ms   3.3 ms   3.3 ms  Kelly_Bundy_compress
                      50.2 ms  50.6 ms  50.7 ms  CrazyChucky
                      54.7 ms  55.0 ms  55.0 ms  Sven_Marnach
                      74.8 ms  74.9 ms  75.0 ms  Mad_Physicist
                       5.4 ms   5.4 ms   5.4 ms  Kelly_Bundy_3
                       5.9 ms   6.0 ms   6.0 ms  Kelly_Bundy_4
                       4.6 ms   4.7 ms   4.7 ms  Kelly_Bundy_5
                      
                      10,000 iterables of 0 to 100 elements, first has 50:
                      ────────────────────────────────────────────────────
                       4.6 ms   4.7 ms   4.8 ms  limit_cheat
                       4.8 ms   4.8 ms   4.8 ms  Kelly_Bundy_compress
                       8.4 ms   8.4 ms   8.4 ms  Kelly_Bundy_chain
                      27.1 ms  27.3 ms  27.5 ms  CrazyChucky
                      38.3 ms  38.5 ms  38.7 ms  Sven_Marnach
                      73.0 ms  73.0 ms  73.1 ms  Mad_Physicist
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_3
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_4
                       5.0 ms   5.0 ms   5.0 ms  Kelly_Bundy_5
                      
                      
                      def zip_first(first, second, third, fillvalue=None):
                          filler = repeat(fillvalue)
                          return zip(first,
                                     chain(second, filler),
                                     chain(third, filler))
                      
                      def limit_cheat(*iterables, fillvalue=None):
                          return islice(zip_longest(*iterables, fillvalue=fillvalue), cheat_length)
                      
                      def Kelly_Bundy_chain(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def Kelly_Bundy_compress(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      def CrazyChucky(*iterables, fillvalue=None):
                          SENTINEL = object()
                          
                          for first, *others in zip_longest(*iterables, fillvalue=SENTINEL):
                              if first is SENTINEL:
                                  return
                              others = [i if i is not SENTINEL else fillvalue for i in others]
                              yield (first, *others)
                      
                      def Sven_Marnach(first, *rest, fillvalue=None):
                          rest = [iter(r) for r in rest]
                          for x in first:
                              yield x, *(next(r, fillvalue) for r in rest)
                      
                      def Mad_Physicist(*args, fillvalue=None):
                          # zip_by_first('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
                          # zip_by_first('ABC', 'xyzw', fillvalue='-') --> Ax By Cz
                          if not args:
                              return
                          iterators = [iter(it) for it in args]
                          while True:
                              values = []
                              for i, it in enumerate(iterators):
                                  try:
                                      value = next(it)
                                  except StopIteration:
                                      if i == 0:
                                          return
                                      iterators[i] = repeat(fillvalue)
                                      value = fillvalue
                                  values.append(value)
                              yield tuple(values)
                      
                      def Kelly_Bundy_3(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return map(itemgetter(1), zip(a, zip_longest(b, *rest, fillvalue=fillvalue)))
                      
                      def Kelly_Bundy_4(first, *rest, fillvalue=None):
                          sentinel = object()
                          for z in zip_longest(chain(first, [sentinel]), *rest, fillvalue=fillvalue):
                              if z[0] is sentinel:
                                  break
                              yield z
                      
                      def Kelly_Bundy_5(first, *rest, fillvalue=None):
                          stopped = False
                          def stop():
                              nonlocal stopped
                              stopped = True
                              return
                              yield
                          for z in zip_longest(chain(first, stop()), *rest, fillvalue=fillvalue):
                              if stopped:
                                  break
                              yield z
                      
                      
                      import timeit
                      from itertools import chain, repeat, zip_longest, islice, tee, compress
                      from operator import itemgetter
                      from collections import deque
                      
                      funcs = [
                          limit_cheat,
                          Kelly_Bundy_chain,
                          Kelly_Bundy_compress,
                          CrazyChucky,
                          Sven_Marnach,
                          Mad_Physicist,
                          Kelly_Bundy_3,
                          Kelly_Bundy_4,
                          Kelly_Bundy_5,
                      ]
                      
                      def test(args_creator):
                      
                          # Correctness
                          expect = list(funcs[0](*args_creator()))
                          for func in funcs:
                              result = list(func(*args_creator()))
                              print(result == expect, func.__name__)
                          
                          # Speed
                          tss = [[] for _ in funcs]
                          for _ in range(5):
                              print()
                              print(args_creator.__name__)
                              for func, ts in zip(funcs, tss):
                                  t = min(timeit.repeat(lambda: deque(func(*args_creator()), 0), number=1))
                                  ts.append(t)
                                  print(*('%4.1f ms ' % (t * 1e3) for t in sorted(ts)[:3]), func.__name__)
                      
                      def args_few_but_long_iterables():
                          global cheat_length
                          cheat_length = 50_000
                          first = repeat(0, 50_000)
                          rest = [repeat(i, 10_000 * i) for i in range(1, 10)]
                          return first, *rest
                      
                      def args_many_but_short_iterables():
                          global cheat_length
                          cheat_length = 50
                          first = repeat(0, 50)
                          rest = [repeat(i, i % 101) for i in range(1, 10_000)]
                          return first, *rest
                      
                      test(args_few_but_long_iterables)
                      funcs[1:3] = funcs[1:3][::-1]
                      test(args_many_but_short_iterables)
                      
                      from itertools import chain, repeat
                      
                      def zip_first(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def zip_first(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      10 iterables of 10,000 to 90,000 elements, first has 50,000:
                      ────────────────────────────────────────────────────────────
                       2.2 ms   2.2 ms   2.3 ms  limit_cheat
                       2.6 ms   2.6 ms   2.6 ms  Kelly_Bundy_chain
                       3.3 ms   3.3 ms   3.3 ms  Kelly_Bundy_compress
                      50.2 ms  50.6 ms  50.7 ms  CrazyChucky
                      54.7 ms  55.0 ms  55.0 ms  Sven_Marnach
                      74.8 ms  74.9 ms  75.0 ms  Mad_Physicist
                       5.4 ms   5.4 ms   5.4 ms  Kelly_Bundy_3
                       5.9 ms   6.0 ms   6.0 ms  Kelly_Bundy_4
                       4.6 ms   4.7 ms   4.7 ms  Kelly_Bundy_5
                      
                      10,000 iterables of 0 to 100 elements, first has 50:
                      ────────────────────────────────────────────────────
                       4.6 ms   4.7 ms   4.8 ms  limit_cheat
                       4.8 ms   4.8 ms   4.8 ms  Kelly_Bundy_compress
                       8.4 ms   8.4 ms   8.4 ms  Kelly_Bundy_chain
                      27.1 ms  27.3 ms  27.5 ms  CrazyChucky
                      38.3 ms  38.5 ms  38.7 ms  Sven_Marnach
                      73.0 ms  73.0 ms  73.1 ms  Mad_Physicist
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_3
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_4
                       5.0 ms   5.0 ms   5.0 ms  Kelly_Bundy_5
                      
                      
                      def zip_first(first, second, third, fillvalue=None):
                          filler = repeat(fillvalue)
                          return zip(first,
                                     chain(second, filler),
                                     chain(third, filler))
                      
                      def limit_cheat(*iterables, fillvalue=None):
                          return islice(zip_longest(*iterables, fillvalue=fillvalue), cheat_length)
                      
                      def Kelly_Bundy_chain(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def Kelly_Bundy_compress(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      def CrazyChucky(*iterables, fillvalue=None):
                          SENTINEL = object()
                          
                          for first, *others in zip_longest(*iterables, fillvalue=SENTINEL):
                              if first is SENTINEL:
                                  return
                              others = [i if i is not SENTINEL else fillvalue for i in others]
                              yield (first, *others)
                      
                      def Sven_Marnach(first, *rest, fillvalue=None):
                          rest = [iter(r) for r in rest]
                          for x in first:
                              yield x, *(next(r, fillvalue) for r in rest)
                      
                      def Mad_Physicist(*args, fillvalue=None):
                          # zip_by_first('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
                          # zip_by_first('ABC', 'xyzw', fillvalue='-') --> Ax By Cz
                          if not args:
                              return
                          iterators = [iter(it) for it in args]
                          while True:
                              values = []
                              for i, it in enumerate(iterators):
                                  try:
                                      value = next(it)
                                  except StopIteration:
                                      if i == 0:
                                          return
                                      iterators[i] = repeat(fillvalue)
                                      value = fillvalue
                                  values.append(value)
                              yield tuple(values)
                      
                      def Kelly_Bundy_3(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return map(itemgetter(1), zip(a, zip_longest(b, *rest, fillvalue=fillvalue)))
                      
                      def Kelly_Bundy_4(first, *rest, fillvalue=None):
                          sentinel = object()
                          for z in zip_longest(chain(first, [sentinel]), *rest, fillvalue=fillvalue):
                              if z[0] is sentinel:
                                  break
                              yield z
                      
                      def Kelly_Bundy_5(first, *rest, fillvalue=None):
                          stopped = False
                          def stop():
                              nonlocal stopped
                              stopped = True
                              return
                              yield
                          for z in zip_longest(chain(first, stop()), *rest, fillvalue=fillvalue):
                              if stopped:
                                  break
                              yield z
                      
                      
                      import timeit
                      from itertools import chain, repeat, zip_longest, islice, tee, compress
                      from operator import itemgetter
                      from collections import deque
                      
                      funcs = [
                          limit_cheat,
                          Kelly_Bundy_chain,
                          Kelly_Bundy_compress,
                          CrazyChucky,
                          Sven_Marnach,
                          Mad_Physicist,
                          Kelly_Bundy_3,
                          Kelly_Bundy_4,
                          Kelly_Bundy_5,
                      ]
                      
                      def test(args_creator):
                      
                          # Correctness
                          expect = list(funcs[0](*args_creator()))
                          for func in funcs:
                              result = list(func(*args_creator()))
                              print(result == expect, func.__name__)
                          
                          # Speed
                          tss = [[] for _ in funcs]
                          for _ in range(5):
                              print()
                              print(args_creator.__name__)
                              for func, ts in zip(funcs, tss):
                                  t = min(timeit.repeat(lambda: deque(func(*args_creator()), 0), number=1))
                                  ts.append(t)
                                  print(*('%4.1f ms ' % (t * 1e3) for t in sorted(ts)[:3]), func.__name__)
                      
                      def args_few_but_long_iterables():
                          global cheat_length
                          cheat_length = 50_000
                          first = repeat(0, 50_000)
                          rest = [repeat(i, 10_000 * i) for i in range(1, 10)]
                          return first, *rest
                      
                      def args_many_but_short_iterables():
                          global cheat_length
                          cheat_length = 50
                          first = repeat(0, 50)
                          rest = [repeat(i, i % 101) for i in range(1, 10_000)]
                          return first, *rest
                      
                      test(args_few_but_long_iterables)
                      funcs[1:3] = funcs[1:3][::-1]
                      test(args_many_but_short_iterables)
                      
                      from itertools import chain, repeat
                      
                      def zip_first(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def zip_first(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      10 iterables of 10,000 to 90,000 elements, first has 50,000:
                      ────────────────────────────────────────────────────────────
                       2.2 ms   2.2 ms   2.3 ms  limit_cheat
                       2.6 ms   2.6 ms   2.6 ms  Kelly_Bundy_chain
                       3.3 ms   3.3 ms   3.3 ms  Kelly_Bundy_compress
                      50.2 ms  50.6 ms  50.7 ms  CrazyChucky
                      54.7 ms  55.0 ms  55.0 ms  Sven_Marnach
                      74.8 ms  74.9 ms  75.0 ms  Mad_Physicist
                       5.4 ms   5.4 ms   5.4 ms  Kelly_Bundy_3
                       5.9 ms   6.0 ms   6.0 ms  Kelly_Bundy_4
                       4.6 ms   4.7 ms   4.7 ms  Kelly_Bundy_5
                      
                      10,000 iterables of 0 to 100 elements, first has 50:
                      ────────────────────────────────────────────────────
                       4.6 ms   4.7 ms   4.8 ms  limit_cheat
                       4.8 ms   4.8 ms   4.8 ms  Kelly_Bundy_compress
                       8.4 ms   8.4 ms   8.4 ms  Kelly_Bundy_chain
                      27.1 ms  27.3 ms  27.5 ms  CrazyChucky
                      38.3 ms  38.5 ms  38.7 ms  Sven_Marnach
                      73.0 ms  73.0 ms  73.1 ms  Mad_Physicist
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_3
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_4
                       5.0 ms   5.0 ms   5.0 ms  Kelly_Bundy_5
                      
                      
                      def zip_first(first, second, third, fillvalue=None):
                          filler = repeat(fillvalue)
                          return zip(first,
                                     chain(second, filler),
                                     chain(third, filler))
                      
                      def limit_cheat(*iterables, fillvalue=None):
                          return islice(zip_longest(*iterables, fillvalue=fillvalue), cheat_length)
                      
                      def Kelly_Bundy_chain(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def Kelly_Bundy_compress(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      def CrazyChucky(*iterables, fillvalue=None):
                          SENTINEL = object()
                          
                          for first, *others in zip_longest(*iterables, fillvalue=SENTINEL):
                              if first is SENTINEL:
                                  return
                              others = [i if i is not SENTINEL else fillvalue for i in others]
                              yield (first, *others)
                      
                      def Sven_Marnach(first, *rest, fillvalue=None):
                          rest = [iter(r) for r in rest]
                          for x in first:
                              yield x, *(next(r, fillvalue) for r in rest)
                      
                      def Mad_Physicist(*args, fillvalue=None):
                          # zip_by_first('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
                          # zip_by_first('ABC', 'xyzw', fillvalue='-') --> Ax By Cz
                          if not args:
                              return
                          iterators = [iter(it) for it in args]
                          while True:
                              values = []
                              for i, it in enumerate(iterators):
                                  try:
                                      value = next(it)
                                  except StopIteration:
                                      if i == 0:
                                          return
                                      iterators[i] = repeat(fillvalue)
                                      value = fillvalue
                                  values.append(value)
                              yield tuple(values)
                      
                      def Kelly_Bundy_3(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return map(itemgetter(1), zip(a, zip_longest(b, *rest, fillvalue=fillvalue)))
                      
                      def Kelly_Bundy_4(first, *rest, fillvalue=None):
                          sentinel = object()
                          for z in zip_longest(chain(first, [sentinel]), *rest, fillvalue=fillvalue):
                              if z[0] is sentinel:
                                  break
                              yield z
                      
                      def Kelly_Bundy_5(first, *rest, fillvalue=None):
                          stopped = False
                          def stop():
                              nonlocal stopped
                              stopped = True
                              return
                              yield
                          for z in zip_longest(chain(first, stop()), *rest, fillvalue=fillvalue):
                              if stopped:
                                  break
                              yield z
                      
                      
                      import timeit
                      from itertools import chain, repeat, zip_longest, islice, tee, compress
                      from operator import itemgetter
                      from collections import deque
                      
                      funcs = [
                          limit_cheat,
                          Kelly_Bundy_chain,
                          Kelly_Bundy_compress,
                          CrazyChucky,
                          Sven_Marnach,
                          Mad_Physicist,
                          Kelly_Bundy_3,
                          Kelly_Bundy_4,
                          Kelly_Bundy_5,
                      ]
                      
                      def test(args_creator):
                      
                          # Correctness
                          expect = list(funcs[0](*args_creator()))
                          for func in funcs:
                              result = list(func(*args_creator()))
                              print(result == expect, func.__name__)
                          
                          # Speed
                          tss = [[] for _ in funcs]
                          for _ in range(5):
                              print()
                              print(args_creator.__name__)
                              for func, ts in zip(funcs, tss):
                                  t = min(timeit.repeat(lambda: deque(func(*args_creator()), 0), number=1))
                                  ts.append(t)
                                  print(*('%4.1f ms ' % (t * 1e3) for t in sorted(ts)[:3]), func.__name__)
                      
                      def args_few_but_long_iterables():
                          global cheat_length
                          cheat_length = 50_000
                          first = repeat(0, 50_000)
                          rest = [repeat(i, 10_000 * i) for i in range(1, 10)]
                          return first, *rest
                      
                      def args_many_but_short_iterables():
                          global cheat_length
                          cheat_length = 50
                          first = repeat(0, 50)
                          rest = [repeat(i, i % 101) for i in range(1, 10_000)]
                          return first, *rest
                      
                      test(args_few_but_long_iterables)
                      funcs[1:3] = funcs[1:3][::-1]
                      test(args_many_but_short_iterables)
                      
                      from itertools import chain, repeat
                      
                      def zip_first(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def zip_first(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      10 iterables of 10,000 to 90,000 elements, first has 50,000:
                      ────────────────────────────────────────────────────────────
                       2.2 ms   2.2 ms   2.3 ms  limit_cheat
                       2.6 ms   2.6 ms   2.6 ms  Kelly_Bundy_chain
                       3.3 ms   3.3 ms   3.3 ms  Kelly_Bundy_compress
                      50.2 ms  50.6 ms  50.7 ms  CrazyChucky
                      54.7 ms  55.0 ms  55.0 ms  Sven_Marnach
                      74.8 ms  74.9 ms  75.0 ms  Mad_Physicist
                       5.4 ms   5.4 ms   5.4 ms  Kelly_Bundy_3
                       5.9 ms   6.0 ms   6.0 ms  Kelly_Bundy_4
                       4.6 ms   4.7 ms   4.7 ms  Kelly_Bundy_5
                      
                      10,000 iterables of 0 to 100 elements, first has 50:
                      ────────────────────────────────────────────────────
                       4.6 ms   4.7 ms   4.8 ms  limit_cheat
                       4.8 ms   4.8 ms   4.8 ms  Kelly_Bundy_compress
                       8.4 ms   8.4 ms   8.4 ms  Kelly_Bundy_chain
                      27.1 ms  27.3 ms  27.5 ms  CrazyChucky
                      38.3 ms  38.5 ms  38.7 ms  Sven_Marnach
                      73.0 ms  73.0 ms  73.1 ms  Mad_Physicist
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_3
                       4.9 ms   4.9 ms   5.0 ms  Kelly_Bundy_4
                       5.0 ms   5.0 ms   5.0 ms  Kelly_Bundy_5
                      
                      
                      def zip_first(first, second, third, fillvalue=None):
                          filler = repeat(fillvalue)
                          return zip(first,
                                     chain(second, filler),
                                     chain(third, filler))
                      
                      def limit_cheat(*iterables, fillvalue=None):
                          return islice(zip_longest(*iterables, fillvalue=fillvalue), cheat_length)
                      
                      def Kelly_Bundy_chain(first, *rest, fillvalue=None):
                          return zip(first, *map(chain, rest, repeat(repeat(fillvalue))))
                      
                      def Kelly_Bundy_compress(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return compress(zip_longest(b, *rest, fillvalue=fillvalue), zip(a))
                      
                      def CrazyChucky(*iterables, fillvalue=None):
                          SENTINEL = object()
                          
                          for first, *others in zip_longest(*iterables, fillvalue=SENTINEL):
                              if first is SENTINEL:
                                  return
                              others = [i if i is not SENTINEL else fillvalue for i in others]
                              yield (first, *others)
                      
                      def Sven_Marnach(first, *rest, fillvalue=None):
                          rest = [iter(r) for r in rest]
                          for x in first:
                              yield x, *(next(r, fillvalue) for r in rest)
                      
                      def Mad_Physicist(*args, fillvalue=None):
                          # zip_by_first('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
                          # zip_by_first('ABC', 'xyzw', fillvalue='-') --> Ax By Cz
                          if not args:
                              return
                          iterators = [iter(it) for it in args]
                          while True:
                              values = []
                              for i, it in enumerate(iterators):
                                  try:
                                      value = next(it)
                                  except StopIteration:
                                      if i == 0:
                                          return
                                      iterators[i] = repeat(fillvalue)
                                      value = fillvalue
                                  values.append(value)
                              yield tuple(values)
                      
                      def Kelly_Bundy_3(first, *rest, fillvalue=None):
                          a, b = tee(first)
                          return map(itemgetter(1), zip(a, zip_longest(b, *rest, fillvalue=fillvalue)))
                      
                      def Kelly_Bundy_4(first, *rest, fillvalue=None):
                          sentinel = object()
                          for z in zip_longest(chain(first, [sentinel]), *rest, fillvalue=fillvalue):
                              if z[0] is sentinel:
                                  break
                              yield z
                      
                      def Kelly_Bundy_5(first, *rest, fillvalue=None):
                          stopped = False
                          def stop():
                              nonlocal stopped
                              stopped = True
                              return
                              yield
                          for z in zip_longest(chain(first, stop()), *rest, fillvalue=fillvalue):
                              if stopped:
                                  break
                              yield z
                      
                      
                      import timeit
                      from itertools import chain, repeat, zip_longest, islice, tee, compress
                      from operator import itemgetter
                      from collections import deque
                      
                      funcs = [
                          limit_cheat,
                          Kelly_Bundy_chain,
                          Kelly_Bundy_compress,
                          CrazyChucky,
                          Sven_Marnach,
                          Mad_Physicist,
                          Kelly_Bundy_3,
                          Kelly_Bundy_4,
                          Kelly_Bundy_5,
                      ]
                      
                      def test(args_creator):
                      
                          # Correctness
                          expect = list(funcs[0](*args_creator()))
                          for func in funcs:
                              result = list(func(*args_creator()))
                              print(result == expect, func.__name__)
                          
                          # Speed
                          tss = [[] for _ in funcs]
                          for _ in range(5):
                              print()
                              print(args_creator.__name__)
                              for func, ts in zip(funcs, tss):
                                  t = min(timeit.repeat(lambda: deque(func(*args_creator()), 0), number=1))
                                  ts.append(t)
                                  print(*('%4.1f ms ' % (t * 1e3) for t in sorted(ts)[:3]), func.__name__)
                      
                      def args_few_but_long_iterables():
                          global cheat_length
                          cheat_length = 50_000
                          first = repeat(0, 50_000)
                          rest = [repeat(i, 10_000 * i) for i in range(1, 10)]
                          return first, *rest
                      
                      def args_many_but_short_iterables():
                          global cheat_length
                          cheat_length = 50
                          first = repeat(0, 50)
                          rest = [repeat(i, i % 101) for i in range(1, 10_000)]
                          return first, *rest
                      
                      test(args_few_but_long_iterables)
                      funcs[1:3] = funcs[1:3][::-1]
                      test(args_many_but_short_iterables)
                      
                      first = ['a', 'b', 'c']
                      last = [1, 2, 3, 4]
                      if len(first) < len(last):
                          b = list(zip(first, last))
                      else:
                          b = list(zip_longest(first, last))
                      print(b)
                      
                      from itertools import chain, repeat
                      
                      a = ['a', 'b', 'c']
                      b = [1, 2]
                      
                      b = chain(b, repeat(None))
                      
                      print(*zip(a, b))
                      
                      def zip_first(first, *rest, fillvalue=None):
                          rest = [iter(r) for r in rest]
                          for x in first:
                              yield x, *(next(r, fillvalue) for r in rest)
                      
                      def zip_first(first, second, fillvalue=None):
                          second = iter(second)
                          for x in first:
                              yield x, next(second, fillvalue)
                      
                      def zip_first(first, *rest, fillvalue=None):
                          rest = [iter(r) for r in rest]
                          for x in first:
                              yield x, *(next(r, fillvalue) for r in rest)
                      
                      def zip_first(first, second, fillvalue=None):
                          second = iter(second)
                          for x in first:
                              yield x, next(second, fillvalue)
                      

                      How to redirect in React Router v6?

                      copy iconCopydownload iconDownload
                      import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
                      
                      <BrowserRouter>
                        <Routes>
                          <Route path="/" element={<Home />} />
                          <Route path="/lab" element={<Lab />} />
                          <Route
                              path="*"
                              element={<Navigate to="/" replace />}
                          />
                        </Routes>
                      </BrowserRouter>
                      
                      import { useNavigate } from "react-router-dom";
                      let navigate = useNavigate();
                      
                      useEffect(() => {
                         if (LoggedIn){
                            return navigate("/");
                         }
                      },[LoggedIn]);
                      
                      import { useLocation, Navigate } from "react-router-dom";
                      import { useAuth } from "../hooks/Auth";
                      
                      export function RequireAuth({ children }: { children: JSX.Element }) {
                        let { user } = useAuth();
                        let location = useLocation();
                      
                        if (!user) {
                          return <Navigate to="/" state={{ from: location }} replace />;
                        } else {
                          return children;
                        }
                      }
                      
                      import { Routes as Switch, Route } from "react-router-dom";
                      
                      import { RequireAuth } from "./RequireAuth";
                      import { SignIn } from "../pages/SignIn";
                      import { Dashboard } from "../pages/Dashboard";
                      
                      export function Routes() {
                        return (
                          <Switch>
                            <Route path="/" element={<SignIn />} />
                            <Route
                              path="/dashboard"
                              element={
                                <RequireAuth>
                                  <Dashboard />
                                </RequireAuth>
                              }
                            />
                          </Switch>
                        );
                      }
                      
                      
                      import { useLocation, Navigate } from "react-router-dom";
                      import { useAuth } from "../hooks/Auth";
                      
                      export function RequireAuth({ children }: { children: JSX.Element }) {
                        let { user } = useAuth();
                        let location = useLocation();
                      
                        if (!user) {
                          return <Navigate to="/" state={{ from: location }} replace />;
                        } else {
                          return children;
                        }
                      }
                      
                      import { Routes as Switch, Route } from "react-router-dom";
                      
                      import { RequireAuth } from "./RequireAuth";
                      import { SignIn } from "../pages/SignIn";
                      import { Dashboard } from "../pages/Dashboard";
                      
                      export function Routes() {
                        return (
                          <Switch>
                            <Route path="/" element={<SignIn />} />
                            <Route
                              path="/dashboard"
                              element={
                                <RequireAuth>
                                  <Dashboard />
                                </RequireAuth>
                              }
                            />
                          </Switch>
                        );
                      }
                      
                      

                      find_element_by_* commands are deprecated in selenium

                      copy iconCopydownload iconDownload
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
                      
                      from selenium.webdriver.common.by import By
                      
                      button = driver.find_element_by_class_name("quiz_button")
                      
                      button = driver.find_element(By.CLASS_NAME, "quiz_button")
                      
                      element = find_element_by_id("element_id")
                      
                      element = driver.find_element(By.ID, "element_id")
                      
                      element = find_element_by_name("element_name")
                      
                      element = driver.find_element(By.NAME, "element_name")
                      
                      element = find_element_by_link_text("element_link_text")
                      
                      element = driver.find_element(By.LINK_TEXT, "element_link_text")
                      
                      element = find_element_by_partial_link_text("element_partial_link_text")
                      
                      element = driver.find_element(By.PARTIAL_LINK_TEXT, "element_partial_link_text")
                      
                      element = find_element_by_tag_name("element_tag_name")
                      
                      element = driver.find_element(By.TAG_NAME, "element_tag_name")
                      
                      element = find_element_by_css_selector("element_css_selector")
                      
                      element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
                      
                      element = find_element_by_xpath("element_xpath")
                      
                      element = driver.find_element(By.XPATH, "element_xpath")
                      
                      from selenium import webdriver
                      from selenium.webdriver.common.by import By
                      from selenium.webdriver.common.keys import Keys
                      from selenium.webdriver.chrome.service import Service
                      
                      s = Service('C:/Users/.../chromedriver.exe')
                      driver = webdriver.Chrome(service=s)
                      
                      # from - e.g. find_element_by_id("test")
                      
                      find_element(s?)_by_([a-z]+)\((.*)
                      
                      # to - e.g. find_element(By.ID, "test")
                      
                      find_element$1(By.\U$2\E, $3
                      
                      from selenium.webdriver.common.by import By
                      
                      # from - e.g. find_element_by_id("test")
                      
                      find_element(s?)_by_([a-z]+)\((.*)
                      
                      # to - e.g. find_element(By.ID, "test")
                      
                      find_element$1(By.\U$2\E, $3
                      
                      from selenium.webdriver.common.by import By
                      

                      Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)

                      copy iconCopydownload iconDownload
                      classpath 'com.android.tools.build:gradle:4.1.0'
                      
                      distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
                      
                      classpath 'com.android.tools.build:gradle:4.1.0'
                      
                      distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
                      
                      buildscript {
                          ext.kotlin_version = '1.6.10' // Change here
                          repositories {
                              google()
                              jcenter()
                          }
                      
                          dependencies {
                              classpath 'com.android.tools.build:gradle:4.1.0'
                              classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
                          }
                      }
                      
                      Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
                      e: /home/user/.gradle/caches/transforms-3/36814238b86d8b6b6f9e4e1263bce879/transformed/jetified-kotlinx-coroutines-core-jvm-1.5.2.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: 
                      Module was compiled with an incompatible version of Kotlin. 
                      The binary version of its metadata is 1.5.1, expected version is 1.1.15.
                      
                      buildscript {
                          ext.kotlin_version = '1.6.10' // Change here
                          repositories {
                              google()
                              jcenter()
                          }
                      
                          dependencies {
                              classpath 'com.android.tools.build:gradle:4.1.0'
                              classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
                          }
                      }
                      
                      Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
                      e: /home/user/.gradle/caches/transforms-3/36814238b86d8b6b6f9e4e1263bce879/transformed/jetified-kotlinx-coroutines-core-jvm-1.5.2.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: 
                      Module was compiled with an incompatible version of Kotlin. 
                      The binary version of its metadata is 1.5.1, expected version is 1.1.15.
                      
                      ext.kotlin_version = '<latest-version>'
                      
                      Execution failed for task ':assets_audio_player:compileDebugKotlin'.
                      
                      ext.kotlin_version = '<latest-version>'
                      
                      Execution failed for task ':assets_audio_player:compileDebugKotlin'.
                      
                      ext.kotlin_version = '1.6.10' //
                      
                       buildscript {
                      ext.kotlin_version = '1.6.10'
                      repositories {
                          google()
                          mavenCentral()
                      }
                      

                      VS 2022 - Convert to file-scoped namespace in all files

                      copy iconCopydownload iconDownload
                      [*.cs]
                      csharp_style_namespace_declarations = file_scoped:warning
                      
                      csharp_style_namespace_declarations = file_scoped
                      dotnet_diagnostic.IDE0161.severity = error
                      

                      Error when trying to run my React Native app on Android

                      copy iconCopydownload iconDownload
                      allprojects {
                          repositories {
                              mavenCentral()
                              mavenLocal()
                              jcenter()
                      }
                      
                      allprojects {
                          repositories {
                              .... # Keep the rest
                              jcenter() {
                                  content {
                                      includeModule("com.yqritc", "android-scalablevideoview")
                                  }
                              }
                          }
                      }
                      
                      allprojects {
                          repositories {
                              .... # Keep the rest
                              jcenter() {
                                  content {
                                      includeModule("com.yqritc", "android-scalablevideoview")
                                  }
                              }
                          }
                      }
                      

                      android:exported needs to be explicitly specified for &lt;activity&gt;. Apps targeting Android 12 and higher are required to specify

                      copy iconCopydownload iconDownload
                      <receiver android:name="<name_of_the_entry>"
                                      android:exported="false or true"
                                      tools:node="merge" />
                      
                           <activity
                                      android:name="<activity which is giving error>"
                                      android:exported="true"
                                      tools:node="merge" />
                      
                      <activity android:name="name_of_the_activity_inside_library>"
                          android:exported="false|true"
                          tools:node="merge" />
                      
                      debugImplementation "androidx.fragment:fragment-testing:<version>"
                      
                      androidTestImplementation "androidx.fragment:fragment-testing:<version>"
                      
                      debugImplementation "androidx.fragment:fragment-testing:<version>"
                      
                      androidTestImplementation "androidx.fragment:fragment-testing:<version>"
                      
                       android:exported="true"
                      
                      androidTestImplementation "androidx.test.ext:junit:1.1.3"
                      androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.0.4"
                      
                      > java.util.concurrent.ExecutionException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/xxxxx.tmp/base.apk (at Binary XML file line #129): YOUR.FULLY.QUALIFIED.NAME.FAILING.ACTIVITY: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present
                      
                      <activity android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
                      android:exported="true"
                      tools:node="merge"/>
                      
                      <activity android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
                      android:exported="true"
                      tools:node="merge"/>
                      
                      <activity android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
                      android:exported="true"
                      tools:node="merge"/>
                      
                       <activity
                              android:name="com.test.activity.SplashActivity"
                              android:clearTaskOnLaunch="true"
                              android:label="@string/app_name"
                              android:launchMode="singleTop"
                              android:noHistory="true"
                              android:screenOrientation="portrait"
                              android:theme="@style/AppTheme.NoActionBar"
                              android:exported="true">
                      
                         <receiver
                              android:name="com.test.receiver.ShareReceiver"
                              android:exported="true">
                              <intent-filter>
                                  <action android:name="com.test.fcm.android.action.broadcast" />
                              </intent-filter>
                          </receiver>
                      
                         <service
                              android:name="com.google.android.gms.tagmanager.InstallReferrerService"
                              android:exported="true" />
                      
                      testImplementation 'junit:junit:4.13.2' 
                      androidTestImplementation 'androidx.test:runner:1.4.0'
                      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
                      implementation 'com.razorpay:checkout:1.6.15'
                      
                       <activity
                              android:name="com.test.activity.SplashActivity"
                              android:clearTaskOnLaunch="true"
                              android:label="@string/app_name"
                              android:launchMode="singleTop"
                              android:noHistory="true"
                              android:screenOrientation="portrait"
                              android:theme="@style/AppTheme.NoActionBar"
                              android:exported="true">
                      
                         <receiver
                              android:name="com.test.receiver.ShareReceiver"
                              android:exported="true">
                              <intent-filter>
                                  <action android:name="com.test.fcm.android.action.broadcast" />
                              </intent-filter>
                          </receiver>
                      
                         <service
                              android:name="com.google.android.gms.tagmanager.InstallReferrerService"
                              android:exported="true" />
                      
                      testImplementation 'junit:junit:4.13.2' 
                      androidTestImplementation 'androidx.test:runner:1.4.0'
                      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
                      implementation 'com.razorpay:checkout:1.6.15'
                      
                       <activity
                              android:name="com.test.activity.SplashActivity"
                              android:clearTaskOnLaunch="true"
                              android:label="@string/app_name"
                              android:launchMode="singleTop"
                              android:noHistory="true"
                              android:screenOrientation="portrait"
                              android:theme="@style/AppTheme.NoActionBar"
                              android:exported="true">
                      
                         <receiver
                              android:name="com.test.receiver.ShareReceiver"
                              android:exported="true">
                              <intent-filter>
                                  <action android:name="com.test.fcm.android.action.broadcast" />
                              </intent-filter>
                          </receiver>
                      
                         <service
                              android:name="com.google.android.gms.tagmanager.InstallReferrerService"
                              android:exported="true" />
                      
                      testImplementation 'junit:junit:4.13.2' 
                      androidTestImplementation 'androidx.test:runner:1.4.0'
                      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
                      implementation 'com.razorpay:checkout:1.6.15'
                      
                      "com.google.dagger:hilt-android:2.38.1"
                      "com.google.dagger:hilt-android-gradle-plugin:2.38.1"
                      "com.google.dagger:hilt-android-compiler:2.38.1"
                      "com.google.dagger:hilt-android-testing:2.38.1"
                      
                      "com.google.dagger:hilt-android:2.40.5"
                      "com.google.dagger:hilt-android-gradle-plugin:2.40.5"
                      "com.google.dagger:hilt-android-compiler:2.40.5"
                      "com.google.dagger:hilt-android-testing:2.40.5" 
                      
                      "com.google.dagger:hilt-android:2.38.1"
                      "com.google.dagger:hilt-android-gradle-plugin:2.38.1"
                      "com.google.dagger:hilt-android-compiler:2.38.1"
                      "com.google.dagger:hilt-android-testing:2.38.1"
                      
                      "com.google.dagger:hilt-android:2.40.5"
                      "com.google.dagger:hilt-android-gradle-plugin:2.40.5"
                      "com.google.dagger:hilt-android-compiler:2.40.5"
                      "com.google.dagger:hilt-android-testing:2.40.5" 
                      
                      <receiver
                          android:name="com.razorpay.RzpTokenReceiver"
                          android:exported="false">
                          <intent-filter>
                              <action android:name="rzp.device_token.share" />
                          </intent-filter>
                      </receiver>
                      
                      <activity
                          android:name="com.razorpay.CheckoutActivity"
                          android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
                          android:exported="true"
                          android:theme="@style/CheckoutTheme">
                          <intent-filter>
                              <action android:name="android.intent.action.MAIN" />
                              <data
                                  android:host="rzp.io"
                                  android:scheme="io.rzp" />
                          </intent-filter>
                      </activity>
                      
                      android:exported="true" <!-- or false as required -->
                      
                      <activity
                           android:name=".MainActivity"
                           android:exported="true" <** add this line on AndroidManifest.xml**
                           android:launchMode="singleTop"
                           android:theme="@style/LaunchTheme"
                       </activity>
                      

                      Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent, On AlarmPingSender

                      copy iconCopydownload iconDownload
                      implementation 'androidx.work:work-runtime-ktx:2.7.0-beta01'
                      
                      dependencies {
                        // For Java
                        implementation 'androidx.work:work-runtime:2.7.1' 
                      
                        // For Kotlin
                        implementation 'androidx.work:work-runtime-ktx:2.7.1'
                      }
                      
                      <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
                      
                      implementation 'com.google.firebase:firebase-messaging:20.0.0'
                      
                      implementation 'com.google.firebase:firebase-messaging:23.0.0'
                      
                      implementation 'com.google.firebase:firebase-messaging:20.0.0'
                      
                      implementation 'com.google.firebase:firebase-messaging:23.0.0'
                      
                      dependencies {
                          // For Java
                          implementation 'androidx.work:work-runtime:2.7.1' 
                          // For Kotlin
                          implementation 'androidx.work:work-runtime-ktx:2.7.1'
                          implementation 'com.google.firebase:firebase-messaging:23.0.0'
                          ...
                      }
                      
                      PendingIntent pendingIntent = PendingIntent.getActivity(this, alarmID, notificationIntent, PendingIntent.FLAG_IMMUTABLE);
                      
                      dependencies {
                          // For Java
                          implementation 'androidx.work:work-runtime:2.7.1' 
                          // For Kotlin
                          implementation 'androidx.work:work-runtime-ktx:2.7.1'
                          implementation 'com.google.firebase:firebase-messaging:23.0.0'
                          ...
                      }
                      
                      PendingIntent pendingIntent = PendingIntent.getActivity(this, alarmID, notificationIntent, PendingIntent.FLAG_IMMUTABLE);
                      

                      See all related Code Snippets

                      Community Discussions

                      Trending Discussions on exist
                      • psql: error: connection to server on socket &quot;/tmp/.s.PGSQL.5432&quot; failed: No such file or directory
                      • Unable to negotiate with 40.74.28.9 port 22: no matching host key type found. Their offer: ssh-rsa
                      • zip_longest for the left list always
                      • How to redirect in React Router v6?
                      • find_element_by_* commands are deprecated in selenium
                      • Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)
                      • VS 2022 - Convert to file-scoped namespace in all files
                      • Error when trying to run my React Native app on Android
                      • Error while downloading the requirements using pip install (setup command: use_2to3 is invalid.)
                      • android:exported needs to be explicitly specified for &lt;activity&gt;. Apps targeting Android 12 and higher are required to specify
                      Trending Discussions on exist

                      QUESTION

                      psql: error: connection to server on socket &quot;/tmp/.s.PGSQL.5432&quot; failed: No such file or directory

                      Asked 2022-Apr-04 at 15:46

                      Not really sure what caused this but most likely exiting the terminal while my rails server which was connected to PostgreSQL database was closed (not a good practice I know but lesson learned!)

                      I've already tried the following:

                      1. Rebooting my machine (using MBA M1 2020)
                      2. Restarting PostgreSQL using homebrew brew services restart postgresql
                      3. Re-installing PostgreSQL using Homebrew
                      4. Updating PostgreSQL using Homebrew
                      5. I also tried following this link but when I run cd Library/Application\ Support/Postgres terminal tells me Postgres folder doesn't exist, so I'm kind of lost already. Although I have a feeling that deleting postmaster.pid would really fix my issue. Any help would be appreciated!

                      ANSWER

                      Answered 2022-Jan-13 at 15:19
                      Resetting PostgreSQL

                      My original answer only included the troubleshooting steps below, and a workaround. I now decided to properly fix it via brute force by removing all clusters and reinstalling, since I didn't have any data there to keep. It was something along these lines, on my Ubuntu 21.04 system:

                      sudo pg_dropcluster --stop 12 main
                      sudo pg_dropcluster --stop 14 main
                      sudo apt remove postgresql-14
                      sudo apt purge postgresql*
                      sudo apt install postgresql-14
                      

                      Now I have:

                      $ pg_lsclusters
                      Ver Cluster Port Status Owner    Data directory              Log file
                      14  main    5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      

                      And sudo -u postgres psql works fine. The service was started automatically but it can be done manually with sudo systemctl start postgresql.

                      Incidentally, I can recommend the PostgreSQL docker image, which eliminates the need to bother with a local installation.

                      Troubleshooting

                      Although I cannot provide an answer to your specific problem, I thought I'd share my troubleshooting steps, hoping that it might be of some help. It seems that you are on Mac, whereas I am running Ubuntu 21.04, so expect things to be different.

                      This is a client connection problem, as noted by section 19.3.2 in the docs.

                      The directory in my error message is different:

                      $ sudo su postgres -c "psql"
                      psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
                              Is the server running locally and accepting connections on that socket?
                      

                      I checked what unix sockets I had in that directory:

                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      

                      Makes sense, there is a socket for 5433 not 5432. I confirmed this by running:

                      $ pg_lsclusters
                      Ver Cluster Port Status                Owner    Data directory              Log file
                      12  main    5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
                      14  main    5433 online                postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
                      

                      This explains how it got into this mess on my system. The default port is 5432, but after I upgraded from version 12 to 14, the server was setup to listen to 5433, presumably because it considered 5432 as already taken. Two alternatives here, get the server to listen on 5432 which is the client's default, or get the client to use 5433.

                      Let's try it by changing the client's parameters:

                      $ sudo su postgres -c "psql --port=5433"
                      psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
                      Type "help" for help.
                      
                      postgres=#
                      

                      It worked! Now, to make it permanent I'm supposed to put this setting on a psqlrc or ~/.psqlrc file. The thin documentation on this (under "Files") was not helpful to me as I was not sure on the syntax and my attempts did not change the client's default, so I moved on.

                      To change the server I looked for the postgresql.conf mentioned in the documentation but could not find the file. I did however see /var/lib/postgresql/14/main/postgresql.auto.conf so I created it on the same directory with the content:

                      port = 5432
                      

                      Restarted the server: sudo systemctl restart postgresql

                      But the error persisted because, as the logs confirmed, the port did not change:

                      $ tail /var/log/postgresql/postgresql-14-main.log
                      ...
                      2021-10-29 16:36:12.195 UTC [25236] LOG:  listening on IPv4 address "127.0.0.1", port 5433
                      2021-10-29 16:36:12.198 UTC [25236] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
                      2021-10-29 16:36:12.204 UTC [25237] LOG:  database system was shut down at 2021-10-29 16:36:12 UTC
                      2021-10-29 16:36:12.210 UTC [25236] LOG:  database system is ready to accept connections
                      

                      After other attempts did not succeed, I eventually decided to use a workaround: to redirect the client's requests on 5432 to 5433:

                      ln -s /var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.5432
                      

                      This is what I have now:

                      $ ls -lah /var/run/postgresql/
                      total 8.0K
                      drwxrwsr-x  4 postgres postgres  160 Oct 29 16:40 .
                      drwxr-xr-x 36 root     root     1.1K Oct 29 14:08 ..
                      drwxr-s---  2 postgres postgres   40 Oct 29 14:33 12-main.pg_stat_tmp
                      drwxr-s---  2 postgres postgres  120 Oct 29 16:59 14-main.pg_stat_tmp
                      -rw-r--r--  1 postgres postgres    6 Oct 29 16:36 14-main.pid
                      lrwxrwxrwx  1 postgres postgres   33 Oct 29 16:40 .s.PGSQL.5432 -> /var/run/postgresql/.s.PGSQL.5433
                      srwxrwxrwx  1 postgres postgres    0 Oct 29 16:36 .s.PGSQL.5433
                      -rw-------  1 postgres postgres   70 Oct 29 16:36 .s.PGSQL.5433.lock
                      

                      This means I can now just run psql without having to explicitly set the port to 5433. Now, this is a hack and I would not recommend it. But in my development system I am happy with it for now, because I don't have more time to spend on this. This is why I shared the steps and the links so that you can find a proper solution for your case.

                      Source https://stackoverflow.com/questions/69754628

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install exist

                      You can download it from GitHub.
                      You can use exist like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the exist component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      We hold an open Community Call each week on Monday, from 19:30-20:30 CET. The meetings are posted to this public Google Calendar. If you wish to participate, please join the #community channel on our Slack workspace (invitation link below). Pinned to that channel is a link to the upcoming meeting's agenda, which contains the link to the call, as well as a link to timeanddate.com to look up the time of the meeting for your local time zone.

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Consider Popular Java Libraries
                      Try Top Libraries by eXist-db
                      Compare Java Libraries with Highest Support
                      Compare Java Libraries with Highest Quality
                      Compare Java Libraries with Highest Security
                      Compare Java Libraries with Permissive License
                      Compare Java Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.