问:
Java dependency failure for .deb file on openjdk docker base
I have been working with an opensource project. Which creates docker images with build-generated debian (.deb) packages installed on the jdk8 image.

But lately I started to have error and unfortunately I can not get over it. Once the dpkg command initiated via Dockerfile. It says the dependency to jdk/jre can not be found. which is funny because the base is openjdk/jdk8

======Dockerfile======

```<code>FROM openjdk:8-jdk

COPY *.deb /tmp/
RUN chmod +x /tmp/application.deb
RUN java -version

RUN ls -lrth /tmp/
RUN dpkg -I /tmp/application.deb
RUN dpkg -i /tmp/application.deb
</code>```

======docker command initiated======

```<code>docker build --no-cache -t jdk8-img .
</code>```

======docker build output======

```<code>Sending build context to Docker daemon  103.3MB
Step 1/7 : FROM openjdk:8-jdk
 ---> d318d6aeb831
Step 2/7 : COPY *.deb /tmp/
 ---> 74305ee50ee7
Step 3/7 : RUN chmod +x /tmp/application.deb
 ---> Running in de51d99b4570
Removing intermediate container de51d99b4570
 ---> cb47ff56ec1c
Step 4/7 : RUN java -version
 ---> Running in a14700fcc037
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
Removing intermediate container a14700fcc037
 ---> 813cc1108cc7
Step 5/7 : RUN ls -lrth /tmp/
 ---> Running in 0255efbfd08c
total 99M
-rwxr-xr-x 1 root root  99M May 28 12:23 application.deb
drwxr-xr-x 1 root root 4.0K May 28 12:25 hsperfdata_root
Removing intermediate container 0255efbfd08c
 ---> ebd1965f1b97
Step 6/7 : RUN dpkg -I /tmp/application.deb
 ---> Running in 7f7411200dbd
 new debian package, version 2.0.
 size 103337854 bytes: control archive=2382 bytes.
     175 bytes,     4 lines      conffiles
     266 bytes,    10 lines      control
    4549 bytes,    48 lines      md5sums
     255 bytes,    21 lines   *  postinst             #!/bin/sh
      52 bytes,     7 lines   *  postrm               #!/bin/sh
     534 bytes,    26 lines   *  preinst              #!/bin/sh
     103 bytes,     9 lines   *  prerm                #!/bin/sh
 Package: application
 Source: application
 Version: 2.3.1-1
 Section: java
 Priority: optional
 Architecture: all
 Depends: openjdk-8-jre | java8-runtime | oracle-java8-installer | openjdk-8-jre-headless
 Installed-Size: 112298
 Maintainer: eolgkay
 Description: application
Removing intermediate container 7f7411200dbd
 ---> 1f9db460cbdd
Step 7/7 : RUN dpkg -i /tmp/application.deb
 ---> Running in bba045241db9
Selecting previously unselected package application.
(Reading database ... 12354 files and directories currently installed.)
Preparing to unpack /tmp/application.deb ...
Adding group `application' (GID 102) ...
Done.
Unpacking application (2.3.1-1) ...
dpkg: dependency problems prevent configuration of application:
 application depends on openjdk-8-jre | java8-runtime | oracle-java8-installer | openjdk-8-jre-headless; however:
  Package openjdk-8-jre is not installed.
  Package java8-runtime is not installed.
  Package oracle-java8-installer is not installed.
  Package openjdk-8-jre-headless is not installed.

