问:
DBD-Oracle (1.74 or 1.76) with oracle instantclient 11.2 on win10 wsl ubuntu
I am trying to install DBD::Oracle, either 1.74 or 1.76 on an ubuntu wsl bash on windows 10.

I am on a 64 architecture, and sqlplus64 is working and I can connect to my database!

Installation with cpanm or installing with carton or trying to compile with perl Makeperl.pm -l does not work and always results in the same error.

Using Oracle in /usr/lib/oracle/11.2/client64
-> FAIL Timed out (> 60s). Use --verbose to retry.
-> N/A

I have tried following:

I have tried to elevate folder permissions but no luck.

I am behind a corporate proxy other packages have installed
fine, but I also tried with mobile connection on the wild internet, no luck either.

Here is my build.log

```<code>cpanm (Menlo) 1.9019 on perl 5.018002 built for x86_64-linux
Work directory is /home/user1/.cpanm/work/1558699904.1138
You have make /usr/bin/make
You have LWP: 6.39
You have LWP::Protocol::https: 6.07
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
--> Working on /mnt/c/project/
Entering /mnt/c/project
Configuring /mnt/c/project
-> OK
Checking if you have Try::Tiny 0.24 ... Yes (0.27)
Checking if you have Tie::IxHash 1.23 ... Yes (1.23)
Checking if you have Image::Size 3.300 ... Yes (3.300)
Checking if you have Dancer2 0.203001 ... Yes (0.203001)
Checking if you have HTTP::Request 0 ... Yes (6.11)
Checking if you have Test::Fixture::DBI 0 ... Yes (0.09)
Checking if you have Net::SSLeay 1.88 ... Yes (1.88)
Checking if you have Plack::Middleware::CrossOrigin 0.012 ... Yes (0.012)
Checking if you have Date::Format 2.24 ... Yes (2.24)
Checking if you have Dancer2::Plugin::Database 2.16 ... Yes (2.17)
Checking if you have MIME::Lite 3.030 ... Yes (3.030)
Checking if you have Crypt::JWT 0.018 ... Yes (0.018)
Checking if you have JSON 0 ... Yes (2.90)
Checking if you have LockFile::Simple 0.208 ... Yes (0.208)
Checking if you have DBD::Oracle 1.74 ... No
Checking if you have Date::Language 1.10 ... Yes (1.10)
Checking if you have HTML::TreeBuilder 5.03 ... Yes (5.03)
Checking if you have Date::DayOfWeek 1.22 ... Yes (1.22)
Checking if you have Data::Serializer 0.60 ... Yes (0.60)
Checking if you have Date::Manip 6.54 ... Yes (6.56)
Checking if you have Locale::Maketext 0 ... Yes (1.23)
Checking if you have Time::Piece 0 ... Yes (1.20_01)
Checking if you have Redis 1.991 ... Yes (1.991)
Checking if you have Unicode::String 2.09 ... Yes (2.10)
Checking if you have LWP::Protocol::https 6.06 ... Yes (6.06)
Checking if you have Date::Calc 6.4 ... Yes (6.4)
Checking if you have Test::More 0 ... Yes (0.98)
Checking if you have MooX::Types::MooseLike 0.29 ... Yes (0.29)
Checking if you have MIME::Types 2.13 ... Yes (2.13)
Checking if you have LWP::UserAgent 0 ... Yes (6.15)
Checking if you have Algorithm::Diff 1.1903 ... Yes (1.1903)
Checking if you have Moo 2.002004 ... Yes (2.002004)
Checking if you have Starman 0.4014 ... Yes (0.4014)
==> Found dependencies: DBD::Oracle
Searching DBD::Oracle on mirror index /mnt/c/project/local/cache/modules/02packages.details.txt ...
--> Working on DBD::Oracle
Fetching http://cpan.metacpan.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz
-> OK
Unpacking DBD-Oracle-1.74.tar.gz
Copying DBD-Oracle-1.74.tar.gz to /mnt/c/project/local/cache/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz
Entering DBD-Oracle-1.74
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.18)
Checking if you have DBI 1.51 ... Yes (1.631)
Configuring DBD-Oracle-1.74
Running Makefile.PL
Multiple copies of Driver.xst found in: /mnt/c/project/local/lib/perl5/x86_64-linux/auto/DBI/ /home/user1/.plenv/versions/5.18.2/lib/perl5/site_perl/5.18.2/x86_64-linux/auto/DBI/ at Makefile.PL line 39.
Using DBI 1.631 (for perl 5.018002 on x86_64-linux) installed in /mnt/c/project/local/lib/perl5/x86_64-linux/auto/DBI/

Configuring DBD::Oracle for perl 5.018002 on linux (x86_64-linux)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#4.4
Using Oracle in /usr/lib/oracle/11.2/client64
-> FAIL Timed out (> 60s). Use --verbose to retry.
-> N/A
Checking dependencies from META.json ...
Checking if you have DBI 1.51 ... Yes (1.631)
Checking if you have warnings 0 ... Yes (1.18)
Checking if you have Exporter 0 ... Yes (5.68)
Checking if you have strict 0 ... Yes (1.07)
Checking if you have DynaLoader 0 ... Yes (1.18)
-> FAIL Configure failed for DBD-Oracle-1.74. See /home/user1/.cpanm/work/1558699904.1138/build.log for details.
-> FAIL Installing the dependencies failed: Module 'DBD::Oracle' is not installed
-> FAIL Bailing out the installation for /mnt/c/project/.
</code>```

Running perl Makefile.PL -F -v (force verbose) stops after it outputs PATH:

```<code>Using DBI 1.642 (for perl 5.018002 on x86_64-linux) installed in /home/user1/.plenv/versions/5.18.2/lib/perl5/site_perl/5.18.2/x86_64-linux/auto/DBI/

Configuring DBD::Oracle for perl 5.018002 on linux (x86_64-linux)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#4.4
Using Oracle in /usr/lib/oracle/11.2/client64
PATH=/usr/lib/oracle/11.2/client64/bin:/usr/lib/oracle/11.2/client64:/home/user1/.plenv/versions/5.18.2/bin:/home/user1/.plenv/libexec:/home/user1/.plenv/plugins/perl-build/bin:/home/user1/.plenv/shims:/home/user1/.plenv/bin:/home/user1/.nodenv/shims:/home/user1/.nodenv/bin:/home/user1/.rbenv/shims:/home/user1/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_1804.2019.521.0_x64__79rhkp1fndgsc:/mnt/c/Program Files (x86)/Nmap:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath_target_937390:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/user1/AppData/Local/Microsoft/WindowsApps
</code>```

Latest output with cpanm --verbose --build-timeout

```<code>$ cpanm DBD::Oracle@1.74 --verbose --build-timeout 3600
cpanm (App::cpanminus) 1.7044 on perl 5.018002 built for x86_64-linux
Work directory is /home/user1/.cpanm/work/1559491379.298
You have make /usr/bin/make
You have LWP 6.39
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching DBD::Oracle (== 1.74) on cpanmetadb ...
--> Working on DBD::Oracle
Fetching http://backpan.perl.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz ... OK
Unpacking DBD-Oracle-1.74.tar.gz
DBD-Oracle-1.74/
DBD-Oracle-1.74/lib/
DBD-Oracle-1.74/lib/DBD/
DBD-Oracle-1.74/lib/DBD/Oracle.pm
DBD-Oracle-1.74/lib/DBD/Oracle/
DBD-Oracle-1.74/lib/DBD/Oracle/GetInfo.pm
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Win32.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Vms.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Hpux.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Aix.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Sun.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Macos.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Linux.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Cygwin.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Win64.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Object.pm
DBD-Oracle-1.74/oci.def
DBD-Oracle-1.74/Makefile.PL
DBD-Oracle-1.74/MANIFEST
DBD-Oracle-1.74/ocitrace.h
DBD-Oracle-1.74/Changes
DBD-Oracle-1.74/LICENSE
DBD-Oracle-1.74/README.help.txt
DBD-Oracle-1.74/README.mkdn
DBD-Oracle-1.74/CONTRIBUTING.mkd
DBD-Oracle-1.74/INSTALL
DBD-Oracle-1.74/Oracle.xs
DBD-Oracle-1.74/CONTRIBUTORS
DBD-Oracle-1.74/META.json
DBD-Oracle-1.74/oci8.c
DBD-Oracle-1.74/META.yml
DBD-Oracle-1.74/Oracle.h
DBD-Oracle-1.74/dbivport.h
DBD-Oracle-1.74/typemap
DBD-Oracle-1.74/t/
DBD-Oracle-1.74/t/23wide_db_al32utf8.t
DBD-Oracle-1.74/t/00versions.t
DBD-Oracle-1.74/t/22nchar_al32utf8.t
DBD-Oracle-1.74/t/31lob.t
DBD-Oracle-1.74/t/lib/
DBD-Oracle-1.74/t/lib/ExecuteArray.pm
DBD-Oracle-1.74/t/10general.t
DBD-Oracle-1.74/t/28array_bind.t
DBD-Oracle-1.74/t/26exe_array.t
DBD-Oracle-1.74/t/14threads.t
DBD-Oracle-1.74/t/rt74753-utf8-encoded.t
DBD-Oracle-1.74/t/23wide_db.t
DBD-Oracle-1.74/t/22nchar_utf8.t
DBD-Oracle-1.74/t/31lob_extended.t
DBD-Oracle-1.74/t/000-report-versions-tiny.t
DBD-Oracle-1.74/t/12impdata.t
DBD-Oracle-1.74/t/36lob_leak.t
DBD-Oracle-1.74/t/24implicit_utf8.t
DBD-Oracle-1.74/t/38taf.t
DBD-Oracle-1.74/t/21nchar.t
DBD-Oracle-1.74/t/70meta.t
DBD-Oracle-1.74/t/15nls.t
DBD-Oracle-1.74/t/39attr.t
DBD-Oracle-1.74/t/rt85886.t
DBD-Oracle-1.74/t/34pres_lobs.t
DBD-Oracle-1.74/t/56embbeded.t
DBD-Oracle-1.74/t/40ph_type.t
DBD-Oracle-1.74/t/55nested.t
DBD-Oracle-1.74/t/30long.t
DBD-Oracle-1.74/t/32xmltype.t
DBD-Oracle-1.74/t/58object.t
DBD-Oracle-1.74/t/50cursor.t
DBD-Oracle-1.74/t/80ora_charset.t
DBD-Oracle-1.74/t/51scroll.t
DBD-Oracle-1.74/t/01base.t
DBD-Oracle-1.74/t/20select.t
DBD-Oracle-1.74/t/nchar_test_lib.pl
DBD-Oracle-1.74/t/23wide_db_8bit.t
DBD-Oracle-1.74/t/60reauth.t
DBD-Oracle-1.74/t/rt13865.t
DBD-Oracle-1.74/t/25plsql.t
DBD-Oracle-1.74/examples/
DBD-Oracle-1.74/examples/japh
DBD-Oracle-1.74/examples/oradump.pl
DBD-Oracle-1.74/examples/ora_explain.pl
DBD-Oracle-1.74/examples/commit.pl
DBD-Oracle-1.74/examples/bind.pl
DBD-Oracle-1.74/examples/curref.pl
DBD-Oracle-1.74/examples/ex.pl
DBD-Oracle-1.74/examples/read_long_via_blob_read.pl
DBD-Oracle-1.74/examples/tabinfo.pl
DBD-Oracle-1.74/examples/proc.pl
DBD-Oracle-1.74/examples/sql
DBD-Oracle-1.74/examples/mktable.pl
DBD-Oracle-1.74/examples/inserting_longs.pl
DBD-Oracle-1.74/examples/README
DBD-Oracle-1.74/mkta.pl
DBD-Oracle-1.74/Todo
DBD-Oracle-1.74/dbdimp.h
DBD-Oracle-1.74/hints/
DBD-Oracle-1.74/hints/macos_syms.pl
DBD-Oracle-1.74/hints/macos_bundle.syms
DBD-Oracle-1.74/hints/macos_lib.syms
DBD-Oracle-1.74/hints/dgux.pl
DBD-Oracle-1.74/hints/svr4.pl
DBD-Oracle-1.74/dbdimp.c
DBD-Oracle-1.74/README
Entering DBD-Oracle-1.74
Checking configure dependencies from META.json
Checking if you have DBI 1.51 ... Yes (1.642)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.36)
Running Makefile.PL
Configuring DBD-Oracle-1.74 ... Using DBI 1.642 (for perl 5.018002 on x86_64-linux) installed in /home/user1/.plenv/versions/5.18.2/lib/perl5/site_perl/5.18.2/x86_64-linux/auto/DBI/

Configuring DBD::Oracle for perl 5.018002 on linux (x86_64-linux)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#4.4
Using Oracle in /usr/lib/oracle/11.2/client64
BLINKIN CURSOR LONGER THAN 5 HOURS ...
</code>```

