问:
Why I got "No input file specified." message in my Homestead installation?
I have installed virtualbox  and  vagrant under my ubuntu 20

I created file /home/master/Homestead/Homestead.yaml with 2 hosts (I need mysql and mongodb):

```<code>ip: "192.168.56.56"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /_wwwroot/lar/MS/MS_Banners
      to: /home/vagrant/apps/MS_Banners

    - map: /_wwwroot/lar/MngProducts
      to: /home/vagrant/apps/MngProducts

sites:
    - map: local-ms-banners.test
      to: /_wwwroot/lar/MS/MS_Banners/public
      php: "8.0"

    - map: local-mng-products.test
      to: /_wwwroot/lar/MngProducts/public
      php: "8.1"

databases:
    - MS_Banners

features:
    - mysql: true
    - mongodb: true
    - mariadb: false
    - postgresql: false
    - ohmyzsh: false
    - webdriver: false

services:
    - enabled:
          - "mysql"
</code>```

Running command :

```<code>vagrant up --provision
</code>```

I got long output with some red lines :

```<code>Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Checking if box 'laravel/homestead' version '12.2.0' is up to date...
==> homestead: Running provisioner: file...
    homestead: /home/master/Homestead/aliases => /tmp/bash_aliases
==> homestead: Running provisioner: handle_aliases (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: setting authorize key (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: setting authorize permissions for id_rsa (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: mk_features (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: own_features (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: apt_update (shell)...
    homestead: Running: inline script
    homestead: Ign:1 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
    homestead: Hit:2 https://deb.nodesource.com/node_14.x focal InRelease
    homestead: Hit:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release
    homestead: Get:4 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
    homestead: Hit:6 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu focal InRelease
    homestead: Hit:7 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
    homestead: Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
    homestead: Hit:9 http://us.archive.ubuntu.com/ubuntu focal InRelease
    homestead: Hit:10 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
    homestead: Hit:11 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
    homestead: Hit:12 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
    homestead: Fetched 57.7 kB in 2s (29.4 kB/s)
    homestead: Reading package lists...
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Invalid feature: mysql
==> homestead: Running provisioner: shell...
    homestead: Running: script: Installing mongodb
    homestead: MongoDB already installed.
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: mariadb because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: postgresql because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: ohmyzsh because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: webdriver because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: script: Installing php8.0
    homestead: PHP 8.0 already installed.
==> homestead: Running provisioner: shell...
    homestead: Running: script: Installing php8.1
    homestead: PHP 8.1 already installed.
==> homestead: Running provisioner: enable mysql (shell)...
    homestead: Running: inline script
    // 2 LINES BELOW ARE RED
    homestead: Synchronizing state of mysql.service with SysV service script with /lib/systemd/systemd-sysv-install.
    homestead: Executing: /lib/systemd/systemd-sysv-install enable mysql
==> homestead: Running provisioner: start mysql (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-1acw2t2.sh
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-w2xeim.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Certificate: local-ms-banners.test
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Site: local-ms-banners.test
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-1aeuibw.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Checking for old Schedule
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Certificate: local-mng-products.test
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Site: local-mng-products.test
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-23cr1x.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Checking for old Schedule
==> homestead: Running provisioner: shell...
    homestead: Running: script: Clear Variables
==> homestead: Running provisioner: shell...
    homestead: Running: script: Restarting Cron
==> homestead: Running provisioner: shell...
    homestead: Running: script: Restart Webserver
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating MySQL / MariaDB Database: MS_Banners
    homestead: We didn't find MariaDB ($mariadb), skipping $DB creation
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Mongo Database: MS_Banners
    homestead: MongoDB shell version v4.4.18
    homestead: connecting to: mongodb://127.0.0.1:27017/MS_Banners?compressors=disabled&gssapiServiceName=mongodb
    homestead: Implicit session: session { "id" : UUID("305d08ae-ce7e-4439-a965-72163793dcfa") }
    homestead: MongoDB server version: 4.4.18
    homestead: WriteResult({ "nInserted" : 1 })
==> homestead: Running provisioner: shell...
    homestead: Running: script: Update Composer
    // THE LINE BELOW IS RED
    homestead: You are already using the latest available Composer version 2.5.0 (stable channel).
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-plsvhs.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Update motd
==> homestead: Running provisioner: Run after.sh (shell)...
    homestead: Running: /tmp/vagrant-shell20221220-41221-1vqbufq.sh
</code>```

But running both hostings in browser I got error message only :

```<code>No input file specified.
</code>```

In my I added 2 lines at the end of file /etc/hosts:

```<code>127.0.0.1   localhost
127.0.1.1   master-at-home

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.5   local-bi-currencies.com
...

192.168.56.56  local-mng-products.test
192.168.56.56   local-ms-banners.test
</code>```

I have :

```<code>uname -a
Linux master-at-home 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

master@master-at-home:~/Homestead$ apt show  virtualbox
Package: virtualbox
Version: 6.1.38-dfsg-3~ubuntu1.20.04.1
Priority: optional
Section: multiverse/misc
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Virtualbox Team <team+debian-virtualbox@tracker.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 112 MB
Depends: adduser, iproute2, procps, virtualbox-dkms (>= 6.1.38-dfsg-3~ubuntu1.20.04.1) | virtualbox-source (>= 6.1.38-dfsg-3~ubuntu1.20.04.1) | virtualbox-modules, python3 (<< 3.9), python3 (>= 3.8~), python3.8, python3:any, libc6 (>= 2.29), libcurl3-gnutls (>= 7.16.2), libdevmapper1.02.1 (>= 2:1.02.97), libgcc-s1 (>= 3.0), libgl1, libgsoap-2.8.91, liblzf1 (>= 1.5), libopus0 (>= 1.1), libpng16-16 (>= 1.6.2-1), libpython3.8 (>= 3.8.2), libsdl1.2debian (>= 1.2.11), libssl1.1 (>= 1.1.1), libstdc++6 (>= 5.2), libvncserver1 (>= 0.9.10), libvpx6 (>= 1.6.0), libx11-6, libxcursor1 (>> 1.1.2), libxml2 (>= 2.7.4), libxt6, zlib1g (>= 1:1.1.4)
Recommends: virtualbox-qt (= 6.1.38-dfsg-3~ubuntu1.20.04.1), libqt5core5a (>= 5.12.2), libqt5gui5 (>= 5.0.2) | libqt5gui5-gles (>= 5.0.2), libqt5opengl5 (>= 5.0.2), libqt5widgets5 (>= 5.0.2), libxcb1, libxext6
Suggests: vde2, virtualbox-guest-additions-iso
Conflicts: virtualbox-2.0, virtualbox-2.1, virtualbox-2.2, virtualbox-3.0, virtualbox-3.1, virtualbox-3.2, virtualbox-4.0, virtualbox-4.1, virtualbox-4.2, virtualbox-4.3, virtualbox-5.0, virtualbox-5.1, virtualbox-5.2, virtualbox-6.0, virtualbox-6.1
Homepage: https://www.virtualbox.org
Download-Size: 21.6 MB
APT-Manual-Installed: yes
APT-Sources: http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages
Description: x86 virtualization solution - base binaries
 VirtualBox is a free x86 virtualization solution allowing a wide range
 of x86 operating systems such as Windows, DOS, BSD or Linux to run on a
 Linux system.
 .
 This package provides the binaries for VirtualBox. Either the virtualbox-dkms
 or the virtualbox-source package is also required in order to compile the
 kernel modules needed for virtualbox. A graphical user interface for
 VirtualBox is provided by the package virtualbox-qt.

N: There is 1 additional record. Please use the '-a' switch to see it
master@master-at-home:~/Homestead$ apt show  vagrant
Package: vagrant
Version: 2.2.6+dfsg-2ubuntu3
Priority: optional
Section: universe/admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Ruby Team <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 3,178 kB
Depends: libarchive-tools, curl, openssh-client, rsync, ruby, ruby-bcrypt-pbkdf (>= 1.0.0), ruby-childprocess (>= 0.6.0), ruby-ed25519 (>= 1.2.4), ruby-erubis (>= 2.7.0), ruby-i18n (>= 1.1.1), ruby-listen (>= 3.1.5), ruby-log4r (>= 1.1.9), ruby-net-scp (>= 1.2.0), ruby-net-sftp (>= 2.1), ruby-net-ssh (>= 5.1.0), ruby-rest-client (>= 1.6.0), ruby-vagrant-cloud (>= 2.0.3), ruby-zip (>= 1.2.2)
Recommends: vagrant-libvirt
Suggests: virtualbox (>= 4.0)
Breaks: virtualbox (>= 6.2)
Homepage: https://www.vagrantup.com
Ruby-Versions: all
Download-Size: 425 kB
APT-Manual-Installed: yes
APT-Sources: http://ua.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
Description: Tool for building and distributing virtualized development environments
 This package provides the tools to create and configure lightweight,
 reproducible, and portable virtual environments.
 .
 Vagrant uses Oracle’s VirtualBox to create its virtual machines and then
 uses Chef or Puppet to provision them.

N: There is 1 additional record. Please use the '-a' switch to see it
</code>```

What can be reason of this error? I do not see any config errors...

UPDATED INFO:
I found this
Using Laravel Homestead: 'no input file specified'
branch and try some hints from it :

I run all command as “master” (common) user, not root

vagrant up --provision

But I still got error message :

```<code>No input file specified.
</code>```

On command :

homestead up --provision

I got

```<code>homestead: command not found
</code>```

I found this
https://laracasts.com/discuss/channels/general-discussion/bash-homestead-command-not-found
branch

With advice to run command :

```<code>composer global require "laravel/homestead=~2.0"
</code>```

Not sure if I really neeed to run this command ?

I prefer to have Homestead installed globally, what I did with commands from docs at page https://laravel.com/docs/9.x/homestead
starting with command :

```<code>git clone https://github.com/laravel/homestead.git ~/Homestead
</code>```

How this error can be fixed? Are there some additive logs, degugging options to find reason of this error ?

UPDATED INFO # 2:
I modified my /home/master/Homestead/Homestead.yaml file:

```<code>vagrant up --provision
</code>```0

In the bash I can open root directory of my project :

```<code>vagrant up --provision
</code>```1

and see all files of my project.

but running command :

```<code>vagrant up --provision
</code>```2

I can open php file under homestead.test url ok.
But with url local-ms-banners.test I still got “No input file specified.” error...

In my OS :