dpkg: error processing package application (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 application
The command '/bin/sh -c dpkg -i /tmp/application.deb' returned a non-zero code: 1
</code>```

as you can see this is so weird; I just checked environment (even if I know the base is openjdk:jdk8) and printed all to the output.

update
I am keeping debugging the issue and it seems that the dpkg installed app list does not contain java related package.

```Step 6/6 : RUN dpkg -l
 ---> Running in ac30028e4fb9
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                       Version                        Architecture Description
+++-==========================-==============================-============-===============================================================================
ii  adduser                    3.115                          all          add and remove users and groups
ii  apt                        1.4.9                          amd64        commandline package manager
ii  base-files                 9.9+deb9u9                     amd64        Debian base system miscellaneous files
ii  base-passwd                3.5.43                         amd64        Debian base system master password and group files
ii  bash                       4.4-5                          amd64        GNU Bourne Again SHell
ii  bsdutils                   1:2.29.2-1+deb9u1              amd64        basic utilities from 4.4BSD-Lite
ii  bzip2                      1.0.6-8.1                      amd64        high-quality block-sorting file compressor - utilities
ii  bzr                        2.7.0+bzr6619-7+deb9u1         all          easy to use distributed version control system
ii  ca-certificates            20161130+nmu1+deb9u1           all          Common CA certificates
ii  coreutils                  8.26-3                         amd64        GNU core utilities
ii  curl                       7.52.1-5+deb9u9                amd64        command line tool for transferring data with URL syntax
ii  dash                       0.5.8-2.4                      amd64        POSIX-compliant shell
ii  debconf                    1.5.61                         all          Debian configuration management system
ii  debian-archive-keyring     2017.5                         all          GnuPG archive keys of the Debian archive
ii  debianutils                4.8.1.1                        amd64        Miscellaneous utilities specific to Debian
ii  diffutils                  1:3.5-3                        amd64        File comparison utilities
ii  dirmngr                    2.1.18-8~deb9u4                amd64        GNU privacy guard - network certificate management service
ii  dpkg                       1.18.25                        amd64        Debian package management system
ii  e2fslibs:amd64             1.43.4-2                       amd64        ext2/ext3/ext4 file system libraries
ii  e2fsprogs                  1.43.4-2                       amd64        ext2/ext3/ext4 file system utilities
ii  findutils                  4.6.0+git+20161106-2           amd64        utilities for finding files--find, xargs
ii  fontconfig                 2.11.0-6.7+b1                  amd64        generic font configuration library - support binaries
ii  fontconfig-config          2.11.0-6.7                     all          generic font configuration library - configuration
ii  fonts-dejavu-core          2.37-1                         all          Vera font family derivate with additional characters
ii  gcc-6-base:amd64           6.3.0-18+deb9u1                amd64        GCC, the GNU Compiler Collection (base package)
ii  git                        1:2.11.0-3+deb9u4              amd64        fast, scalable, distributed revision control system
ii  git-man                    1:2.11.0-3+deb9u4              all          fast, scalable, distributed revision control system (manual pages)
ii  gnupg                      2.1.18-8~deb9u4                amd64        GNU privacy guard - a free PGP replacement
ii  gnupg-agent                2.1.18-8~deb9u4                amd64        GNU privacy guard - cryptographic agent
ii  gpgv                       2.1.18-8~deb9u4                amd64        GNU privacy guard - signature verification tool
ii  grep                       2.27-2                         amd64        GNU grep, egrep and fgrep
ii  gzip                       1.6-5+b1                       amd64        GNU compression utilities
ii  hostname                   3.18+b1                        amd64        utility to set/show the host name or domain name
ii  init-system-helpers        1.48                           all          helper tools for all init systems
ii  iproute2                   4.9.0-1+deb9u1                 amd64        networking and traffic control tools
ii  iputils-ping               3:20161105-1                   amd64        Tools to test the reachability of network hosts
ii  libacl1:amd64              2.2.52-3+b1                    amd64        Access control list shared library
ii  libapr1:amd64              1.5.2-5                        amd64        Apache Portable Runtime Library
ii  libaprutil1:amd64          1.5.4-3                        amd64        Apache Portable Runtime Utility Library
ii  libapt-pkg5.0:amd64        1.4.9                          amd64        package management runtime library
ii  libassuan0:amd64           2.4.3-2                        amd64        IPC library for the GnuPG components
ii  libattr1:amd64             1:2.4.47-2+b2                  amd64        Extended attribute shared library
ii  libaudit-common            1:2.6.7-2                      all          Dynamic library for security auditing - common files
ii  libaudit1:amd64            1:2.6.7-2                      amd64        Dynamic library for security auditing
ii  libblkid1:amd64            2.29.2-1+deb9u1                amd64        block device ID library
ii  libbsd0:amd64              0.8.3-1                        amd64        utility functions from BSD systems - shared library
ii  libbz2-1.0:amd64           1.0.6-8.1                      amd64        high-quality block-sorting file compressor library - runtime
ii  libc-bin                   2.24-11+deb9u4                 amd64        GNU C Library: Binaries
ii  libc6:amd64                2.24-11+deb9u4                 amd64        GNU C Library: Shared libraries
ii  libcap-ng0:amd64           0.7.7-3+b1                     amd64        An alternate POSIX capabilities library
ii  libcap2:amd64              1:2.25-1                       amd64        POSIX 1003.1e capabilities (library)
ii  libcomerr2:amd64           1.43.4-2                       amd64        common error description library
ii  libcurl3:amd64             7.52.1-5+deb9u9                amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl3-gnutls:amd64      7.52.1-5+deb9u9                amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  libdb5.3:amd64             5.3.28-12+deb9u1               amd64        Berkeley v5.3 Database Libraries [runtime]
ii  libdebconfclient0:amd64    0.227                          amd64        Debian Configuration Management System (C-implementation library)
ii  libedit2:amd64             3.1-20160903-3                 amd64        BSD editline and history libraries
ii  libelf1:amd64              0.168-1                        amd64        library to read and write ELF files
ii  liberror-perl              0.17024-1                      all          Perl module for error/exception handling in an OO-ish way
ii  libexpat1:amd64            2.2.0-2+deb9u1                 amd64        XML parsing C library - runtime library
ii  libfdisk1:amd64            2.29.2-1+deb9u1                amd64        fdisk partitioning library
ii  libffi6:amd64              3.2.1-6                        amd64        Foreign Function Interface library runtime
ii  libfontconfig1:amd64       2.11.0-6.7+b1                  amd64        generic font configuration library - runtime
ii  libfreetype6:amd64         2.6.3-3.2                      amd64        FreeType 2 font engine, shared library files
ii  libgcc1:amd64              1:6.3.0-18+deb9u1              amd64        GCC support library
ii  libgcrypt20:amd64          1.7.6-2+deb9u3                 amd64        LGPL Crypto library - runtime library
ii  libgdbm3:amd64             1.8.3-14                       amd64        GNU dbm database routines (runtime version)
ii  libgmp10:amd64             2:6.1.2+dfsg-1                 amd64        Multiprecision arithmetic library
ii  libgnutls30:amd64          3.5.8-5+deb9u4                 amd64        GNU TLS library - main runtime library
ii  libgpg-error0:amd64        1.26-2                         amd64        library for common error values and messages in GnuPG components
ii  libgssapi-krb5-2:amd64     1.15-1+deb9u1                  amd64        MIT Kerberos runtime libraries - krb5 GSS-API Mechanism
ii  libhogweed4:amd64          3.3-1+b2                       amd64        low level cryptographic library (public-key cryptos)
ii  libidn11:amd64             1.33-1                         amd64        GNU Libidn library, implementation of IETF IDN specifications
ii  libidn2-0:amd64            0.16-1+deb9u1                  amd64        Internationalized domain names (IDNA2008) library
ii  libjs-excanvas             0.r3-4                         all          HTML5 Canvas for Internet Explorer
ii  libk5crypto3:amd64         1.15-1+deb9u1                  amd64        MIT Kerberos runtime libraries - Crypto Library
ii  libkeyutils1:amd64         1.5.9-9                        amd64        Linux Key Management Utilities (library)
ii  libkrb5-3:amd64            1.15-1+deb9u1                  amd64        MIT Kerberos runtime libraries
ii  libkrb5support0:amd64      1.15-1+deb9u1                  amd64        MIT Kerberos runtime libraries - Support library
ii  libksba8:amd64             1.3.5-2                        amd64        X.509 and CMS support library
ii  libldap-2.4-2:amd64        2.4.44+dfsg-5+deb9u2           amd64        OpenLDAP libraries
ii  libldap-common             2.4.44+dfsg-5+deb9u2           all          OpenLDAP common files for libraries
ii  liblz4-1:amd64             0.0~r131-2+b1                  amd64        Fast LZ compression algorithm library - runtime
ii  liblzma5:amd64             5.2.2-1.2+b1                   amd64        XZ-format compression library
ii  libmnl0:amd64              1.0.4-2                        amd64        minimalistic Netlink communication library
ii  libmount1:amd64            2.29.2-1+deb9u1                amd64        device mounting library
ii  libncurses5:amd64          6.0+20161126-1+deb9u2          amd64        shared libraries for terminal handling
ii  libncursesw5:amd64         6.0+20161126-1+deb9u2          amd64        shared libraries for terminal handling (wide character support)
ii  libnettle6:amd64           3.3-1+b2                       amd64        low level cryptographic library (symmetric and one-way cryptos)
ii  libnghttp2-14:amd64        1.18.1-1                       amd64        library implementing HTTP/2 protocol (shared library)
ii  libnpth0:amd64             1.3-1                          amd64        replacement for GNU Pth using system threads
ii  libp11-kit0:amd64          0.23.3-2                       amd64        library for loading and coordinating access to PKCS#11 modules - runtime
ii  libpam-modules:amd64       1.1.8-3.6                      amd64        Pluggable Authentication Modules for PAM
ii  libpam-modules-bin         1.1.8-3.6                      amd64        Pluggable Authentication Modules for PAM - helper binaries
ii  libpam-runtime             1.1.8-3.6                      all          Runtime support for the PAM library
ii  libpam0g:amd64             1.1.8-3.6                      amd64        Pluggable Authentication Modules library
ii  libpcre3:amd64             2:8.39-3                       amd64        Old Perl 5 Compatible Regular Expression Library - runtime files
ii  libperl5.24:amd64          5.24.1-3+deb9u5                amd64        shared Perl library
ii  libpng16-16:amd64          1.6.28-1+deb9u1                amd64        PNG library - runtime (version 1.6)
ii  libprocps6:amd64           2:3.3.12-3+deb9u1              amd64        library for accessing process information from /proc
ii  libpsl5:amd64              0.17.0-3                       amd64        Library for Public Suffix List (shared libraries)
ii  libpython-stdlib:amd64     2.7.13-2                       amd64        interactive high-level object-oriented language (default python version)
ii  libpython2.7-minimal:amd64 2.7.13-2+deb9u3                amd64        Minimal subset of the Python language (version 2.7)
ii  libpython2.7-stdlib:amd64  2.7.13-2+deb9u3                amd64        Interactive high-level object-oriented language (standard library, version 2.7)
ii  libreadline7:amd64         7.0-3                          amd64        GNU readline and history libraries, run-time libraries
ii  librtmp1:amd64             2.4+20151223.gitfa8646d.1-1+b1 amd64        toolkit for RTMP streams (shared library)
ii  libsasl2-2:amd64           2.1.27~101-g0780600+dfsg-3     amd64        Cyrus SASL - authentication abstraction library
ii  libsasl2-modules-db:amd64  2.1.27~101-g0780600+dfsg-3     amd64        Cyrus SASL - pluggable authentication modules (DB)
ii  libselinux1:amd64          2.6-3+b3                       amd64        SELinux runtime shared libraries
ii  libsemanage-common         2.6-2                          all          Common files for SELinux policy management libraries
ii  libsemanage1:amd64         2.6-2                          amd64        SELinux policy management library
ii  libsepol1:amd64            2.6-2                          amd64        SELinux library for manipulating binary security policies
ii  libserf-1-1:amd64          1.3.9-3+deb9u1                 amd64        high-performance asynchronous HTTP client library
ii  libsmartcols1:amd64        2.29.2-1+deb9u1                amd64        smart column output alignment library
ii  libsqlite3-0:amd64         3.16.2-5+deb9u1                amd64        SQLite 3 shared library
ii  libss2:amd64               1.43.4-2                       amd64        command-line interface parsing library
ii  libssh2-1:amd64            1.7.0-1+deb9u1                 amd64        SSH2 client-side library
ii  libssl1.0.2:amd64          1.0.2r-1~deb9u1                amd64        Secure Sockets Layer toolkit - shared libraries
ii  libssl1.1:amd64            1.1.0j-1~deb9u1                amd64        Secure Sockets Layer toolkit - shared libraries
ii  libstdc++6:amd64           6.3.0-18+deb9u1                amd64        GNU Standard C++ Library v3
ii  libsvn1:amd64              1.9.5-1+deb9u3                 amd64        Shared libraries used by Apache Subversion
ii  libsystemd0:amd64          232-25+deb9u11                 amd64        systemd utility library
ii  libtasn1-6:amd64           4.10-1.1+deb9u1                amd64        Manage ASN.1 structures (runtime)
ii  libtinfo5:amd64            6.0+20161126-1+deb9u2          amd64        shared low-level terminfo library for terminal handling
ii  libudev1:amd64             232-25+deb9u11                 amd64        libudev shared library
ii  libunistring0:amd64        0.9.6+really0.9.3-0.1          amd64        Unicode string library for C
ii  libustr-1.0-1:amd64        1.0.4-6                        amd64        Micro string library: shared library
ii  libuuid1:amd64             2.29.2-1+deb9u1                amd64        Universally Unique ID library
ii  login                      1:4.4-4.1                      amd64        system login tools
ii  lsb-base                   9.20161125                     all          Linux Standard Base init script functionality
ii  mawk                       1.3.3-17+b3                    amd64        a pattern scanning and text processing language
ii  mercurial                  4.0-1+deb9u1                   amd64        easy-to-use, scalable distributed version control system
ii  mercurial-common           4.0-1+deb9u1                   all          easy-to-use, scalable distributed version control system (common files)
ii  mime-support               3.60                           all          MIME files 'mime.types' & 'mailcap', and support programs
ii  mount                      2.29.2-1+deb9u1                amd64        tools for mounting and manipulating filesystems
ii  multiarch-support          2.24-11+deb9u4                 amd64        Transitional package to ensure multiarch compatibility
ii  ncurses-base               6.0+20161126-1+deb9u2          all          basic terminal type definitions
ii  ncurses-bin                6.0+20161126-1+deb9u2          amd64        terminal-related programs and man pages
ii  netbase                    5.4                            all          Basic TCP/IP networking system
ii  openssh-client             1:7.4p1-10+deb9u6              amd64        secure shell (SSH) client, for secure access to remote machines
ii  openssl                    1.1.0j-1~deb9u1                amd64        Secure Sockets Layer toolkit - cryptographic utility
ii  passwd                     1:4.4-4.1                      amd64        change and administer password and group data
ii  perl                       5.24.1-3+deb9u5                amd64        Larry Wall's Practical Extraction and Report Language
ii  perl-base                  5.24.1-3+deb9u5                amd64        minimal Perl system
ii  perl-modules-5.24          5.24.1-3+deb9u5                all          Core Perl modules
ii  pinentry-curses            1.0.0-2                        amd64        curses-based PIN or pass-phrase entry dialog for GnuPG
ii  procps                     2:3.3.12-3+deb9u1              amd64        /proc file system utilities
ii  python                     2.7.13-2                       amd64        interactive high-level object-oriented language (default version)
ii  python-bzrlib              2.7.0+bzr6619-7+deb9u1         amd64        distributed version control system - python library
ii  python-configobj           5.0.6-2                        all          simple but powerful config file reader and writer for Python 2
ii  python-minimal             2.7.13-2                       amd64        minimal subset of the Python language (default version)
ii  python-six                 1.10.0-3                       all          Python 2 and 3 compatibility library (Python 2 interface)
ii  python2.7                  2.7.13-2+deb9u3                amd64        Interactive high-level object-oriented language (version 2.7)
ii  python2.7-minimal          2.7.13-2+deb9u3                amd64        Minimal subset of the Python language (version 2.7)
ii  readline-common            7.0-3                          all          GNU readline and history libraries, common files
ii  sed                        4.4-1                          amd64        GNU stream editor for filtering/transforming text
ii  sensible-utils             0.0.9+deb9u1                   all          Utilities for sensible alternative selection
ii  subversion                 1.9.5-1+deb9u3                 amd64        Advanced version control system
ii  sysvinit-utils             2.88dsf-59.9                   amd64        System-V-like utilities
ii  tar                        1.29b-1.1                      amd64        GNU version of the tar archiving utility
ii  tzdata                     2019a-0+deb9u1                 all          time zone and daylight-saving time data
ii  ucf                        3.0036                         all          Update Configuration File(s): preserve user changes to config files
ii  unzip                      6.0-21+deb9u1                  amd64        De-archiver for .zip files
ii  util-linux                 2.29.2-1+deb9u1                amd64        miscellaneous system utilities
ii  wget                       1.18-5+deb9u3                  amd64        retrieves files from the web
ii  xz-utils                   5.2.2-1.2+b1                   amd64        XZ-format compression utilities
ii  zlib1g:amd64               1:1.2.8.dfsg-5                 amd64        compression library - runtime
```

答:
On 22.05.2019 openjdk guys changed the way they create base image. by this they are now manually downloading the image and unzipping it to installation folder. Thus dpkg not listed the installation and mark jdk dependent packages as not compliant.

https://github.com/docker-library/openjdk/commit/3eb0351b208d739fac35345c85e3c6237c2114ec#diff-fef076ee1e5f270f2c5a93d075150919

Body:
I have been working with an opensource project. Which creates docker images with build-generated debian (.deb) packages installed on the jdk8 image.

But lately I started to have error and unfortunately I can not get over it. Once the dpkg command initiated via Dockerfile. It says the dependency to jdk/jre can not be found. which is funny because the base is openjdk/jdk8

======Dockerfile======

FROM openjdk:8-jdk

COPY *.deb /tmp/
RUN chmod +x /tmp/application.deb
RUN java -version

RUN ls -lrth /tmp/
RUN dpkg -I /tmp/application.deb
RUN dpkg -i /tmp/application.deb

======docker command initiated======

docker build --no-cache -t jdk8-img .

======docker build output======

Sending build context to Docker daemon  103.3MB
Step 1/7 : FROM openjdk:8-jdk
 ---> d318d6aeb831
Step 2/7 : COPY *.deb /tmp/
 ---> 74305ee50ee7
Step 3/7 : RUN chmod +x /tmp/application.deb
 ---> Running in de51d99b4570
Removing intermediate container de51d99b4570
 ---> cb47ff56ec1c
Step 4/7 : RUN java -version
 ---> Running in a14700fcc037
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
Removing intermediate container a14700fcc037
 ---> 813cc1108cc7
Step 5/7 : RUN ls -lrth /tmp/
 ---> Running in 0255efbfd08c
total 99M
-rwxr-xr-x 1 root root  99M May 28 12:23 application.deb
drwxr-xr-x 1 root root 4.0K May 28 12:25 hsperfdata_root
Removing intermediate container 0255efbfd08c
 ---> ebd1965f1b97
Step 6/7 : RUN dpkg -I /tmp/application.deb
 ---> Running in 7f7411200dbd
 new debian package, version 2.0.
 size 103337854 bytes: control archive=2382 bytes.
     175 bytes,     4 lines      conffiles
     266 bytes,    10 lines      control
    4549 bytes,    48 lines      md5sums
     255 bytes,    21 lines   *  postinst             #!/bin/sh
      52 bytes,     7 lines   *  postrm               #!/bin/sh
     534 bytes,    26 lines   *  preinst              #!/bin/sh
     103 bytes,     9 lines   *  prerm                #!/bin/sh
 Package: application
 Source: application
 Version: 2.3.1-1
 Section: java
 Priority: optional
 Architecture: all
 Depends: openjdk-8-jre | java8-runtime | oracle-java8-installer | openjdk-8-jre-headless
 Installed-Size: 112298
 Maintainer: eolgkay
 Description: application
Removing intermediate container 7f7411200dbd
 ---> 1f9db460cbdd
Step 7/7 : RUN dpkg -i /tmp/application.deb
 ---> Running in bba045241db9
Selecting previously unselected package application.
(Reading database ... 12354 files and directories currently installed.)
Preparing to unpack /tmp/application.deb ...
Adding group `application' (GID 102) ...
Done.
Unpacking application (2.3.1-1) ...
dpkg: dependency problems prevent configuration of application:
 application depends on openjdk-8-jre | java8-runtime | oracle-java8-installer | openjdk-8-jre-headless; however:
  Package openjdk-8-jre is not installed.
  Package java8-runtime is not installed.
  Package oracle-java8-installer is not installed.
  Package openjdk-8-jre-headless is not installed.

dpkg: error processing package application (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 application
The command '/bin/sh -c dpkg -i /tmp/application.deb' returned a non-zero code: 1

as you can see this is so weird; I just checked environment (even if I know the base is openjdk:jdk8) and printed all to the output.

update
I am keeping debugging the issue and it seems that the dpkg installed app list does not contain java related package.

Step 6/6 : RUN dpkg -l
 ---> Running in ac30028e4fb9
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                       Version                        Architecture Description
+++-==========================-==============================-============-===============================================================================
ii  adduser                    3.115                          all          add and remove users and groups
ii  apt                        1.4.9                          amd64        commandline package manager
ii  base-files                 9.9+deb9u9                     amd64        Debian base system miscellaneous files
ii  base-passwd                3.5.43                         amd64        Debian base system master password and group files
ii  bash                       4.4-5                          amd64        GNU Bourne Again SHell
ii  bsdutils                   1:2.29.2-1+deb9u1              amd64        basic utilities from 4.4BSD-Lite
ii  bzip2                      1.0.6-8.1                      amd64        high-quality block-sorting file compressor - utilities
ii  bzr                        2.7.0+bzr6619-7+deb9u1         all          easy to use distributed version control system
ii  ca-certificates            20161130+nmu1+deb9u1           all          Common CA certificates
ii  coreutils                  8.26-3                         amd64        GNU core utilities
ii  curl                       7.52.1-5+deb9u9                amd64        command line tool for transferring data with URL syntax
ii  dash                       0.5.8-2.4                      amd64        POSIX-compliant shell
ii  debconf                    1.5.61                         all          Debian configuration management system
ii  debian-archive-keyring     2017.5                         all          GnuPG archive keys of the Debian archive
ii  debianutils                4.8.1.1                        amd64        Miscellaneous utilities specific to Debian
ii  diffutils                  1:3.5-3                        amd64        File comparison utilities
ii  dirmngr                    2.1.18-8~deb9u4                amd64        GNU privacy guard - network certificate management service
ii  dpkg                       1.18.25                        amd64        Debian package management system
ii  e2fslibs:amd64             1.43.4-2                       amd64        ext2/ext3/ext4 file system libraries
ii  e2fsprogs                  1.43.4-2                       amd64        ext2/ext3/ext4 file system utilities
ii  findutils                  4.6.0+git+20161106-2           amd64        utilities for finding files--find, xargs
ii  fontconfig                 2.11.0-6.7+b1                  amd64        generic font configuration library - support binaries
ii  fontconfig-config          2.11.0-6.7                     all          generic font configuration library - configuration
ii  fonts-dejavu-core          2.37-1                         all          Vera font family derivate with additional characters
ii  gcc-6-base:amd64           6.3.0-18+deb9u1                amd64        GCC, the GNU Compiler Collection (base package)
ii  git                        1:2.11.0-3+deb9u4              amd64        fast, scalable, distributed revision control system
ii  git-man                    1:2.11.0-3+deb9u4              all          fast, scalable, distributed revision control system (manual pages)
ii  gnupg                      2.1.18-8~deb9u4                amd64        GNU privacy guard - a free PGP replacement
ii  gnupg-agent                2.1.18-8~deb9u4                amd64        GNU privacy guard - cryptographic agent
ii  gpgv                       2.1.18-8~deb9u4                amd64        GNU privacy guard - signature verification tool
ii  grep                       2.27-2                         amd64        GNU grep, egrep and fgrep
ii  gzip                       1.6-5+b1                       amd64        GNU compression utilities
ii  hostname                   3.18+b1                        amd64        utility to set/show the host name or domain name
ii  init-system-helpers        1.48                           all          helper tools for all init systems
ii  iproute2                   4.9.0-1+deb9u1                 amd64        networking and traffic control tools
ii  iputils-ping               3:20161105-1                   amd64        Tools to test the reachability of network hosts
ii  libacl1:amd64              2.2.52-3+b1                    amd64        Access control list shared library
ii  libapr1:amd64              1.5.2-5                        amd64        Apache Portable Runtime Library
ii  libaprutil1:amd64          1.5.4-3                        amd64        Apache Portable Runtime Utility Library
ii  libapt-pkg5.0:amd64        1.4.9                          amd64        package management runtime library
ii  libassuan0:amd64           2.4.3-2                        amd64        IPC library for the GnuPG components
ii  libattr1:amd64             1:2.4.47-2+b2                  amd64        Extended attribute shared library
ii  libaudit-common            1:2.6.7-2                      all          Dynamic library for security auditing - common files
ii  libaudit1:amd64            1:2.6.7-2                      amd64        Dynamic library for security auditing
ii  libblkid1:amd64            2.29.2-1+deb9u1                amd64        block device ID library
ii  libbsd0:amd64              0.8.3-1                        amd64        utility functions from BSD systems - shared library
ii  libbz2-1.0:amd64           1.0.6-8.1                      amd64        high-quality block-sorting file compressor library - runtime
ii  libc-bin                   2.24-11+deb9u4                 amd64        GNU C Library: Binaries
ii  libc6:amd64                2.24-11+deb9u4                 amd64        GNU C Library: Shared libraries
ii  libcap-ng0:amd64           0.7.7-3+b1                     amd64        An alternate POSIX capabilities library
ii  libcap2:amd64              1:2.25-1                       amd64        POSIX 1003.1e capabilities (library)
ii  libcomerr2:amd64           1.43.4-2                       amd64        common error description library
ii  libcurl3:amd64             7.52.1-5+deb9u9                amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl3-gnutls:amd64      7.52.1-5+deb9u9                amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  libdb5.3:amd64             5.3.28-12+deb9u1               amd64        Berkeley v5.3 Database Libraries [runtime]
ii  libdebconfclient0:amd64    0.227                          amd64        Debian Configuration Management System (C-implementation library)
ii  libedit2:amd64             3.1-20160903-3                 amd64        BSD editline and history libraries
ii  libelf1:amd64              0.168-1                        amd64        library to read and write ELF files
ii  liberror-perl              0.17024-1                      all          Perl module for error/exception handling in an OO-ish way
ii  libexpat1:amd64            2.2.0-2+deb9u1                 amd64        XML parsing C library - runtime library
ii  libfdisk1:amd64            2.29.2-1+deb9u1                amd64        fdisk partitioning library
ii  libffi6:amd64              3.2.1-6                        amd64        Foreign Function Interface library runtime
ii  libfontconfig1:amd64       2.11.0-6.7+b1                  amd64        generic font configuration library - runtime
ii  libfreetype6:amd64         2.6.3-3.2                      amd64        FreeType 2 font engine, shared library files
ii  libgcc1:amd64              1:6.3.0-18+deb9u1              amd64        GCC support library
ii  libgcrypt20:amd64          1.7.6-2+deb9u3                 amd64        LGPL Crypto library - runtime library
ii  libgdbm3:amd64             1.8.3-14                       amd64        GNU dbm database routines (runtime version)
ii  libgmp10:amd64             2:6.1.2+dfsg-1                 amd64        Multiprecision arithmetic library
ii  libgnutls30:amd64          3.5.8-5+deb9u4                 amd64        GNU TLS library - main runtime library
ii  libgpg-error0:amd64        1.26-2                         amd64        library for common error values and messages in GnuPG components
ii  libgssapi-krb5-2:amd64     1.15-1+deb9u1                  amd64        MIT Kerberos runtime libraries - krb5 GSS-API Mechanism
ii  libhogweed4:amd64          3.3-1+b2                       amd64        low level cryptographic library (public-key cryptos)
ii  libidn11:amd64             1.33-1                         amd64        GNU Libidn library, implementation of IETF IDN specifications
ii  libidn2-0:amd64            0.16-1+deb9u1                  amd64        Internationalized domain names (IDNA2008) library
ii  libjs-excanvas             0.r3-4                         all          HTML5 Canvas for Internet Explorer
ii  libk5crypto3:amd64         1.15-1+deb9u1                  amd64        MIT Kerberos runtime libraries - Crypto Library
ii  libkeyutils1:amd64         1.5.9-9                        amd64        Linux Key Management Utilities (library)
ii  libkrb5-3:amd64            1.15-1+deb9u1                  amd64        MIT Kerberos runtime libraries
ii  libkrb5support0:amd64      1.15-1+deb9u1                  amd64        MIT Kerberos runtime libraries - Support library
ii  libksba8:amd64             1.3.5-2                        amd64        X.509 and CMS support library
ii  libldap-2.4-2:amd64        2.4.44+dfsg-5+deb9u2           amd64        OpenLDAP libraries
ii  libldap-common             2.4.44+dfsg-5+deb9u2           all          OpenLDAP common files for libraries
ii  liblz4-1:amd64             0.0~r131-2+b1                  amd64        Fast LZ compression algorithm library - runtime
ii  liblzma5:amd64             5.2.2-1.2+b1                   amd64        XZ-format compression library
ii  libmnl0:amd64              1.0.4-2                        amd64        minimalistic Netlink communication library
ii  libmount1:amd64            2.29.2-1+deb9u1                amd64        device mounting library
ii  libncurses5:amd64          6.0+20161126-1+deb9u2          amd64        shared libraries for terminal handling
ii  libncursesw5:amd64         6.0+20161126-1+deb9u2          amd64        shared libraries for terminal handling (wide character support)
ii  libnettle6:amd64           3.3-1+b2                       amd64        low level cryptographic library (symmetric and one-way cryptos)
ii  libnghttp2-14:amd64        1.18.1-1                       amd64        library implementing HTTP/2 protocol (shared library)
ii  libnpth0:amd64             1.3-1                          amd64        replacement for GNU Pth using system threads
ii  libp11-kit0:amd64          0.23.3-2                       amd64        library for loading and coordinating access to PKCS#11 modules - runtime
ii  libpam-modules:amd64       1.1.8-3.6                      amd64        Pluggable Authentication Modules for PAM
ii  libpam-modules-bin         1.1.8-3.6                      amd64        Pluggable Authentication Modules for PAM - helper binaries
ii  libpam-runtime             1.1.8-3.6                      all          Runtime support for the PAM library
ii  libpam0g:amd64             1.1.8-3.6                      amd64        Pluggable Authentication Modules library
ii  libpcre3:amd64             2:8.39-3                       amd64        Old Perl 5 Compatible Regular Expression Library - runtime files
ii  libperl5.24:amd64          5.24.1-3+deb9u5                amd64        shared Perl library
ii  libpng16-16:amd64          1.6.28-1+deb9u1                amd64        PNG library - runtime (version 1.6)
ii  libprocps6:amd64           2:3.3.12-3+deb9u1              amd64        library for accessing process information from /proc
ii  libpsl5:amd64              0.17.0-3                       amd64        Library for Public Suffix List (shared libraries)
ii  libpython-stdlib:amd64     2.7.13-2                       amd64        interactive high-level object-oriented language (default python version)
ii  libpython2.7-minimal:amd64 2.7.13-2+deb9u3                amd64        Minimal subset of the Python language (version 2.7)
ii  libpython2.7-stdlib:amd64  2.7.13-2+deb9u3                amd64        Interactive high-level object-oriented language (standard library, version 2.7)
ii  libreadline7:amd64         7.0-3                          amd64        GNU readline and history libraries, run-time libraries
ii  librtmp1:amd64             2.4+20151223.gitfa8646d.1-1+b1 amd64        toolkit for RTMP streams (shared library)
ii  libsasl2-2:amd64           2.1.27~101-g0780600+dfsg-3     amd64        Cyrus SASL - authentication abstraction library
ii  libsasl2-modules-db:amd64  2.1.27~101-g0780600+dfsg-3     amd64        Cyrus SASL - pluggable authentication modules (DB)
ii  libselinux1:amd64          2.6-3+b3                       amd64        SELinux runtime shared libraries
ii  libsemanage-common         2.6-2                          all          Common files for SELinux policy management libraries
ii  libsemanage1:amd64         2.6-2                          amd64        SELinux policy management library
ii  libsepol1:amd64            2.6-2                          amd64        SELinux library for manipulating binary security policies
ii  libserf-1-1:amd64          1.3.9-3+deb9u1                 amd64        high-performance asynchronous HTTP client library
ii  libsmartcols1:amd64        2.29.2-1+deb9u1                amd64        smart column output alignment library
ii  libsqlite3-0:amd64         3.16.2-5+deb9u1                amd64        SQLite 3 shared library
ii  libss2:amd64               1.43.4-2                       amd64        command-line interface parsing library
ii  libssh2-1:amd64            1.7.0-1+deb9u1                 amd64        SSH2 client-side library
ii  libssl1.0.2:amd64          1.0.2r-1~deb9u1                amd64        Secure Sockets Layer toolkit - shared libraries
ii  libssl1.1:amd64            1.1.0j-1~deb9u1                amd64        Secure Sockets Layer toolkit - shared libraries
ii  libstdc++6:amd64           6.3.0-18+deb9u1                amd64        GNU Standard C++ Library v3
ii  libsvn1:amd64              1.9.5-1+deb9u3                 amd64        Shared libraries used by Apache Subversion
ii  libsystemd0:amd64          232-25+deb9u11                 amd64        systemd utility library
ii  libtasn1-6:amd64           4.10-1.1+deb9u1                amd64        Manage ASN.1 structures (runtime)
ii  libtinfo5:amd64            6.0+20161126-1+deb9u2          amd64        shared low-level terminfo library for terminal handling
ii  libudev1:amd64             232-25+deb9u11                 amd64        libudev shared library
ii  libunistring0:amd64        0.9.6+really0.9.3-0.1          amd64        Unicode string library for C
ii  libustr-1.0-1:amd64        1.0.4-6                        amd64        Micro string library: shared library
ii  libuuid1:amd64             2.29.2-1+deb9u1                amd64        Universally Unique ID library
ii  login                      1:4.4-4.1                      amd64        system login tools
ii  lsb-base                   9.20161125                     all          Linux Standard Base init script functionality
ii  mawk                       1.3.3-17+b3                    amd64        a pattern scanning and text processing language
ii  mercurial                  4.0-1+deb9u1                   amd64        easy-to-use, scalable distributed version control system
ii  mercurial-common           4.0-1+deb9u1                   all          easy-to-use, scalable distributed version control system (common files)
ii  mime-support               3.60                           all          MIME files 'mime.types' & 'mailcap', and support programs
ii  mount                      2.29.2-1+deb9u1                amd64        tools for mounting and manipulating filesystems
ii  multiarch-support          2.24-11+deb9u4                 amd64        Transitional package to ensure multiarch compatibility
ii  ncurses-base               6.0+20161126-1+deb9u2          all          basic terminal type definitions
ii  ncurses-bin                6.0+20161126-1+deb9u2          amd64        terminal-related programs and man pages
ii  netbase                    5.4                            all          Basic TCP/IP networking system
ii  openssh-client             1:7.4p1-10+deb9u6              amd64        secure shell (SSH) client, for secure access to remote machines
ii  openssl                    1.1.0j-1~deb9u1                amd64        Secure Sockets Layer toolkit - cryptographic utility
ii  passwd                     1:4.4-4.1                      amd64        change and administer password and group data
ii  perl                       5.24.1-3+deb9u5                amd64        Larry Wall's Practical Extraction and Report Language
ii  perl-base                  5.24.1-3+deb9u5                amd64        minimal Perl system
ii  perl-modules-5.24          5.24.1-3+deb9u5                all          Core Perl modules
ii  pinentry-curses            1.0.0-2                        amd64        curses-based PIN or pass-phrase entry dialog for GnuPG
ii  procps                     2:3.3.12-3+deb9u1              amd64        /proc file system utilities
ii  python                     2.7.13-2                       amd64        interactive high-level object-oriented language (default version)
ii  python-bzrlib              2.7.0+bzr6619-7+deb9u1         amd64        distributed version control system - python library
ii  python-configobj           5.0.6-2                        all          simple but powerful config file reader and writer for Python 2
ii  python-minimal             2.7.13-2                       amd64        minimal subset of the Python language (default version)
ii  python-six                 1.10.0-3                       all          Python 2 and 3 compatibility library (Python 2 interface)
ii  python2.7                  2.7.13-2+deb9u3                amd64        Interactive high-level object-oriented language (version 2.7)
ii  python2.7-minimal          2.7.13-2+deb9u3                amd64        Minimal subset of the Python language (version 2.7)
ii  readline-common            7.0-3                          all          GNU readline and history libraries, common files
ii  sed                        4.4-1                          amd64        GNU stream editor for filtering/transforming text
ii  sensible-utils             0.0.9+deb9u1                   all          Utilities for sensible alternative selection
ii  subversion                 1.9.5-1+deb9u3                 amd64        Advanced version control system
ii  sysvinit-utils             2.88dsf-59.9                   amd64        System-V-like utilities
ii  tar                        1.29b-1.1                      amd64        GNU version of the tar archiving utility
ii  tzdata                     2019a-0+deb9u1                 all          time zone and daylight-saving time data
ii  ucf                        3.0036                         all          Update Configuration File(s): preserve user changes to config files
ii  unzip                      6.0-21+deb9u1                  amd64        De-archiver for .zip files
ii  util-linux                 2.29.2-1+deb9u1                amd64        miscellaneous system utilities
ii  wget                       1.18-5+deb9u3                  amd64        retrieves files from the web
ii  xz-utils                   5.2.2-1.2+b1                   amd64        XZ-format compression utilities
ii  zlib1g:amd64               1:1.2.8.dfsg-5                 amd64        compression library - runtime


来源: stackexchange

问:
Combining test-Path -Path with a regular expression
In Jenkins I'm creating a PowerShell script. This is working:

```<code>if (Test-Path -Path "$baseDirectory\s*") {...}
</code>```

But this is "dangerous" and not "safe" enough.

The directory name will be: sdd or sddd (d=digits).
So the name starts with the character "s" and is 2 and later three digits long.

I have tried the following:

```<code>if (Test-Path -Path "$baseDirectory\ -match 's(\d{2,3})'") {...}
</code>```

and

```<code>if (Test-Path -Path "-match '$baseDirectory\s(\d{2,3})'") {...}
</code>```

and all kind of little differences.

If I do this with s* than the script returns directory name s54, s55 etc.

I'm expecthing, if possible, the same result with the regular expression instead of "no directory found".

答:
You could use this to see if one or more folders can be found with that name.

```<code>if ([bool](Get-ChildItem "$baseDirectory\s*" -Directory | Where-Object { $_.Name -match 's\d{2,3}$' })) {
    # your code goes here
}
</code>```

Hope that helps

ContentLicense: CC BY-SA 4.0

Body:
In Jenkins I'm creating a PowerShell script. This is working:

if (Test-Path -Path "$baseDirectory\s*") {...}

But this is "dangerous" and not "safe" enough.

The directory name will be: sdd or sddd (d=digits).
So the name starts with the character "s" and is 2 and later three digits long.

I have tried the following:

if (Test-Path -Path "$baseDirectory\ -match 's(\d{2,3})'") {...}

and

if (Test-Path -Path "-match '$baseDirectory\s(\d{2,3})'") {...}

and all kind of little differences.

If I do this with s* than the script returns directory name s54, s55 etc.

I'm expecthing, if possible, the same result with the regular expression instead of "no directory found".

Body:
You could use this to see if one or more folders can be found with that name.

if ([bool](Get-ChildItem "$baseDirectory\s*" -Directory | Where-Object { $_.Name -match 's\d{2,3}$' })) {
    # your code goes here
}

Hope that helps


问:
How to check if a List<List<int>> contains a List<int>
I have a List<List<int>> in which I would like to insert a new List<int>. I would like to check before adding the new List<int> if it already exists in the List<List<int>>.

For e.g.

```<code>List<List<int>> MasterList = new List<List<int>>();
List<int> childList = new List<int>();
</code>```

I have already tried

```<code>MaterList.Contains, MasterList.Any
</code>```

but nothing is helping

e.g.

```<code>MasterList(1)=1,2,3
MasterList(2)=4,5
</code>```

but when I see 1,2,3 or 4,5 is coming again then do not want to enter it as they are already there somewhere in MasterList

答:
```<code> List<List<int>> MasterList = new List<List<int>>();

        List<int> childList1 = new List<int>() { 1, 2, 3 };
        List<int> childList2 = new List<int>() { 4, 5 };

        MasterList.Add(childList1);
       //  MasterList.Add(childList2);

        Console.WriteLine(MasterList.Contains(childList1));
        Console.WriteLine(MasterList.Contains(childList2));
        Console.WriteLine(MasterList[0].Contains(1));
        Console.WriteLine(MasterList[0].Contains(7));
//True
//False
//True
//False
</code>```

Perhaps I don't understand what is your problem, sorry.

Body:
I have a List<List<int>> in which I would like to insert a new List<int>. I would like to check before adding the new List<int> if it already exists in the List<List<int>>.

For e.g.

List<List<int>> MasterList = new List<List<int>>();
List<int> childList = new List<int>();

I have already tried

MaterList.Contains, MasterList.Any

but nothing is helping

e.g.

MasterList(1)=1,2,3
MasterList(2)=4,5

but when I see 1,2,3 or 4,5 is coming again then do not want to enter it as they are already there somewhere in MasterList

Body:
 List<List<int>> MasterList = new List<List<int>>();

        List<int> childList1 = new List<int>() { 1, 2, 3 };
        List<int> childList2 = new List<int>() { 4, 5 };

        MasterList.Add(childList1);
       //  MasterList.Add(childList2);

        Console.WriteLine(MasterList.Contains(childList1));
        Console.WriteLine(MasterList.Contains(childList2));
        Console.WriteLine(MasterList[0].Contains(1));
        Console.WriteLine(MasterList[0].Contains(7));
//True
//False
//True
//False

Perhaps I don't understand what is your problem, sorry.


问:
How to extract text following a keyword in UNIX
I have a text file (file.txt) that contains a wall of results (no newlines, whitespaces etc) that I received from an external source.  From this file, I need to find all mentions of the word serId, and then print out the alpha-numeric sequence following it.  The alpha-numeric sequence is of any length but will end with the character ,.  How can I extract these alpha-numeric sequences?

I've tried finding scripts/code using sed / awk but the results seem to revolve around a known sequence to find, rather than an unknown sequence.

For example, I would like to extract 28655784-EE from the following sample text:

```<code>{"preRollbackCheckResults":[],"patchingHistory":[{"backupStatus":"Available","rollbackStatus":"Available","additionalNote":"Patching CDS as planned","appliedBy":"xxrbsgCDS02services","appliedDate":"2019-01-18T12:45:33.926+0000","totalTime":"29 min, 47 sec","serId":"28655784-EE","patchDescription":"DB 18.4.0.0.0 Oct 2018 PSU
</code>```

答:
Try this awk script (gawk only):

```<code>awk  -F '","' 'match($0,/serId\":\"[^,]*/,m){print m[1]}' input.txt
</code>```

If you need the terminating ,

```<code>awk  -F '","' 'match($0,/serId\":\"[^,]*/,m){print m[1]","}' input.txt
</code>```

explanation:

-F "," parse the file to records separated by ,

match($0,"serId[^,]*",m) filter in current record, matching a string starting with serId terminating with ,. Put result in array m

print substr(m[0],8) print the matched string from 8th position

Body:
I have a text file (file.txt) that contains a wall of results (no newlines, whitespaces etc) that I received from an external source.  From this file, I need to find all mentions of the word serId, and then print out the alpha-numeric sequence following it.  The alpha-numeric sequence is of any length but will end with the character ,.  How can I extract these alpha-numeric sequences?

I've tried finding scripts/code using sed / awk but the results seem to revolve around a known sequence to find, rather than an unknown sequence.

For example, I would like to extract 28655784-EE from the following sample text:

{"preRollbackCheckResults":[],"patchingHistory":[{"backupStatus":"Available","rollbackStatus":"Available","additionalNote":"Patching CDS as planned","appliedBy":"xxrbsgCDS02services","appliedDate":"2019-01-18T12:45:33.926+0000","totalTime":"29 min, 47 sec","serId":"28655784-EE","patchDescription":"DB 18.4.0.0.0 Oct 2018 PSU

Body:
Try this awk script (gawk only):

awk  -F '","' 'match($0,/serId\":\"[^,]*/,m){print m[1]}' input.txt

If you need the terminating ,

awk  -F '","' 'match($0,/serId\":\"[^,]*/,m){print m[1]","}' input.txt

explanation:

-F "," parse the file to records separated by ,

match($0,"serId[^,]*",m) filter in current record, matching a string starting with serId terminating with ,. Put result in array m

print substr(m[0],8) print the matched string from 8th position


问:
How to trigger one lambda function from multiple lambdas at the same time
I want to trigger a lambda function from multiple lambdas at the same time.
The architecture i am  following is
lambda -- > Step Function--> parallel execution of 2 lambdas --> these two lambda should trigger one lambda.
the event from these two lambda should be passed to one lambda.

Till the triggering of two lambda function from step function i have already achieved.
 to Trigger the lambda function i have written the below code. but only on lambda event is passed to the next lambda.

```<code>from boto3 import client as botoClient
import json
lambdas = botoClient("lambda")

def lambda_handler(event, context):

    response = lambdas.invoke(FunctionName="lambda-name",
                              InvocationType="RequestResponse",
                               Payload=json.dumps(event))
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }
</code>```

答:
Here's a snippet to invoke a Lambda function, from another Lambda function -

```<code>let AWS = require('aws-sdk');
let util = require('util');

module.exports.proxyAPIRequest = async () => {

    let client = new AWS.Lambda({
        region: "us-east-1"
    });

    let requestPayload = {
        'someKey' : 'someValue'
    };

    requestPayload = JSON.stringify(requestPayload);
    console.log("Payload => ", requestPayload);

    let params = {
        FunctionName: functionName,
        InvocationType: "RequestResponse",
        Payload: requestPayload
    };

    let lambda = util.promisify(client.invoke).bind(client);
    let response = await lambda(params);

    console.log(response.Payload);

    return response.Payload;
};
</code>```

Ensure your caller Lambda function has permission to invoke another function -

```<code>{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Lambda permission",
      "Action": [
        "lambda:InvokeFunction"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:lambda:awsRegion:awsAccountId:function:functionName"
    }
  ]
}
</code>```

Body:
I want to trigger a lambda function from multiple lambdas at the same time.
The architecture i am  following is
lambda -- > Step Function--> parallel execution of 2 lambdas --> these two lambda should trigger one lambda.
the event from these two lambda should be passed to one lambda.

Till the triggering of two lambda function from step function i have already achieved.
 to Trigger the lambda function i have written the below code. but only on lambda event is passed to the next lambda.

from boto3 import client as botoClient
import json
lambdas = botoClient("lambda")

def lambda_handler(event, context):

    response = lambdas.invoke(FunctionName="lambda-name",
                              InvocationType="RequestResponse",
                               Payload=json.dumps(event))
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }

Body:
Here's a snippet to invoke a Lambda function, from another Lambda function -

let AWS = require('aws-sdk');
let util = require('util');

module.exports.proxyAPIRequest = async () => {

    let client = new AWS.Lambda({
        region: "us-east-1"
    });

    let requestPayload = {
        'someKey' : 'someValue'
    };

    requestPayload = JSON.stringify(requestPayload);
    console.log("Payload => ", requestPayload);

    let params = {
        FunctionName: functionName,
        InvocationType: "RequestResponse",
        Payload: requestPayload
    };

    let lambda = util.promisify(client.invoke).bind(client);
    let response = await lambda(params);

    console.log(response.Payload);

    return response.Payload;
};

Ensure your caller Lambda function has permission to invoke another function -

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Lambda permission",
      "Action": [
        "lambda:InvokeFunction"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:lambda:awsRegion:awsAccountId:function:functionName"
    }
  ]
}


问:
getViewByID Returns null for the Listview
I have got my main.xml as follows:

```<code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView android:text="TextView" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
    <ListView android:layout_height="wrap_content" android:id="@+id/listView1" android:layout_width="match_parent"></ListView>
</LinearLayout>
</code>```

Now i want to get the ListView with id listView1 in the onCreate event of the activity. Here goes my code to achieve this stuff ..

```<code>public class TwitterClient extends Activity {
    private static ListView mTweetsList;

     @SuppressWarnings("deprecation")
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main); // Set the content view.
            TextView txtView = (TextView)findViewById(R.id.textView1); // This works as expected
            mTweetsList = (ListView)findViewById(R.id.listView1); // This returns null
</code>```

The line to get the list view returns null.

```<code>mTweetsList = (ListView)findViewById(R.id.listView1); -- Does not work and returns null !!
</code>```

where as when i use the same function to find the textview by id in the same layout, it works all fine. Can anyone point me to what might be an error here?

Thanks

答:
Check what target have you taken, is it Android 2.2 ?
It is working fine in Android2.2 .
If the error continues clean & build the project and restart the eclipse.</p>

ContentLicense: CC BY-SA 3.0

Body:
I have got my main.xml as follows:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView android:text="TextView" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
    <ListView android:layout_height="wrap_content" android:id="@+id/listView1" android:layout_width="match_parent"></ListView>
</LinearLayout>

Now i want to get the ListView with id listView1 in the onCreate event of the activity. Here goes my code to achieve this stuff ..

public class TwitterClient extends Activity {
    private static ListView mTweetsList;

     @SuppressWarnings("deprecation")
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main); // Set the content view.
            TextView txtView = (TextView)findViewById(R.id.textView1); // This works as expected
            mTweetsList = (ListView)findViewById(R.id.listView1); // This returns null

The line to get the list view returns null.

mTweetsList = (ListView)findViewById(R.id.listView1); -- Does not work and returns null !!

where as when i use the same function to find the textview by id in the same layout, it works all fine. Can anyone point me to what might be an error here?

Thanks


问:
How to give different row id's for two different variables in the same table, one for folders and the other for medias?
I need some help plz!!

I need to give each variable an id to use it later to make an ajax click on method action to enter the $folder subdirectory's inside the table.
Do I have to do that in the controller or in the ajax?

The data tables plugin is used in the application: https://datatables.net/

// These are the three functions: Controller function, Ajax function, and Bootstrap, as you can see the folders at the top of the table then the medias will be listed, I am not having any problem with the code and its working fine.

```<code>public function ajaxSearchMedias() {
        $this->checkAccessPlaylists(false) ;

        $this->loadModelSpe('Media');
        $this->loadModelSpe('media');

        $orderby = 'name' ;
        $orderway = 'ASC' ;
        $search = NULL ;

        if(isset($_POST['order'][0]["column"])) {
            $column_to_order = (int) $_POST['order'][0]["column"] ;
            if($column_to_order == 2)
                $orderby = 'length' ;
        }

        if(isset($_POST['order'][0]["dir"])) {
            $way_to_order = $_POST['order'][0]["dir"] ;
            if(strtolower($way_to_order) == 'desc')
                $orderway = 'DESC' ;
        }

        if($_POST['search']["value"])
            $search = $_POST['search']["value"] ;

        $data = array();

        // Display folders in the content playlists

        if(isset($_POST['folderId']) && $_POST['folderId'] != -1) {
                $level = $this->media->getFolderLevel($_POST['folderId'])->level;
                $level++;
                $parentFolder = $_POST['folderId'];
                $folders = $this->media->getFoldersByParentFolderId($_POST['folderId']);
                $medias = $this->media->getMediasByParentFolderId($_POST['folderId']);
        }else {
                $siteId = $_SESSION["sess_id_site"];
                $folders = $this->media->getRootFoldersBySiteId($siteId);
                $medias = $this->media->getRootMediasBySiteId($siteId);
        }
        if($folders) {
            foreach ($folders as $folder){
                //$name = $newtext = wordwrap( $one_media->name, 15, "\n", true );
                $name = $folder->name;
                $name = '<span>'.$name.'</span>';

                $unformatted_length = Helper::getLengthForMedia(array("type" => $folder->type)) ;

                $length = Helper::convertSecondsToMinutesSeconds($unformatted_length) ;

                $orientation_and_type_icon = '<div class="" data-name="'.htmlspecialchars($folder->name, ENT_QUOTES, 'UTF-8').'" data-length="'.$length.'"  data-unformatted_length="'.$unformatted_length.'" data-id="'.$one_media->id.'"  data-type="media"  >' ;
                $orientation_and_type_icon .= '<span class="icon">'.Helper::getIconForTypeAndOrientationForMedia($folder).'</span>' ;
                $orientation_and_type_icon .= '<span class="thumbnail" style="display:none;">'.Helper::getThumbnailForMedia($folder, $this->current_id_company, $this->current_id_site, "img-thumbnail").'</span>' ;
                $orientation_and_type_icon .= '<button type="button" id="'.$folder->name.'" > <span class="glyphicon glyphicon-plus-sign"></span></span></button>' ;
                $orientation_and_type_icon .= '</div>' ;

                array_push($data, array('orientation_and_type_icon' => $orientation_and_type_icon, 'name' => $name, 'length' => $length));
            }
        }

        // Display Medias in the content playlist

        $medias = $this->Media->getMediasForContentPlaylists($search, $orderby, $orderway, 500, $this->current_id_site, $id_folder = NULL);

        if($medias) {
            foreach ($medias as $one_media){
                //$name = $newtext = wordwrap( $one_media->name, 15, "\n", true );
                $name = $newtext = $one_media->name;
                $name = '<span>'.$name.'</span>';

                $unformatted_length = Helper::getLengthForMedia(array("type" => $one_media->type, "length" => $one_media->length)) ;

                $length = Helper::convertSecondsToMinutesSeconds($unformatted_length) ;

                $orientation_and_type_icon = '<div class="pl_media_data" data-name="'.htmlspecialchars($one_media->name, ENT_QUOTES, 'UTF-8').'" data-length="'.$length.'"  data-unformatted_length="'.$unformatted_length.'" data-id="'.$one_media->id.'"  data-type="media"  >' ;
                $orientation_and_type_icon .= '<span class="icon">'.Helper::getIconForTypeAndOrientationForMedia($one_media).'</span>' ;
                $orientation_and_type_icon .= '<span class="thumbnail" style="display:none;">'.Helper::getThumbnailForMedia($one_media, $this->current_id_company, $this->current_id_site, "img-thumbnail").'</span>' ;
                $orientation_and_type_icon .= '</div>' ;

                array_push($data, array('orientation_and_type_icon' => $orientation_and_type_icon, 'name' => $name, 'length' => $length));
            }
        }

       $json_result = json_encode(array("data" => $data));

        print $json_result;
    }

// This is the ajax function, this function list media's and folders using data tables plugin without any problem, the main problem is giving an id to folders different than the media's so I can use it to make the click on for the folders.

    this.getMediaList = function() {
        var jqxhr = $.getJSON( url + 'plugins/DataTables-1.10.12/media/js/i18n/fr_FR.json', function( data ) {});
        jqxhr.done(function(data) {
            self.pl_dt_language_json = data ;
            var languages_dt =  self.pl_dt_language_json ;
            languages_dt = $.extend(languages_dt, {"sSearch": ""});

            self.pl_medias_dt = $('#pl_medias').DataTable({
                language: languages_dt,
                "columns": [
                    { "data": "type" },
                    { "data": "orientation_and_type_icon" },
                    { "data": "name" },
                    { "data": "length" },
                ],
                "columnDefs": [
                    { "searchable": false, "orderable": false, "targets": 0 },
                    { className: "pl_media_cell_type", "targets": [ 0 ] } ;
                    { className: "pl_media_cell_icon", "targets": [ 1 ] } ,
                    { className: "pl_media_cell_name", "targets": [ 2 ] } ,
                    { className: "pl_media_cell_length", "targets": [ 3 ] }
                ],
                "order": [[ 1, 'asc' ]],
                initComplete: function(settings, json) {
                    // search
                    if($('#pl_medias_filter input').eq(0).size() > 0) {
                        $('#pl_medias_filter input').eq(0).attr("placeholder", "Rechercher un fichier") ;
                        $('#pl_medias_filter input').unbind();
                        $('#pl_medias_filter input').on( 'keyup', function () {
                            var searchInput = $(this).val();
                            if(searchInput.length == 0) {
                                window.clearTimeout(self.pl_medias_dt_filter_status);
                                self.pl_medias_dt.search( searchInput ).draw();
                            } else {
                                if(searchInput.length < 3) {
                                    window.clearTimeout(self.pl_medias_dt_filter_status);
                                    self.pl_medias_dt_filter_status = setTimeout(function() {
                                        self.pl_medias_dt.search( searchInput ).draw() ;
                                    }, 3000);
                                } else {
                                    window.clearTimeout(self.pl_medias_dt_filter_status);
                                    self.pl_medias_dt_filter_status = setTimeout(function() {
                                        self.pl_medias_dt.search( searchInput ).draw()
                                    }, 1000);
                                }
                            }
                        });
                    }
                },
                drawCallback: function(settings) {
                    // refresh drag and drop
                    self.initDragDropSortElementForContentPlaylist();
                },
                "serverSide": true,
                "paging":   false,
                "lengthChange" : false,
                "scrollY": 122,
                "info": false,
                "ajax": {
                    url : url + "playlists/ajaxSearchMedias", // json datasource
                    type: "post"
                },
                "dom": '<lf<t>ip>'
            });
        });
    },

// This is the Bootstrap script

        <div class="pl_block_wrapper pl_block_media_wrapper row">
            <div class="col-xs-2 pl_block_label"><span>AUTOPROMO</span></div>
            <div class="col-xs-10 pl_block_container_middle">
                <table id="pl_medias" class="table table-striped table-bordered"  width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th>Type</th>
                            <th>Nom</th>
                            <th>Durée</th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</code>```

As you can see the three Bootstrap ajax jquery and PHP scripts.

答:
I found a simple solution to add an id and a class :-) :

$('#pl_medias tr').attr('id', 'table-row-id');

$('#pl_medias tr').attr('class', 'table-row-class');

Thank you very much!

Body:
I need some help plz!!

I need to give each variable an id to use it later to make an ajax click on method action to enter the $folder subdirectory's inside the table.
Do I have to do that in the controller or in the ajax?

The data tables plugin is used in the application: https://datatables.net/

// These are the three functions: Controller function, Ajax function, and Bootstrap, as you can see the folders at the top of the table then the medias will be listed, I am not having any problem with the code and its working fine.

public function ajaxSearchMedias() {
        $this->checkAccessPlaylists(false) ;

        $this->loadModelSpe('Media');
        $this->loadModelSpe('media');

        $orderby = 'name' ;
        $orderway = 'ASC' ;
        $search = NULL ;

        if(isset($_POST['order'][0]["column"])) {
            $column_to_order = (int) $_POST['order'][0]["column"] ;
            if($column_to_order == 2)
                $orderby = 'length' ;
        }

        if(isset($_POST['order'][0]["dir"])) {
            $way_to_order = $_POST['order'][0]["dir"] ;
            if(strtolower($way_to_order) == 'desc')
                $orderway = 'DESC' ;
        }

        if($_POST['search']["value"])
            $search = $_POST['search']["value"] ;

        $data = array();

        // Display folders in the content playlists

        if(isset($_POST['folderId']) && $_POST['folderId'] != -1) {
                $level = $this->media->getFolderLevel($_POST['folderId'])->level;
                $level++;
                $parentFolder = $_POST['folderId'];
                $folders = $this->media->getFoldersByParentFolderId($_POST['folderId']);
                $medias = $this->media->getMediasByParentFolderId($_POST['folderId']);
        }else {
                $siteId = $_SESSION["sess_id_site"];
                $folders = $this->media->getRootFoldersBySiteId($siteId);
                $medias = $this->media->getRootMediasBySiteId($siteId);
        }
        if($folders) {
            foreach ($folders as $folder){
                //$name = $newtext = wordwrap( $one_media->name, 15, "\n", true );
                $name = $folder->name;
                $name = ''.$name.'';

                $unformatted_length = Helper::getLengthForMedia(array("type" => $folder->type)) ;

                $length = Helper::convertSecondsToMinutesSeconds($unformatted_length) ;

                $orientation_and_type_icon = '
name, ENT_QUOTES, 'UTF-8').'" data-length="'.$length.'"  data-unformatted_length="'.$unformatted_length.'" data-id="'.$one_media->id.'"  data-type="media"  >' ;
                $orientation_and_type_icon .= ''.Helper::getIconForTypeAndOrientationForMedia($folder).'' ;
                $orientation_and_type_icon .= ''.Helper::getThumbnailForMedia($folder, $this->current_id_company, $this->current_id_site, "img-thumbnail").'' ;
                $orientation_and_type_icon .= '<button type="button" id="'.$folder->name.'" > </button>' ;
                $orientation_and_type_icon .= '
' ;

                array_push($data, array('orientation_and_type_icon' => $orientation_and_type_icon, 'name' => $name, 'length' => $length));
            }
        }

        // Display Medias in the content playlist

        $medias = $this->Media->getMediasForContentPlaylists($search, $orderby, $orderway, 500, $this->current_id_site, $id_folder = NULL);

        if($medias) {
            foreach ($medias as $one_media){
                //$name = $newtext = wordwrap( $one_media->name, 15, "\n", true );
                $name = $newtext = $one_media->name;
                $name = ''.$name.'';

                $unformatted_length = Helper::getLengthForMedia(array("type" => $one_media->type, "length" => $one_media->length)) ;

                $length = Helper::convertSecondsToMinutesSeconds($unformatted_length) ;

                $orientation_and_type_icon = '
name, ENT_QUOTES, 'UTF-8').'" data-length="'.$length.'"  data-unformatted_length="'.$unformatted_length.'" data-id="'.$one_media->id.'"  data-type="media"  >' ;
                $orientation_and_type_icon .= ''.Helper::getIconForTypeAndOrientationForMedia($one_media).'' ;
                $orientation_and_type_icon .= ''.Helper::getThumbnailForMedia($one_media, $this->current_id_company, $this->current_id_site, "img-thumbnail").'' ;
                $orientation_and_type_icon .= '
' ;

                array_push($data, array('orientation_and_type_icon' => $orientation_and_type_icon, 'name' => $name, 'length' => $length));
            }
        }

       $json_result = json_encode(array("data" => $data));

        print $json_result;
    }