答:
From what I have seen here https://github.com/perl-carton/carton/issues/139 this could be the issue.

Add --build-timeout with a very large value to avoid timeout, also you can try with cpan instead of cpanm.

EDIT:

There are three arguments concerning timeout for different parts of the build:

--configure-timeout, --build-timeout, --test-timeout

They should be passed as arguments to cpanm.

Source: https://metacpan.org/pod/distribution/App-cpanminus/bin/cpanm

Body:
I am trying to install DBD::Oracle, either 1.74 or 1.76 on an ubuntu wsl bash on windows 10.

I am on a 64 architecture, and sqlplus64 is working and I can connect to my database!

Installation with cpanm or installing with carton or trying to compile with perl Makeperl.pm -l does not work and always results in the same error.

Using Oracle in /usr/lib/oracle/11.2/client64
-> FAIL Timed out (> 60s). Use --verbose to retry.
-> N/A

I have tried following:

I have tried to elevate folder permissions but no luck.

I am behind a corporate proxy other packages have installed
fine, but I also tried with mobile connection on the wild internet, no luck either.

Here is my build.log

cpanm (Menlo) 1.9019 on perl 5.018002 built for x86_64-linux
Work directory is /home/user1/.cpanm/work/1558699904.1138
You have make /usr/bin/make
You have LWP: 6.39
You have LWP::Protocol::https: 6.07
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
--> Working on /mnt/c/project/
Entering /mnt/c/project
Configuring /mnt/c/project
-> OK
Checking if you have Try::Tiny 0.24 ... Yes (0.27)
Checking if you have Tie::IxHash 1.23 ... Yes (1.23)
Checking if you have Image::Size 3.300 ... Yes (3.300)
Checking if you have Dancer2 0.203001 ... Yes (0.203001)
Checking if you have HTTP::Request 0 ... Yes (6.11)
Checking if you have Test::Fixture::DBI 0 ... Yes (0.09)
Checking if you have Net::SSLeay 1.88 ... Yes (1.88)
Checking if you have Plack::Middleware::CrossOrigin 0.012 ... Yes (0.012)
Checking if you have Date::Format 2.24 ... Yes (2.24)
Checking if you have Dancer2::Plugin::Database 2.16 ... Yes (2.17)
Checking if you have MIME::Lite 3.030 ... Yes (3.030)
Checking if you have Crypt::JWT 0.018 ... Yes (0.018)
Checking if you have JSON 0 ... Yes (2.90)
Checking if you have LockFile::Simple 0.208 ... Yes (0.208)
Checking if you have DBD::Oracle 1.74 ... No
Checking if you have Date::Language 1.10 ... Yes (1.10)
Checking if you have HTML::TreeBuilder 5.03 ... Yes (5.03)
Checking if you have Date::DayOfWeek 1.22 ... Yes (1.22)
Checking if you have Data::Serializer 0.60 ... Yes (0.60)
Checking if you have Date::Manip 6.54 ... Yes (6.56)
Checking if you have Locale::Maketext 0 ... Yes (1.23)
Checking if you have Time::Piece 0 ... Yes (1.20_01)
Checking if you have Redis 1.991 ... Yes (1.991)
Checking if you have Unicode::String 2.09 ... Yes (2.10)
Checking if you have LWP::Protocol::https 6.06 ... Yes (6.06)
Checking if you have Date::Calc 6.4 ... Yes (6.4)
Checking if you have Test::More 0 ... Yes (0.98)
Checking if you have MooX::Types::MooseLike 0.29 ... Yes (0.29)
Checking if you have MIME::Types 2.13 ... Yes (2.13)
Checking if you have LWP::UserAgent 0 ... Yes (6.15)
Checking if you have Algorithm::Diff 1.1903 ... Yes (1.1903)
Checking if you have Moo 2.002004 ... Yes (2.002004)
Checking if you have Starman 0.4014 ... Yes (0.4014)
==> Found dependencies: DBD::Oracle
Searching DBD::Oracle on mirror index /mnt/c/project/local/cache/modules/02packages.details.txt ...
--> Working on DBD::Oracle
Fetching http://cpan.metacpan.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz
-> OK
Unpacking DBD-Oracle-1.74.tar.gz
Copying DBD-Oracle-1.74.tar.gz to /mnt/c/project/local/cache/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz
Entering DBD-Oracle-1.74
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.18)
Checking if you have DBI 1.51 ... Yes (1.631)
Configuring DBD-Oracle-1.74
Running Makefile.PL
Multiple copies of Driver.xst found in: /mnt/c/project/local/lib/perl5/x86_64-linux/auto/DBI/ /home/user1/.plenv/versions/5.18.2/lib/perl5/site_perl/5.18.2/x86_64-linux/auto/DBI/ at Makefile.PL line 39.
Using DBI 1.631 (for perl 5.018002 on x86_64-linux) installed in /mnt/c/project/local/lib/perl5/x86_64-linux/auto/DBI/

Configuring DBD::Oracle for perl 5.018002 on linux (x86_64-linux)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#4.4
Using Oracle in /usr/lib/oracle/11.2/client64
-> FAIL Timed out (> 60s). Use --verbose to retry.
-> N/A
Checking dependencies from META.json ...
Checking if you have DBI 1.51 ... Yes (1.631)
Checking if you have warnings 0 ... Yes (1.18)
Checking if you have Exporter 0 ... Yes (5.68)
Checking if you have strict 0 ... Yes (1.07)
Checking if you have DynaLoader 0 ... Yes (1.18)
-> FAIL Configure failed for DBD-Oracle-1.74. See /home/user1/.cpanm/work/1558699904.1138/build.log for details.
-> FAIL Installing the dependencies failed: Module 'DBD::Oracle' is not installed
-> FAIL Bailing out the installation for /mnt/c/project/.

Running perl Makefile.PL -F -v (force verbose) stops after it outputs PATH:

Using DBI 1.642 (for perl 5.018002 on x86_64-linux) installed in /home/user1/.plenv/versions/5.18.2/lib/perl5/site_perl/5.18.2/x86_64-linux/auto/DBI/

Configuring DBD::Oracle for perl 5.018002 on linux (x86_64-linux)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#4.4
Using Oracle in /usr/lib/oracle/11.2/client64
PATH=/usr/lib/oracle/11.2/client64/bin:/usr/lib/oracle/11.2/client64:/home/user1/.plenv/versions/5.18.2/bin:/home/user1/.plenv/libexec:/home/user1/.plenv/plugins/perl-build/bin:/home/user1/.plenv/shims:/home/user1/.plenv/bin:/home/user1/.nodenv/shims:/home/user1/.nodenv/bin:/home/user1/.rbenv/shims:/home/user1/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_1804.2019.521.0_x64__79rhkp1fndgsc:/mnt/c/Program Files (x86)/Nmap:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath_target_937390:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/user1/AppData/Local/Microsoft/WindowsApps

Latest output with cpanm --verbose --build-timeout

$ cpanm DBD::Oracle@1.74 --verbose --build-timeout 3600
cpanm (App::cpanminus) 1.7044 on perl 5.018002 built for x86_64-linux
Work directory is /home/user1/.cpanm/work/1559491379.298
You have make /usr/bin/make
You have LWP 6.39
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching DBD::Oracle (== 1.74) on cpanmetadb ...
--> Working on DBD::Oracle
Fetching http://backpan.perl.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz ... OK
Unpacking DBD-Oracle-1.74.tar.gz
DBD-Oracle-1.74/
DBD-Oracle-1.74/lib/
DBD-Oracle-1.74/lib/DBD/
DBD-Oracle-1.74/lib/DBD/Oracle.pm
DBD-Oracle-1.74/lib/DBD/Oracle/
DBD-Oracle-1.74/lib/DBD/Oracle/GetInfo.pm
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Win32.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Vms.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Hpux.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Aix.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Sun.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Macos.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Linux.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Cygwin.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting/Win64.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Troubleshooting.pod
DBD-Oracle-1.74/lib/DBD/Oracle/Object.pm
DBD-Oracle-1.74/oci.def
DBD-Oracle-1.74/Makefile.PL
DBD-Oracle-1.74/MANIFEST
DBD-Oracle-1.74/ocitrace.h
DBD-Oracle-1.74/Changes
DBD-Oracle-1.74/LICENSE
DBD-Oracle-1.74/README.help.txt
DBD-Oracle-1.74/README.mkdn
DBD-Oracle-1.74/CONTRIBUTING.mkd
DBD-Oracle-1.74/INSTALL
DBD-Oracle-1.74/Oracle.xs
DBD-Oracle-1.74/CONTRIBUTORS
DBD-Oracle-1.74/META.json
DBD-Oracle-1.74/oci8.c
DBD-Oracle-1.74/META.yml
DBD-Oracle-1.74/Oracle.h
DBD-Oracle-1.74/dbivport.h
DBD-Oracle-1.74/typemap
DBD-Oracle-1.74/t/
DBD-Oracle-1.74/t/23wide_db_al32utf8.t
DBD-Oracle-1.74/t/00versions.t
DBD-Oracle-1.74/t/22nchar_al32utf8.t
DBD-Oracle-1.74/t/31lob.t
DBD-Oracle-1.74/t/lib/
DBD-Oracle-1.74/t/lib/ExecuteArray.pm
DBD-Oracle-1.74/t/10general.t
DBD-Oracle-1.74/t/28array_bind.t
DBD-Oracle-1.74/t/26exe_array.t
DBD-Oracle-1.74/t/14threads.t
DBD-Oracle-1.74/t/rt74753-utf8-encoded.t
DBD-Oracle-1.74/t/23wide_db.t
DBD-Oracle-1.74/t/22nchar_utf8.t
DBD-Oracle-1.74/t/31lob_extended.t
DBD-Oracle-1.74/t/000-report-versions-tiny.t
DBD-Oracle-1.74/t/12impdata.t
DBD-Oracle-1.74/t/36lob_leak.t
DBD-Oracle-1.74/t/24implicit_utf8.t
DBD-Oracle-1.74/t/38taf.t
DBD-Oracle-1.74/t/21nchar.t
DBD-Oracle-1.74/t/70meta.t
DBD-Oracle-1.74/t/15nls.t
DBD-Oracle-1.74/t/39attr.t
DBD-Oracle-1.74/t/rt85886.t
DBD-Oracle-1.74/t/34pres_lobs.t
DBD-Oracle-1.74/t/56embbeded.t
DBD-Oracle-1.74/t/40ph_type.t
DBD-Oracle-1.74/t/55nested.t
DBD-Oracle-1.74/t/30long.t
DBD-Oracle-1.74/t/32xmltype.t
DBD-Oracle-1.74/t/58object.t
DBD-Oracle-1.74/t/50cursor.t
DBD-Oracle-1.74/t/80ora_charset.t
DBD-Oracle-1.74/t/51scroll.t
DBD-Oracle-1.74/t/01base.t
DBD-Oracle-1.74/t/20select.t
DBD-Oracle-1.74/t/nchar_test_lib.pl
DBD-Oracle-1.74/t/23wide_db_8bit.t
DBD-Oracle-1.74/t/60reauth.t
DBD-Oracle-1.74/t/rt13865.t
DBD-Oracle-1.74/t/25plsql.t
DBD-Oracle-1.74/examples/
DBD-Oracle-1.74/examples/japh
DBD-Oracle-1.74/examples/oradump.pl
DBD-Oracle-1.74/examples/ora_explain.pl
DBD-Oracle-1.74/examples/commit.pl
DBD-Oracle-1.74/examples/bind.pl
DBD-Oracle-1.74/examples/curref.pl
DBD-Oracle-1.74/examples/ex.pl
DBD-Oracle-1.74/examples/read_long_via_blob_read.pl
DBD-Oracle-1.74/examples/tabinfo.pl
DBD-Oracle-1.74/examples/proc.pl
DBD-Oracle-1.74/examples/sql
DBD-Oracle-1.74/examples/mktable.pl
DBD-Oracle-1.74/examples/inserting_longs.pl
DBD-Oracle-1.74/examples/README
DBD-Oracle-1.74/mkta.pl
DBD-Oracle-1.74/Todo
DBD-Oracle-1.74/dbdimp.h
DBD-Oracle-1.74/hints/
DBD-Oracle-1.74/hints/macos_syms.pl
DBD-Oracle-1.74/hints/macos_bundle.syms
DBD-Oracle-1.74/hints/macos_lib.syms
DBD-Oracle-1.74/hints/dgux.pl
DBD-Oracle-1.74/hints/svr4.pl
DBD-Oracle-1.74/dbdimp.c
DBD-Oracle-1.74/README
Entering DBD-Oracle-1.74
Checking configure dependencies from META.json
Checking if you have DBI 1.51 ... Yes (1.642)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.36)
Running Makefile.PL
Configuring DBD-Oracle-1.74 ... Using DBI 1.642 (for perl 5.018002 on x86_64-linux) installed in /home/user1/.plenv/versions/5.18.2/lib/perl5/site_perl/5.18.2/x86_64-linux/auto/DBI/