```<code> echo $PATH;
/home/master/.composer/vendor/bin:/home/master/.composer/vendor/bin:/home/master/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/master/.config/composer/vendor/bin
</code>```

?

UPDATED INFO # 3:

At this subbranch

```<code>https://stackoverflow.com/questions/24274387/using-laravel-homestead-no-input-file-specified/29962065#29962065
I found a hint to use commands :

homestead destroy
homestead up

But trying to follow it I got unexpected results:

master@master-at-home:~/Homestead$ homestead destroy

  Command "destroy" is not defined.

master@master-at-home:~/Homestead$ homestead -h
Description:
  List commands

Usage:
  list [options] [--] [<namespace>]

Arguments:
  namespace             The namespace name

Options:
      --raw             To output raw command list
      --format=FORMAT   The output format (txt, xml, json, or md) [default: "txt"]
      --short           To skip describing commands' arguments
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The list command lists all commands:

    /home/master/.config/composer/vendor/bin/homestead list

  You can also display the commands for a specific namespace:

    /home/master/.config/composer/vendor/bin/homestead list test

  You can also output the information in other formats by using the --format option:

    /home/master/.config/composer/vendor/bin/homestead list --format=xml

  It's also possible to get raw list of commands (useful for embedding command runner):

    /home/master/.config/composer/vendor/bin/homestead list --raw
master@master-at-home:~/Homestead$ homestead up --provision

  Command "up" is not defined.

master@master-at-home:~/Homestead$ homestead --provision

  The "--provision" option does not exist.

list [--raw] [--format FORMAT] [--short] [--] [<namespace>]

master@master-at-home:~/Homestead$ homestead provision

  Command "provision" is not defined.

master@master-at-home:~/Homestead$ whereis homestead
homestead: /home/master/.config/composer/vendor/bin/homestead

master@master-at-home:~/Homestead$ homestead -v
Laravel Homestead 13.3.2

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  completion            Dump the shell completion script
  help                  Display help for a command
  list                  List commands
  make                  Install Homestead into the current project
 wsl
  wsl:apply-features    Configure features in WSL from Homestead configuration
  wsl:create-databases  Create Databases in WSL from Homestead configuration
  wsl:create-sites      Create Sites in WSL from Homestead configuration
</code>```

Have Laravel Homestead 13.3.2 different commands ?
Or do I have some invalid Homestead installed ?

I removed from folders “/apps” path

map: /_wwwroot/lar/MS/MS_Banners
to: /home/vagrant/apps/MS_Banners

with “code” subdirectory:

```<code>to: /home/vagrant/code/MS_Banners
</code>```

and removed 2nd item :

```<code>to: /home/vagrant/apps/MngProducts
</code>```

but when I enter box with command :

```<code>vagrant ssh
</code>```

I still see directory “~/apps"
with 2 subdirectories “MngProducts” and “MS_Banners”
I have run commands

```<code>vagrant reload --provision
...
vagrant up --provision
</code>```

many times, but looks like there were not applied.
What have I do to apply my config changes?

Thanks!

Body:
I have installed virtualbox  and  vagrant under my ubuntu 20

I created file /home/master/Homestead/Homestead.yaml with 2 hosts (I need mysql and mongodb):

ip: "192.168.56.56"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /_wwwroot/lar/MS/MS_Banners
      to: /home/vagrant/apps/MS_Banners

    - map: /_wwwroot/lar/MngProducts
      to: /home/vagrant/apps/MngProducts

sites:
    - map: local-ms-banners.test
      to: /_wwwroot/lar/MS/MS_Banners/public
      php: "8.0"

    - map: local-mng-products.test
      to: /_wwwroot/lar/MngProducts/public
      php: "8.1"

databases:
    - MS_Banners

features:
    - mysql: true
    - mongodb: true
    - mariadb: false
    - postgresql: false
    - ohmyzsh: false
    - webdriver: false

services:
    - enabled:
          - "mysql"

Running command :

vagrant up --provision

I got long output with some red lines :

Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Checking if box 'laravel/homestead' version '12.2.0' is up to date...
==> homestead: Running provisioner: file...
    homestead: /home/master/Homestead/aliases => /tmp/bash_aliases