// This is the ajax function, this function list media's and folders using data tables plugin without any problem, the main problem is giving an id to folders different than the media's so I can use it to make the click on for the folders.

    this.getMediaList = function() {
        var jqxhr = $.getJSON( url + 'plugins/DataTables-1.10.12/media/js/i18n/fr_FR.json', function( data ) {});
        jqxhr.done(function(data) {
            self.pl_dt_language_json = data ;
            var languages_dt =  self.pl_dt_language_json ;
            languages_dt = $.extend(languages_dt, {"sSearch": ""});

            self.pl_medias_dt = $('#pl_medias').DataTable({
                language: languages_dt,
                "columns": [
                    { "data": "type" },
                    { "data": "orientation_and_type_icon" },
                    { "data": "name" },
                    { "data": "length" },
                ],
                "columnDefs": [
                    { "searchable": false, "orderable": false, "targets": 0 },
                    { className: "pl_media_cell_type", "targets": [ 0 ] } ;
                    { className: "pl_media_cell_icon", "targets": [ 1 ] } ,
                    { className: "pl_media_cell_name", "targets": [ 2 ] } ,
                    { className: "pl_media_cell_length", "targets": [ 3 ] }
                ],
                "order": [[ 1, 'asc' ]],
                initComplete: function(settings, json) {
                    // search
                    if($('#pl_medias_filter input').eq(0).size() > 0) {
                        $('#pl_medias_filter input').eq(0).attr("placeholder", "Rechercher un fichier") ;
                        $('#pl_medias_filter input').unbind();
                        $('#pl_medias_filter input').on( 'keyup', function () {
                            var searchInput = $(this).val();
                            if(searchInput.length == 0) {
                                window.clearTimeout(self.pl_medias_dt_filter_status);
                                self.pl_medias_dt.search( searchInput ).draw();
                            } else {
                                if(searchInput.length < 3) {
                                    window.clearTimeout(self.pl_medias_dt_filter_status);
                                    self.pl_medias_dt_filter_status = setTimeout(function() {
                                        self.pl_medias_dt.search( searchInput ).draw() ;
                                    }, 3000);
                                } else {
                                    window.clearTimeout(self.pl_medias_dt_filter_status);
                                    self.pl_medias_dt_filter_status = setTimeout(function() {
                                        self.pl_medias_dt.search( searchInput ).draw()
                                    }, 1000);
                                }
                            }
                        });
                    }
                },
                drawCallback: function(settings) {
                    // refresh drag and drop
                    self.initDragDropSortElementForContentPlaylist();
                },
                "serverSide": true,
                "paging":   false,
                "lengthChange" : false,
                "scrollY": 122,
                "info": false,
                "ajax": {
                    url : url + "playlists/ajaxSearchMedias", // json datasource
                    type: "post"
                },
                "dom": '<lf<t>ip>'
            });
        });
    },