Configuring DBD::Oracle for perl 5.018002 on linux (x86_64-linux)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#4.4
Using Oracle in /usr/lib/oracle/11.2/client64
BLINKIN CURSOR LONGER THAN 5 HOURS ...


来源: stackexchange

问:
Getting AzureAD implicit flow working with Swagger UI
As an exercise, I have been attempting to create a swagger configuration that can invoke the Azure Management API, and to run this from the online swagger editor.

I have configured it to use implicit authentication, and it almost works, but I just cannot get the Azure Framework to recognize the swagger editor as a valid redirect URL.

Here is all the steps I have taken. Can anyone spot what I'm doing wrong?

Using the Azure AD portal, I create a new Azure AD Application

In the application registration's Reply URL's, I added https://editor.swagger.io/oauth2-redirect.html

I created the following security entries in my Swagger 2.0 document:

```<code>securityDefinitions:
  azureTokenAuthentication:
    flow: implicit
    authorizationUrl: https://login.microsoft.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/oauth2/authorize
    scopes:
      https://management.azure.com: Accessing the Azure API
    type: oauth2
security:
- azureTokenAuthentication:
  - https://management.azure.com
</code>```

(The redacted GUID is my tenant id).

Now, when I click on the "Authorization" button, swagger opens up a dialog for me:

So I enter the application ID and click authorize. It then sends me to the logon URL with the following parameters:

response_type: token

client_id: eb482fb2-8229-434e-b5a6-9fc3e0f06968

redirect_uri: https://editor.swagger.io/oauth2-redirect.html

scope: https://management.azure.com

state: <Base64 string>Wed Mar 13 2019 09:16:06 GMT+1000 (Australian Eastern Standard Time)

Note that the redirect uri matches the value I entered in the app registration.

So I enter my username and password, and then the URL gets redirected to the following:

```<code>https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=The+provided+value+for+the+input+parameter+'redirect_uri'+is+not+valid.+The+expected+value+is+a+URI+which+matches+a+redirect+URI+registered+for+this+client+application.&state=rQIIAdNiNtQztFJJTTKxMEpLMtK1MDKy1DUxNknVTTJNNNO1TEs2TjVIMzCzNLMoEuISWF1yo3vvud0Ozb9b9Z66bQ-cxcgZn5NZlqqXnJ-7ilEvo6SkoNhKXz81JbMkv0ivuDwxPT21SC8zXz8_sbQkw0i3CChTlJpcAlSZm7ODkfECI-MLRsZbTPz-jiB5EJFflFmVOos5JswoLNvT1TAjOdOxwrfSsdLXxdXU08XR1D_L1cg_y9HI0zXFL8y5uMLXxbHc0znDKSXCzyA51604Mdyt1NM1LCPZOCgnOdckPdQ4KCMpNygjOTcwPcw9pyQqONt2E7NKSqqpuZGhmZGuabJ5iq6JRVqSrmWSqaGuubmlabKpeaKZqWXyKWYZmI9yE_MS01NzU_NK9BKrSovAHr7BzHiBhfEVC48BsxUHB5cAgwSDAsMPFsZFrMCQmrTR22we8wzHyc1Bd633_2M4xapfku7mkeJk5qxfkpOb7lcUXB5SmOZb7Jef7l-c526UmVUQqV_q5Zzh4uzma2tkZTiBTeYDG2MHO8MuThID9haXiJGBoaWugbGuoZGCkbGVoZmVgXkUAA2
</code>```

The interesting text I glean from this is:

The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect URI registered for this client application.

But it DOES match! What am I doing wrong?!?

答:
reply url = "your web api's swagger page url" concatenated with "/oauth2-redirect.html"

example: https://localhost:44329/swagger/oauth2-redirect.html

configure that for each environment in your app registration including your localhost.

ContentLicense: CC BY-SA 4.0

Body:
As an exercise, I have been attempting to create a swagger configuration that can invoke the Azure Management API, and to run this from the online swagger editor.

I have configured it to use implicit authentication, and it almost works, but I just cannot get the Azure Framework to recognize the swagger editor as a valid redirect URL.

Here is all the steps I have taken. Can anyone spot what I'm doing wrong?

Using the Azure AD portal, I create a new Azure AD Application

In the application registration's Reply URL's, I added https://editor.swagger.io/oauth2-redirect.html

I created the following security entries in my Swagger 2.0 document:

securityDefinitions:
  azureTokenAuthentication:
    flow: implicit
    authorizationUrl: https://login.microsoft.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/oauth2/authorize
    scopes:
      https://management.azure.com: Accessing the Azure API
    type: oauth2
security:
- azureTokenAuthentication:
  - https://management.azure.com

(The redacted GUID is my tenant id).

Now, when I click on the "Authorization" button, swagger opens up a dialog for me:

So I enter the application ID and click authorize. It then sends me to the logon URL with the following parameters:

response_type: token

client_id: eb482fb2-8229-434e-b5a6-9fc3e0f06968

redirect_uri: https://editor.swagger.io/oauth2-redirect.html

scope: https://management.azure.com

state: <Base64 string>Wed Mar 13 2019 09:16:06 GMT+1000 (Australian Eastern Standard Time)

Note that the redirect uri matches the value I entered in the app registration.

So I enter my username and password, and then the URL gets redirected to the following:

https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=The+provided+value+for+the+input+parameter+'redirect_uri'+is+not+valid.+The+expected+value+is+a+URI+which+matches+a+redirect+URI+registered+for+this+client+application.&state=rQIIAdNiNtQztFJJTTKxMEpLMtK1MDKy1DUxNknVTTJNNNO1TEs2TjVIMzCzNLMoEuISWF1yo3vvud0Ozb9b9Z66bQ-cxcgZn5NZlqqXnJ-7ilEvo6SkoNhKXz81JbMkv0ivuDwxPT21SC8zXz8_sbQkw0i3CChTlJpcAlSZm7ODkfECI-MLRsZbTPz-jiB5EJFflFmVOos5JswoLNvT1TAjOdOxwrfSsdLXxdXU08XR1D_L1cg_y9HI0zXFL8y5uMLXxbHc0znDKSXCzyA51604Mdyt1NM1LCPZOCgnOdckPdQ4KCMpNygjOTcwPcw9pyQqONt2E7NKSqqpuZGhmZGuabJ5iq6JRVqSrmWSqaGuubmlabKpeaKZqWXyKWYZmI9yE_MS01NzU_NK9BKrSovAHr7BzHiBhfEVC48BsxUHB5cAgwSDAsMPFsZFrMCQmrTR22we8wzHyc1Bd633_2M4xapfku7mkeJk5qxfkpOb7lcUXB5SmOZb7Jef7l-c526UmVUQqV_q5Zzh4uzma2tkZTiBTeYDG2MHO8MuThID9haXiJGBoaWugbGuoZGCkbGVoZmVgXkUAA2

The interesting text I glean from this is:

The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect URI registered for this client application.

But it DOES match! What am I doing wrong?!?


问:
Why does this code throw an error - "Python stopped working"?
In this code, I want to sort some random generated Numbers. If I want to sort more than ~2000 elements, Python stops working when sorting via QuickSort (after it sorted via Bubblesort) and throws "Process finished with exit code -1073741571 (0xC00000FD)". I dont know, why this problem occurs. My recursion depth is extendet, so I dont think this is the problem. Has anyone a idea, how I can solve this problem?

import time
import random
from sys import setrecursionlimit
setrecursionlimit(1000000)

#------------------------------Sortieralgorithmen-----------------------------------------------
#-----------------------------------------------------------------------------------------------

def bubbleSort(array):

    length = len(array)

    for sorted in range(length):

        for j in range(0, length-sorted-1):
            if array[j] > array[j+1] :
                array[j], array[j+1] = array[j+1], array[j]

def help(array, low, high):
    pivot = array[low]
    fromhigh = high
    fromlow = low
    while True:
        while(array[fromhigh]>pivot):
            fromhigh = fromhigh-1
        while(array[fromlow]<pivot):
            fromlow = fromlow+1
        if(fromlow<fromhigh):
            array[fromlow], array[fromhigh] = array[fromhigh], array[fromlow]
        else:
            return fromhigh

def quickSort(array, low, high):
   if (low<high):
       pivot = help(array, low, high)
       quickSort(array, low, pivot)
       quickSort(array, pivot + 1, high)

#--------------------------------Zeitmessung-----------------------------------------------------
#------------------------------------------------------------------------------------------------

numb_elements = 6000

sortedarray = []
for i in range (0,numb_elements):
    sortedarray.append(i)

notsortedarray = random.sample(range(0,numb_elements),numb_elements)

copy1 = sortedarray.copy()
before = time.time()
bubbleSort(copy1)
after = time.time()
total = after-before
print("Bubblesort sortiertes Array:\t\t" + str(total))

copy2 = notsortedarray.copy()
before = time.time()
bubbleSort(copy2)
after = time.time()
total = after-before
print("Bubblesort nicht sortiertes Array:\t" + str(total))

copy3 = sortedarray.copy()
before = time.time()
quickSort(copy3, 0, len(copy3)-1)
after = time.time()
total = after-before
print("QuickSort sortiertes Array:\t\t\t" + str(total))

copy4 = notsortedarray.copy()
before = time.time()
quickSort(copy4, 0, len(copy4)-1)
after = time.time()
total = after-before
print("QuickSort nicht sortiertes Array:\t" + str(total)+"\t (Worst Case)")
```

Process finished with exit code -1073741571 (0xC00000FD)

答:
You can avoid stack overflow in quicksort by using recursion on the smaller (or equal) part, then iterating back to handle the larger part:

```<code>def quickSort(array, low, high):
   while (low<high):
       pivot = help(array, low, high)
       if(pivot - low < high - pivot):
           quickSort(array, low, pivot)
           low = pivot+1
       else:
           quickSort(array, pivot + 1, high)
           high = pivot