==> homestead: Running provisioner: handle_aliases (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: setting authorize key (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: setting authorize permissions for id_rsa (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: mk_features (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: own_features (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: apt_update (shell)...
    homestead: Running: inline script
    homestead: Ign:1 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
    homestead: Hit:2 https://deb.nodesource.com/node_14.x focal InRelease
    homestead: Hit:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release
    homestead: Get:4 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
    homestead: Hit:6 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu focal InRelease
    homestead: Hit:7 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
    homestead: Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
    homestead: Hit:9 http://us.archive.ubuntu.com/ubuntu focal InRelease
    homestead: Hit:10 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
    homestead: Hit:11 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
    homestead: Hit:12 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
    homestead: Fetched 57.7 kB in 2s (29.4 kB/s)
    homestead: Reading package lists...
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Invalid feature: mysql
==> homestead: Running provisioner: shell...
    homestead: Running: script: Installing mongodb
    homestead: MongoDB already installed.
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: mariadb because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: postgresql because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: ohmyzsh because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
    homestead: Ignoring feature: webdriver because it is set to false
==> homestead: Running provisioner: shell...
    homestead: Running: script: Installing php8.0
    homestead: PHP 8.0 already installed.
==> homestead: Running provisioner: shell...
    homestead: Running: script: Installing php8.1
    homestead: PHP 8.1 already installed.
==> homestead: Running provisioner: enable mysql (shell)...
    homestead: Running: inline script
    // 2 LINES BELOW ARE RED
    homestead: Synchronizing state of mysql.service with SysV service script with /lib/systemd/systemd-sysv-install.
    homestead: Executing: /lib/systemd/systemd-sysv-install enable mysql
==> homestead: Running provisioner: start mysql (shell)...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-1acw2t2.sh
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-w2xeim.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Certificate: local-ms-banners.test
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Site: local-ms-banners.test
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-1aeuibw.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Checking for old Schedule
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Certificate: local-mng-products.test
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Site: local-mng-products.test
==> homestead: Running provisioner: shell...
    homestead: Running: inline script
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-23cr1x.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Checking for old Schedule
==> homestead: Running provisioner: shell...
    homestead: Running: script: Clear Variables
==> homestead: Running provisioner: shell...
    homestead: Running: script: Restarting Cron
==> homestead: Running provisioner: shell...
    homestead: Running: script: Restart Webserver
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating MySQL / MariaDB Database: MS_Banners
    homestead: We didn't find MariaDB ($mariadb), skipping $DB creation
==> homestead: Running provisioner: shell...
    homestead: Running: script: Creating Mongo Database: MS_Banners
    homestead: MongoDB shell version v4.4.18
    homestead: connecting to: mongodb://127.0.0.1:27017/MS_Banners?compressors=disabled&gssapiServiceName=mongodb
    homestead: Implicit session: session { "id" : UUID("305d08ae-ce7e-4439-a965-72163793dcfa") }
    homestead: MongoDB server version: 4.4.18
    homestead: WriteResult({ "nInserted" : 1 })
==> homestead: Running provisioner: shell...
    homestead: Running: script: Update Composer
    // THE LINE BELOW IS RED
    homestead: You are already using the latest available Composer version 2.5.0 (stable channel).
==> homestead: Running provisioner: shell...
    homestead: Running: /tmp/vagrant-shell20221220-41221-plsvhs.sh
==> homestead: Running provisioner: shell...
    homestead: Running: script: Update motd
==> homestead: Running provisioner: Run after.sh (shell)...
    homestead: Running: /tmp/vagrant-shell20221220-41221-1vqbufq.sh

But running both hostings in browser I got error message only :

No input file specified.

In my I added 2 lines at the end of file /etc/hosts:

127.0.0.1   localhost
127.0.1.1   master-at-home

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.5   local-bi-currencies.com
...

192.168.56.56  local-mng-products.test
192.168.56.56   local-ms-banners.test

I have :

uname -a
Linux master-at-home 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

master@master-at-home:~/Homestead$ apt show  virtualbox
Package: virtualbox
Version: 6.1.38-dfsg-3~ubuntu1.20.04.1
Priority: optional
Section: multiverse/misc
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Virtualbox Team <team+debian-virtualbox@tracker.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 112 MB
Depends: adduser, iproute2, procps, virtualbox-dkms (>= 6.1.38-dfsg-3~ubuntu1.20.04.1) | virtualbox-source (>= 6.1.38-dfsg-3~ubuntu1.20.04.1) | virtualbox-modules, python3 (<< 3.9), python3 (>= 3.8~), python3.8, python3:any, libc6 (>= 2.29), libcurl3-gnutls (>= 7.16.2), libdevmapper1.02.1 (>= 2:1.02.97), libgcc-s1 (>= 3.0), libgl1, libgsoap-2.8.91, liblzf1 (>= 1.5), libopus0 (>= 1.1), libpng16-16 (>= 1.6.2-1), libpython3.8 (>= 3.8.2), libsdl1.2debian (>= 1.2.11), libssl1.1 (>= 1.1.1), libstdc++6 (>= 5.2), libvncserver1 (>= 0.9.10), libvpx6 (>= 1.6.0), libx11-6, libxcursor1 (>> 1.1.2), libxml2 (>= 2.7.4), libxt6, zlib1g (>= 1:1.1.4)
Recommends: virtualbox-qt (= 6.1.38-dfsg-3~ubuntu1.20.04.1), libqt5core5a (>= 5.12.2), libqt5gui5 (>= 5.0.2) | libqt5gui5-gles (>= 5.0.2), libqt5opengl5 (>= 5.0.2), libqt5widgets5 (>= 5.0.2), libxcb1, libxext6
Suggests: vde2, virtualbox-guest-additions-iso
Conflicts: virtualbox-2.0, virtualbox-2.1, virtualbox-2.2, virtualbox-3.0, virtualbox-3.1, virtualbox-3.2, virtualbox-4.0, virtualbox-4.1, virtualbox-4.2, virtualbox-4.3, virtualbox-5.0, virtualbox-5.1, virtualbox-5.2, virtualbox-6.0, virtualbox-6.1
Homepage: https://www.virtualbox.org
Download-Size: 21.6 MB
APT-Manual-Installed: yes
APT-Sources: http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages
Description: x86 virtualization solution - base binaries
 VirtualBox is a free x86 virtualization solution allowing a wide range
 of x86 operating systems such as Windows, DOS, BSD or Linux to run on a
 Linux system.
 .
 This package provides the binaries for VirtualBox. Either the virtualbox-dkms
 or the virtualbox-source package is also required in order to compile the
 kernel modules needed for virtualbox. A graphical user interface for
 VirtualBox is provided by the package virtualbox-qt.

N: There is 1 additional record. Please use the '-a' switch to see it
master@master-at-home:~/Homestead$ apt show  vagrant
Package: vagrant
Version: 2.2.6+dfsg-2ubuntu3
Priority: optional
Section: universe/admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Ruby Team <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 3,178 kB
Depends: libarchive-tools, curl, openssh-client, rsync, ruby, ruby-bcrypt-pbkdf (>= 1.0.0), ruby-childprocess (>= 0.6.0), ruby-ed25519 (>= 1.2.4), ruby-erubis (>= 2.7.0), ruby-i18n (>= 1.1.1), ruby-listen (>= 3.1.5), ruby-log4r (>= 1.1.9), ruby-net-scp (>= 1.2.0), ruby-net-sftp (>= 2.1), ruby-net-ssh (>= 5.1.0), ruby-rest-client (>= 1.6.0), ruby-vagrant-cloud (>= 2.0.3), ruby-zip (>= 1.2.2)
Recommends: vagrant-libvirt
Suggests: virtualbox (>= 4.0)
Breaks: virtualbox (>= 6.2)
Homepage: https://www.vagrantup.com
Ruby-Versions: all
Download-Size: 425 kB
APT-Manual-Installed: yes
APT-Sources: http://ua.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
Description: Tool for building and distributing virtualized development environments
 This package provides the tools to create and configure lightweight,
 reproducible, and portable virtual environments.
 .
 Vagrant uses Oracle’s VirtualBox to create its virtual machines and then
 uses Chef or Puppet to provision them.

N: There is 1 additional record. Please use the '-a' switch to see it

What can be reason of this error? I do not see any config errors...

UPDATED INFO:
I found this
Using Laravel Homestead: 'no input file specified'
branch and try some hints from it :

I run all command as “master” (common) user, not root

vagrant up --provision

But I still got error message :

No input file specified.

On command :

homestead up --provision

I got

homestead: command not found

I found this
https://laracasts.com/discuss/channels/general-discussion/bash-homestead-command-not-found
branch

With advice to run command :

composer global require "laravel/homestead=~2.0"

Not sure if I really neeed to run this command ?

I prefer to have Homestead installed globally, what I did with commands from docs at page https://laravel.com/docs/9.x/homestead
starting with command :

git clone https://github.com/laravel/homestead.git ~/Homestead

How this error can be fixed? Are there some additive logs, degugging options to find reason of this error ?

UPDATED INFO # 2:
I modified my /home/master/Homestead/Homestead.yaml file:

folders:
    - map: ~/code
      to: /home/vagrant/code

    - map: /_wwwroot/lar/MS/MS_Banners
      to: /home/vagrant/apps/MS_Banners

sites:
    - map: homestead.test
      to: /home/vagrant/code

    - map: local-ms-banners.test
      to: /_wwwroot/lar/MS/MS_Banners/public

In the bash I can open root directory of my project :

vagrant@homestead:~$ cd apps
vagrant@homestead:~/apps$ cd  MS_Banners
vagrant@homestead:~/apps/MS_Banners$ ls -la
total 1236
...

and see all files of my project.

but running command :

vagrant up --provision

I can open php file under homestead.test url ok.
But with url local-ms-banners.test I still got “No input file specified.” error...

In my OS :

 echo $PATH;
/home/master/.composer/vendor/bin:/home/master/.composer/vendor/bin:/home/master/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/master/.config/composer/vendor/bin

?

UPDATED INFO # 3:

At this subbranch

https://stackoverflow.com/questions/24274387/using-laravel-homestead-no-input-file-specified/29962065#29962065
I found a hint to use commands :

homestead destroy
homestead up

But trying to follow it I got unexpected results:

master@master-at-home:~/Homestead$ homestead destroy

  Command "destroy" is not defined.

master@master-at-home:~/Homestead$ homestead -h
Description:
  List commands

Usage:
  list [options] [--] [<namespace>]

Arguments:
  namespace             The namespace name

Options:
      --raw             To output raw command list
      --format=FORMAT   The output format (txt, xml, json, or md) [default: "txt"]
      --short           To skip describing commands' arguments
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The list command lists all commands:

    /home/master/.config/composer/vendor/bin/homestead list

  You can also display the commands for a specific namespace:

    /home/master/.config/composer/vendor/bin/homestead list test

  You can also output the information in other formats by using the --format option:

    /home/master/.config/composer/vendor/bin/homestead list --format=xml

  It's also possible to get raw list of commands (useful for embedding command runner):

    /home/master/.config/composer/vendor/bin/homestead list --raw
master@master-at-home:~/Homestead$ homestead up --provision

  Command "up" is not defined.

master@master-at-home:~/Homestead$ homestead --provision

  The "--provision" option does not exist.

list [--raw] [--format FORMAT] [--short] [--] [<namespace>]

master@master-at-home:~/Homestead$ homestead provision

  Command "provision" is not defined.

master@master-at-home:~/Homestead$ whereis homestead
homestead: /home/master/.config/composer/vendor/bin/homestead

master@master-at-home:~/Homestead$ homestead -v
Laravel Homestead 13.3.2

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  completion            Dump the shell completion script
  help                  Display help for a command
  list                  List commands
  make                  Install Homestead into the current project
 wsl
  wsl:apply-features    Configure features in WSL from Homestead configuration
  wsl:create-databases  Create Databases in WSL from Homestead configuration
  wsl:create-sites      Create Sites in WSL from Homestead configuration

Have Laravel Homestead 13.3.2 different commands ?
Or do I have some invalid Homestead installed ?

I removed from folders “/apps” path

map: /_wwwroot/lar/MS/MS_Banners
to: /home/vagrant/apps/MS_Banners

with “code” subdirectory:

to: /home/vagrant/code/MS_Banners

and removed 2nd item :

to: /home/vagrant/apps/MngProducts

but when I enter box with command :

vagrant ssh

I still see directory “~/apps"
with 2 subdirectories “MngProducts” and “MS_Banners”
I have run commands

vagrant reload --provision
...
vagrant up --provision

many times, but looks like there were not applied.
What have I do to apply my config changes?

Thanks!


来源: stackexchange

问:
JSTL: The method is undefined for the type String
I am learning JSP and JSTL through a book, in said book they mention this example code:

<c:if test="${ 'POST'.equalsIgnoreCase(pageContext.request.method) }">

The method doesn't seem to get recognized however, giving the error: The method getEqualsIgnoreCase() is undefined for the type String.
I don't understand why does it try to find **get**EqualsIgnoreCase() ?

I am using javax.servlet.jsp.jstl-1.2.1.jar and javax.servlet.jsp.jstl-api-1.2.1.jar, since the book is doing things this way, I am assuming this might be a version issue. I would appreciate any tip or clarification on this matter, I couldn't find any answer to this on the suggested posts.

Here the simplified jsp file where I am given the error:

```<code><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Login</title>
</head>

<c:set var="errMsg" value="${null}"/>
<c:set var="displayForm" value="${true}"/>

<c:if test="${ 'POST'.equalsIgnoreCase(pageContext.request.method) }">

</c:if>

<body>

</body>

</html>
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I am learning JSP and JSTL through a book, in said book they mention this example code:

<c:if test="${ 'POST'.equalsIgnoreCase(pageContext.request.method) }">

The method doesn't seem to get recognized however, giving the error: The method getEqualsIgnoreCase() is undefined for the type String.
I don't understand why does it try to find **get**EqualsIgnoreCase() ?

I am using javax.servlet.jsp.jstl-1.2.1.jar and javax.servlet.jsp.jstl-api-1.2.1.jar, since the book is doing things this way, I am assuming this might be a version issue. I would appreciate any tip or clarification on this matter, I couldn't find any answer to this on the suggested posts.

Here the simplified jsp file where I am given the error:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>

<meta charset="ISO-8859-1">
<title>Login</title>

<c:set var="errMsg" value="${null}"/>
<c:set var="displayForm" value="${true}"/>

<c:if test="${ 'POST'.equalsIgnoreCase(pageContext.request.method) }">

</c:if>


问:
How to embed Tableau dashboard to a notebook?
I'm writing a notebook in which I want to embed a cloud Tableau dashboard but haven't figured out how. To test if embedding that dashboard works in general, I copy its embed code to make a HTML page as follows (src in the tableau-viz tag made alias):

<!DOCTYPE html>

        <tableau-viz id='tableau-viz' src='my_source' width='1400' height='840' hide-tabs toolbar='bottom' >
        </tableau-viz>

```

And it works properly, like this:

However, when I copy the code above to a notebook's HTML or Markdown cell (in VS Code), it doesn't work. Instead of showing the dashboard, it asks me to sign in to my Tableau account. I also try to display the embedded code using IPython.display.HTML() or %%HTML but get the same result.

How can I fix this issue?

UPDATE: It turns out I can get the embedding work in Jupyter Notebook (using IPython.display.HTML() and %%HTML). So it seems the issue pertains to VS Code, or simply that it requires the app in use to be web-based? Still, I'd appreciate any suggestions as what to try to fix it on VS Code.

Body:
I'm writing a notebook in which I want to embed a cloud Tableau dashboard but haven't figured out how. To test if embedding that dashboard works in general, I copy its embed code to make a HTML page as follows (src in the tableau-viz tag made alias):

<!DOCTYPE html>

        <tableau-viz id='tableau-viz' src='my_source' width='1400' height='840' hide-tabs toolbar='bottom' >
        </tableau-viz>

And it works properly, like this:

However, when I copy the code above to a notebook's HTML or Markdown cell (in VS Code), it doesn't work. Instead of showing the dashboard, it asks me to sign in to my Tableau account. I also try to display the embedded code using IPython.display.HTML() or %%HTML but get the same result.

How can I fix this issue?

UPDATE: It turns out I can get the embedding work in Jupyter Notebook (using IPython.display.HTML() and %%HTML). So it seems the issue pertains to VS Code, or simply that it requires the app in use to be web-based? Still, I'd appreciate any suggestions as what to try to fix it on VS Code.


问:
airflow : executor could not be loaded on apache airflow localhost
i have install apache airflow on localhost using ubuntu. the executor can't be loaded, this is the traceback :

```<code>[2022-12-20 22:11:13,927] {manager.py:343} WARNING - Ending without manager process.
[2022-12-20 22:11:13,928] {scheduler_job.py:788} INFO - Exited execute loop

    Traceback (most recent call last):
      File "/usr/local/bin/airflow", line 8, in <module>
        sys.exit(main())
      File "/usr/local/lib/python3.8/dist-packages/airflow/__main__.py", line 39, in main
        args.func(args)
      File "/usr/local/lib/python3.8/dist-packages/airflow/cli/cli_parser.py", line 52, in command
        return func(*args, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/airflow/utils/cli.py", line 108, in wrapper
        return f(*args, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/airflow/cli/commands/scheduler_command.py", line 73, in scheduler
        _run_scheduler_job(args=args)
      File "/usr/local/lib/python3.8/dist-packages/airflow/cli/commands/scheduler_command.py", line 43, in _run_scheduler_job
        job.run()
      File "/usr/local/lib/python3.8/dist-packages/airflow/jobs/base_job.py", line 247, in run
        self._execute()
      File "/usr/local/lib/python3.8/dist-packages/airflow/jobs/scheduler_job.py", line 738, in _execute
        self.executor.job_id = self.id
      File "/usr/lib/python3.8/functools.py", line 967, in __get__
        val = self.func(instance)
      File "/usr/local/lib/python3.8/dist-packages/airflow/jobs/base_job.py", line 119, in executor
        return ExecutorLoader.get_default_executor()
      File "/usr/local/lib/python3.8/dist-packages/airflow/executors/executor_loader.py", line 77, in get_default_executor
        cls._default_executor = cls.load_executor(executor_name)
      File "/usr/local/lib/python3.8/dist-packages/airflow/executors/executor_loader.py", line 103, in load_executor
        raise AirflowConfigException(
    airflow.exceptions.AirflowConfigException: The module/attribute could not be loaded. Please check "executor" key in "core" section. Current value: "CeleryExecutor".
</code>```

this is config file in airflow.cfg

```<code># The executor class that airflow should use. Choices include
# ``SequentialExecutor``, ``LocalExecutor``, ``CeleryExecutor``, ``DaskExecutor``,
# ``KubernetesExecutor``, ``CeleryKubernetesExecutor`` or the
# full import path to the class when using a custom executor.
executor = CeleryExecutor
</code>```

Body:
i have install apache airflow on localhost using ubuntu. the executor can't be loaded, this is the traceback :

[2022-12-20 22:11:13,927] {manager.py:343} WARNING - Ending without manager process.
[2022-12-20 22:11:13,928] {scheduler_job.py:788} INFO - Exited execute loop

    Traceback (most recent call last):
      File "/usr/local/bin/airflow", line 8, in <module>
        sys.exit(main())
      File "/usr/local/lib/python3.8/dist-packages/airflow/__main__.py", line 39, in main
        args.func(args)
      File "/usr/local/lib/python3.8/dist-packages/airflow/cli/cli_parser.py", line 52, in command
        return func(*args, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/airflow/utils/cli.py", line 108, in wrapper
        return f(*args, **kwargs)
      File "/usr/local/lib/python3.8/dist-packages/airflow/cli/commands/scheduler_command.py", line 73, in scheduler
        _run_scheduler_job(args=args)
      File "/usr/local/lib/python3.8/dist-packages/airflow/cli/commands/scheduler_command.py", line 43, in _run_scheduler_job
        job.run()
      File "/usr/local/lib/python3.8/dist-packages/airflow/jobs/base_job.py", line 247, in run
        self._execute()
      File "/usr/local/lib/python3.8/dist-packages/airflow/jobs/scheduler_job.py", line 738, in _execute
        self.executor.job_id = self.id
      File "/usr/lib/python3.8/functools.py", line 967, in __get__
        val = self.func(instance)
      File "/usr/local/lib/python3.8/dist-packages/airflow/jobs/base_job.py", line 119, in executor
        return ExecutorLoader.get_default_executor()
      File "/usr/local/lib/python3.8/dist-packages/airflow/executors/executor_loader.py", line 77, in get_default_executor
        cls._default_executor = cls.load_executor(executor_name)
      File "/usr/local/lib/python3.8/dist-packages/airflow/executors/executor_loader.py", line 103, in load_executor
        raise AirflowConfigException(
    airflow.exceptions.AirflowConfigException: The module/attribute could not be loaded. Please check "executor" key in "core" section. Current value: "CeleryExecutor".

this is config file in airflow.cfg

# The executor class that airflow should use. Choices include
# ``SequentialExecutor``, ``LocalExecutor``, ``CeleryExecutor``, ``DaskExecutor``,
# ``KubernetesExecutor``, ``CeleryKubernetesExecutor`` or the
# full import path to the class when using a custom executor.
executor = CeleryExecutor


问:
Touble web scraping streaming sites
I'm trying to make a web scraper using Python and I'm facing one issue. Every streaming site I try to inspect doesnt let me inspect it's html code when i'm on the episodes page. It sends me back to the home page whenever I open Element Inspector. Any help?

I'm new to web scraping so I don't know another way of doing this

```<code>import requests
from bs4 import BeautifulSoup

# THIS PROJECT IS JUST TO SCRAPE ZORO.TO AND DOWNLOAD ANIME USING IT

# Make a request and get the return the HTML content of a webpage
def getWebpage(url):
    r = requests.get(url)
    return BeautifulSoup(r.content, 'html5lib')

# Search the title and get it's Page Url
def getWatchUrl(titleName):
    keyword = ""

    # Transform the Anime title into a Url as on the website
    for word in titleName.split(sep=" "):
        keyword += '+' + word
    keyword = keyword[1:]

    SearchURL = f'https://zoro.to/search?keyword={keyword}'

    # Get the HTML contents of the website
    try:
        soup = getWebpage(SearchURL)

    except Exception as e:
        print(f"Unexpected Error {e}. Please try again!")
        return None

    # Seperate the useful content (Anime title and Links)
    try:
        titles = soup.findAll('div', {'class' : 'film-poster'},  limit=None)

    except:
        print(e)
        print("Couldn't Find title. Check spellings and please try again!")
        return None

    # Search the content for Anime title and extract it's link
    for title in titles:
        for content in title:
            try:
                if titleName in content.get('title').lower():
                    path = content.get('href').replace('?ref=search', '')
                    watchURL = f'https://zoro.to/watch{path}'
                    return watchURL

            except:
                continue

    print("Couldn't Find title. Check spellings and please try again!")
    return None

# Get the direct download links from the Web page
def getDownloadUrl(watchUrl):
    try:
        soup = getWebpage(watchUrl)
        print(soup.prettify())

    except Exception as e:
        print(f"Unexpected Error {e}. Please try again!")
        return None

def main():
    animeName = input("Enter Anime Name: ").lower()
    watchURL = getWatchUrl(animeName)
    if watchURL is not None: getDownloadUrl(watchURL)

if __name__ == "__main__":
    main()
</code>```

Title: Touble web scraping streaming sites

Body:
I'm trying to make a web scraper using Python and I'm facing one issue. Every streaming site I try to inspect doesnt let me inspect it's html code when i'm on the episodes page. It sends me back to the home page whenever I open Element Inspector. Any help?

I'm new to web scraping so I don't know another way of doing this

import requests
from bs4 import BeautifulSoup

# THIS PROJECT IS JUST TO SCRAPE ZORO.TO AND DOWNLOAD ANIME USING IT

# Make a request and get the return the HTML content of a webpage
def getWebpage(url):
    r = requests.get(url)
    return BeautifulSoup(r.content, 'html5lib')

# Search the title and get it's Page Url
def getWatchUrl(titleName):
    keyword = ""

    # Transform the Anime title into a Url as on the website
    for word in titleName.split(sep=" "):
        keyword += '+' + word
    keyword = keyword[1:]

    SearchURL = f'https://zoro.to/search?keyword={keyword}'

    # Get the HTML contents of the website
    try:
        soup = getWebpage(SearchURL)

    except Exception as e:
        print(f"Unexpected Error {e}. Please try again!")
        return None

    # Seperate the useful content (Anime title and Links)
    try:
        titles = soup.findAll('div', {'class' : 'film-poster'},  limit=None)

    except:
        print(e)
        print("Couldn't Find title. Check spellings and please try again!")
        return None

    # Search the content for Anime title and extract it's link
    for title in titles:
        for content in title:
            try:
                if titleName in content.get('title').lower():
                    path = content.get('href').replace('?ref=search', '')
                    watchURL = f'https://zoro.to/watch{path}'
                    return watchURL

            except:
                continue

    print("Couldn't Find title. Check spellings and please try again!")
    return None

# Get the direct download links from the Web page
def getDownloadUrl(watchUrl):
    try:
        soup = getWebpage(watchUrl)
        print(soup.prettify())

    except Exception as e:
        print(f"Unexpected Error {e}. Please try again!")
        return None

def main():
    animeName = input("Enter Anime Name: ").lower()
    watchURL = getWatchUrl(animeName)
    if watchURL is not None: getDownloadUrl(watchURL)

if __name__ == "__main__":
    main()


问:
Find the coordinates (indexes) of an element matrix knowing its linear value
The title isn't very accurate because I didn't know the specific terms to describe it.

I have a matrix of known dimensions width and height. This matrix contains every

integer from 0 to width*height-1 so for example:

```<code>width = 7
height = 4

0  1  2  3  4  5  6
7  8  9  10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27

n = 18
x = ?
y = ?
</code>```

Now if I'm given the value n = 18  I want the program to set x = 4 and y = 2 .

What is the mathematical operation behind it?

It feels like it should be pretty easy but I can wrap my head around it.

I thought the answer was x = n % width  and y = n / height but it's not working, unless I'm just implementing it the wrong way

SOLVED

I'll leave the post here in case someone needs it.

The answer was actually x = n % width and y = n / width and I feel kinda dumb. You can also use height instead of width but keep in mind that you'll need to swap the operations.

Body:
The title isn't very accurate because I didn't know the specific terms to describe it.

I have a matrix of known dimensions width and height. This matrix contains every

integer from 0 to width*height-1 so for example:

width = 7
height = 4

0  1  2  3  4  5  6
7  8  9  10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27

n = 18
x = ?
y = ?

Now if I'm given the value n = 18  I want the program to set x = 4 and y = 2 .

What is the mathematical operation behind it?

It feels like it should be pretty easy but I can wrap my head around it.

I thought the answer was x = n % width  and y = n / height but it's not working, unless I'm just implementing it the wrong way

SOLVED

I'll leave the post here in case someone needs it.

The answer was actually x = n % width and y = n / width and I feel kinda dumb. You can also use height instead of width but keep in mind that you'll need to swap the operations.


问:
Is there equivalent of C++ "using" in Java (introducing alias for some class, or construction of classes)
I wonder if is there any equivalent of C++'s using in Java - I have pretty convoluted construction: Map<String, ArrayList<Function<String, Map<String, String>>>> rules and I would like to make it a little bit simpler by introducing something like:

using Check = Function<Map<String, String>, TypeOfCheckResponse>
and later defining rules (and other usages of Check) using it: Map<String, ArrayList<Check>> rules


问:
Website publishing fails with error could not find a part of the path 'xxx\System.Runtime.InteropServices.RuntimeInformation.dll'
Application works fine in Visual Studio 2022 when debugging, but When trying to publish my Website project getting below error. The reference package is installed through NuGet package manager. Website project is running on .Net framwork 4.8.

Error       Copying file packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\runtimes\unix\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll to xxxxxxxxxxxxx\obj\Debug\AspnetCompileMerge\Source\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\runtimes\unix\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll failed. Could not find a part of the path 'xxxxxx\obj\Debug\AspnetCompileMerge\Source\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\runtimes\unix\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll'.

Tried installing lower and higher version also didn't worked.


问:
How to get user roles - not to project level
I need to get evidence about the role assigned to my user.
Mi role it's supose to be It_Support.. some kind of global viewer role.. when I check in IAM it only shows the roles to proyect level, and i'm not assigned to the project.. my guess is that my role is assigned above this level and I don't know how to get it.

Thanks

I need a shell command or instructions to get the role


问:
Property 'selectedFlatRows' does not exist on type 'TableInstance<object>'
I want to use the row selection feature of react-table. I have the table working well, but when i try to use the row selection feature, I keep getting the error. Property 'selectedFlatRows' does not exist on type 'TableInstance'.

```<code>  const {
    rows,
    getTableProps,
    getTableBodyProps,
    headerGroups,
    prepareRow,
    selectedFlatRows,
  } = useTable(
    {
      data,
      columns,
    },
    useRowSelect,
    (hooks) => {
      hooks.visibleColumns.push((columns) => [
        {
          id: "selection",
          Header: ({ getToggleAllRowsSelectedProps }: any) => (
            <Group position="center">
              <Checkbox {...getToggleAllRowsSelectedProps()} />
            </Group>
          ),
          Cell: ({ row }: any) => (
            <Group position="center">
              <Checkbox {...row.getToggleRowSelectedProps()} />
            </Group>
          ),
        },
        ...columns,
      ]);
    }
  );
</code>```

This is my tsconfig file

```<code>{
  "compilerOptions": {
    "target": "ESNext",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext",
    ],
    "types": ["vite/client", "vite-plugin-svgr/client", "vitest/globals"],
    "allowJs": false,
    "skipLibCheck": false,
    "esModuleInterop": false,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "ESNext",
    "moduleResolution": "Node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx"
  },
  "include": ["src"],

  // "references": [{ "path": "./tsconfig.node.json" }]
}

</code>```

Please how do i fix it?

Body:
I want to use the row selection feature of react-table. I have the table working well, but when i try to use the row selection feature, I keep getting the error. Property 'selectedFlatRows' does not exist on type 'TableInstance'.

  const {
    rows,
    getTableProps,
    getTableBodyProps,
    headerGroups,
    prepareRow,
    selectedFlatRows,
  } = useTable(
    {
      data,
      columns,
    },
    useRowSelect,
    (hooks) => {
      hooks.visibleColumns.push((columns) => [
        {
          id: "selection",
          Header: ({ getToggleAllRowsSelectedProps }: any) => (
            <Group position="center">
              <Checkbox {...getToggleAllRowsSelectedProps()} />
            </Group>
          ),
          Cell: ({ row }: any) => (
            <Group position="center">
              <Checkbox {...row.getToggleRowSelectedProps()} />
            </Group>
          ),
        },
        ...columns,
      ]);
    }
  );

This is my tsconfig file

{
  "compilerOptions": {
    "target": "ESNext",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext",
    ],
    "types": ["vite/client", "vite-plugin-svgr/client", "vitest/globals"],
    "allowJs": false,
    "skipLibCheck": false,
    "esModuleInterop": false,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "ESNext",
    "moduleResolution": "Node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx"
  },
  "include": ["src"],

  // "references": [{ "path": "./tsconfig.node.json" }]
}

Please how do i fix it?


问:
Custom vue validator to have same behavior as `required` validator
Greetings I created custom validator with custom msg for my webpage to check if on register form entered email in unique.

```<code>import userService from '@/services/user-service';
import { helpers } from '@vuelidate/validators';
const { withAsync } = helpers;

const uniqueEmail = helpers.withMessage(
    () => 'Email is already registered',
    withAsync(async (value: string) => {
        return await userService.isEmailTaken(value);
    })
);

export { uniqueEmail };
</code>```

So how it is added to component. The problem is I did not found solution to add same option as 'required' have to turn off validator if I needed.

```<code>validations() {
        return {
            form: {
                email: {
                    required: requiredIf(() => this.isSubsidiary), // I want validator pass function tu turn it off If i want
                    email,
                    uniqueEmail: requiredIf(() => false) // this thing does not work to turn the validation off if needed
                }
            }
        };
    }
</code>```

Any ideas how to make uniqueEmail validator work same as required validator. So I can pass to it boolean to turn it on/off ?

Body:
Greetings I created custom validator with custom msg for my webpage to check if on register form entered email in unique.

import userService from '@/services/user-service';
import { helpers } from '@vuelidate/validators';
const { withAsync } = helpers;

const uniqueEmail = helpers.withMessage(
    () => 'Email is already registered',
    withAsync(async (value: string) => {
        return await userService.isEmailTaken(value);
    })
);

export { uniqueEmail };

So how it is added to component. The problem is I did not found solution to add same option as 'required' have to turn off validator if I needed.

validations() {
        return {
            form: {
                email: {
                    required: requiredIf(() => this.isSubsidiary), // I want validator pass function tu turn it off If i want
                    email,
                    uniqueEmail: requiredIf(() => false) // this thing does not work to turn the validation off if needed
                }
            }
        };
    }

Any ideas how to make uniqueEmail validator work same as required validator. So I can pass to it boolean to turn it on/off ?


问:
Error when i try to convert file using imagemagick
I try to make a PDF file cover in JPG for this I use Node JS and the following libraries ImageMagick Graphicsmagick and Ghostcript.

Code:

root/controller/convertorController.js

```<code>const path = require('path');
const {exec} = require('child_process')

let baseDir = path.join(__dirname,'../tmp');

exports.customExecution = async(req,res,next)=>{

console.log(testDir)
exec(`magick convert ${testDir} -quality 100 awbtest.jpg`,(err,stdout,stderr)=>{
    if(err){
        console.log(err)
    }else{
        console.log('success')
        next();
    }
})

}
</code>```

Project Structure

I checked the file path is correct if when I execute the function does nothing:

```<code>Error: Command failed: magick convert D:\Project\pdf-jpg convertor\tmp/test.pdf -quality 100 awbtest.jpg
 convert: unable to open image 'D:\Project\pdf-jpg convertor\tmp/test.pdf': No such file
or directory @ error/blob.c/OpenBlob/3570.
 convert: no images defined `awbtest.jpg' @ error/convert.c/ConvertImageCommand/3342.

at ChildProcess.exithandler (node:child_process:397:12)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
killed: false,
code: 1,
signal: null,
cmd: 'magick convert D:\Project\pdf-jpg convertor\tmp/test.pdf -quality 100
 awbtest.jpg'
 }
</code>```

Body:
I try to make a PDF file cover in JPG for this I use Node JS and the following libraries ImageMagick Graphicsmagick and Ghostcript.

Code:

root/controller/convertorController.js

const path = require('path');
const {exec} = require('child_process')

let baseDir = path.join(__dirname,'../tmp');

exports.customExecution = async(req,res,next)=>{

console.log(testDir)
exec(`magick convert ${testDir} -quality 100 awbtest.jpg`,(err,stdout,stderr)=>{
    if(err){
        console.log(err)
    }else{
        console.log('success')
        next();
    }
})

}

Project Structure

I checked the file path is correct if when I execute the function does nothing:

Error: Command failed: magick convert D:\Project\pdf-jpg convertor\tmp/test.pdf -quality 100 awbtest.jpg
 convert: unable to open image 'D:\Project\pdf-jpg convertor\tmp/test.pdf': No such file
or directory @ error/blob.c/OpenBlob/3570.
 convert: no images defined `awbtest.jpg' @ error/convert.c/ConvertImageCommand/3342.

at ChildProcess.exithandler (node:child_process:397:12)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
killed: false,
code: 1,
signal: null,
cmd: 'magick convert D:\Project\pdf-jpg convertor\tmp/test.pdf -quality 100
 awbtest.jpg'
 }


问:
reduce neo4j path query memory consumption
I have the following graph

```<code>  A1 A2 A3
   \/   /|
   /\  / |
  B1 B2  B3
</code>```

Imagine I have many type A and many type B nodes and they can be connected like a full mesh network. Now when I do

```<code>match p=(a:A)--(b:B)
return p
</code>```

My graph will produce millions of paths. This incurs too much memory overhead and I either need to bump the memory of neo4j container or somehow make this path query into smaller pieces. Now increasing memory is going to be problematic since the graph size can grow.

How can I break the above query into smaller steps (with each step a smaller memory footprint) so I can still get the complete result after multiple queries?

Body:
I have the following graph

  A1 A2 A3
   \/   /|
   /\  / |
  B1 B2  B3

Imagine I have many type A and many type B nodes and they can be connected like a full mesh network. Now when I do

match p=(a:A)--(b:B)
return p

My graph will produce millions of paths. This incurs too much memory overhead and I either need to bump the memory of neo4j container or somehow make this path query into smaller pieces. Now increasing memory is going to be problematic since the graph size can grow.

How can I break the above query into smaller steps (with each step a smaller memory footprint) so I can still get the complete result after multiple queries?


问:
Postgres select queries inside a transaction is slow
What could be the reason that select queries performed inside a transaction is really slow
even though the queries are with just their primary key?

I have two tables after updating one row in table1 the query in table2 within the same transaction is really slow
even though the query on table2 is just

```<code>select * from table2 where id = 10
</code>```

table1 and table2 have a lot of rows

Body:
What could be the reason that select queries performed inside a transaction is really slow
even though the queries are with just their primary key?

I have two tables after updating one row in table1 the query in table2 within the same transaction is really slow
even though the query on table2 is just

select * from table2 where id = 10

table1 and table2 have a lot of rows


问:
Django Handling Multiple Image Uploads
I have a simple project that has two different models. One that handles a report and one that stores the images for each report connected by a ForeignKey:

```<code>class Report(models.Model):
    report_location = models.ForeignKey(Locations, on_delete=models.CASCADE)
    timesheet = models.ImageField(upload_to='report_images', default='default.png')
    text = models.CharField(max_length=999)
    report_date = models.DateField(auto_now=True)
    created_by = models.ForeignKey(User, on_delete=models.CASCADE)

    def __str__(self):
        return f"{self.report_location, self.report_date, self.created_by}"

class TimeSheetAndPics(models.Model):
    report = models.ForeignKey(Report, on_delete=models.CASCADE)
    report_images = models.ImageField(upload_to='report_images', default='default.png')
    date = models.DateField(auto_now=True)

    def __str__(self):
        return f"{self.report} on {self.date}"
</code>```

My Goal is to have a user fill out the report and then upload multiple pictures, however i cannot figure out how to handle multiple image uploads.

I have two forms for each model:

```<code>class ReportCreationForm(ModelForm):
    class Meta:
        model = Report
        fields = [
            'report_location',
            'text',
        ]

class TimeSheetAndPicForm(ModelForm):
    report_images = forms.FileField(widget=ClearableFileInput(attrs={'multiple': True}))

    class Meta:
        model = TimeSheetAndPics
        fields = [
            'report_images',
        ]
</code>```

And this is how i try to handle my views:

```<code>class NewReport(LoginRequiredMixin, View):
    def get(self, request):
        context = {
            'create_form': ReportCreationForm(),
            'image_form': TimeSheetAndPicForm(),
        }
        return render(request, 'rakan/report_form.html', context)

    def post(self, request):
        post = request.POST
        data = request.FILES or None
        create_form = ReportCreationForm(post)
        image_form = TimeSheetAndPicForm(post, data)

        if create_form.is_valid() and image_form.is_valid():
            clean_form = create_form.save(commit=False)
            clean_form.created_by = request.user
            clean_form.save()

            clean_image_form = image_form.save(commit=False)

            for images in clean_image_form:
                clean_image_form.report = clean_form
                clean_image_form.report = images

                clean_image_form.save()

            return redirect('rakan:rakan_index')

        return redirect('rakan:new-report')
</code>```

I have tried to solve this in different ways but i unfortunately hit a wall. I cant seem to find a solution that actually works. My best try i was able to save only 1 image in the models instead of the 3 test images.

I dont believe it makes a difference but here is also the HTML File that uses the forms:

```<code><div class="content-section">
    <form method="POST" enctype="multipart/form-data">
        {% csrf_token %}
        <fieldset class="form-group">
            <legend class="border-bottom mb-4">Create Report</legend>
            {{ create_form }}
            <br>
            {{ image_form }}
        </fieldset>
        <div class="form-group">
            <button class="btn btn-outline-info" type="submit">submit</button>
        </div>
    </form>
</div>
</code>```

Anyone dealt with this problem would like to help me achieve a solution i would be very thankful. Thank you.

Title: Django Handling Multiple Image Uploads

Body:
I have a simple project that has two different models. One that handles a report and one that stores the images for each report connected by a ForeignKey:

class Report(models.Model):
    report_location = models.ForeignKey(Locations, on_delete=models.CASCADE)
    timesheet = models.ImageField(upload_to='report_images', default='default.png')
    text = models.CharField(max_length=999)
    report_date = models.DateField(auto_now=True)
    created_by = models.ForeignKey(User, on_delete=models.CASCADE)

    def __str__(self):
        return f"{self.report_location, self.report_date, self.created_by}"

class TimeSheetAndPics(models.Model):
    report = models.ForeignKey(Report, on_delete=models.CASCADE)
    report_images = models.ImageField(upload_to='report_images', default='default.png')
    date = models.DateField(auto_now=True)

    def __str__(self):
        return f"{self.report} on {self.date}"

My Goal is to have a user fill out the report and then upload multiple pictures, however i cannot figure out how to handle multiple image uploads.

I have two forms for each model:

class ReportCreationForm(ModelForm):
    class Meta:
        model = Report
        fields = [
            'report_location',
            'text',
        ]

class TimeSheetAndPicForm(ModelForm):
    report_images = forms.FileField(widget=ClearableFileInput(attrs={'multiple': True}))

    class Meta:
        model = TimeSheetAndPics
        fields = [
            'report_images',
        ]

And this is how i try to handle my views:

class NewReport(LoginRequiredMixin, View):
    def get(self, request):
        context = {
            'create_form': ReportCreationForm(),
            'image_form': TimeSheetAndPicForm(),
        }
        return render(request, 'rakan/report_form.html', context)

    def post(self, request):
        post = request.POST
        data = request.FILES or None
        create_form = ReportCreationForm(post)
        image_form = TimeSheetAndPicForm(post, data)

        if create_form.is_valid() and image_form.is_valid():
            clean_form = create_form.save(commit=False)
            clean_form.created_by = request.user
            clean_form.save()

            clean_image_form = image_form.save(commit=False)

            for images in clean_image_form:
                clean_image_form.report = clean_form
                clean_image_form.report = images

                clean_image_form.save()

            return redirect('rakan:rakan_index')

        return redirect('rakan:new-report')

I have tried to solve this in different ways but i unfortunately hit a wall. I cant seem to find a solution that actually works. My best try i was able to save only 1 image in the models instead of the 3 test images.

I dont believe it makes a difference but here is also the HTML File that uses the forms:

    <form method="POST" enctype="multipart/form-data">
        {% csrf_token %}
        <fieldset class="form-group">
            <legend class="border-bottom mb-4">Create Report</legend>
            {{ create_form }}

            {{ image_form }}
        </fieldset>

            <button class="btn btn-outline-info" type="submit">submit</button>

    </form>

Anyone dealt with this problem would like to help me achieve a solution i would be very thankful. Thank you.


问:
Matplotlib subplot alignment and equal spacing
I am trying to make an image with multiple subplots using matplotlib. That part is no problem. What I have been struggling with is alignment. Specifically, having the outside edges of the plots aligned and having equal spacing between the plots (the same space horizontally and vertically).

I have been able to get it working with no spacing between plots:

```<code>import numpy as np
import matplotlib.pyplot as plt

plt.set_cmap('jet')
plt.close()

dim1 = 81
dim2 = 445
rad = 10

arr1 = np.random.rand(dim1, dim2) # Representative data, first plot
arr1[round(dim1/2 - rad):round(dim1/2 + rad), round(dim1/2 - rad):round(dim1/2 + rad)] += 6
arr1[round(dim1/2 - rad):round(dim1/2 + rad), round(-dim1/2 - rad):round(-dim1/2 + rad)] += 3

arr2 = arr1[:, :dim1] # Second plot
arr3 = arr1[:, -dim1:] # Third plot

xpix = dim2 # sudo x pixels in the image
ypix = xpix/2 + dim1 # sudo y pixels for the image
ratio = xpix/ypix # ratio of the width to height for the image

size = 7

fig = plt.figure(figsize = (size*ratio, size))

grid = plt.GridSpec(2, 2, wspace = 0, hspace = 0, left = 0, right = 1, top = 1, bottom = 0, height_ratios = [dim1, xpix/2])

ax1=fig.add_subplot(grid[0,:]) # Top plot
ax1.axis(False)
#ax1.set_anchor('N')
ax1.imshow(arr1, aspect = 'equal')

ax2=fig.add_subplot(grid[1,0]) # Bottom left plot
ax2.axis(False)
ax2.set_anchor('SW')
ax2.imshow(arr2, aspect = 'equal')

ax3=fig.add_subplot(grid[1,1]) # Bottom right plot
ax3.axis(False)
ax3.set_anchor('SE')
ax3.imshow(arr3, aspect = 'equal')

plt.show()
</code>```

Which gives me the attached output.
No spacing plot

However, after many attempts at adding in spaces, I have had no luck. One way that I tried to do it was replacing the GridSpec line above with:

```<code>space = 0.01
grid = plt.GridSpec(2, 2, wspace = space, hspace = space*ratio, left = 0, right = 1, top = 1, bottom = 0, height_ratios=[dim1, xpix*(1-space)/2])
</code>```

Sometimes depending on the space, image size, or number of pixels this seems to work, but a lot of the time it does not. I have tried several other things including using a 3*3 GridSpec with wspace = 0, hspace = 0 and using the middle row/column for spacing. I also tried using multiple GridSpec's and specifying the top, bottom, left, and right for each to get equal spacing and aligned edges. All of these attempts yielded similar results. One other important thing is that the I do need to have square pixels for each of the arrays (I noticed that a lot of the examples/other questions regarding GridSpec use subplots with nothing in them and it looks like the aspect ratio changes to get alignment?).

My ultimate goal is to be able to set an arbitrary space, size and input arrays and not have to worry about fiddling with things in order to get equal spacing with the edges aligned. Thank you in advance for any help!

Edit:

I am hoping that in the end the output will look like this: Desired Output and that I will be able to choose the amount of space between the images.

Body:
I am trying to make an image with multiple subplots using matplotlib. That part is no problem. What I have been struggling with is alignment. Specifically, having the outside edges of the plots aligned and having equal spacing between the plots (the same space horizontally and vertically).

I have been able to get it working with no spacing between plots:

import numpy as np
import matplotlib.pyplot as plt

plt.set_cmap('jet')
plt.close()

dim1 = 81
dim2 = 445
rad = 10

arr1 = np.random.rand(dim1, dim2) # Representative data, first plot
arr1[round(dim1/2 - rad):round(dim1/2 + rad), round(dim1/2 - rad):round(dim1/2 + rad)] += 6
arr1[round(dim1/2 - rad):round(dim1/2 + rad), round(-dim1/2 - rad):round(-dim1/2 + rad)] += 3

arr2 = arr1[:, :dim1] # Second plot
arr3 = arr1[:, -dim1:] # Third plot

xpix = dim2 # sudo x pixels in the image
ypix = xpix/2 + dim1 # sudo y pixels for the image
ratio = xpix/ypix # ratio of the width to height for the image

size = 7

fig = plt.figure(figsize = (size*ratio, size))

grid = plt.GridSpec(2, 2, wspace = 0, hspace = 0, left = 0, right = 1, top = 1, bottom = 0, height_ratios = [dim1, xpix/2])

ax1=fig.add_subplot(grid[0,:]) # Top plot
ax1.axis(False)
#ax1.set_anchor('N')
ax1.imshow(arr1, aspect = 'equal')

ax2=fig.add_subplot(grid[1,0]) # Bottom left plot
ax2.axis(False)
ax2.set_anchor('SW')
ax2.imshow(arr2, aspect = 'equal')

ax3=fig.add_subplot(grid[1,1]) # Bottom right plot
ax3.axis(False)
ax3.set_anchor('SE')
ax3.imshow(arr3, aspect = 'equal')

plt.show()

Which gives me the attached output.
No spacing plot

However, after many attempts at adding in spaces, I have had no luck. One way that I tried to do it was replacing the GridSpec line above with:

space = 0.01
grid = plt.GridSpec(2, 2, wspace = space, hspace = space*ratio, left = 0, right = 1, top = 1, bottom = 0, height_ratios=[dim1, xpix*(1-space)/2])

Sometimes depending on the space, image size, or number of pixels this seems to work, but a lot of the time it does not. I have tried several other things including using a 3*3 GridSpec with wspace = 0, hspace = 0 and using the middle row/column for spacing. I also tried using multiple GridSpec's and specifying the top, bottom, left, and right for each to get equal spacing and aligned edges. All of these attempts yielded similar results. One other important thing is that the I do need to have square pixels for each of the arrays (I noticed that a lot of the examples/other questions regarding GridSpec use subplots with nothing in them and it looks like the aspect ratio changes to get alignment?).

My ultimate goal is to be able to set an arbitrary space, size and input arrays and not have to worry about fiddling with things in order to get equal spacing with the edges aligned. Thank you in advance for any help!

Edit:

I am hoping that in the end the output will look like this: Desired Output and that I will be able to choose the amount of space between the images.


问:
Authentication with tomcat 10
i have a tomcat 10 server set up and trying to run opengrok. Opengrok is supplied as a war file.

I have also enabled security constraints ( form based ldap) via the web.xml file but when i have this configured it seems to redirect all requests to the login page. this includes all the asset files. I assumed that once it had been authenticated the jsessionid would allow access to all parts of the webapp. once authenticated that part is fine to access again but it does mean that every css, js, jsp file is prompted for authentication.

I have already excluded some of the asset files but it is now prompting for authentication to files in the root. Ideally i dont want to exclude all of the files as it kind of defeats the point of the authentication

web.xml contains the following:
`

```<code>   <security-constraint>
        <display-name>Not Authenticated</display-name>
        <web-resource-collection>
            <web-resource-name>API</web-resource-name>
            <url-pattern>/api/*</url-pattern>
        </web-resource-collection>
        <web-resource-collection>
            <web-resource-name>Web Assets</web-resource-name>
            <url-pattern>/default/*</url-pattern>
            <url-pattern>/js/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

    <security-constraint>
        <display-name>Authenticated</display-name>
        <web-resource-collection>
            <web-resource-name>Protected Area</web-resource-name>
            <url-pattern>/*</url-pattern>
            <url-pattern>/api/v1/search</url-pattern>
            <url-pattern>/api/v1/suggest/*</url-pattern>
         </web-resource-collection>
        <auth-constraint>
            <role-name>OpenGrok-Users</role-name>
        </auth-constraint>
    </security-constraint>
    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>Form-Based Authentication Area</realm-name>
        <form-login-config>
            <form-login-page>/security/protected/index.jsp</form-login-page>
            <form-error-page>/security/protected/error.jsp</form-error-page>
        </form-login-config>
    </login-config>

</code>```

context.xml contains

```<code><Context antiJARLocking="true" path="/" sessionCookiePath="/">
   <CookieProcessor sameSiteCookies="strict" />
</Context>

</code>```

`

Any assistance would be appreciated

Title: Authentication with tomcat 10

Body:
i have a tomcat 10 server set up and trying to run opengrok. Opengrok is supplied as a war file.

I have also enabled security constraints ( form based ldap) via the web.xml file but when i have this configured it seems to redirect all requests to the login page. this includes all the asset files. I assumed that once it had been authenticated the jsessionid would allow access to all parts of the webapp. once authenticated that part is fine to access again but it does mean that every css, js, jsp file is prompted for authentication.

I have already excluded some of the asset files but it is now prompting for authentication to files in the root. Ideally i dont want to exclude all of the files as it kind of defeats the point of the authentication

web.xml contains the following:
`

   <security-constraint>
        <display-name>Not Authenticated</display-name>
        <web-resource-collection>
            <web-resource-name>API</web-resource-name>
            <url-pattern>/api/*</url-pattern>
        </web-resource-collection>
        <web-resource-collection>
            <web-resource-name>Web Assets</web-resource-name>
            <url-pattern>/default/*</url-pattern>
            <url-pattern>/js/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

    <security-constraint>
        <display-name>Authenticated</display-name>
        <web-resource-collection>
            <web-resource-name>Protected Area</web-resource-name>
            <url-pattern>/*</url-pattern>
            <url-pattern>/api/v1/search</url-pattern>
            <url-pattern>/api/v1/suggest/*</url-pattern>
         </web-resource-collection>
        <auth-constraint>
            <role-name>OpenGrok-Users</role-name>
        </auth-constraint>
    </security-constraint>
    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>Form-Based Authentication Area</realm-name>
        <form-login-config>
            <form-login-page>/security/protected/index.jsp</form-login-page>
            <form-error-page>/security/protected/error.jsp</form-error-page>
        </form-login-config>
    </login-config>

context.xml contains

<Context antiJARLocking="true" path="/" sessionCookiePath="/">
   <CookieProcessor sameSiteCookies="strict" />
</Context>

`

Any assistance would be appreciated


问:
How to send a variable into an included php-file that's nested in a php-file
I have a nav-bar with 3 link's. I used to keep the navbar within my 3 pages but someone suggested to use one navbar.php with that navbar code and include that file within all other files that use the navbar. So, less code, same result. And it works.

However, I was using aria-current="page" to highlight the link on the active page. But now that doesn't work anymore.

I found some similar pages with that question but it puzzles me. I am relatively new to all this so I hoped one could make it not only clear but crystal-clear to me.

I found this page :
PHP Pass variable to next page

and so I used this code already to get info to navbar.php.
(https://i.stack.imgur.com/ne5FI.png)

So , all things start on my index.php page where I use a navbar.php which contains my navbar.
I can move to page 'about', 'portfolio' or 'contact' with one of the three links provided in navbar.php.
On index.php none of the three links are highlighted of course because I'm not on one of those pages.

Now, when I am going to page 2 'about'. I want to give that info "$active_var=2" into navbar.php which will return a different outcome on the highlight of a 'href' with aria-current="page". The link 'about' will be fatter.

Same for the other pages.

I think i need to declare the variable in the navbar.php only. and then give a value when clicking on a link. That info will go to the corresponding page ex. about.php but that i'm not sure.

Here is my navbar code :

I left the code for the link to about.php like it was and changed the code for the other two links like I think they should be, but it doesn't work.
enter image description here

I hope I was clear enough myself in my question.

tried inserting info from a variable but don't see how because I use a php with a include navbar.php which needs info from the parent php. I might not understand which page needs which var info. So I am on index.php with 3 links to other php's which all have the include navbar.php that has the code for making the links and highlighting the current page.


问:
WordPress website how to dynamically switch between horizontal and vertical scroll
I am developing a website with Elementor Pro where I want to have a page that has a normal, vertical scroll but when it gets to the second section I want to have the vertical scroll stop and automatically scroll you horizontally.

Until now I have achieved a horizontal scroll but if I have created a new page with only that section. On a page with more content that scrolls vertically, I would have to click the section or the horizontal scroll bar to get the page's attention to change the scrolling direction, and I do not know how to stop the section at the top anchor point as well.

This is what I am trying to achieve: screenshot
https://premiumaddons.com/elementor-horizontal-scroll-widget/

The code I have so far:

page code:

```<code>HTML {
  scroll-behavior: smooth;
}
@media only screen and (min-width: 1025px) {
    main {
      overflow-x: hidden;
      display: flex;
    }

    section {
      min-width: 100vw!important;
      min-height: 100vh!important;
    }
}
</code>```

HTML element:

```<code><script type="text/javascript">
    if (window.innerWidth > 1025) {
       const scrollContainer = document.querySelector("main");

        scrollContainer.addEventListener("wheel", (evt) => {
            evt.preventDefault();
            scrollContainer.scrollLeft += evt.deltaY;
        });
    } else {

}
</script>
</code>```

Can someone please help me with some ideas or another thread I really did not find anything that is answering my question here or on Youtube, only how to do a full horizontal scroll website?

Body:
I am developing a website with Elementor Pro where I want to have a page that has a normal, vertical scroll but when it gets to the second section I want to have the vertical scroll stop and automatically scroll you horizontally.

Until now I have achieved a horizontal scroll but if I have created a new page with only that section. On a page with more content that scrolls vertically, I would have to click the section or the horizontal scroll bar to get the page's attention to change the scrolling direction, and I do not know how to stop the section at the top anchor point as well.

This is what I am trying to achieve: screenshot
https://premiumaddons.com/elementor-horizontal-scroll-widget/

The code I have so far:

page code:

HTML {
  scroll-behavior: smooth;
}
@media only screen and (min-width: 1025px) {
    main {
      overflow-x: hidden;
      display: flex;
    }

    section {
      min-width: 100vw!important;
      min-height: 100vh!important;
    }
}

HTML element:

Can someone please help me with some ideas or another thread I really did not find anything that is answering my question here or on Youtube, only how to do a full horizontal scroll website?


问:
Session id getting terminated due to SO_TIMEOUT
enter image description here](https://i.stack.imgur.com/TV23U.png)

i runned my cucumber test could someone help me me out in this

i should my my cucumber tests


问:
Why can't I get a new function in an AngularJS provider to run?
I have a django application using AngularJS on the front end.

I have added a function to an AngularJS provider (getByEmployeeId).

```<code>app.provider('changeTrackingService', function( CTO_LOCAL_STORAGE_BYTES, MEGABYTE_MULTIPLIER, LOGGED_IN_EMPLOYEE) {

      this.getByEmployeeId = function (employee_id) {
          return httpServ.post('/hr/get_ctm_by_employee', {employee_id: employee_id}).then(function    (resp) {
              return objectModel(resp.data.object_id, resp.data.changeset);
          });
      }

      this.getByEncounterId = function (encounter_id) {
          return httpServ.post('/encounters/get_ctm_by_encounter', {encounter_id: encounter_id}).then(function (resp) {
              return objectModel(resp.data.object_id, resp.data.changeset);
          });
      }

    this.$get = function ($http) {
  httpServ = $http;
        return {
getByEmployeeId: this.getByEmployeeId,
            getByEncounterId: this.getByEncounterId,
            getByOrderId: this.getByOrderId
        }
    }

</code>```

When I try to run that provider function from a function int he service, nothing happens.  The existing function, getByEncounterId works completely fine.  But, getByEmployeeId does absolutely nothing.  No errors... everything just stops right then.

```<code>app.service('chartProvider', ['$http', 'changeTrackingService', function($http, changeTrackingService){
   return {
      get: function(entity_id, isEmployee = false) {
         if(isEmployee)
            return changeTrackingService.getByEmployeeId(entity_id).then(function (object) {
                  return object;
            });
         else
            return changeTrackingService.getByEncounterId(entity_id).then(function (object) {
                  return object;
            });
      },
</code>```

If I look at the changeTrackingService while debugging, this it is showing the function is there.

```<code>{getByEmployeeId: ƒ, getByEncounterId: ƒ, getByOrderId: ƒ}

</code>```

If I look at the .js file in the browser, the function is there.

If I change it to incorrectly run getByEncounterId it works fine.

I have tried clearing caches, rebuilding docker images, re-collecting static files and spinning around in my chair three times while cutting a potato in half.

Body:
I have a django application using AngularJS on the front end.

I have added a function to an AngularJS provider (getByEmployeeId).

app.provider('changeTrackingService', function( CTO_LOCAL_STORAGE_BYTES, MEGABYTE_MULTIPLIER, LOGGED_IN_EMPLOYEE) {

      this.getByEmployeeId = function (employee_id) {
          return httpServ.post('/hr/get_ctm_by_employee', {employee_id: employee_id}).then(function    (resp) {
              return objectModel(resp.data.object_id, resp.data.changeset);
          });
      }

      this.getByEncounterId = function (encounter_id) {
          return httpServ.post('/encounters/get_ctm_by_encounter', {encounter_id: encounter_id}).then(function (resp) {
              return objectModel(resp.data.object_id, resp.data.changeset);
          });
      }

    this.$get = function ($http) {
  httpServ = $http;
        return {
getByEmployeeId: this.getByEmployeeId,
            getByEncounterId: this.getByEncounterId,
            getByOrderId: this.getByOrderId
        }
    }

When I try to run that provider function from a function int he service, nothing happens.  The existing function, getByEncounterId works completely fine.  But, getByEmployeeId does absolutely nothing.  No errors... everything just stops right then.

app.service('chartProvider', ['$http', 'changeTrackingService', function($http, changeTrackingService){
   return {
      get: function(entity_id, isEmployee = false) {
         if(isEmployee)
            return changeTrackingService.getByEmployeeId(entity_id).then(function (object) {
                  return object;
            });
         else
            return changeTrackingService.getByEncounterId(entity_id).then(function (object) {
                  return object;
            });
      },

If I look at the changeTrackingService while debugging, this it is showing the function is there.

{getByEmployeeId: ƒ, getByEncounterId: ƒ, getByOrderId: ƒ}

If I look at the .js file in the browser, the function is there.

If I change it to incorrectly run getByEncounterId it works fine.

I have tried clearing caches, rebuilding docker images, re-collecting static files and spinning around in my chair three times while cutting a potato in half.


问:
why javascript Delete backslash(\) when Using Onclick method for File Addresses
Why Javascript Methods like (javascript onclick, and Onchange) Getting File Addresses like this ( FilesItem38069707322680384-5832364197407734490_121.jpg ) instead of correct way like this(Files\Item\638069707322680384-5832364197407734490_121.jpg)

i expecting for javascript Methods to Send The File Address on the correct way with backslash,
what should i do for javascript method to do not delet backslash for file address


问:
Wrong path chosen in VsCode (Python)
Whenever I launch a python code in vscode, it does not use the file's path but the folder I opened for the interpreter.
It gets annoyning because I know it would work in other applications like Sypder and I do not know why can't I find a parameter that let me say "open Python interpreter with the file's directory for its path".
could you help me ?

Let's say I open this folder with the files inside in vscode :

Main_Folder

Secondary_Folder
Code.py
- csv_folder
info.csv

If I want to read the 'info.csv' file, I would like to use this code
import csv file = open('csv_folder/info.csv,'r')
However, I have to use this code because it starts at the origin of the folder :
import csv file = open('Secondaary_Folder/csv_folder/info.csv,'r')

Title: Wrong path chosen in VsCode (Python)


问:
how to put headers content type = octet Stream with flutter and retrofit?
I'm on consuming an endpoint with retrofit. The function returns Bytes Content.
this is the service function:

```<code>  @GET("/down/{fileName}")
  Future<HttpResponse> downFile(@Path("fileName") String fileName);
}
</code>```

this is the function that returns data:

```<code> getData() async {
    final apiService = ApiService(Dio());
    String fileName = 'bootloader_file.bin';
    final response = await apiService.downFile(fileName);
    print("Response : ${response.data}");
  }

</code>```

Unfortunatly, in the terminal I got response: MSTR But the response should be the content of the file.
Thanks in advance for your help

Body:
I'm on consuming an endpoint with retrofit. The function returns Bytes Content.
this is the service function:

  @GET("/down/{fileName}")
  Future<HttpResponse> downFile(@Path("fileName") String fileName);
}

this is the function that returns data:

 getData() async {
    final apiService = ApiService(Dio());
    String fileName = 'bootloader_file.bin';
    final response = await apiService.downFile(fileName);
    print("Response : ${response.data}");
  }

Unfortunatly, in the terminal I got response: MSTR But the response should be the content of the file.
Thanks in advance for your help


问:
JSON hijacking a string without bracket on the outside, is it possible?
OWASP shows this examples of JSON hijacking:

Exploitable:
[{"object": "inside an array"}]

Not exploitable:
{"object": "not inside an array"}

Also not exploitable:
{"result": [{"object": "inside an array"}]}

But is just a JSON string '"c29tZXRva2Vu"' created by JSON.stringify('c29tZXRva2Vu') without brackets on the outside exploitable?


问:
VueJS pagination method implementing
Hi I am trying to make a giphy app. Everything goes well but I couldn't find a way to implement the pagination feature for pagination. I have documentation for giphy pagination  link  and I created a pagination component by using vuetify. But I don't know how am I going to fetch page length and show all pages into this component.

```<code><div class="my-4 text-center" v-if="this.loaded">
      <v-pagination v-model="page" :length="6"></v-pagination>
    </div>
</code>```

My full code is here. API keyis hidden for security. I used vue3 and vuetify 3.

```<code><template>
  <v-container>
    <v-row class="my-8">
      <v-col>
        <h2 class="my-4">{{ title }}</h2>
        <form @submit.prevent="fetchGifs">
          <v-text-field
            required
            v-model="search"
            class="pb-4"
            :loading="loading"
            density="compact"
            variant="solo"
            label="Search Gif"
            append-inner-icon="mdi-magnify"
            single-line
            hide-details
            @click:append-inner="fetchGifs"
          ></v-text-field>
          <v-btn type="submit" class="mr-4" color="error">Search</v-btn>
        </form>
      </v-col>
    </v-row>

    <div class="my-4 text-center" v-if="this.loaded">
      <v-pagination v-model="page" :length="6"></v-pagination>
    </div>

    <div style="column-count: 3" v-if="this.loaded">
      <v-row v-for="(image, index) in images" :key="index++">
        <img class="pa-2" :src="image" alt="" />
      </v-row>
    </div>
  </v-container>
</template>

<script>
export default {
  data: () => ({
    title: 'Giphy Search App',
    search: '',
    startTime: '',
    endTime: '',
    loaded: false,
    loading: false,
    images: [],
    page: 1,
  }),

  methods: {
    async fetchGifs() {
      this.images = [];

      this.loading = true;

      setTimeout(() => {
        this.loading = false;
        this.loaded = true;
      }, 2000);

      try {
        this.startTime = new Date().getTime();
        const response = await fetch(
          `https://api.giphy.com/v1/gifs/search?api_key="HIDDEN FOR SECURITY"&q=${this.search}`
        );
        const {data} = await response.json();
        data.forEach(d => {
          this.images.push(d.images.original.url);
        });
      } catch (err) {
        console.log(err);
      }
      this.endTime = new Date().getTime();
    },
  },
};
</script>

<style>
img {
  width: 100%;
}
</style>
</code>```

Title: VueJS pagination method implementing

Body:
Hi I am trying to make a giphy app. Everything goes well but I couldn't find a way to implement the pagination feature for pagination. I have documentation for giphy pagination  link  and I created a pagination component by using vuetify. But I don't know how am I going to fetch page length and show all pages into this component.

      <v-pagination v-model="page" :length="6"></v-pagination>

My full code is here. API keyis hidden for security. I used vue3 and vuetify 3.

<template>
  <v-container>
    <v-row class="my-8">
      <v-col>

{{ title }}

        <form @submit.prevent="fetchGifs">
          <v-text-field
            required
            v-model="search"
            class="pb-4"
            :loading="loading"
            density="compact"
            variant="solo"
            label="Search Gif"
            append-inner-icon="mdi-magnify"
            single-line
            hide-details
            @click:append-inner="fetchGifs"
          ></v-text-field>
          <v-btn type="submit" class="mr-4" color="error">Search</v-btn>
        </form>
      </v-col>
    </v-row>

      <v-pagination v-model="page" :length="6"></v-pagination>

      <v-row v-for="(image, index) in images" :key="index++">

      </v-row>

  </v-container>
</template>