// This is the Bootstrap script

AUTOPROMO

                            Type
                            Nom
                            Durée

As you can see the three Bootstrap ajax jquery and PHP scripts.


问:
No errors with Carousel, Left/Right Buttons do not function
My Bootstrap Carousel Buttons are not working. Currently the first image shows and so do the buttons, however the image does not change by itself nor does it change when I press the buttons.

This is for a web application I am making, ran using Express. I've tried changing around some snippets of code but nothing makes the slides change. There are 3 images, the other 2 are not showing because they are not active, so I do have more than 1 image.

```<code>
<!--Dependencies -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script language="JavaScript" type="text/javascript">
  $(document).ready(function(){
    $('.carouselExampleControls').carousel({
      interval: 3000
    })
  })
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="/assets/css/main.css">

<!--Carousel Code -->
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(45).jpg"
        alt="First slide">
    </div>
    <div class="carousel-item">
      <img class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(46).jpg"
        alt="Second slide">
    </div>
    <div class="carousel-item">
      <img class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(47).jpg"
        alt="Third slide">
    </div>
  </div>
  <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

</code>```

I expect to have the Carousel buttons functioning once the page is rendered, however there are no errors in the console.

答:
I just found the issue, so if you are having this problem as well listen up!

You need to make sure you have an up-to-date version of Bootstrap JS and CSS.