</code>```

For already sorted data, in help it would be better to choose the middle value as pivot:

```<code>    pivot = array[(low+high)//2]
</code>```

Body:
In this code, I want to sort some random generated Numbers. If I want to sort more than ~2000 elements, Python stops working when sorting via QuickSort (after it sorted via Bubblesort) and throws "Process finished with exit code -1073741571 (0xC00000FD)". I dont know, why this problem occurs. My recursion depth is extendet, so I dont think this is the problem. Has anyone a idea, how I can solve this problem?

import time
import random
from sys import setrecursionlimit
setrecursionlimit(1000000)

#------------------------------Sortieralgorithmen-----------------------------------------------
#-----------------------------------------------------------------------------------------------

def bubbleSort(array):

    length = len(array)

    for sorted in range(length):

        for j in range(0, length-sorted-1):
            if array[j] > array[j+1] :
                array[j], array[j+1] = array[j+1], array[j]

def help(array, low, high):
    pivot = array[low]
    fromhigh = high
    fromlow = low
    while True:
        while(array[fromhigh]>pivot):
            fromhigh = fromhigh-1
        while(array[fromlow]<pivot):
            fromlow = fromlow+1
        if(fromlow<fromhigh):
            array[fromlow], array[fromhigh] = array[fromhigh], array[fromlow]
        else:
            return fromhigh

def quickSort(array, low, high):
   if (low<high):
       pivot = help(array, low, high)
       quickSort(array, low, pivot)
       quickSort(array, pivot + 1, high)

#--------------------------------Zeitmessung-----------------------------------------------------
#------------------------------------------------------------------------------------------------

numb_elements = 6000

sortedarray = []
for i in range (0,numb_elements):
    sortedarray.append(i)

notsortedarray = random.sample(range(0,numb_elements),numb_elements)

copy1 = sortedarray.copy()
before = time.time()
bubbleSort(copy1)
after = time.time()
total = after-before
print("Bubblesort sortiertes Array:\t\t" + str(total))

copy2 = notsortedarray.copy()
before = time.time()
bubbleSort(copy2)
after = time.time()
total = after-before
print("Bubblesort nicht sortiertes Array:\t" + str(total))

copy3 = sortedarray.copy()
before = time.time()
quickSort(copy3, 0, len(copy3)-1)
after = time.time()
total = after-before
print("QuickSort sortiertes Array:\t\t\t" + str(total))

copy4 = notsortedarray.copy()
before = time.time()
quickSort(copy4, 0, len(copy4)-1)
after = time.time()
total = after-before
print("QuickSort nicht sortiertes Array:\t" + str(total)+"\t (Worst Case)")

Process finished with exit code -1073741571 (0xC00000FD)

Body:
You can avoid stack overflow in quicksort by using recursion on the smaller (or equal) part, then iterating back to handle the larger part:

def quickSort(array, low, high):
   while (low<high):
       pivot = help(array, low, high)
       if(pivot - low < high - pivot):
           quickSort(array, low, pivot)
           low = pivot+1
       else:
           quickSort(array, pivot + 1, high)
           high = pivot

For already sorted data, in help it would be better to choose the middle value as pivot:

    pivot = array[(low+high)//2]


问:
Regex for capturing 4 consecutive numbers in an ID
I need a formula to start at a a certain index and then get the next 4 consecutive numbers.  Using REGEX.  And testing whether they are in the range of 0000-4999.

```<code>^.{6}\d{4}$[0000-4999]
</code>```

This is some code I have tried.  Although I'm still new and don't understand regex.

The outcome needs to be as follows:

ID Number:

```<code>9202204720082
</code>```

Get the following 4 numbers:  4720

Starting at index 7 (presuming indexes starts at 1)

So want to get numbers if indexes 7,8,9, and 10.
This is done to determine the gender in an ID.

答:
May be this can help :

```<code>(?<=\d{6})\d{4}(?<=\d{3})
</code>```

you can check it out in the regex101 link : Link to Regex

Body:
I need a formula to start at a a certain index and then get the next 4 consecutive numbers.  Using REGEX.  And testing whether they are in the range of 0000-4999.

^.{6}\d{4}$[0000-4999]

This is some code I have tried.  Although I'm still new and don't understand regex.

The outcome needs to be as follows:

ID Number:

9202204720082

Get the following 4 numbers:  4720

Starting at index 7 (presuming indexes starts at 1)

So want to get numbers if indexes 7,8,9, and 10.
This is done to determine the gender in an ID.

Body:
May be this can help :

(?<=\d{6})\d{4}(?<=\d{3})

you can check it out in the regex101 link : Link to Regex


问:
how can I copy one file to multiple sub directories
I'm trying to use nant because I thought it would be the easiest, but i'm open to any solution that works on windows xp.

I have the following folder structure

```<code>basefolder
    folder1
    folder2
        subfolder1
            code
                solutionname1
                     projectname.interface
                     projectname.simulation
                     projectname.testcase
                         bin
                             release
    folder3
    ...
    folderN
</code>```

folder1 - folderN all have the same directory structure as folder2.  I want to copy a file to the release folder in each folderN.

I currently have the following nant script

```<code><?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://nant.sf.net/release/0.90/nant.xsd" name="CopyDll" default="FileCopy">
  <property name="fileToCopy"
            value="C:\file.dll"
            overwrite="false"/>
  <property name="baseDirectory" value="${directory::get-current-directory()}" overwrite="false"/>
  <target name="FileCopy"
          description="Copies file to multiple directories">
    <foreach item="Folder"
             in="${baseDirectory}"
             property="foldername">
      <in>
        <items>
          <include name="**\**\**\*.TestCase\bin\Release"/>
        </items>
      </in>
      <do>
        <copy file="${fileToCopy}"
              todir="${foldername}"/>
        <echo message="Copied file to ${foldername}"/>
      </do>
    </foreach>
  </target>
</project>
</code>```

This copies file.dll to each folderN directory.
What am I doing wrong?
Is there a better way to do this?

答:
I figured it out.  I had to change my foreach to look like this</p>

```<code>    <foreach item="Folder"
             property="foldername">
      <in>
        <items>
          <include name="${baseDirectory}\**\*.TestCase\bin\Release"/>
        </items>
      </in>
      <do>
        <copy file="${fileToCopy}"
              todir="${foldername}"/>
        <echo message="Copied file to ${foldername}"/>
      </do>
    </foreach>
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I'm trying to use nant because I thought it would be the easiest, but i'm open to any solution that works on windows xp.

I have the following folder structure

basefolder
    folder1
    folder2
        subfolder1
            code
                solutionname1
                     projectname.interface
                     projectname.simulation
                     projectname.testcase
                         bin
                             release
    folder3
    ...
    folderN

folder1 - folderN all have the same directory structure as folder2.  I want to copy a file to the release folder in each folderN.

I currently have the following nant script

<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://nant.sf.net/release/0.90/nant.xsd" name="CopyDll" default="FileCopy">
  <property name="fileToCopy"
            value="C:\file.dll"
            overwrite="false"/>
  <property name="baseDirectory" value="${directory::get-current-directory()}" overwrite="false"/>
  <target name="FileCopy"
          description="Copies file to multiple directories">
    <foreach item="Folder"
             in="${baseDirectory}"
             property="foldername">
      <in>
        <items>
          <include name="**\**\**\*.TestCase\bin\Release"/>
        </items>
      </in>
      <do>
        <copy file="${fileToCopy}"
              todir="${foldername}"/>
        <echo message="Copied file to ${foldername}"/>
      </do>
    </foreach>
  </target>
</project>

This copies file.dll to each folderN directory.
What am I doing wrong?
Is there a better way to do this?

Body:
I figured it out.  I had to change my foreach to look like this

    <foreach item="Folder"
             property="foldername">
      <in>
        <items>
          <include name="${baseDirectory}\**\*.TestCase\bin\Release"/>
        </items>
      </in>
      <do>
        <copy file="${fileToCopy}"
              todir="${foldername}"/>
        <echo message="Copied file to ${foldername}"/>
      </do>
    </foreach>


问:
Why this gallery is not responsive?
I don't know what should I change in this gallery code to make this responsive on mobile phone. Everything is good when I show it on computer screen but on mobile screen it's broken.

I've already tried different bootstrap command to make this code responsive but without any success.

Full gallery code bellow:
https://bootsnipp.com/snippets/Ga9k0

答:
You should use media queries, for example:

```<code>/* On screens that are 992px or less, set the background color to blue */
@media screen and (max-width: 992px) {
  body {
    background-color: blue;
  }
}
</code>```

Another example here:

https://www.w3schools.com/css/css3_mediaqueries_ex.asp

And here:

https://css-tricks.com/snippets/css/media-queries-for-standard-devices/

Look at the actual device resolution:

http://gs.statcounter.com/screen-resolution-stats

Title: Why this gallery is not responsive?

Body:
You should use media queries, for example:

/* On screens that are 992px or less, set the background color to blue */
@media screen and (max-width: 992px) {
  body {
    background-color: blue;
  }
}

Another example here:

https://www.w3schools.com/css/css3_mediaqueries_ex.asp

And here:

https://css-tricks.com/snippets/css/media-queries-for-standard-devices/

Look at the actual device resolution:

http://gs.statcounter.com/screen-resolution-stats


问:
Using "Either" in data validation
I have a program which is dedicated to create "Student" (First Name, Last Name, Age) and validate input data. My problem is that: when I insert student which e.g either name hasn't 2 letters or age is lower than 18 - the program only show one error. How to use "Either function" to create for example a string which contains all errors ? </p>

```<code>module Student where

data Student = Student {firstName::FirstName, lastName::LastName, age::Age}
  deriving Show

newtype FirstName = FirstName String
  deriving Show

newtype LastName = LastName String
  deriving Show

newtype Age = Age Int
  deriving Show

mkStudent :: String -> String -> String -> Either String Student
mkStudent fn ln a =
   Student <$> validate fn
           <*> validate ln
           <*> validate a

aceptableLetters = ['a'..'z']++['A'..'Z']

validateFn :: String -> Either String FirstName
validateFn fn
   | length fn < 2 = Left "First name has to at least 2 letters"
   | length fn > 100 = Left "First name is limited to 100 characters"
   | not . null $ filter (\c -> not . elem c $ aceptableLetters) fn = Left "First name contains unacceptable chars"
   | otherwise = Right . FirstName $ fn

validateLn :: String -> Either String LastName
validateLn lastName
   | length lastName < 2 = Left "Last name has to at least 2 letters"
   | length lastName > 100 = Left "Last name is limited to 100 characters"
   | not . null $ filter (\c -> not . elem c $ aceptableLetters) lastName = Left "Last name contains unacceptable chars"
   | otherwise = Right . LastName $ lastName

validateA :: String -> Either String Age
validateA a
   | age <= 18 = Left "Student has to be at least 18"
   | age > 100 = Left "Student has more than 100 years. Probably it is an error."
   | otherwise = Right . Age $ age
   where
    age = read a

class Validate v where
    validate :: String -> Either String v

instance Validate FirstName where
    validate=validateFn

instance Validate LastName where
    validate=validateLn

instance Validate Age where
    validate=validateA
</code>```

答:
Either's Monad and Applicative instances can't accumulate errors: by law, they must stop at the first Left value. So if you want to use Either to accumulate errors, you have to do it by hand, not through the Applicative or Monad instances.

What you're looking for instead is Validation. With that, you could write:

```<code>causes :: Applicative f => Bool -> a -> Validation (f a) ()
True `causes` err = Failure $ pure err
False `causes` err = Success ()

validateA :: String -> Validation [String] Age
validateA a = (Success . Age $ age)
           <* (age <= 18) `causes` "Student has to be at least 18"
           <* (age > 100) `causes` "Student has more than 100 years. Probably it is an error."
  where age = read a
</code>```

and similarly for your other validators. mkStudent remains as you have written it: applicative combinators are the right way to combine Validation values.

Title: Using "Either" in data validation

Body:
I have a program which is dedicated to create "Student" (First Name, Last Name, Age) and validate input data. My problem is that: when I insert student which e.g either name hasn't 2 letters or age is lower than 18 - the program only show one error. How to use "Either function" to create for example a string which contains all errors ?

module Student where

data Student = Student {firstName::FirstName, lastName::LastName, age::Age}
  deriving Show

newtype FirstName = FirstName String
  deriving Show

newtype LastName = LastName String
  deriving Show

newtype Age = Age Int
  deriving Show

mkStudent :: String -> String -> String -> Either String Student
mkStudent fn ln a =
   Student <$> validate fn
           <*> validate ln
           <*> validate a

aceptableLetters = ['a'..'z']++['A'..'Z']

validateFn :: String -> Either String FirstName
validateFn fn
   | length fn < 2 = Left "First name has to at least 2 letters"
   | length fn > 100 = Left "First name is limited to 100 characters"
   | not . null $ filter (\c -> not . elem c $ aceptableLetters) fn = Left "First name contains unacceptable chars"
   | otherwise = Right . FirstName $ fn

validateLn :: String -> Either String LastName
validateLn lastName
   | length lastName < 2 = Left "Last name has to at least 2 letters"
   | length lastName > 100 = Left "Last name is limited to 100 characters"
   | not . null $ filter (\c -> not . elem c $ aceptableLetters) lastName = Left "Last name contains unacceptable chars"
   | otherwise = Right . LastName $ lastName

validateA :: String -> Either String Age
validateA a
   | age <= 18 = Left "Student has to be at least 18"
   | age > 100 = Left "Student has more than 100 years. Probably it is an error."
   | otherwise = Right . Age $ age
   where
    age = read a

class Validate v where
    validate :: String -> Either String v

instance Validate FirstName where
    validate=validateFn

instance Validate LastName where
    validate=validateLn

instance Validate Age where
    validate=validateA

Body:
Either's Monad and Applicative instances can't accumulate errors: by law, they must stop at the first Left value. So if you want to use Either to accumulate errors, you have to do it by hand, not through the Applicative or Monad instances.

What you're looking for instead is Validation. With that, you could write:

causes :: Applicative f => Bool -> a -> Validation (f a) ()
True `causes` err = Failure $ pure err
False `causes` err = Success ()

validateA :: String -> Validation [String] Age
validateA a = (Success . Age $ age)
           <* (age <= 18) `causes` "Student has to be at least 18"
           <* (age > 100) `causes` "Student has more than 100 years. Probably it is an error."
  where age = read a

and similarly for your other validators. mkStudent remains as you have written it: applicative combinators are the right way to combine Validation values.


问:
Subtracting each element of list from every elements on its right in the same list
I need to manipulate list to get subtraction (subtracting each number from every number on its right).

I have tried using below code which is working with 2 for loops, is there anyway I can do it in only 1 for loop or in a better way then I did.

```<code>list=[3,2,5,4,3]
output_list = [0]

    for element in list:
        for i in range(0, length(list)):
            new_element = [ (list[i] - element) if i > index(element) else 0]
            if new_element > 0:
                output_list.append( new_element )
</code>```

example:
input [3,2,5,4,3]

subtract like [2-3, 5-3, 4-3, 3-3, 5-2, 4-2, 3-2, 4-5, 3-5, 3-4] = [-1, 2, 1, 0, 3, 2, 1, -1, -2, 1]

output with values > 0, first 0 is from initialization [0, 2, 1, 3, 2, 1, 1]

答:
This should generate the correct output:

values = [3,2,5,4,3]
print([j-i for k,i in enumerate(values[:-1]) for j in values[k+1:] if j-i > 0])
```

Body:
I need to manipulate list to get subtraction (subtracting each number from every number on its right).

I have tried using below code which is working with 2 for loops, is there anyway I can do it in only 1 for loop or in a better way then I did.

list=[3,2,5,4,3]
output_list = [0]

    for element in list:
        for i in range(0, length(list)):
            new_element = [ (list[i] - element) if i > index(element) else 0]
            if new_element > 0:
                output_list.append( new_element )

example:
input [3,2,5,4,3]

subtract like [2-3, 5-3, 4-3, 3-3, 5-2, 4-2, 3-2, 4-5, 3-5, 3-4] = [-1, 2, 1, 0, 3, 2, 1, -1, -2, 1]

output with values > 0, first 0 is from initialization [0, 2, 1, 3, 2, 1, 1]


问:
Code about stacks in Python doesnt print anything. why?
I have an assignment where the teacher gave me the code ready but i have to run it and figure out what it does and why. The code doesnt run in pycharm can you help me find any mistakes ???

I tried putting every line in its place to avoid errors but it just doent print anything. Does it need another class or something like that ?

```<code>def push(elements):
    if len(stack)>=limit:
        print('Stack Overflow!')
    else:
        stack.append(elements)
        print('Stack after Push',stack)
        def pop():
            if len(stack)<=0:
                print('Stack Underflow!')
                return0
            else:
                return stack.pop()
        stack = []
contents, elements = 0, 0
limit = int(input('Enter the no of elements to be stored in stack:'))
for contents in range(limit):
    elements = int(input('Enter elements' + str(contents) + ':'))
    push(elements)
for contents in range(limit):
    print('Popping' + str(limit - contents) + 'th element:', pop())
    print('Stack after Popping!', stack)
</code>```

I really cant tell why it doesnt print anything

答:
I believe your indentation is wrong. I believe the code should be:

```<code>def push(elements):
    if len(stack)>=limit:
        print('Stack Overflow!')
    else:
        stack.append(elements)
        print('Stack after Push',stack)
def pop(): # unindent this function
    if len(stack)<=0:
        print('Stack Underflow!')
        return0
    else:
        return stack.pop()
stack = [] # unindent
contents, elements = 0, 0
limit = int(input('Enter the no of elements to be stored in stack:'))
for contents in range(limit):
    elements = int(input('Enter elements' + str(contents) + ':'))
    push(elements)
for contents in range(limit):
    print('Popping' + str(limit - contents) + 'th element:', pop())
    print('Stack after Popping!', stack)
</code>```

Then the output is:

```<code>Enter the no of elements to be stored in stack:3
Enter elements0:1
Stack after Push [1]
Enter elements1:2
Stack after Push [1, 2]
Enter elements2:3
Stack after Push [1, 2, 3]
Popping3th element: 3
Stack after Popping! [1, 2]
Popping2th element: 2
Stack after Popping! [1]
Popping1th element: 1
Stack after Popping! []
</code>```

Body:
I have an assignment where the teacher gave me the code ready but i have to run it and figure out what it does and why. The code doesnt run in pycharm can you help me find any mistakes ???

I tried putting every line in its place to avoid errors but it just doent print anything. Does it need another class or something like that ?

def push(elements):
    if len(stack)>=limit:
        print('Stack Overflow!')
    else:
        stack.append(elements)
        print('Stack after Push',stack)
        def pop():
            if len(stack)<=0:
                print('Stack Underflow!')
                return0
            else:
                return stack.pop()
        stack = []
contents, elements = 0, 0
limit = int(input('Enter the no of elements to be stored in stack:'))
for contents in range(limit):
    elements = int(input('Enter elements' + str(contents) + ':'))
    push(elements)
for contents in range(limit):
    print('Popping' + str(limit - contents) + 'th element:', pop())
    print('Stack after Popping!', stack)

I really cant tell why it doesnt print anything

Body:
I believe your indentation is wrong. I believe the code should be:

def push(elements):
    if len(stack)>=limit:
        print('Stack Overflow!')
    else:
        stack.append(elements)
        print('Stack after Push',stack)
def pop(): # unindent this function
    if len(stack)<=0:
        print('Stack Underflow!')
        return0
    else:
        return stack.pop()
stack = [] # unindent
contents, elements = 0, 0
limit = int(input('Enter the no of elements to be stored in stack:'))
for contents in range(limit):
    elements = int(input('Enter elements' + str(contents) + ':'))
    push(elements)
for contents in range(limit):
    print('Popping' + str(limit - contents) + 'th element:', pop())
    print('Stack after Popping!', stack)

Then the output is:

Enter the no of elements to be stored in stack:3
Enter elements0:1
Stack after Push [1]
Enter elements1:2
Stack after Push [1, 2]
Enter elements2:3
Stack after Push [1, 2, 3]
Popping3th element: 3
Stack after Popping! [1, 2]
Popping2th element: 2
Stack after Popping! [1]
Popping1th element: 1
Stack after Popping! []


问:
Displaying full path of filename in tabs ~ Netbeans 6.8
I can't seem to find a way in the options to display the full path of the file at the title of the tab. I can hover over it to see it, but it would be nice to see it at a glance.

There is a SU question about it also, https://superuser.com/questions/88637/netbeans-how-to-view-file-full-path-in-window-title-or-somewhere-else

Does anyone have a solution for this to actually display it? I can see there is a custom .jar for it in the RC2 Netbeans, but that's probably way old now.

PS, I should mention that a path relative to the project would be ideal, as well as a full path. Either really :)

答: In Netbeans 6.9.1 (at least) you can open the Window/Properties window and pin it under the editor; this will contain the full path in the "All Files" property which is then visible at all times and always contains the current editor file's properties.</p>

ContentLicense: CC BY-SA 2.5


问:
Tensorflow view graph from model.ckpt.meta file
I have a model.ckpt.meta file and I just want to view the architecture/graph structure. I can't find how to do this from the model.ckpt.meta file.

Following the code thanks to Milan:

```<code>tf.train.import_meta_graph("./model.ckpt.meta")
for n in tf.get_default_graph().as_graph_def().node:
   print(n)
with tf.Session() as sess:
  writer = tf.summary.FileWriter("./output/", sess.graph)
  writer.close()
</code>```

I get the graph below. But a lot of the architecture is missing.

EDIT: Woops! I forgot to double click the model. Sorted.

答:
You can import the meta graph in python with tf.train.import_meta_graph and then traverse the nodes in the graph, for example:

```<code>import tensorflow as tf

tf.train.import_meta_graph("./model.ckpt-200000.meta")
for n in tf.get_default_graph().as_graph_def().node:
   print(n)
</code>```

Once imported, you can make a summary file for Tensorboard, which allows you to visualize the graph nicely:

```<code>with tf.Session() as sess:
  writer = tf.summary.FileWriter("./output/", sess.graph)
  writer.close()
</code>```

To see the saved summary file in Tensorboard, run tensorboard --logdir=./output/

Body:
I have a model.ckpt.meta file and I just want to view the architecture/graph structure. I can't find how to do this from the model.ckpt.meta file.

Following the code thanks to Milan:

tf.train.import_meta_graph("./model.ckpt.meta")
for n in tf.get_default_graph().as_graph_def().node:
   print(n)
with tf.Session() as sess:
  writer = tf.summary.FileWriter("./output/", sess.graph)
  writer.close()

I get the graph below. But a lot of the architecture is missing.

EDIT: Woops! I forgot to double click the model. Sorted.

Body:
You can import the meta graph in python with tf.train.import_meta_graph and then traverse the nodes in the graph, for example:

import tensorflow as tf

tf.train.import_meta_graph("./model.ckpt-200000.meta")
for n in tf.get_default_graph().as_graph_def().node:
   print(n)

Once imported, you can make a summary file for Tensorboard, which allows you to visualize the graph nicely:

with tf.Session() as sess:
  writer = tf.summary.FileWriter("./output/", sess.graph)
  writer.close()

To see the saved summary file in Tensorboard, run tensorboard --logdir=./output/


问:
Issue: Several bookdown pages not appearing anymore
This is similar to the recent issue posed by jtr13 where the order of sections in the page sidebar have changed, however I'm missing sections from the page entirely. Rmd files 02- though 09- don't have their respective html files showing up.

I've installed and rerendered using 0.10 and the developer version on GitHub, but haven't seen the page (being hosted on GitHub) update.

答:
I've resolved the issue myself by looking more closely at the commit where the disappearance happened. In the middle of one of the Rmd files, I had placed:

```<code>----
Other Variables
----
</code>```

to try to represent a new section with a horizontal rule without it being numbered. This was likely interpreted during the render as a new section/YAML and subsequently turned the later page sections into code confetti.

Body:
I've resolved the issue myself by looking more closely at the commit where the disappearance happened. In the middle of one of the Rmd files, I had placed:

----
Other Variables
----

to try to represent a new section with a horizontal rule without it being numbered. This was likely interpreted during the render as a new section/YAML and subsequently turned the later page sections into code confetti.


问:
CMake with MinGW-w64 does not install built DLL, but it's being built fine
NB: The files referenced here are all given below the horizontal ruler a bit down.

This is the MWE derived from a project where I ran into this. CMake version used is 3.12.2 on Ubuntu 16.04 (16.04.6 to be precise).

The goal is to create a CMakeLists.txt which can be re-targeted to build a Windows DLL using the MinGW-w64 toolchain (apt-get install mingw-w64 on Ubuntu/Debian).

When using no explicit toolchain file (i.e. without -DCMAKE_TOOLCHAIN_FILE=...), all works as expected and the lib${PRJNAME}.so gets installed as desired. However, once I use the toolchain file given below, I only get the resulting import lib ${PRJNAME}Lib.dll.a but not the corresponding .dll file installed.

If I invoke the Bash script as follows:

```<code>./build.sh 2>&1 |grep '^-- Install'
</code>```

the output is:

```<code>-- Install configuration: ""
-- Installing: /home/user/cmake-test/build-native/install-target/lib/libtest.so
-- Install configuration: ""
-- Installing: /home/user/cmake-test/build-windows/install-target/lib/test.dll.a
</code>```

As you can see the native build installs the actual shared library, but the one targeting Windows only installs the import lib, not the DLL. What I'd expect to see is something like this:

```<code>-- Install configuration: ""
-- Installing: /home/user/cmake-test/build-native/install-target/lib/libtest.so
-- Install configuration: ""
-- Installing: /home/user/cmake-test/build-windows/install-target/lib/test.dll
-- Installing: /home/user/cmake-test/build-windows/install-target/lib/test.dll.a
</code>```

What is it I am doing wrong here? It would seem that the install() function is invoked properly:

```<code>install(
    TARGETS ${PRJNAME}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    COMPONENT library
)
</code>```

Clearly ARCHIVE DESTINATION takes effect as that's where the import lib ends up. But why is the built .dll completely ignored here?

Side-note: I am aware of GNUInstallDirs, but that fell totally apart once I started cross-compiling for Windows. So I am setting the desired paths "manually" before invoking install().

build.sh (should be executable)

The script will first wipe the folders build-native and build-windows, if present, and then create those again. Then it will invoke cmake from these folders respectively, targeting using the system (native) toolchain and the MinGW-w64 toolchain respectively. Last but not least it will invoke the installation from these folders respectively.

So if you place this into an empty folder along with the other files this should not meddle with your data elsewhere in any way.

```<code>#/usr/bin/env bash
for i in native windows; do
        D=build-$i
        test -d $D && rm -rf $D
        mkdir $D
        [[ "$i" == "windows" ]] && TCFILE=mingw64-64bit.cmake
        ( set -x; cd $D && cmake .. -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=. ${TCFILE+-DCMAKE_TOOLCHAIN_FILE=$TCFILE} -DCMAKE_VERBOSE_MAKEFILE=ON )
        ( set -x; cd $D && cmake --build . --target install )
done
</code>```

test.cpp

```<code>#ifdef _WIN32
#   if defined(test_EXPORTS)
#       define TEST_API  __declspec(dllexport)
#   else
#       define TEST_API __declspec(dllimport)
#   endif
#else
#   define TEST_API
#endif

TEST_API void SomeFunction()
{
}
</code>```

CMakeLists.txt

```<code>cmake_minimum_required(VERSION 3.12)
set(PRJNAME test)
set(TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}/install-target")
project(${PRJNAME})

add_library(${PRJNAME} SHARED test.cpp)

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    set(DLL_PREFIX)
    set(DLL_POSTFIX Lib)
else()
    set(DLL_PREFIX lib)
    set(DLL_POSTFIX)
endif()

set_target_properties(
    ${PRJNAME}
    PROPERTIES
    PREFIX "${DLL_PREFIX}"
    IMPORT_PREFIX "${DLL_PREFIX}"
    DEBUG_POSTFIX "${DLL_POSTFIX}"
    RELEASE_POSTFIX "${DLL_POSTFIX}"
    CXX_STANDARD 11
    CXX_EXTENSIONS OFF
    CXX_STANDARD_REQUIRED ON
    POSITION_INDEPENDENT_CODE 1
)

set(CMAKE_INSTALL_PREFIX ${TARGET_DIR})
set(CMAKE_INSTALL_LIBDIR lib)
set(CMAKE_INSTALL_INCLUDEDIR include)

install(
    TARGETS ${PRJNAME}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    COMPONENT library
)
</code>```

mingw64-64bit.cmake

```<code>set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)

set(CMAKE_C_COMPILER   ${TOOLCHAIN_PREFIX}-gcc-posix)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++-posix)
set(CMAKE_RC_COMPILER  ${TOOLCHAIN_PREFIX}-windres)

set(CMAKE_FIND_ROOT_PATH  /usr/${TOOLCHAIN_PREFIX})

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
</code>```

答:
```<code>install(
    TARGETS ${PRJNAME}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
    COMPONENT library
)
</code>```

According to the install command documentation the DLL file is considered a runtime object.  I tested the example on Ubuntu 14.04.

Body:
NB: The files referenced here are all given below the horizontal ruler a bit down.

This is the MWE derived from a project where I ran into this. CMake version used is 3.12.2 on Ubuntu 16.04 (16.04.6 to be precise).

The goal is to create a CMakeLists.txt which can be re-targeted to build a Windows DLL using the MinGW-w64 toolchain (apt-get install mingw-w64 on Ubuntu/Debian).

When using no explicit toolchain file (i.e. without -DCMAKE_TOOLCHAIN_FILE=...), all works as expected and the lib${PRJNAME}.so gets installed as desired. However, once I use the toolchain file given below, I only get the resulting import lib ${PRJNAME}Lib.dll.a but not the corresponding .dll file installed.

If I invoke the Bash script as follows:

./build.sh 2>&1 |grep '^-- Install'

the output is:

-- Install configuration: ""
-- Installing: /home/user/cmake-test/build-native/install-target/lib/libtest.so
-- Install configuration: ""
-- Installing: /home/user/cmake-test/build-windows/install-target/lib/test.dll.a

As you can see the native build installs the actual shared library, but the one targeting Windows only installs the import lib, not the DLL. What I'd expect to see is something like this:

-- Install configuration: ""
-- Installing: /home/user/cmake-test/build-native/install-target/lib/libtest.so
-- Install configuration: ""
-- Installing: /home/user/cmake-test/build-windows/install-target/lib/test.dll
-- Installing: /home/user/cmake-test/build-windows/install-target/lib/test.dll.a

What is it I am doing wrong here? It would seem that the install() function is invoked properly:

install(
    TARGETS ${PRJNAME}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    COMPONENT library
)

Clearly ARCHIVE DESTINATION takes effect as that's where the import lib ends up. But why is the built .dll completely ignored here?

Side-note: I am aware of GNUInstallDirs, but that fell totally apart once I started cross-compiling for Windows. So I am setting the desired paths "manually" before invoking install().

build.sh (should be executable)

The script will first wipe the folders build-native and build-windows, if present, and then create those again. Then it will invoke cmake from these folders respectively, targeting using the system (native) toolchain and the MinGW-w64 toolchain respectively. Last but not least it will invoke the installation from these folders respectively.

So if you place this into an empty folder along with the other files this should not meddle with your data elsewhere in any way.

#/usr/bin/env bash
for i in native windows; do
        D=build-$i
        test -d $D && rm -rf $D
        mkdir $D
        [[ "$i" == "windows" ]] && TCFILE=mingw64-64bit.cmake
        ( set -x; cd $D && cmake .. -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=. ${TCFILE+-DCMAKE_TOOLCHAIN_FILE=$TCFILE} -DCMAKE_VERBOSE_MAKEFILE=ON )
        ( set -x; cd $D && cmake --build . --target install )
done

test.cpp

#ifdef _WIN32
#   if defined(test_EXPORTS)
#       define TEST_API  __declspec(dllexport)
#   else
#       define TEST_API __declspec(dllimport)
#   endif
#else
#   define TEST_API
#endif

TEST_API void SomeFunction()
{
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.12)
set(PRJNAME test)
set(TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}/install-target")
project(${PRJNAME})

add_library(${PRJNAME} SHARED test.cpp)

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    set(DLL_PREFIX)
    set(DLL_POSTFIX Lib)
else()
    set(DLL_PREFIX lib)
    set(DLL_POSTFIX)
endif()

set_target_properties(
    ${PRJNAME}
    PROPERTIES
    PREFIX "${DLL_PREFIX}"
    IMPORT_PREFIX "${DLL_PREFIX}"
    DEBUG_POSTFIX "${DLL_POSTFIX}"
    RELEASE_POSTFIX "${DLL_POSTFIX}"
    CXX_STANDARD 11
    CXX_EXTENSIONS OFF
    CXX_STANDARD_REQUIRED ON
    POSITION_INDEPENDENT_CODE 1
)

set(CMAKE_INSTALL_PREFIX ${TARGET_DIR})
set(CMAKE_INSTALL_LIBDIR lib)
set(CMAKE_INSTALL_INCLUDEDIR include)

install(
    TARGETS ${PRJNAME}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    COMPONENT library
)

mingw64-64bit.cmake

set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)

set(CMAKE_C_COMPILER   ${TOOLCHAIN_PREFIX}-gcc-posix)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++-posix)
set(CMAKE_RC_COMPILER  ${TOOLCHAIN_PREFIX}-windres)

set(CMAKE_FIND_ROOT_PATH  /usr/${TOOLCHAIN_PREFIX})

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Body:
install(
    TARGETS ${PRJNAME}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
    COMPONENT library
)

According to the install command documentation the DLL file is considered a runtime object.  I tested the example on Ubuntu 14.04.


问:
make highlight with pdfIum pdfSearchManager
I need to programmatically search pdf with pdfSearchManager and highlight the text. The code can make the search but with no highlight.
Plese see my code and correct me.</p>

```<code>PdfSearchManager a = new PdfSearchManager(pdfRenderer1);
a.Reset();
a.MatchWholeWord = true;
a.HighlightAllMatches = true;
MessageBox.Show(a.Search(textBox1.Text).ToString());
</code>```

答:
From PdfSearchManager source code :

```<code>public bool Search(string text)
        {
            Renderer.Markers.Clear();

            if (String.IsNullOrEmpty(text))
            {
                _matches = null;
                _bounds = null;
            }
            else
            {
                _matches = Renderer.Document.Search(text, MatchCase, MatchWholeWord);
                _bounds = GetAllBounds();
            }

            _offset = -1;

            UpdateHighlights();

            return _matches != null && _matches.Items.Count > 0;
        }