Both versions need to be the same; I had the latest CSS but not JS.

My Carousel now functions, thank you to those who helped.

Body:
My Bootstrap Carousel Buttons are not working. Currently the first image shows and so do the buttons, however the image does not change by itself nor does it change when I press the buttons.

This is for a web application I am making, ran using Express. I've tried changing around some snippets of code but nothing makes the slides change. There are 3 images, the other 2 are not showing because they are not active, so I do have more than 1 image.

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="/assets/css/main.css">

    Previous

    Next

I expect to have the Carousel buttons functioning once the page is rendered, however there are no errors in the console.


问:
Is assigning two variables to items in the same list the best way to access and perform operations on those items?
Say I have a list

```<code>l = [1,2,3]
</code>```

and I want to sum each item in the list with every other item in the list. I could do this:

```<code>x = [(a, b) for a in l for b in l]
y = [(a + b) for a in l for b in l]

x = [(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)]
y = [2, 3, 4, 3, 4, 5, 4, 5, 6]
</code>```

Is assigning two variables (a and b) to items in the same list (l) the best way to access and perform operations on those items? Is there a better way to do this?

I've looked at list methods and functions, and couldn't find any.

UPDATE

Many people recommended the itertools product function so I thought I'd include timings before I mark as answered:

```<code>mysetup = """
from itertools import product
l = [10, 15, 3, 7]
k = 17
"""
mycode = """
[i for i in product(l, repeat=2)]
"""

t = timeit.timeit(setup=mysetup, stmt=mycode, number=100000)
# 0.1505305

mysetup2 = """
l = [10, 15, 3, 7]
k = 17
"""
mycode2 = """
[(a, b) for a in l for b in l]
"""

t1 = timeit.timeit(setup=mysetup2, stmt=mycode2, number=100000)
# 0.1432976
</code>```