</code>```

there is private method UpdateHighlights and AddMatch :

```<code>private void UpdateHighlights()
        {
            Renderer.Markers.Clear();

            if (_matches == null)
                return;

            if (_highlightAllMatches)
            {
                for (int i = 0; i < _matches.Items.Count; i++)
                {
                    AddMatch(i, i == _offset);
                }
            }
            else if (_offset != -1)
            {
                AddMatch(_offset, true);
            }
        }

        private void AddMatch(int index, bool current)
        {
            foreach (var pdfBounds in _bounds[index])
            {
                var bounds = new RectangleF(
                    pdfBounds.Bounds.Left - 1,
                    pdfBounds.Bounds.Top + 1,
                    pdfBounds.Bounds.Width + 2,
                    pdfBounds.Bounds.Height - 2
                );

                var marker = new PdfMarker(
                    pdfBounds.Page,
                    bounds,
                    current ? CurrentMatchColor : MatchColor,
                    current ? CurrentMatchBorderColor : MatchBorderColor,
                    current ? CurrentMatchBorderWidth : MatchBorderWidth
                );

                Renderer.Markers.Add(marker);
            }
        }
</code>```

I think the Search method had add all the marker from searched text.
Now, how to make it visible in pdfiumViewer.

Body:
I need to programmatically search pdf with pdfSearchManager and highlight the text. The code can make the search but with no highlight.
Plese see my code and correct me.

PdfSearchManager a = new PdfSearchManager(pdfRenderer1);
a.Reset();
a.MatchWholeWord = true;
a.HighlightAllMatches = true;
MessageBox.Show(a.Search(textBox1.Text).ToString());

Body:
From PdfSearchManager source code :

public bool Search(string text)
        {
            Renderer.Markers.Clear();

            if (String.IsNullOrEmpty(text))
            {
                _matches = null;
                _bounds = null;
            }
            else
            {
                _matches = Renderer.Document.Search(text, MatchCase, MatchWholeWord);
                _bounds = GetAllBounds();
            }

            _offset = -1;

            UpdateHighlights();

            return _matches != null && _matches.Items.Count > 0;
        }

there is private method UpdateHighlights and AddMatch :

private void UpdateHighlights()
        {
            Renderer.Markers.Clear();

            if (_matches == null)
                return;

            if (_highlightAllMatches)
            {
                for (int i = 0; i < _matches.Items.Count; i++)
                {
                    AddMatch(i, i == _offset);
                }
            }
            else if (_offset != -1)
            {
                AddMatch(_offset, true);
            }
        }

        private void AddMatch(int index, bool current)
        {
            foreach (var pdfBounds in _bounds[index])
            {
                var bounds = new RectangleF(
                    pdfBounds.Bounds.Left - 1,
                    pdfBounds.Bounds.Top + 1,
                    pdfBounds.Bounds.Width + 2,
                    pdfBounds.Bounds.Height - 2
                );

                var marker = new PdfMarker(
                    pdfBounds.Page,
                    bounds,
                    current ? CurrentMatchColor : MatchColor,
                    current ? CurrentMatchBorderColor : MatchBorderColor,
                    current ? CurrentMatchBorderWidth : MatchBorderWidth
                );

                Renderer.Markers.Add(marker);
            }
        }

I think the Search method had add all the marker from searched text.
Now, how to make it visible in pdfiumViewer.


问:
How to get URL from Firebase Storage getDownloadURL
I'm trying to get the "long term persistent download link" to files in our Firebase storage bucket.
I've changed the permissions of this to

```<code>service firebase.storage {
  match /b/project-xxx.appspot.com/o {
    match /{allPaths=**} {
      allow read, write;
    }
  }
}
</code>```

And my javacode looks like this:

```<code>private String niceLink (String date){
    String link;
    // Points to the root reference
    StorageReference storageRef = FirebaseStorage.getInstance().getReference();
    StorageReference dateRef = storageRef.child("/" + date+ ".csv");
    link = dateRef.getDownloadUrl().toString();
    return link;
}
</code>```

When I run this I get the uri link that looks something like
com.google.android.gms.tasks.zzh@xxx

Question 1. Can I from this get the download link similar to: https://firebasestorage.googleapis.com/v0/b/project-xxxx.appspot.com/o/20-5-2016.csv?alt=media&token=b5d45a7f-3ab7-4f9b-b661-3a2187adxxxx

When trying to get the link above I changed the last row before my return, like this:

```<code>private String niceLink (String date){
    String link;
    // Points to the root reference
    StorageReference storageRef = FirebaseStorage.getInstance().getReference();
    StorageReference dateRef = storageRef.child("/" + date+ ".csv");
    link = dateRef.getDownloadUrl().getResult().toString();
    return link;
}
</code>```

But when doing this i get a 403 error, and the app crashing. The consol tells me this is bc user is not logged in /auth.
"Please sign in before asking for token"

Question 2. How do I fix this?

答:
```<code>Clean And Simple
private void putImageInStorage(StorageReference storageReference, Uri uri, final String key) {
        storageReference.putFile(uri).addOnCompleteListener(MainActivity.this,
                new OnCompleteListener<UploadTask.TaskSnapshot>() {
                    @Override
                    public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
                        if (task.isSuccessful()) {
                            task.getResult().getMetadata().getReference().getDownloadUrl()
                                    .addOnCompleteListener(MainActivity.this,
                                            new OnCompleteListener<Uri>() {
                                @Override
                                public void onComplete(@NonNull Task<Uri> task) {
                                    if (task.isSuccessful()) {
                                        FriendlyMessage friendlyMessage =
                                                new FriendlyMessage(null, mUsername, mPhotoUrl,
                                                        task.getResult().toString());
                                        mFirebaseDatabaseReference.child(MESSAGES_CHILD).child(key)
                                                .setValue(friendlyMessage);
                                    }
                                }
                            });
                        } else {
                            Log.w(TAG, "Image upload task was not successful.",
                                    task.getException());
                        }
                    }
                });
    }