答:
Try using itertools.product, which gets every combination of a sequence:

```<code>>>> from itertools import product
>>> l = [1,2,3]
>>> list(product(l, repeat=2))
[(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)]
>>> list(map(sum, product(l, repeat=2)))
[2, 3, 4, 3, 4, 5, 4, 5, 6]
>>>
</code>```

Body:
Say I have a list

l = [1,2,3]

and I want to sum each item in the list with every other item in the list. I could do this:

x = [(a, b) for a in l for b in l]
y = [(a + b) for a in l for b in l]

x = [(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)]
y = [2, 3, 4, 3, 4, 5, 4, 5, 6]

Is assigning two variables (a and b) to items in the same list (l) the best way to access and perform operations on those items? Is there a better way to do this?

I've looked at list methods and functions, and couldn't find any.

UPDATE

Many people recommended the itertools product function so I thought I'd include timings before I mark as answered:

mysetup = """
from itertools import product
l = [10, 15, 3, 7]
k = 17
"""
mycode = """
[i for i in product(l, repeat=2)]
"""

t = timeit.timeit(setup=mysetup, stmt=mycode, number=100000)
# 0.1505305

mysetup2 = """
l = [10, 15, 3, 7]
k = 17
"""
mycode2 = """
[(a, b) for a in l for b in l]
"""