</code>```

Body:
I'm trying to get the "long term persistent download link" to files in our Firebase storage bucket.
I've changed the permissions of this to

service firebase.storage {
  match /b/project-xxx.appspot.com/o {
    match /{allPaths=**} {
      allow read, write;
    }
  }
}

And my javacode looks like this:

private String niceLink (String date){
    String link;
    // Points to the root reference
    StorageReference storageRef = FirebaseStorage.getInstance().getReference();
    StorageReference dateRef = storageRef.child("/" + date+ ".csv");
    link = dateRef.getDownloadUrl().toString();
    return link;
}

When I run this I get the uri link that looks something like
com.google.android.gms.tasks.zzh@xxx

Question 1. Can I from this get the download link similar to: https://firebasestorage.googleapis.com/v0/b/project-xxxx.appspot.com/o/20-5-2016.csv?alt=media&token=b5d45a7f-3ab7-4f9b-b661-3a2187adxxxx

When trying to get the link above I changed the last row before my return, like this:

private String niceLink (String date){
    String link;
    // Points to the root reference
    StorageReference storageRef = FirebaseStorage.getInstance().getReference();
    StorageReference dateRef = storageRef.child("/" + date+ ".csv");
    link = dateRef.getDownloadUrl().getResult().toString();
    return link;
}

But when doing this i get a 403 error, and the app crashing. The consol tells me this is bc user is not logged in /auth.
"Please sign in before asking for token"

Question 2. How do I fix this?


问:
linux kernel step by step
i know c language.my goal is to read linux kernel.so what languages should i learn(write books too) before start reading kernel  and is there any book to help reading linux kernel</p>

答: Not so long ago there was a Linux kernel workshop at Hackerspace Brussels. You can take a look at the links on the event page https://hackerspace.be/LinuxKernelWorkshop</p>

Title: linux kernel step by step


答:
Try this, you can use itertools.combinations</p>

```<code>>>> from itertools import combinations
>>> from operator import sub
>>> l = [3,2,5,4,3]
>>> [0]+[sub(c[1],c[0]) for c in combinations(l,2) if sub(c[1],c[0]) > 0]
[0, 2, 1, 3, 2, 1]
</code>```

Title: Subtracting each element of list from every elements on its right in the same list

Body:
Try this, you can use itertools.combinations

>>> from itertools import combinations
>>> from operator import sub
>>> l = [3,2,5,4,3]
>>> [0]+[sub(c[1],c[0]) for c in combinations(l,2) if sub(c[1],c[0]) > 0]
[0, 2, 1, 3, 2, 1]


问:
Looping over the subsets of a dataframe based on two conditions
I have the following problem: I need to run each subset of a dataframe -based on the value of a variable- creating a new entries for another variable depending on 2 conditions.

The dataframe (dt3) is as follows: I have 4 variables (birth_year, last name –Name-, role in the household -role- and household -hh-). The whole set is divided or subsetted by the hh variable, which gathers all the individuals under the same household. For instances, in my example bellow, the first 4 rows belong to the household “1”. Also, under the variable role, only the head of the household is stated. The rest of roles are empty and must be derived, and this is what I’m trying to do. My first step is to assign the roles of "children". I was thinking of doing it by running a loop over the whole data set and over each subset (each hh value). Whenever each line has a person who has the same last name as the head of the household and whose birth year is at least 15 years later than the head’s, then this person is inferred as “children”.

The original dataframe is:

```<code>birth_year       Name           role        hh

1877        Snijders    Head ofhousehold    1
1885        Marteen     NA                  1
1897        Snijders    NA                  1
1892        Zelstra     NA                  1
1878        Kuipers     Head of household   2
1870        Marteen     NA                  2
1897        Wals        NA                  2
1900        Venstra     NA                  2
1900        Lippe       Head of household   3
1905        Flachs      NA                  3
1920        Lippe       NA                  3
1922        Lippe       NA                  3
</code>```

So, I need to run the whole set and each hh subset and perform the following two conditions:
a.  If the person’s name == the name of the head, and
b.  If the birth year of the person has a difference of 15 years or more with the head´s

Then this person is “children”.

So far I´ve been trying several things. As I’m placing the head role in the first row of each household then I was doing this:

a)
Nested loop, where I try to run the data set and then each hh. For each hh I run the conditions (by comparing each row’s name and birth year with those of the first line of the hh –the head-)

```<code>for (n in 1:unique(dt3$hh)){
  for (i in 1:length(which(dt3$hh==n)) ){
     mutate(dt3, role = ifelse( dt3$Name[[1,2]] == dt3$Name[[n,1]]
     & dt3$birth_year[[n,i]] > dt3$birth_year[[n,1]], "children","NoA"))
      }
  }
</code>```

Also b), I have tried to do the same, but with lists. I first Split dt3 by means of the hh variable

```<code>dt3 <- split(dt3, f = dt3$hh)
</code>```

And then

```<code>for (n in 1:dt3){
  mutate(dt3, role = ifelse( dt3$name [[n,i]] == dt3$name[[n,1]] &
        dt3$birth_year[[n,i]] > dt3$birth_year[[n,1]],"children","NoA"))
  }
</code>```

No success with the two solutions I was exploring, and what I was expecting is an outcomelike this:

```<code>birth_year       Name           role        hh