t1 = timeit.timeit(setup=mysetup2, stmt=mycode2, number=100000)
# 0.1432976

Body:
Try using itertools.product, which gets every combination of a sequence:

>>> from itertools import product
>>> l = [1,2,3]
>>> list(product(l, repeat=2))
[(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)]
>>> list(map(sum, product(l, repeat=2)))
[2, 3, 4, 3, 4, 5, 4, 5, 6]
>>>


问:
Using Unity 3d asset bundles on Hololens from device folders
We are building a Hololens app which is going to use asset bundles from the device folders, but we are getting a 'Unable to open archive file' error when trying to load the bundle files.

As we don't have much experience with asset bundles we started this by creating a very simple bundle file (just a few Unity primitives and materials) and we made a first try loading them into the app from the Unity editor. That is working as expected but it fails when we deploy the app into our Hololens.

This is our loading method:

#if WINDOWS_UWP
    public async void CallForBundles()
#else
    public void CallForBundles()
#endif
    {
        string bundleFile = "--- NO BUNDLE ---";
#if UNITY_EDITOR
        bundleFile = @"D:\temp\UnityBuilds\AssetBundles\exportablebundle";
#endif
#if WINDOWS_UWP
        Windows.Storage.StorageFolder objectsFolder = Windows.Storage.KnownFolders.Objects3D;
        Windows.Storage.StorageFile bundleFilePointer = await objectsFolder.GetFileAsync("exportablebundle");
        bundleFile = bundleFilePointer.Path;
#endif

        var myLoadedAB = AssetBundle.LoadFromFile(bundleFile);
        //instante bundle components from myLoadedAB//
    }
```

<p>As you see is something very simple. We find the bundle path by different methods depending on the platform (we already used this system for text files, pngs and others) and the UNITY_EDITOR side is working. The WINDOWS_UWP is throwing this error just on the call to AssetBundle.LoadFromFile(bundleFile);:</p>

```Unable to open archive file: C:/Data/Users/edata/3D Objects/exportablebundle

(Filename: C:\buildslave\unity\build\Runtime/VirtualFileSystem/ArchiveFileSystem/ArchiveStorageReader.cpp Line: 542)

'Holoplan.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\HoloplanVS.Release_x86.jalfonso\System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
NullReferenceException: Object reference not set to an instance of an object.
at GameManager.<CallForBundles>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
at UnityEngine.UnitySynchronizationContext.WorkRequest.Invoke()
at UnityEngine.UnitySynchronizationContext.Exec()
at UnityEngine.UnitySynchronizationContext.ExecuteTasks()
at UnityEngine.UnitySynchronizationContext.$Invoke1(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)

(Filename: <Unknown> Line: 0)
```

<blockquote>
  <p>"Unable to open archive file: C:/Data/Users/edata/3D Objects/exportablebundle"  </p>
</blockquote>

<p>seems to be the same error that happens when the app try to load a bunde with wrong file name or path even when running on the editor so it looks like that for some reason 'AssetBundle.LoadFromFile' can't locate de file. We checked the bundleFile at that line and it contains the right filepath ('C:\Data\Users\edata\3D Objects\exportablebundle' where 'exportablebundle' is the bundle file name), so we guess that 'AssetBundle.LoadFromFile' has issues when reading from the Hololens local folder but we don't have much idea about how to address this.</p>

<p>¿Anyone can lend us a hand, please?</p>

<p>EDIT-</p>

<p>We are building our asset bundle with the sample code from the Unity manual in 'Asset bundle workflow'. Is like this:</p>

```static void BuildAllAssetBundles(){
  string assetBundleDirectory = "Assets/AssetBundles";
  if (!Directory.Exists(assetBundleDirectory)){
    Directory.CreateDirectory(assetBundleDirectory);
  }

  BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None,  BuildTarget.StandaloneWindows);
}
```

'StandaloneWindows' as build target seems the closest to hololens from the available list so we went for it.

答: Sorry, asset bundling isn't working in HL devices right now. It's known issue that has to be fixed.</p>

Body:
We are building a Hololens app which is going to use asset bundles from the device folders, but we are getting a 'Unable to open archive file' error when trying to load the bundle files.

As we don't have much experience with asset bundles we started this by creating a very simple bundle file (just a few Unity primitives and materials) and we made a first try loading them into the app from the Unity editor. That is working as expected but it fails when we deploy the app into our Hololens.

This is our loading method:

#if WINDOWS_UWP
    public async void CallForBundles()
#else
    public void CallForBundles()
#endif
    {
        string bundleFile = "--- NO BUNDLE ---";
#if UNITY_EDITOR
        bundleFile = @"D:\temp\UnityBuilds\AssetBundles\exportablebundle";
#endif
#if WINDOWS_UWP
        Windows.Storage.StorageFolder objectsFolder = Windows.Storage.KnownFolders.Objects3D;
        Windows.Storage.StorageFile bundleFilePointer = await objectsFolder.GetFileAsync("exportablebundle");
        bundleFile = bundleFilePointer.Path;
#endif

        var myLoadedAB = AssetBundle.LoadFromFile(bundleFile);
        //instante bundle components from myLoadedAB//
    }

As you see is something very simple. We find the bundle path by different methods depending on the platform (we already used this system for text files, pngs and others) and the UNITY_EDITOR side is working. The WINDOWS_UWP is throwing this error just on the call to AssetBundle.LoadFromFile(bundleFile);:

Unable to open archive file: C:/Data/Users/edata/3D Objects/exportablebundle

(Filename: C:\buildslave\unity\build\Runtime/VirtualFileSystem/ArchiveFileSystem/ArchiveStorageReader.cpp Line: 542)

'Holoplan.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\HoloplanVS.Release_x86.jalfonso\System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
NullReferenceException: Object reference not set to an instance of an object.
at GameManager.<CallForBundles>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
at UnityEngine.UnitySynchronizationContext.WorkRequest.Invoke()
at UnityEngine.UnitySynchronizationContext.Exec()
at UnityEngine.UnitySynchronizationContext.ExecuteTasks()
at UnityEngine.UnitySynchronizationContext.$Invoke1(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)

(Filename: <Unknown> Line: 0)

"Unable to open archive file: C:/Data/Users/edata/3D Objects/exportablebundle"

seems to be the same error that happens when the app try to load a bunde with wrong file name or path even when running on the editor so it looks like that for some reason 'AssetBundle.LoadFromFile' can't locate de file. We checked the bundleFile at that line and it contains the right filepath ('C:\Data\Users\edata\3D Objects\exportablebundle' where 'exportablebundle' is the bundle file name), so we guess that 'AssetBundle.LoadFromFile' has issues when reading from the Hololens local folder but we don't have much idea about how to address this.

¿Anyone can lend us a hand, please?

EDIT-

We are building our asset bundle with the sample code from the Unity manual in 'Asset bundle workflow'. Is like this:

static void BuildAllAssetBundles(){
  string assetBundleDirectory = "Assets/AssetBundles";
  if (!Directory.Exists(assetBundleDirectory)){
    Directory.CreateDirectory(assetBundleDirectory);
  }

  BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None,  BuildTarget.StandaloneWindows);
}

'StandaloneWindows' as build target seems the closest to hololens from the available list so we went for it.


问:
embed window(glfwCreateWindow) as child to C++ MFC parent form
Please refer this link

Embedding a GLFW window inside windows forms

How can the same achieved by using VC++ to embed glfw window to Parent form?

答:
The link in zett42's post is dead, so here's a more complete snippet</p>

```<code>glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);

GLFWwindow* pWindow = glfwCreateWindow(width, height, "", NULL, NULL);

HWND hwNative = glfwGetWin32Window(m_pWindow);

SetParent(hwNative, hwParentWindow);

long style = GetWindowLong(hwNative, GWL_STYLE);
style &= ~WS_POPUP; // remove popup style
style |= WS_CHILDWINDOW; // add childwindow style
SetWindowLong(hwNative, GWL_STYLE, style);

... any other initialisation code (e.g enable/disable gl features) ...

ShowWindow(hwNative, SW_SHOW);
</code>```

Body:
The link in zett42's post is dead, so here's a more complete snippet

glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);

GLFWwindow* pWindow = glfwCreateWindow(width, height, "", NULL, NULL);

HWND hwNative = glfwGetWin32Window(m_pWindow);

SetParent(hwNative, hwParentWindow);

long style = GetWindowLong(hwNative, GWL_STYLE);
style &= ~WS_POPUP; // remove popup style
style |= WS_CHILDWINDOW; // add childwindow style
SetWindowLong(hwNative, GWL_STYLE, style);

... any other initialisation code (e.g enable/disable gl features) ...

ShowWindow(hwNative, SW_SHOW);


问:
How to implement Bubble Chart / Circle Packing in React Native?
I want to render a Bubble Chart (Circle Packing) dynamic with an data array as a prop in React Native using EXPO (no native code). I wonder which way I could go to implement this chart. Do I use d3? And if yes, does it work for React Native? Are there other ideas on how to implement this bubble chart? Does it work only with SVG? Or d3 including SVG?

I found also a react library that renders the Bubble Chart like in the picture below but the styles and other attributes from react aren't matching to React Native.

I have not yet found an answer to this problem. Does anyone in the community encounter this problem and solved it?

答: You can use react-native-chart-wrapper as it is providing bubble chart with a list of additional charts</p>


问:
Figuring out MySQL data information on an ec2 instance
I installed MySQL on an EC2 instance and need to get some information about that database so I can setup pligg on it.

The info it needs are:  Database Name, Username, Password, Database Server and Table Prefix.  Is there a simple way to retrieve this information?  I assume I need to use PuTTy but I couldn't find specific info on it.

Thanks

答:
The database server is most likely to be localhost and the rest are values that you must set. The docs for whatever application you are installing should give a tutorial on how to create these.

You might find phpMyAdmin useful if the application provides a SQL script to run and you don't want to use the command line.