1877        Snijders    Head ofhousehold    1
1885        Marteen     NA                  1
1897        Snijders    children            1
1892        Zelstra     NA                  1
1878        Kuipers     Head of household   2
1870        Marteen     NA                  2
1897        Wals        NA                  2
1900        Venstra     NA                  2
1900        Lippe       Head of household   3
1905        Flachs      NA                  3
1920        Lippe       children            3
1922        Lippe       children            3
</code>```

Any tips will be welcome.

Thank you in advance

答:
Maybe the following is faster:

You can first order by hh and role!="HeadOfHousehold", which places the head role in the first row of each household, what you have done already but maybe in a different way, and then test with ave per hh if the name is equal and the birth_year difference is more then 14

```<code>dt3 <- read.table(header=T, text="birth_year      Name           role        hh
1877        Snijders    HeadOfHousehold    1
1885        Marteen     NA                  1
1897        Snijders    NA                  1
1892        Zelstra     NA                  1
1878        Kuipers     HeadOfHousehold   2
1870        Marteen     NA                  2
1897        Wals        NA                  2
1900        Venstra     NA                  2
1900        Lippe       HeadOfHousehold   3
1905        Flachs      NA                  3
1920        Lippe       NA                  3
1922        Lippe       NA                  3", as.is = T)

dt3 <- dt3[with(dt3, order(hh,role!="HeadOfHousehold")),]
dt3$role[with(dt3, as.logical(ave(Name, hh, FUN = function(x) x==x[1])) & ave(birth_year, hh, FUN = function(x) x>(x[1]+14)))] <- "children"
dt3

   birth_year     Name            role hh
1        1877 Snijders HeadOfHousehold  1
2        1885  Marteen            <NA>  1
3        1897 Snijders        children  1
4        1892  Zelstra            <NA>  1
5        1878  Kuipers HeadOfHousehold  2
6        1870  Marteen            <NA>  2
7        1897     Wals            <NA>  2
8        1900  Venstra            <NA>  2
9        1900    Lippe HeadOfHousehold  3
10       1905   Flachs            <NA>  3
11       1920    Lippe        children  3
12       1922    Lippe        children  3
</code>```

Body:
I have the following problem: I need to run each subset of a dataframe -based on the value of a variable- creating a new entries for another variable depending on 2 conditions.

The dataframe (dt3) is as follows: I have 4 variables (birth_year, last name –Name-, role in the household -role- and household -hh-). The whole set is divided or subsetted by the hh variable, which gathers all the individuals under the same household. For instances, in my example bellow, the first 4 rows belong to the household “1”. Also, under the variable role, only the head of the household is stated. The rest of roles are empty and must be derived, and this is what I’m trying to do. My first step is to assign the roles of "children". I was thinking of doing it by running a loop over the whole data set and over each subset (each hh value). Whenever each line has a person who has the same last name as the head of the household and whose birth year is at least 15 years later than the head’s, then this person is inferred as “children”.

The original dataframe is:

birth_year       Name           role        hh

1877        Snijders    Head ofhousehold    1
1885        Marteen     NA                  1
1897        Snijders    NA                  1
1892        Zelstra     NA                  1
1878        Kuipers     Head of household   2
1870        Marteen     NA                  2
1897        Wals        NA                  2
1900        Venstra     NA                  2
1900        Lippe       Head of household   3
1905        Flachs      NA                  3
1920        Lippe       NA                  3
1922        Lippe       NA                  3

So, I need to run the whole set and each hh subset and perform the following two conditions:
a.  If the person’s name == the name of the head, and
b.  If the birth year of the person has a difference of 15 years or more with the head´s

Then this person is “children”.

So far I´ve been trying several things. As I’m placing the head role in the first row of each household then I was doing this:

a)
Nested loop, where I try to run the data set and then each hh. For each hh I run the conditions (by comparing each row’s name and birth year with those of the first line of the hh –the head-)

for (n in 1:unique(dt3$hh)){
  for (i in 1:length(which(dt3$hh==n)) ){
     mutate(dt3, role = ifelse( dt3$Name[[1,2]] == dt3$Name[[n,1]]
     & dt3$birth_year[[n,i]] > dt3$birth_year[[n,1]], "children","NoA"))
      }
  }

Also b), I have tried to do the same, but with lists. I first Split dt3 by means of the hh variable

dt3 <- split(dt3, f = dt3$hh)

And then

for (n in 1:dt3){
  mutate(dt3, role = ifelse( dt3$name [[n,i]] == dt3$name[[n,1]] &
        dt3$birth_year[[n,i]] > dt3$birth_year[[n,1]],"children","NoA"))
  }

No success with the two solutions I was exploring, and what I was expecting is an outcomelike this:

birth_year       Name           role        hh

1877        Snijders    Head ofhousehold    1
1885        Marteen     NA                  1
1897        Snijders    children            1
1892        Zelstra     NA                  1
1878        Kuipers     Head of household   2
1870        Marteen     NA                  2
1897        Wals        NA                  2
1900        Venstra     NA                  2
1900        Lippe       Head of household   3
1905        Flachs      NA                  3
1920        Lippe       children            3
1922        Lippe       children            3

Any tips will be welcome.

Thank you in advance

Body:
Maybe the following is faster:

You can first order by hh and role!="HeadOfHousehold", which places the head role in the first row of each household, what you have done already but maybe in a different way, and then test with ave per hh if the name is equal and the birth_year difference is more then 14

dt3 <- read.table(header=T, text="birth_year      Name           role        hh
1877        Snijders    HeadOfHousehold    1
1885        Marteen     NA                  1
1897        Snijders    NA                  1
1892        Zelstra     NA                  1
1878        Kuipers     HeadOfHousehold   2
1870        Marteen     NA                  2
1897        Wals        NA                  2
1900        Venstra     NA                  2
1900        Lippe       HeadOfHousehold   3
1905        Flachs      NA                  3
1920        Lippe       NA                  3
1922        Lippe       NA                  3", as.is = T)

dt3 <- dt3[with(dt3, order(hh,role!="HeadOfHousehold")),]
dt3$role[with(dt3, as.logical(ave(Name, hh, FUN = function(x) x==x[1])) & ave(birth_year, hh, FUN = function(x) x>(x[1]+14)))] <- "children"
dt3

   birth_year     Name            role hh
1        1877 Snijders HeadOfHousehold  1
2        1885  Marteen            <NA>  1
3        1897 Snijders        children  1
4        1892  Zelstra            <NA>  1
5        1878  Kuipers HeadOfHousehold  2
6        1870  Marteen            <NA>  2
7        1897     Wals            <NA>  2
8        1900  Venstra            <NA>  2
9        1900    Lippe HeadOfHousehold  3
10       1905   Flachs            <NA>  3
11       1920    Lippe        children  3
12       1922    Lippe        children  3


问:
set focus to input box
I have the existing code:

```<code> <form action="page.php?id=<?= $_GET['id'] ?>" method="post">
            <fieldset>
                <p id="edit_name"><label for="name">Page Name:</label><input type="text" name="name" value="<?PHP echo htmlspecialchars_decode($s->name);?>" id="name"> <input type="submit" src="../img/button_save.jpg" name="btnSubmit" value="Save" id="btnSubmit" class="submit"></p>
                <div id="show_name"<?= $_GET['edit'] ? ' style=" display: none"' : '' ?>><p><label for="name">Page Name:</label> <?PHP echo $s->name;?>   <a href="?id=<?= $_GET['id'] ?>&edit_name=1" onClick="$('edit_name').show(); $('show_name').hide(); return false;"><img style="vertical-align: top;" src="../img/button_change.png" alt="Change Name"></a></p></div>
                <?
                // for non-JS browsers
                if(!$_GET['edit']) {
                    ?>
                <script type="text/javascript">
                    $('edit_name').hide();
                </script>
                    <?
                }
                ?>
            </fieldset>
        </form>
</code>```

I want to also set focus to the input box on clicking change. Currently it just shows/hides upon clicking change.

Thanks!

答:
As suggested in one of the answers make the click handler unobstrusive.
Use the following code to focus the text box.

```<code>$(function(){
    $("id^=show_name a").click(function(){
        $('edit_name').show();
        $('show_name').hide();
        $("#name").focus();
        return false;
    });
});
</code>```

Your HTML/PHP should now look like below:

```<code> <form action="page.php?id=<?= $_GET['id'] ?>" method="post">
    <fieldset>
            <p id="edit_name"><label for="name">Page Name:</label><input type="text" name="name" value="<?PHP echo htmlspecialchars_decode($s->name);?>" id="name"> <input type="submit" src="../img/button_save.jpg" name="btnSubmit" value="Save" id="btnSubmit" class="submit"></p>
            <div id="show_name"<?= $_GET['edit'] ? ' style=" display: none"' : '' ?>><p><label for="name">Page Name:</label> <?PHP echo $s->name;?>   <a href="?id=<?= $_GET['id'] ?>&edit_name=1"><img style="vertical-align: top;" src="../img/button_change.png" alt="Change Name"></a></p></div>
            <?
            // for non-JS browsers
            if(!$_GET['edit']) {
                ?>
            <script type="text/javascript">
                $('edit_name').hide();
            </script>
                <?
            }
            ?>
    </fieldset>
</form>
</code>```

Title: set focus to input box

Body:
I have the existing code:

 <form action="page.php?id=<?= $_GET['id'] ?>" method="post">
            <fieldset>

Page Name:<input type="text" name="name" value="<?PHP echo htmlspecialchars_decode($s->name);?>" id="name"> <input type="submit" src="../img/button_save.jpg" name="btnSubmit" value="Save" id="btnSubmit" class="submit">

                <div id="show_name"<?= $_GET['edit'] ? ' style=" display: none"' : '' ?>>
Page Name: <?PHP echo $s->name;?>   <a href="?id=<?= $_GET['id'] ?>&edit_name=1" onClick="$('edit_name').show(); $('show_name').hide(); return false;">

                <?
                // for non-JS browsers
                if(!$_GET['edit']) {
                    ?>

                    <?
                }
                ?>
            </fieldset>
        </form>

I want to also set focus to the input box on clicking change. Currently it just shows/hides upon clicking change.

Thanks!

Body:
As suggested in one of the answers make the click handler unobstrusive.
Use the following code to focus the text box.

$(function(){
    $("id^=show_name a").click(function(){
        $('edit_name').show();
        $('show_name').hide();
        $("#name").focus();
        return false;
    });
});

Your HTML/PHP should now look like below:

 <form action="page.php?id=<?= $_GET['id'] ?>" method="post">
    <fieldset>
            <p id="edit_name"><label for="name">Page Name:</label><input type="text" name="name" value="<?PHP echo htmlspecialchars_decode($s->name);?>" id="name"> <input type="submit" src="../img/button_save.jpg" name="btnSubmit" value="Save" id="btnSubmit" class="submit"></p>
            <div id="show_name"<?= $_GET['edit'] ? ' style=" display: none"' : '' ?>><p><label for="name">Page Name:</label> <?PHP echo $s->name;?> &nbsp;&nbsp;<a href="?id=<?= $_GET['id'] ?>&edit_name=1"><img style="vertical-align: top;" src="../img/button_change.png" alt="Change Name"></a></p></div>
            <?
            // for non-JS browsers
            if(!$_GET['edit']) {
                ?>
            <script type="text/javascript">
                $('edit_name').hide();
            </script>
                <?
            }
            ?>
    </fieldset>
</form>


问:
How to access Jupyter notebook stored in Windows when Jupyter runs from Ubuntu WSL?
I have setup WSL (Windows Subsystem for Linux) on Windows 10 and installed Anaconda with python 3 and jupyter lab included.
When launching Jupyter lab, I am asked to copy paste http://localhost:8888/lab in my browser, and that works fine.
However, I don't know how to access to all my notebooks stored in Windows, I can't browse Windows through Jupyter Lab.

I have searched in Google but can't find the answer.

Does anyone have an idea on how I can browse my notebooks folder stored in Windows?

答:
Juggling files between different environments can be a big productivity killer, as you are already finding out.  A potential approach would be to:

Organize your files on your local PC into a repository using github.com or equivalent, and pushing those files to your account.

Open a new terminal window in your Jupyter Lab, and pull the repo, substituting your name and email:

```<code>$ sudo apt install git
$ git config --global user.name "username"
$ git config --global user.email "email"
$ git init
$ git clone
</code>```

If you are not already doing, so it may also help you to use a conda environment, and add the spec file to your github repo so that you always know conda environment specification regardless if you are in windows or WSL (or on another server altogether).

```<code>$ conda list --explicit > spec-file.txt
$ git add spec-file.txt
$ git commit -m "added spec file for conda environment"
</code>```

If you installed jupyter using conda, then your conda environment should be 'selectable' within Jupyter Lab, but if not, there are other posts on stackoverflow that show how to configure Jupyter Lab to make sure you can select your various conda environments.

Body:
Juggling files between different environments can be a big productivity killer, as you are already finding out.  A potential approach would be to:

Organize your files on your local PC into a repository using github.com or equivalent, and pushing those files to your account.

Open a new terminal window in your Jupyter Lab, and pull the repo, substituting your name and email:

$ sudo apt install git
$ git config --global user.name "username"
$ git config --global user.email "email"
$ git init
$ git clone

If you are not already doing, so it may also help you to use a conda environment, and add the spec file to your github repo so that you always know conda environment specification regardless if you are in windows or WSL (or on another server altogether).

$ conda list --explicit > spec-file.txt
$ git add spec-file.txt
$ git commit -m "added spec file for conda environment"

If you installed jupyter using conda, then your conda environment should be 'selectable' within Jupyter Lab, but if not, there are other posts on stackoverflow that show how to configure Jupyter Lab to make sure you can select your various conda environments.


问:
Unable to start php-fpm - "cannot get uid for user 'apache'"
On a fresh AWS Linux HVM box, I ran the commands:

```<code>sudo yum update
sudo yum install git nginx php-fpm
</code>```

I then tried to sudo service start php-fpm, but got the error:

```<code>Starting php-fpm: [10-Sep-2014 20:52:39] ERROR: [pool www] cannot get uid for user 'apache'
[10-Sep-2014 20:52:39] ERROR: FPM initialization failed
</code>```

Where am I going wrong and where is the apache user coming from?

答:
For a docker OpenShift no root way, prepare groups in build

```<code>vim /etc/groups
</code>```

e.g. nobody:x:999:

it's after some update in php-fpm

Body:
On a fresh AWS Linux HVM box, I ran the commands:

sudo yum update
sudo yum install git nginx php-fpm

I then tried to sudo service start php-fpm, but got the error:

Starting php-fpm: [10-Sep-2014 20:52:39] ERROR: [pool www] cannot get uid for user 'apache'
[10-Sep-2014 20:52:39] ERROR: FPM initialization failed

Where am I going wrong and where is the apache user coming from?

Body:
For a docker OpenShift no root way, prepare groups in build

vim /etc/groups

e.g. nobody:x:999:

it's after some update in php-fpm