text:
Q: Having trouble installing DateTime on OSX Mojave All my perl codes were working fine in the past. I got a new Mac which came with Mojave OSX Ver10.14.1. Got excited and ported in all my old stuff. Now all the scripts are failing and I am not able to install any new modules via cpan. So, after some of research, I opted out for perlbrew.
I have installed "brew install perl" and and now on perl v5.28.1.
When I run my script, it fails as so.
Can't locate DateTime.pm in @INC (you may need to install the DateTime module) (@INC contains: /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1 /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1 /usr/local/lib/perl5/site_perl/5.28.1/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.28.1) at sch_update.pl line 6.
BEGIN failed--compilation aborted at sch_update.pl line 6.
That should be easy and just install the module. So, I proceeded. Ended up with following error message.
> sudo cpanm DateTime
--> Working on DateTime
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-1.50.tar.gz ... OK
Configuring DateTime-1.50 ... OK
==> Found dependencies: DateTime::Locale, DateTime::TimeZone, namespace::autoclean
--> Working on DateTime::Locale
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-Locale-1.23.tar.gz ... OK
Configuring DateTime-Locale-1.23 ... OK
==> Found dependencies: namespace::autoclean
--> Working on namespace::autoclean
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/namespace-autoclean-0.28.tar.gz ... OK
Configuring namespace-autoclean-0.28 ... OK
==> Found dependencies: B::Hooks::EndOfScope, namespace::clean
--> Working on B::Hooks::EndOfScope
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/B-Hooks-EndOfScope-0.24.tar.gz ... OK
Configuring B-Hooks-EndOfScope-0.24 ... OK
==> Found dependencies: Variable::Magic
--> Working on Variable::Magic
Fetching http://www.cpan.org/authors/id/V/VP/VPIT/Variable-Magic-0.62.tar.gz ... OK
Configuring Variable-Magic-0.62 ... OK
Building and testing Variable-Magic-0.62 ... FAIL
! Installing Variable::Magic failed. See /Users/bpark1/.cpanm/work/1547585021.44629/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'Variable::Magic' is not installed
! Bailing out the installation for B-Hooks-EndOfScope-0.24.
--> Working on namespace::clean
Fetching http://www.cpan.org/authors/id/R/RI/RIBASUSHI/namespace-clean-0.27.tar.gz ... OK
Configuring namespace-clean-0.27 ... OK
==> Found dependencies: Package::Stash, B::Hooks::EndOfScope
--> Working on Package::Stash
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Package-Stash-0.38.tar.gz ... OK
Configuring Package-Stash-0.38 ... OK
==> Found dependencies: Package::Stash::XS
--> Working on Package::Stash::XS
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Package-Stash-XS-0.29.tar.gz ... OK
Configuring Package-Stash-XS-0.29 ... OK
Building and testing Package-Stash-XS-0.29 ... FAIL
! Installing Package::Stash::XS failed. See /Users/bpark1/.cpanm/work/1547585021.44629/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'Package::Stash::XS' is not installed
! Bailing out the installation for Package-Stash-0.38.
! Installing the dependencies failed: Module 'B::Hooks::EndOfScope' is not installed, Module 'Package::Stash' is not installed
! Bailing out the installation for namespace-clean-0.27.
! Installing the dependencies failed: Module 'namespace::clean' is not installed, Module 'B::Hooks::EndOfScope' is not installed
! Bailing out the installation for namespace-autoclean-0.28.
! Installing the dependencies failed: Module 'namespace::autoclean' is not installed
! Bailing out the installation for DateTime-Locale-1.23.
--> Working on DateTime::TimeZone
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-TimeZone-2.23.tar.gz ... OK
Configuring DateTime-TimeZone-2.23 ... OK
==> Found dependencies: namespace::autoclean
! Installing the dependencies failed: Module 'namespace::autoclean' is not installed
! Bailing out the installation for DateTime-TimeZone-2.23.
! Installing the dependencies failed: Module 'DateTime::TimeZone' is not installed, Module 'namespace::autoclean' is not installed, Module 'DateTime::Locale' is not installed
! Bailing out the installation for DateTime-1.50.
I tried using '--installdeps' in cpanm to see if the dependancies would be taken care, but not work.
Please help.
Adding build.log
cpanm (App::cpanminus) 1.9018 on perl 5.028001 built for darwin-thread-multi-2level
Work directory is /Users/bpark1/.cpanm/work/1547585021.44629
You have make /usr/bin/make
You have /usr/bin/curl: curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.4 zlib/1.2.11 nghttp2/1.24.1
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching DateTime () on cpanmetadb ...
--> Working on DateTime
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-1.50.tar.gz
-> OK
Unpacking DateTime-1.50.tar.gz
Entering DateTime-1.50
Checking configure dependencies from META.json
Checking if you have Dist::CheckConflicts 0.02 ... Yes (0.11)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring DateTime-1.50
Running Makefile.PL
Warning: prerequisite DateTime::Locale 1.06 not found.
Warning: prerequisite DateTime::TimeZone 2.02 not found.
Warning: prerequisite namespace::autoclean 0.19 not found.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for DateTime
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Specio 0.18 ... Yes (0.43)
Checking if you have utf8 0 ... Yes (1.21)
Checking if you have Carp 0 ... Yes (1.50)
Checking if you have warnings 0 ... Yes (1.42)
Checking if you have Test::Warnings 0.005 ... Yes (0.026)
Checking if you have DateTime::Locale 1.06 ... No
Checking if you have Dist::CheckConflicts 0.02 ... Yes (0.11)
Checking if you have Test::More 0.96 ... Yes (1.302156)
Checking if you have strict 0 ... Yes (1.11)
Checking if you have Specio::Library::Builtins 0 ... Yes (0.43)
Checking if you have Specio::Library::String 0 ... Yes (0.43)
Checking if you have Specio::Declare 0 ... Yes (0.43)
Checking if you have Try::Tiny 0 ... Yes (0.30)
Checking if you have CPAN::Meta::Check 0.011 ... Yes (0.014)
Checking if you have Test::Fatal 0 ... Yes (0.014)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have File::Spec 0 ... Yes (3.74)
Checking if you have integer 0 ... Yes (1.01)
Checking if you have DateTime::TimeZone 2.02 ... No
Checking if you have XSLoader 0 ... Yes (0.30)
Checking if you have namespace::autoclean 0.19 ... No
Checking if you have warnings::register 0 ... Yes (1.04)
Checking if you have Scalar::Util 0 ... Yes (1.50)
Checking if you have CPAN::Meta::Requirements 0 ... Yes (2.140)
Checking if you have Specio::Exporter 0 ... Yes (0.43)
Checking if you have Params::ValidationCompiler 0.26 ... Yes (0.30)
Checking if you have overload 0 ... Yes (1.30)
Checking if you have Specio::Library::Numeric 0 ... Yes (0.43)
Checking if you have POSIX 0 ... Yes (1.84)
Checking if you have Storable 0 ... Yes (3.08)
Checking if you have base 0 ... Yes (2.27)
Checking if you have parent 0 ... Yes (0.236)
==> Found dependencies: DateTime::Locale, DateTime::TimeZone, namespace::autoclean
Searching DateTime::Locale (1.06) on cpanmetadb ...
--> Working on DateTime::Locale
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-Locale-1.23.tar.gz
-> OK
Unpacking DateTime-Locale-1.23.tar.gz
Entering DateTime-Locale-1.23
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Checking if you have File::ShareDir::Install 0.03 ... Yes (0.13)
Checking if you have Dist::CheckConflicts 0.02 ... Yes (0.11)
Configuring DateTime-Locale-1.23
Running Makefile.PL
Warning: prerequisite namespace::autoclean 0.19 not found.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for DateTime::Locale
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Storable 0 ... Yes (3.08)
Checking if you have base 0 ... Yes (2.27)
Checking if you have File::ShareDir 0 ... Yes (1.116)
Checking if you have Params::ValidationCompiler 0.13 ... Yes (0.30)
Checking if you have Exporter 0 ... Yes (5.73)
Checking if you have File::Temp 0 ... Yes (0.2304)
Checking if you have namespace::autoclean 0.19 ... No
Checking if you have CPAN::Meta::Requirements 0 ... Yes (2.140)
Checking if you have IPC::System::Simple 0 ... Yes (1.25)
Checking if you have CPAN::Meta::Check 0.011 ... Yes (0.014)
Checking if you have strict 0 ... Yes (1.11)
Checking if you have Test::More 0.96 ... Yes (1.302156)
Checking if you have Specio::Library::String 0 ... Yes (0.43)
Checking if you have Specio::Declare 0 ... Yes (0.43)
Checking if you have Test::Requires 0 ... Yes (0.10)
Checking if you have Test::Fatal 0 ... Yes (0.014)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have File::Spec 0 ... Yes (3.74)
Checking if you have Test::File::ShareDir::Dist 0 ... Yes (1.001002)
Checking if you have utf8 0 ... Yes (1.21)
Checking if you have Carp 0 ... Yes (1.50)
Checking if you have warnings 0 ... Yes (1.42)
Checking if you have Test::Warnings 0 ... Yes (0.026)
Checking if you have List::Util 1.45 ... Yes (1.50)
Checking if you have Dist::CheckConflicts 0.02 ... Yes (0.11)
==> Found dependencies: namespace::autoclean
Searching namespace::autoclean (0.19) on cpanmetadb ...
--> Working on namespace::autoclean
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/namespace-autoclean-0.28.tar.gz
-> OK
Unpacking namespace-autoclean-0.28.tar.gz
Entering namespace-autoclean-0.28
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring namespace-autoclean-0.28
Running Makefile.PL
Warning: prerequisite B::Hooks::EndOfScope 0.12 not found.
Warning: prerequisite namespace::clean 0.20 not found.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for namespace::autoclean
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Test::Requires 0 ... Yes (0.10)
Checking if you have B::Hooks::EndOfScope 0.12 ... No
Checking if you have Test::More 0.88 ... Yes (1.302156)
Checking if you have FindBin 0 ... Yes (1.51)
Checking if you have strict 0 ... Yes (1.11)
Checking if you have File::Spec 0 ... Yes (3.74)
Checking if you have overload 0 ... Yes (1.30)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have base 0 ... Yes (2.27)
Checking if you have List::Util 0 ... Yes (1.50)
Checking if you have Carp 0 ... Yes (1.50)
Checking if you have warnings 0 ... Yes (1.42)
Checking if you have Sub::Identify 0 ... Yes (0.14)
Checking if you have namespace::clean 0.20 ... No
Checking if you have File::Basename 0 ... Yes (2.85)
Checking if you have constant 0 ... Yes (1.33)
Checking if you have Scalar::Util 0 ... Yes (1.50)
==> Found dependencies: B::Hooks::EndOfScope, namespace::clean
Searching B::Hooks::EndOfScope (0.12) on cpanmetadb ...
--> Working on B::Hooks::EndOfScope
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/B-Hooks-EndOfScope-0.24.tar.gz
-> OK
Unpacking B-Hooks-EndOfScope-0.24.tar.gz
Entering B-Hooks-EndOfScope-0.24
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Checking if you have Text::ParseWords 0 ... Yes (3.30)
Configuring B-Hooks-EndOfScope-0.24
Running Makefile.PL
Distribution opts in x_use_unsafe_inc: 0
In file included from HASCOMPILERel7O/TESTQjCr.c:3:
/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level/CORE/perl.h:719:13: warning: non-portable path to file '<Xlocale.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#   include <xlocale.h>
            ^~~~~~~~~~~
            <Xlocale.h>
1 warning generated.
Warning: prerequisite Variable::Magic 0.48 not found.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for B::Hooks::EndOfScope
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have strict 0 ... Yes (1.11)
Checking if you have Test::More 0.88 ... Yes (1.302156)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have Module::Implementation 0.05 ... Yes (0.09)
Checking if you have File::Spec 0 ... Yes (3.74)
Checking if you have IPC::Open2 0 ... Yes (1.04)
Checking if you have File::Glob 0 ... Yes (1.31)
Checking if you have Tie::Hash 0 ... Yes (1.05)
Checking if you have Hash::Util::FieldHash 0 ... Yes (1.20)
Checking if you have warnings 0 ... Yes (1.42)
Checking if you have Scalar::Util 0 ... Yes (1.50)
Checking if you have lib 0 ... Yes (0.64)
Checking if you have Sub::Exporter::Progressive 0.001006 ... Yes (0.001013)
Checking if you have Variable::Magic 0.48 ... No
==> Found dependencies: Variable::Magic
Searching Variable::Magic (0.48) on cpanmetadb ...
--> Working on Variable::Magic
Fetching http://www.cpan.org/authors/id/V/VP/VPIT/Variable-Magic-0.62.tar.gz
-> OK
Unpacking Variable-Magic-0.62.tar.gz
Entering Variable-Magic-0.62
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Checking if you have Config 0 ... Yes (5.028001)
Configuring Variable-Magic-0.62
Running Makefile.PL
Checking if this is ActiveState Perl 5.8.8 build 822 or higher... no
Checking if this is gcc 3.4 on Windows trying to link against an import library... no
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Variable::Magic
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have base 0 ... Yes (2.27)
Checking if you have Socket 0 ... Yes (2.027)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have POSIX 0 ... Yes (1.84)
Checking if you have Exporter 0 ... Yes (5.73)
Checking if you have IO::Handle 0 ... Yes (1.39)
Checking if you have Config 0 ... Yes (5.028001)
Checking if you have IPC::Open3 0 ... Yes (1.20)
Checking if you have Test::More 0 ... Yes (1.302156)
Checking if you have lib 0 ... Yes (0.64)
Checking if you have IO::Select 0 ... Yes (1.39)
Checking if you have Carp 0 ... Yes (1.50)
Checking if you have XSLoader 0 ... Yes (0.30)
Building and testing Variable-Magic-0.62
cp lib/Variable/Magic.pm blib/lib/Variable/Magic.pm
Running Mkbootstrap for Magic ()
chmod 644 "Magic.bs"
"/usr/local/Cellar/perl/5.28.1/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Magic.bs blib/arch/auto/Variable/Magic/Magic.bs 644
"/usr/local/Cellar/perl/5.28.1/bin/perl" "/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/ExtUtils/xsubpp"  -typemap '/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/ExtUtils/typemap'  Magic.xs > Magic.xsc
mv Magic.xsc Magic.c
cc -c   -fno-common -DPERL_DARWIN -mmacosx-version-min=10.14 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -O3   -DVERSION=\"0.62\" -DXS_VERSION=\"0.62\"  "-I/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level/CORE"   Magic.c
In file included from Magic.xs:10:
/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level/CORE/perl.h:719:13: warning: non-portable path to file '<Xlocale.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#   include <xlocale.h>
            ^~~~~~~~~~~
            <Xlocale.h>
Magic.xs:1297:12: warning: initializing 'const U8 *' (aka 'const unsigned char *') with an expression of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
 const U8 *s = VOID2(const U8 *, VOID2(const void *, SvPV_const(sv, len)));
           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
rm -f blib/arch/auto/Variable/Magic/Magic.bundle
cc  -mmacosx-version-min=10.14 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong  Magic.o  -o blib/arch/auto/Variable/Magic/Magic.bundle  \
          \

chmod 755 blib/arch/auto/Variable/Magic/Magic.bundle
Manifying 1 pod document
"/usr/local/Cellar/perl/5.28.1/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Magic.bs blib/arch/auto/Variable/Magic/Magic.bs 644
PERL_DL_NONLAZY=1 "/usr/local/Cellar/perl/5.28.1/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# Testing Variable::Magic 0.62, Perl 5.028001 (no patchlevel), /usr/local/Cellar/perl/5.28.1/bin/perl
t/00-load.t .......... ok
t/01-import.t ........ ok
t/02-constants.t ..... ok
# Using threads 2.22
# Using threads::shared 1.58
t/09-load-threads.t ..
All 2 subtests passed
t/10-simple.t ........ ok
t/11-multiple.t ......
Failed 59/74 subtests
t/13-data.t ..........
Failed 32/35 subtests
t/14-callbacks.t .....
Failed 21/26 subtests
# According to Config::Perl::V version 0.29, this is NOT a debugging perl
# Not testing global destruction
t/15-self.t ..........
Failed 159/162 subtests
# Using Hash::Util::FieldHash 1.20
t/16-huf.t ...........
Failed 11/18 subtests
# Using IO::Handle 1.39
# Using IO::Select 1.39
# Using IPC::Open3 1.20
t/17-ctl.t ...........
Failed 96/96 subtests
t/18-opinfo.t ........
Failed 138/139 subtests
t/20-get.t ...........
Failed 11/15 subtests
t/21-set.t ...........
Failed 14/18 subtests
t/22-len.t ...........
Failed 53/55 subtests
t/23-clear.t .........
Failed 14/18 subtests
t/24-free.t ..........
Failed 7/11 subtests
# Using Tie::Array 1.07
t/25-copy.t ..........
Failed 43/48 subtests
t/27-local.t .........
Failed 19/24 subtests
t/28-uvar.t ..........
Failed 70/75 subtests
t/30-scalar.t ........
Failed 72/76 subtests
t/31-array.t .........
Failed 61/68 subtests
t/32-hash.t ..........
Failed 90/94 subtests
t/33-code.t ..........
Failed 25/36 subtests
# Using Symbol 1.08
t/34-glob.t ..........
Failed 31/35 subtests
t/35-stash.t .........
Failed 43/43 subtests
# Using threads 2.22
# Using threads::shared 1.58
t/40-threads.t .......
All 3 subtests passed
# Using threads 2.22
# Using threads::shared 1.58
t/41-clone.t .........
All 6 subtests passed
t/50-return.t ........
Failed 33/33 subtests
t/80-leaks.t .........
Failed 47/47 subtests

Test Summary Report
-------------------
t/09-load-threads.t (Wstat: 11 Tests: 2 Failed: 0)
  Non-zero wait status: 11
  Parse errors: No plan found in TAP output
t/11-multiple.t    (Wstat: 11 Tests: 15 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 74 tests but ran 15.
t/13-data.t        (Wstat: 11 Tests: 3 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 35 tests but ran 3.
t/14-callbacks.t   (Wstat: 11 Tests: 5 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 26 tests but ran 5.
t/15-self.t        (Wstat: 11 Tests: 3 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 162 tests but ran 3.
t/16-huf.t         (Wstat: 11 Tests: 7 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 18 tests but ran 7.
t/17-ctl.t         (Wstat: 11 Tests: 0 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 96 tests but ran 0.
t/18-opinfo.t      (Wstat: 11 Tests: 1 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 139 tests but ran 1.
t/20-get.t         (Wstat: 11 Tests: 4 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 15 tests but ran 4.
t/21-set.t         (Wstat: 11 Tests: 4 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 18 tests but ran 4.
t/22-len.t         (Wstat: 11 Tests: 2 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 55 tests but ran 2.
t/23-clear.t       (Wstat: 11 Tests: 4 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 18 tests but ran 4.
t/24-free.t        (Wstat: 11 Tests: 4 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 11 tests but ran 4.
t/25-copy.t        (Wstat: 11 Tests: 5 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 48 tests but ran 5.
t/27-local.t       (Wstat: 11 Tests: 5 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 24 tests but ran 5.
t/28-uvar.t        (Wstat: 11 Tests: 5 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 75 tests but ran 5.
t/30-scalar.t      (Wstat: 11 Tests: 4 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 76 tests but ran 4.
t/31-array.t       (Wstat: 11 Tests: 7 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 68 tests but ran 7.
t/32-hash.t        (Wstat: 11 Tests: 4 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 94 tests but ran 4.
t/33-code.t        (Wstat: 11 Tests: 11 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 36 tests but ran 11.
t/34-glob.t        (Wstat: 11 Tests: 4 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 35 tests but ran 4.
t/35-stash.t       (Wstat: 11 Tests: 0 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 43 tests but ran 0.
t/40-threads.t     (Wstat: 11 Tests: 3 Failed: 0)
  Non-zero wait status: 11
  Parse errors: No plan found in TAP output
t/41-clone.t       (Wstat: 11 Tests: 6 Failed: 0)
  Non-zero wait status: 11
  Parse errors: No plan found in TAP output
t/50-return.t      (Wstat: 11 Tests: 0 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 33 tests but ran 0.
t/80-leaks.t       (Wstat: 11 Tests: 0 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 47 tests but ran 0.
Files=30, Tests=198,  2 wallclock secs ( 0.07 usr  0.05 sys +  1.42 cusr  0.23 csys =  1.77 CPU)
Result: FAIL
Failed 26/30 test programs. 0/198 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing Variable::Magic failed. See /Users/bpark1/.cpanm/work/1547585021.44629/build.log for details. Retry with --force to force install it.
-> FAIL Installing the dependencies failed: Module 'Variable::Magic' is not installed
-> FAIL Bailing out the installation for B-Hooks-EndOfScope-0.24.
Searching namespace::clean (0.20) on cpanmetadb ...
--> Working on namespace::clean
Fetching http://www.cpan.org/authors/id/R/RI/RIBASUSHI/namespace-clean-0.27.tar.gz
-> OK
Unpacking namespace-clean-0.27.tar.gz
Entering namespace-clean-0.27
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring namespace-clean-0.27
Running Makefile.PL
Warning: prerequisite B::Hooks::EndOfScope 0.12 not found.
Warning: prerequisite Package::Stash 0.23 not found.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for namespace::clean
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Package::Stash 0.23 ... No
Checking if you have B::Hooks::EndOfScope 0.12 ... No
Checking if you have Test::More 0.47 ... Yes (1.302156)
==> Found dependencies: Package::Stash, B::Hooks::EndOfScope
Searching Package::Stash (0.23) on cpanmetadb ...
--> Working on Package::Stash
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Package-Stash-0.38.tar.gz
-> OK
Unpacking Package-Stash-0.38.tar.gz
Entering Package-Stash-0.38
Checking configure dependencies from META.json
Checking if you have Text::ParseWords 0 ... Yes (3.30)
Checking if you have Config 0 ... Yes (5.028001)
Checking if you have Dist::CheckConflicts 0.02 ... Yes (0.11)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Checking if you have File::Spec 0 ... Yes (3.74)
Configuring Package-Stash-0.38
Running Makefile.PL
Distribution opts in x_use_unsafe_inc: 0
Warning: prerequisite Package::Stash::XS 0.26 not found.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Package::Stash
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have IPC::Open3 0 ... Yes (1.20)
Checking if you have IO::Handle 0 ... Yes (1.39)
Checking if you have B 0 ... Yes (1.74)
Checking if you have Test::Requires 0 ... Yes (0.10)
Checking if you have strict 0 ... Yes (1.11)
Checking if you have Test::More 0.88 ... Yes (1.302156)
Checking if you have Symbol 0 ... Yes (1.08)
Checking if you have base 0 ... Yes (2.27)
Checking if you have Module::Implementation 0.06 ... Yes (0.09)
Checking if you have File::Spec 0 ... Yes (3.74)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have Test::Fatal 0 ... Yes (0.014)
Checking if you have warnings 0 ... Yes (1.42)
Checking if you have Package::Stash::XS 0.26 ... No
Checking if you have Carp 0 ... Yes (1.50)
Checking if you have constant 0 ... Yes (1.33)
Checking if you have Getopt::Long 0 ... Yes (2.5)
Checking if you have Dist::CheckConflicts 0.02 ... Yes (0.11)
Checking if you have Scalar::Util 0 ... Yes (1.50)
Checking if you have lib 0 ... Yes (0.64)
==> Found dependencies: Package::Stash::XS
Searching Package::Stash::XS (0.26) on cpanmetadb ...
--> Working on Package::Stash::XS
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Package-Stash-XS-0.29.tar.gz
-> OK
Unpacking Package-Stash-XS-0.29.tar.gz
Entering Package-Stash-XS-0.29
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring Package-Stash-XS-0.29
Running Makefile.PL
Distribution opts in x_use_unsafe_inc: 0
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Package::Stash::XS
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have lib 0 ... Yes (0.64)
Checking if you have Scalar::Util 0 ... Yes (1.50)
Checking if you have constant 0 ... Yes (1.33)
Checking if you have XSLoader 0 ... Yes (0.30)
Checking if you have warnings 0 ... Yes (1.42)
Checking if you have Test::Fatal 0 ... Yes (0.014)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have File::Spec 0 ... Yes (3.74)
Checking if you have base 0 ... Yes (2.27)
Checking if you have Symbol 0 ... Yes (1.08)
Checking if you have Test::More 0.88 ... Yes (1.302156)
Checking if you have strict 0 ... Yes (1.11)
Checking if you have Test::Requires 0 ... Yes (0.10)
Checking if you have B 0 ... Yes (1.74)
Checking if you have IO::Handle 0 ... Yes (1.39)
Checking if you have IPC::Open3 0 ... Yes (1.20)
Building and testing Package-Stash-XS-0.29
Distribution opts in x_use_unsafe_inc: 0

A: @Brian, no worries, if you can, start all over again, following the instructions on perlbrew.pl. Most likely, the perl installed by homebrew can safely be removed.


text:
Q: How to enable direct rendering for i915 driver? My glxgears works just fine, bit of slow though. When running on some python OpenGL demo, it crashes with
X Error of failed request:  BadRequest (invalid request code or no such operation)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  168 ()
  Serial number of failed request:  114
  Current serial number in output stream:  114

My OpenGL version and mesa goes as follows,
$ glxinfo | grep "OpenGL version"
OpenGL version string: 1.4 (2.1 Mesa 10.1.3)

Also, direct rendering is set to false. I would like to verify if it is the "direct rendering" that is causing the problem. But I didn't find a proper solutino on the web. Can anyone help me out?
--Edit--
$ lspci -knn | grep VGA -A3
00:02.0 VGA compatible controller [0300]: Intel Corporation Sky Lake Integrated Graphics [8086:1912] (rev 06)
        Subsystem: Dell Device [1028:06b9]
        Kernel driver in use: i915
00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)

And segfault encountered with vainfo
$ vainfo
libva info: VA-API version 0.36.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_36
Segmetation fault (core dumped)

redpajama_set_name: RedPajamaStackExchange


text:
Q: Get node attributes of connected neightbouring nodes I am pretty new to networkx and working with graphs. Currently, I am working with a twitter dataset and I'm trying to get the attributes of any nodes that may be following a particular node. The approach I'm thinking of is to loop through all the nodes in my graph and use in_edges() to try and create a subgraph of the current node and all of its "followers" so that I can extract the attributes of those nodes which are following the target node. Unfortunately i'm not sure how to proceed.
Any help is greatly appreciated.

A: You can start from studying this example:
import networkx as nx
import matplotlib.pyplot as plt
plt.figure(figsize=(10,2))
G = nx.Graph([(1,0), (2,1), (3,2), (4,3), (5,1), (6,2), (7,6), (8,7), (9,0), (10,0), (11,10)])
blue_edges = dict.fromkeys(G.edges(1), 'blue') #dict of green edges
light_edges = dict.fromkeys(G.edges, 'lightblue')
nx.set_edge_attributes(G, light_edges, 'color')
nx.set_edge_attributes(G, blue_edges, 'color')
nx.draw(G, with_labels=True, edge_color=nx.get_edge_attributes(G,'color').values())

I've used a quite rare method dict.fromkeys(G.edges(1), 'blue') to create a dictionary with blue values for all edges incident to node 1. You might like to move further with your question from this point:
>>> G.edges(1)
EdgeDataView([(1, 0), (1, 2), (1, 5)])
>>> list(G.edges(1))
[(1, 0), (1, 2), (1, 5)]
>>> [y for x,y in list(G.edges(1))]
[0, 2, 5]

Or you could simply do:
>>> list(G[1])
[0, 2, 5]
>>> list(G.adj[1])
[0, 2, 5]

And if you need a subgraph:
>>> G.subgraph([1] + G[1])
<networkx.classes.graph.Graph at 0x22a1ba6bb50>
>>> G.subgraph([1] + G[1]).nodes()
NodeView((0, 1, 2, 5))
>>> G.subgraph([1] + list(G[1])).edges()
EdgeView([(0, 1), (1, 2), (1, 5)])


text:
Q: A question about the preposition "with" I have read an article, and encountered a sentence like this "..., we shall be sure to conquer and overcome every difficulty we meet with.".Then I have a question about the use of the preposition "with" at the end of the sentence. Can we just say "overcome every difficulty we meet"? It seems that the verb "meet" can be transitive. And why we use "overcome every difficulty we meet with"? What is the difference?
Thanks for you kind answer!

A: Typically, in formal writing, you would not place a preposition at the end of a sentence. Yet, in common speech, it is common to use a preposition at the end.
Informal:

Who shall I give this pie to?

Formal:

To whom shall I give this pie?

In this case, the preposition at the end doesn't seem to make much sense. But, to answer your question, it wouldn't be wrong. And, yes, they could have just left it out.

A: The idea that a terminal preposition is unacceptable was promoted by Dryden, who argued that, being  pre-position (Latin pre, before), it could not be last. Such grammatical sophistry has fallen out of favour and was debunked, for example, by Winston Churchill:
Here is the longest quotation I have ever posted on this site. It comes from Merriam Webster, is full of amusement and good sense and I commend it to you.

Where did this rule come from?
There is some disagreement as to how we came to cluck our tongues at people who finish off their sentences with an of, to, or through, but it is agreed that it's been bothering people for a very long time. Many people believe that the rule originated with the 17th century poet John Dryden, who in 1672 chastised Ben Jonson: "The preposition in the end of the sentence; a common fault with him." Jonson probably didn't take much heed of this admonition, seeing as how he was dead, but untold millions of people have suffered in the subsequent years as a result.
Nuria Yáñez-Bouza has proposed an alternate theory: she discovered that, several decades prior to Dryden, an obscure grammarian named Joshua Poole took a similar position in his book The English Accidence. Poole was more concerned with prepositions being placed in "their naturall order," and did not mention the end of the sentence as specifically as Dryden did.
If we are to be fair we may credit Poole for creating the rule, and Dryden for popularizing it. Both Dryden and Poole were likely motivated by a desire to make English grammar more in line with Latin, a language in which sentences syntactically cannot end in prepositions.
In the 18th century, a number of people who liked telling other people that they were wrong decided Dryden was correct and began advising against the terminal preposition. Sometimes, the advice was to not end a sentence with a preposition. At other times it was more general, as Poole's rule was. For instance, Noah Webster, in his 1784 book on grammar, took care to advise against separating prepositions "from the words which they govern." He did allow that "grammarians seem to allow of this mode of expression in conversation and familiar writings, but it is generally considered inelegant, and in the grave and sublime styles, is certainly inadmissible."
However, by the time the 20th century rolled around most grammar and usage guides had come to the conclusion that there was really nothing wrong with terminal prepositions. In fact, there has been, for about 100 years now, near unanimity in this regard from usage guides. The matter must therefore be settled, mustn't it?
No, it must not. A quick look at newspapers from the past year indicates that there are still a number of people who find the terminal preposition an abomination, enough so that they are willing—perhaps, one imagines, even eager—to write letters to the editor of any newspaper in which they find it.
Why do both editorial and letter writers have to flagrantly split the infinitive? And lastly, ending a sentence with a preposition is something we can do without!
— letter to Daily Camera (Boulder, CO), 17 February 2016
I would think a State Columnist would know correct English, unless this was done to get people's attention. It sure got mine. The first sentence of the second paragraph, "Here's where we're at". Really...No sentence should end in a preposition. It should be, "Here's where we are". If it wasn't done on purpose, I would suggest Patrick go back to English Grammar 101 before he writes his next column.
— letter to Asheville (NC) Citizen-Times, 15 February 2016
Conventional wisdom would figure that a Canadian citizen is a Canadian, regardless of status. Plus, you're not supposed to end a sentence with a preposition.
— The Star Phoenix (Saskatoon, Saskatchewan), 25 September 2015
It would appear that some people are determined to hold on to this rule, no matter how many times they are informed that it really isn't one. In a similar vein, many people who like to use terminal prepositions will give some mangled version of a quote from Winston Churchill, "This is the sort of nonsense up with which I will not put." The linguist Ben Zimmer has conclusively demonstrated that, as is the case with so many Churchill quotes, this was almost certainly never said by him.
If you don't like to end your sentences with prepositions, you don't have to—just don't say that it is a rule. And if you like to end your sentences with a succinct with, go right ahead and keep doing so—just don't quote Winston Churchill when someone says that you shouldn't.
Merriam Webster


text:
Q: ng2-pdfjs-viewer: PDF is all black I have a Problem with ng2-pdfjs-viewer.
Sometimes the PDF I try to display is all black.
I figured out, that it appears to be black whenever the PDf was created with j&k DPU-X.
If the PDF was created by OmniPage CSDK 19 it works just fine.
So the Problem is, that I acquire the PDF by REST call and that the exact same PDF appears sometimes to be created with j&k DPU-X and on another call with OmniPage CSDK 19.
I also see, that the one which is all black is way smaller despite the Byte[] I use is the same
for both cases.
Is there any possibility to change these information or how are they determined?

Thank you for you help and input.


text:
Q: force push to another remote branch using husky hook I would like to run
git push origin --force CURRENT_BRANCH_NAME:sandbox

in a pre-push hook.
How do I get
CURRENT_BRANCH_NAME

as part of the above command?
I understand I can have git branch --show-current to return the current branch name. Just not sure how to use its output with the above-mentioned git command.

A: First, I'll answer the question you actually asked:

*

*To get the current branch name, use git branch --show-current or git symbolic-ref --short HEAD or git rev-parse --abbrev-ref HEAD.  Note that these three commands do slightly different things!  See details below.

*In POSIX-compatible shells, to substitute the output of a command in place inside another command as an argument, use either backquotes or $( and ).  I prefer the $(...) sequence as it nests properly: that is, you can put another $(...) inside the $(...) and it Just Works since parentheses nest.  This is not true of backquotes (they can be made to work but it is trickier).
Next, I'll note that you should not bother to do this.  The reason is simple: you have to pick one of the above three items and two of them are probably wrong, and this is all unnecessary.  Simply use:
git push --force origin HEAD:sandbox

or, for strict correctness in the case where two of the items are probably wrong:
git push --force origin HEAD:refs/heads/sandbox

This variant uses a fully qualified reference, refs/heads/sandbox, to refer to the branch name sandbox in the remote Git, regardless of the result of an attempt to turn HEAD into a Git commit hash ID.
Why this works
The git push command pushes commits (not files, not branches, just commits and other supporting Git objects) to the other Git.  Once the commits (and/or other supporting Git objects) have made it to that other Git and are ready to be used there, then git push ends by asking (non-forced push) or commanding (forced push) the other Git to create, delete, or update some name(s) in their repository.
To achieve this sequence of events, git push needs:

*

*the raw hash ID(s) of some commit(s) and/or other supporting Git objects it should send if / as needed;

*the names it should ask / command the other Git to set or delete, along with the operation to do (set vs delete); and

*the force flag (which can be a simple off/on, or one of the more complicated "with lease" style options).

Your Git—your software, sending from your repository, to the other Git that's software receiving into a target repository—gets these three items from:

*

*flags like --force or the + in +HEAD:refs/heads/sandbox or the --delete in git push --delete, which go in the obvious positions;

*for the raw hash ID(s) that should be sent, from the left side of the src:dst pair;

*for the name to update, from the right side of this same pair.

Git calls the pair itself, with or without the optional + force flag, a refspec.  So feature:sandbox is a refspec, and HEAD:sandbox is also a refspec.  In fact, even the degenerate form:
git push origin main

for instance, uses a refspec: it's just one in which the colon is missing, so that you provide only a src part.  This is a partial refspec and in this case, Git uses the same name for the target as you supplied for the source (for git push that is—while git fetch also works with refspecs, its treatment of partial refspecs is different).
Since you already plan to use a full refspec, with the colon in it, the item on the left is not required to be a name.  The name that your Git will send to the other Git comes from the right hand side of the refspec.
Now, there's a small hitch here: how does the sending Git (i.e., yours) know whether to ask the receiving Git to set a branch name (refs/heads/moo), or a tag name (refs/tags/moo), or perhaps some other kind of name (refs/for/moo for Gerrit for instance) if you give your Git an unqualified name like moo?  The answer is that your Git and/or their Git will do their best to guess which kind of name you mean, but in general, when you are doing this—providing a full refspec, that is—it's wise to provide a full ref on the right, so that you know for sure what you intend to ask the other Git to set (or delete).  This is especially true from scripts, which may operate without a human overseer.
Hence there is a general rule here
When you, as a human, are running:
git push origin feature3 v1.2

you know that feature3 is your own local branch name, and v1.2 is your own local tag name, so you know that this is really refs/heads/feature3:refs/heads/feature3 and refs/tags/v1.2:refs/tags/v1.2.  But in scripts, which are generally write-once run-many-times, it's wiser to be explicit.
Coda: the three different commands
Git has two "modes" for HEAD: attached and detached.  (Note: Git calls the latter detached HEAD mode; I made up the name attached HEAD mode as the obvious counterpart, but it's not officially a Git name.)  In the attached-HEAD mode, the name HEAD is a symbolic reference to a branch name.1  In the detached mode, however, HEAD holds a raw commit hash ID.
The command git branch --show-current will show the name to which HEAD is attached when you are in attached-HEAD mode, but will silently print nothing and exit with a successful status when you are in detached-HEAD mode.
The command git symbolic-ref HEAD prints the full name of the branch to which HEAD is attached when in attached-HEAD mode, and produces an error message, no standard output, and a nonzero exit code when in detached-HEAD mode.  It prints the short version of the branch name with --short but still produces the same no-output-but-error-instead when detached.
The command git rev-parse --abbrev-ref HEAD prints the shortened name of the current branch when in attached-HEAD mode, and prints the word HEAD when in detached-HEAD mode.
There's one more mode worthy of mention here, although it's quite rare: when you are on an "orphan" or "unborn" branch (Git uses both terms to refer to this state), the name HEAD is a symbolic ref to a branch name that does not exist.  In this state, git branch --show-current and git symbolic-ref HEAD both succeed (and print the nonexistent branch name), but git rev-parse --abbrev-rev HEAD fails.
To test which mode you're in and get the commit hash ID:
detached=false unborn=false
branch=$(git symbolic-ref --short HEAD 2>/dev/null) || detached=true
if ! $detached; then
    git rev-parse -q --verify HEAD >/dev/null || unborn=true
fi

After executing these five lines, $detached holds whether HEAD is detached (as a simple boolean result), $branch holds the branch name if HEAD is not detached, and $unborn contains the result of testing whether there is currently a commit, or making a new commit will create the current branch.  (The need for $unborn is rare.)

1In ancient, primeval Git, this was implemented with symlinks: ln -s refs/heads/master HEAD for instance.  Git had to drop this particular shortcut when it was ported to Windows, which lacked symlinks.


text:
Q: Another application launched from my app uses the same heap I am launching an application for eg  : Box app from my application. on launch of the the box app. my app goes to background and when i come back to my application all the static objects like datbase instances and static models are getting reset because of memory issue.
How should i handle this.I understand that onsaveinstancestate can be used.But in my case i have to hold onto many static models and DB instamces etc.which i think should not be held in onsavedinstancestate.
One more thing which i noted is that box application uses the same heap for creating objects and the Allocated heap and free memory gets changed.why is it like that?it runs in a different process.

A: new heap: https://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK
DB and static instances:
there's nothing you can do. Whenever the system needs memory it will reclaim the memory. You have to learn how to proper deal with DB connections, singletons and the activity life-cycle.


text:
Q: Use a javascript array to display specific HTML divs Using django I have a HTML page with a table containing checkboxes:
{% for o in obj %}

    <input class='germ_ids' name='{{o.id}}'>

{% endfor %}

This has given me an array of specific 'germ ids'. These relate to other django objects I have:
the same .html page:
{% for k, v in add_state_dict.items %}

{{v}}

{% endfor %}

{{additional_statement}}

What I want to achieve is a statement for each germ_id when their checkbox is checked. However when more than one boxes are checked, it makes a concat statement called additional_statement in the 'all_germ' class.
I have hard coded it in in a JSFiddle http://jsfiddle.net/sDsCM/1037/
However I want to use the elements in the array to do this to account for different array values.

A: You should not be using class names with IDs but instead use class names that categorize your checkboxes. As example I'll be using .checkbox-plus-info. Also, use a data attribute to find the associated statement (unless you can render them inside one div):
{% for o in obj %}
    <input class='germ_ids checkbox-plus-info' name='{{o.id}}'
        data-info-tag="info-{{o.id}}">
{% endfor %}

{% for k, v in add_state_dict.items %}

{{v}}

{% endfor %}

In the above, k of course needs to contain a reference to the object (its PK/ID). You should have that information in your view and add it to the context. You haven't posted your view/context code but the business logic should mostly be ready while you create the template context, so prepare as much as you can there.
In your JS:
$(".checkbox-plus-info").click(function() {
  $(".info").hide(); // hide all
  stmtElId = $(this).target.data("info-tag");
  $("#" + stmtElId).show();
  // check whether something has to be shown when several checkboxes are checked
  // e.g. count whether all checkboxes are checked, or other logic
});


text:
Q: Creating map/plan header, which is editable by field list using ArcGIS Pro I am using ArcGIS Pro 2.9.
I'd like to create a plan header on my plan layout with common information. Here a rough example:

But now, I don't want to edit the single informations directly in the plan header, rather more I'd like to edit them by a separate 'field list' (I'm not sure whether this is the perfect term) as a part of the object properties of the plan header or in a comparable manner. I know this approach from VectorWorks. There, it's possible to design a plan header with textfields that are editable in the plan header's object properties by accordingly assigned entries. In the end, I just have to open the plan header's properties dialog, there I find an according list of Information fields and editable values as shown below. (This is first a very quick method of editing the whole plan header, which secondly helps to avoid mistakes, especially with omitting entries, as you can move systematically from the top entry down, instead of switching 'wildly' from field to field across the header)
| Field        | Value        |
| Projekt:     | Mega-Project |
| Sub-projekt: | MP Part 1    |
| Builder:     | Mr. XXX      |
| Architect:   | Mr. YYY      |
| Date:        | xx.xx.xxxx   |
and so on.
If I change any value in the field list, it will change accordingly in the actual plan header.
The depicted approach I would like to use in ArcGIS Pro.
I looked up for instructions in the ArcGIS Pro manual, but I couldn't find any useful hints.
If editing by field lists is possible, where can I find relevant ArcGIS Pro documentation , or can you explain to me how to proceed?


text:
Q: How to use .whereEqualTo and use .startAt on it in Firestore query? I'm trying to query the documents where the field "lStatus" is equal to active and orderBy the documents, I'm using it for my search bar, here's my code. Thank You!
@Override
public void onTextChanged(final CharSequence s, int start, int before, int count) {
    if(count == 0){
        choose(mFirestore.collection("Listing"));
        onStart();
    }
    else{
        choose(mFirestore.collection("Listing").whereEqualTo("lStatus","Active").orderBy("lMHeadings").startAt(s.toString()).endAt(s.toString() + "\uf8ff"));
        onStart();
        Log.d("tag", "Text: " + s.toString());

    }

it doesn't show any Output.


text:
Q: Syntax to reference a file which is in the same folder as the file you are currently working on Q. Using relative referencing, what syntax would you use to reference a file called image.gif
which is in the same folder (named pass2) as the file you are currently working on?
A.

B.

C.

D.

I will select option A because I am working on the same folder. So, no need to change the folders from the root. But there is no answers so can't verify this.

A: if the image is in the same folder  , then you can use below

From MDN :

To link to a target file in the same directory as the invoking HTML file, just use the filename, e.g. my-image.jpg.
To reference a file in a subdirectory, write the directory name in front of the path, plus a forward slash, e.g. subdirectory/my-image.jpg.
To link to a target file in the directory above the invoking HTML file, write two dots. So for example, if index.html was inside a subfolder of test-site and my-image.jpg was inside test-site, you could reference my-image.jpg from index.html using ../my-image.jpg.
You can combine these as much as you like, for example ../subdirectory/another-subdirectory/my-image.jpg.

For More


text:
Q: Json Web Token, Axios 401-Unauthorized, Django, Vue.js Every time i do a GET request to API from FrontEnd or POSTMAN to secured (isAuthenticated) content, i get 401 error(Unauthorized).
I have two servers:

1.Django, django-rest-framework, with Json Web Token.(API)
  2.Vue.js

api endpoints:
Registration (AllowAny):  http://holykrava.hopto.org:8002/user-api/register/
Login (AllowAny): http://holykrava.hopto.org:8002/user-api/get-token/
List of Users (IsAuthenticated): http://holykrava.hopto.org:8002/user-api/user-list/

Vue-Part
<script>
//import {HTTP} from './http-common';
import axios from 'axios'
export default {
  created() {
    //let tokenOld = localStorage.getItem('token')
    let token = this.$store.state.token
    axios.get(
    'http://holykrava.hopto.org:8002/user-api/user-list/',
    {headers: {
        authorization: token
      }}
    )
    .then(response => {
        console.log(response);
    })
    .catch(error => {
        console.log(error);
    })
  }
}
</script>

Chrome Dev Tool (Network-Logs)
General-Headers:

Request URL: http://holykrava.hopto.org:8002/user-api/user-list/
Request Method: GET
Status Code: 401 Unauthorized
Remote Address: 188.190.62.145:8002
Referrer Policy: no-referrer-when-downgrade

Request-Headers:

Provisional headers are shown
Accept: application/json, text/plain, */*
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VybmFtZSI6Im11dGFwdXRhIiwiZXhwIjoxNTMxODUxODg0LCJlbWFpbCI6IiIsIm9yaWdfaWF0IjoxNTMxNzY1NDg0fQ.LGji_eCDVIvGpQ9xDEO2QAISEEW9FpHVcwRl6Oz9cCM
Origin: http://localhost:8080
Referer: http://localhost:8080/?

Response-Headers:

Access-Control-Allow-Origin: *
Allow: GET, HEAD, OPTIONS
Content-Length: 58
Content-Type: application/json
Date: Mon, 16 Jul 2018 19:34:45 GMT
Server: WSGIServer/0.2 CPython/3.6.4
Vary: Accept
WWW-Authenticate: JWT realm="api"
X-Frame-Options: SAMEORIGIN

IT Works in Terminal like this:
get token:
curl -X POST -d "username=userusername&password=userpassword" http://holykrava.hopto.org:8002/user-api/get-token/

pass token:
curl -H "Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0MCwidXNlcm5hbWUiOiJ1c2VydXNlcm5hbWUiLCJleHAiOjE1MzE4NDAxNTAsImVtYWlsIjoiIiwib3JpZ19pYXQiOjE1MzE3NTM3NTB9.SoITxagpmbviEFl_Iy086Jy0KgAUNV0WW-a3wMM_Fos" http://holykrava.hopto.org:8002/user-api/user-list/

corsheaders.middleware.CorsMiddleware, installed
CORS_ORIGIN_ALLOW_ALL = True

Default Authintication Class:
'rest_framework_jwt.authentication.JSONWebTokenAuthentication'

i spend two days trying to figure out whats wrong, but failed
looking for some1 who can help! thanks.


text:
Q: jmeter for capturing system generated dynamic values I am using JMeter for a real estate application when I am selecting a plot it is generating a dynamic value like this 1305003402565. It is incrementing like this 1305003280751 per request to request I need to capture this value and I am not able to find it in the source code.

A: You may be able to force your application to show the dynamic value in the source code by requesting the page as a GET (instead of POST).  Then, using Tree View, copy the source into your favorite regular expression extractor to write your regex to extract the value.


text:
Q: ¿Como confirmar antes de eliminar un registro con PHP y AlertifyJS? Tengo una duda con la confirmación antes de eliminar un registro de mi Base de datos, para esto estoy utilizando PHP y la librería de AlertifyJS, en mi estructura HTML tengo un enlace mediante el cual envío por método GET el id de la persona a eliminar, en este mismo enlace tengo una clase llamada elimina la cual utilizo en JQuery para disparar la función que contiene el alertify.confirm, cabe mencionar que si me elimina a la persona pero el problema es que me manda la confirmación pero no me deja decidir si quiero o no eliminar al usuario.
<a href="becarios.php?becarioid=<?php echo $registro['id_becario'];?>" class="enlace-table elimina" data-toggle="tooltip" data-placement="bottom" title="Eliminar Becario" alt="Eliminar Becario">

código JQuery
$(document).ready(function()
{

   $('.elimina').on('click', function() {
       validaBaja();
   });
});
 function validaBaja() {
       alertify.confirm("Deseas eliminar al usuario",
            function(){
               alertify.success('Eliminado');
       },
       function(){
           alertify.error('Cancelado');
       }
      );
}

Código PHP
$delBecario = verificaId($_GET['becarioid']);

if (!empty($delBecario))
{
   $sql_del_becario = "DELETE FROM becarios WHERE id_becario='$delBecario'";
   $elimina = eliminaRegistro($sql_del_becario, $conecta);
   if ($elimina !== false)
   {
      header('Location:becarios.php');
   }
}

Saludos.

A: Saludos te dejo el codigo:

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.1/build/css/alertify.min.css"/>
<form action="" onsubmit="return false" name="miFormulario">
<input type="text">
<input type="submit" value="Grabar Datos">
</form>

Explicacion, dentro del form:
<form action="" onsubmit="return false" name="miFormulario">

detengo el submit para controlarlo por javascript, adicional se asigna un name al form que sirva para una vez confirmada la accion envio el form o hago el submit.
//submit
document.miFormulario.submit();

con ese codigo lo que hago una vez confirmada la accion del alert envio el form o forzo el submit.
'Confirm Title', 'Confirm Message',

esa parte sirve para poner el titulo del alert y tu mensaje:

Espero te sirva, te dejo el link de la documentacion oficial para mayor informacion.
Documentacion-Confirm

A: Primero, no deberías eliminar un registro mediante un GET, usaría un POST (o un DELETE si es una Api REST). Luego, utilizaría una función en JS que elimine el registro mediante Ajax.
Crearía un botón que tenga un atributo data con el id a eliminar.
<button type="button" class="elimina" data-becarioId="<?php echo $registro['id_becario']; ?>">Eliminar</button>

Luego el JS, en el evento click, obtenes el id que está asociado al botón mediante el atributo data. Lo pasas por parámetro a la función que elimina.
$(document).ready(function() {

  $('.elimina').on('click', function() {
    var id = $(this).data('becarioId');
    eliminar(id);
  });

  var eliminar = function(id) {
    alertify.confirm("Deseas eliminar al usuario", function() {

      // confirma eliminar
      $.post('tu_url_para_eliminar.php', { becarioId: id }, function(data) {
        // se eliminó correctamente
        alertify.success('Usuario eliminado');
      }).fail(function() {
        // ocurrió un error
        alertify.error('Error al eliminar usuario');
      });

    });
  }

});

Método $.post()
Método $.ajax() (versión completa de $.post() o $.get())


text:
Q: Need help to make link active with change background-position onClick I can't figure out how to make my image links change background-position onClick on ACTIVE.  Nothing works:
    .active {
    background-position-y: -96px 0px;
    }

A: A simple typo in your CSS perhaps?
.active {
    background-position: -96px 0px;
}

background-position-y doesn't take two arguments.


text:
Q: how to map column names with new dataframe and replace it with new values I have a csv file as below
df1:-
1  2  6  4
u  f  b  h
a  f  r  m
q  r  b  c

now I have another csv file as below
df2:-
cat dog fish sand  vent wear
1   2    3    4      5   6

now I want to write a python code which should map column name with 2nd csv and replace the value and I have total 1900 columns in df2 which i need to map.
output csv
   cat dog   wear  sand
    u   f    b     h
    a   f    r     m
    q   r    b     c

can any one help me with this

A: You can use a dictionary to map df2 with df.rename()
#Convert df2 to dict and switch the string representations of the values with the keys
dct={str(v[0]):k for k,v in df2.to_dict(orient='list').items()}

df1.rename(mapper=dct, axis=1, inplace=True)

    cat dog wear    sand
0   u   f   b       h
1   a   f   r       m
2   q   r   b       c

df1.rename(mapper={str(v[0]):k for k,v in df2.to_dict(orient='list').items()}, axis=1, inplace=True)


text:
Q: Can't use data from JSON files for datetime So I have been trying to make a program that can display a countdown clock to a GUI. It requests a JSON file from a website and then uses that data- getting the JSON file and it's data is working for other parts of my program except using the data inside datetime.
import time
import requests
import json
import datetime as dt

response = requests.get("https://website.website/mission.json")
data = json.loads(response.text)

a = dt.datetime(data['launch'])
b = dt.datetime.now()

print("T- " + time.strftime("%H:%M:%S", time.gmtime(round((a-b).total_seconds()))))

JSON file:
{
  "mission": "GlobeSat2",
  "launch": "2020,9,13,19,00,00",
  "status": "Go"
}

When I use a = dt.datetime(data['launch']) it gives an error of TypeError: an integer is required (got type str) but when I use a = dt.datetime(2020,9,13,19,00,00) there is no error.
The value  is the same as if I put it in myself
>print(data['launch'])
>2020,9,13,19,00,00

What I've tried:
I changed the value of the JSON file to "launch": "20200913120000" and gave an error of OverflowError: Python int too large to convert to C long.
I tried to do int(data['launch']) which obviously didn't work.

A: If your problem is to change that date to datetime format you can easily use this one line of code to do that
a=dt.datetime(*([int(i) for i in data['launch'].split(",")]))

then a will get converted into datetime.

A: Beginning programmers often make similar mistakes to yours here, confusing print statements with return values and confusing string representations of values with the actual value.
Remember that standard in and out, or the console are just a text-based user interface. They feel technical and close to the language, but they are still just a user interface.
If you run this script:
x = 123
print(123)

Or you do the same thing on the Python CLI:
>>> x = 123
>>> x
123

You might thing Python showed you the value of the x variable of type int, 123. But 123 is just the text representation of that value. There's many ways you could represent 123, for example 0b1111011 or 0x7B - all valid string representations of the exact same integer number.
Your problem is similar, in that you expect these two things to be the same:
a = dt.datetime(2020,9,13,19,00,00)

parameter = '2020,9,13,19,00,00'
b = dt.datetime(parameters)

But in the case of assigning to a, you call .datetime() with 6 integer values, while in the case of assigning to b, you call .datetime() with a single string value. The fact that the string looks very similar when printed to how you would normally write those 6 integer values in code really means nothing to Python. Note the 'when printed' vs. 'in code'.
You can have Python interpret a string to obtain the values you know it represents, but you'll have to tell it how (there's many approaches).
For example:
a = dt.datetime(*[int(part) for part in data['launch'].split(',')])

This takes the string value of data['launch'], splits it over the ',' into 6 strings in a list (['2020','9','13','19','00','00']) and then turns each part of that list into an integer with the int() function, which can turn a string that represents a single integer into its int value. The resulting list is then spread over the parameters using the * operator on the list.
There's many different approaches, but of course you could also consider fixing the JSON if you wrote the server that returned the value:
{
  "mission": "GlobeSat2",
  "launch": [2020,9,13,19,0,0],
  "status": "Go"
}

By replacing the "" with [], JSON now represents the value of "launch" as a list and when read by Python, it will be read as a list of integers.
If that was your JSON, this would be your code:
a = dt.datetime(*data['launch'])

Still using the * to spread it over the parameters of the function, but everything else would be done automatically when interpreting the JSON.


text:
Q: Add a landscape page to a pivot view I'm trying to add one landscape page to my pivot view.
The rest of the pages are portrait pages.
How can I achieve this?
This is a sample of what I want
<phone:PhoneApplicationPage
    x:Class="BitcoinTicker.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">

        <!--Pivot Control-->
        <phone:Pivot Title="App title">

            <!--Pivot item one-->
            <phone:PivotItem Header="First">
                <!-- Portrait page -->
            </phone:PivotItem>

            <!--Pivot item two-->
            <phone:PivotItem Header="Second">
                <!-- Landscape page -->
            </phone:PivotItem>

        <!--Pivot item three -->
            <phone:PivotItem Header="Third">
                <!-- Portrait page -->
            </phone:PivotItem>
        </phone:Pivot>

    </Grid>
</phone:PhoneApplicationPage>

Cheers

A: You should probably use a panorama and follow certain Windows Phone Design Guidelines. Details explained here: http://msdn.microsoft.com/library/windows/apps/hh202912(v=vs.105).aspx


text:
Q: C pointers - Point to the same address #include <stdio.h>
#include <stdlib.h>

void foo(int *a, int *b);

void foo(int *a, int *b) {
    *a = 5;
    *b = 6;
    a = b;
}

int main(void) {
    int a, b;
    foo(&a, &b);
    printf("%d, %d", a, b);
    return 0;
}

Why a = b (foo) doesn't work? printf outputs "5, 6"
Thank you.

A: The call to foo() ends with its local variables pointing to the same addres, the one of stored in b. This change is not reflected in main(), the caller.
I you liked to actually do this and make this change pemanent, then you would have to pass a pointer to a pointer to foo() (so you can change them), instead of their simple values:
void foo(int **a, int **b) {
    **a = 5;
    **b = 6;
    *a = *b;
}

I have just observed that your code is incompatible with that modification, anyway, since you cannot change two normal variables to point to each other. You'd have to also modify main() this way:
int main(void) {
    int a, b;
    int * ptrA = &a;
    int * ptrB = &b;

    foo(&ptrA, &ptrB);
    printf("%d, %d (%d, %d)", *ptrA, *ptrB, a, b);
    return 0;
}

A: Using a pseudo-memory map,
In main(),
    a      b
 --------------
|  5   |   6   | <- data
 --------------
 [1000]  [1004]  <- address

In the function foo(),
    a        b      ( local to foo(), different from the a & b in main() )
 ----------------
|  1000  | 1004  | <- data
 ----------------
  [2000]   [2004]  <- address

So, when in foo()'s scope,
*a = 5;   // store 5 in int variable a
*b = 6;   // store 6 in int variable b
 a = b;   // copies contents of pointer variable b to a

So the final map in foo()'s scope is:
    a        b
 ----------------
|  1004  | 1004  | <- data
 ----------------
  [2000]   [2004]  <- address

A: It does work; it just doesn't do what you think it does.
In foo(), a = b changes the pointer a to point to whatever b points to.  It has no effect on anything outside of the function; it only changes the pointers.
If you want to change the value of the int pointed to by a to be the same as the value of the int pointed to by b, you need to use *a = *b, similar to how you do the assignments in the function already.

A: In foo, a and b are separate local variables. Setting them to have the same value has no effect on the previous values - the last line of foo currently does nothing, basically.
Within foo, a is initially a pointer to the same location as a in main, and b is a pointer to the same location as b in main. The last line just makes the value of a in foo the same as b - namely a pointer to the same location as b in main. So if you add a line
*a = 7;

at the end of foo, then you'd see output of "5, 7".
(Your code would definitely be easier to talk about if you used different variable names in main and foo, by the way.)
If you're trying to make a and b within main "aliased" to each other, you're not going to be successful. They're separate local variables on the stack, and will remain so. You can't make the stack "shrink" to alias the two, whatever you do.

A: I'm not sure what you're going after... if it's to get a and b to contain the same value, try *a = *b.

A: Because when foo is called, the values of the pointers are copied  into the function. If you want to change the values of the pointers themselves, you need to pass a pointer to a pointer into the function.

A: a and b are local to the function foo (they are on the stack), when program returns from the function data on the stack is lost. when you assign b to a, you are only modifying memory addresses on the stack, not their values.


text:
Q: Why does this program result in an InputMismatchException? private static int[] loadMarks(String fileName) throws IOException {

    int[] marks = new int[94];
    /* complete */
    Scanner input = new Scanner(fileName);
    for(int i=0;i<94;i++) {
        marks[i]=input.nextInt();
    }
    return marks;
}

A: Scanner input = new Scanner(new File(fileName));

Try this, if your goal is to parse the contents of the file and not the actual string fileName


text:
Q: MySQL Error 1055 even though strict mode is disabled Even though strict mode is disabled I am still getting ERROR 1055 when running a stored procedure
On Ubuntu 19.04 with MySQL 5.7.26, I've tried every combination of options for sql-mode in my.cnf and set global that makes any sense. Including just sql-mode = '', but it still acts as though strict mode is on.
mysql> SHOW VARIABLES LIKE 'sql_mode';
| Variable_name | Value
| sql_mode      | IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Or even with sql-mode empty
mysql> SHOW VARIABLES LIKE 'sql_mode';
| Variable_name | Value |
| sql_mode      |       |

I get the error that  only_full_group_by is still on...
mysql> CALL getReadyToInvoiceOrders(480,-1,-1,'','','','','','');
ERROR 1055 (42000): Expression #14 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'axistms_transport_local.BPBCR.currentAwardedID' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

You can see "STRICT_TRANS_TABLES" and "ONLY_FULL_GROUP_BY" have been removed, but still the ERROR 1055 persists

A: Remove the clause ONLY_FULL_GROUP_BY :
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

The default settings are ONLY_FULL_GROUP_BY, NO_AUTO_CREATE_USER, STRICT_TRANS_TABLES, NO_ENGINE_SUBSTITUTION for sql_mode in version 5.7 MySQL


text:
Q: How can I change parent control's content though child control event? I have three user controls. ControlC is parent of ControlB, ControlB is parent of ControlA.Now I wan to use a ControlA's event to change ControlC's content(let's say change ControlC's content to ControlD). I can do this if there are only 2 Controls, I don't know to do it with 3 Controls. Any idea with it?
For 2 controls solution is:
        private void ChangeParentContent()
    {
        UserControlB userControlB = (UserControlB)this.Parent;
        userControlB.Content = new userControlC();
    }

A: EDIT
After re-reading your question a couple of times, I think I better understand what you're going for.  @Servy is correct, you should not modify the parent from the child.  Instead, create events that the parents can subscribe to.  When the event is fired you can handle the event in the parent.  My original answer (below) provides for a couple of paths you could use to achieve this.
ORIGINAL
A couple of ideas:

*

*ControlB could subscribe to the ControlA event.  ControlB then fires its own event, to which ControlC is subscribed.

*Change the Modifier of ControlA to public so that you can access it directly from ControlC (ControlB.ControlA.Event += ...)


text:
Q: PHP inconsistently generates a 500 server error when looping through an array I was using the following code to retrieve HTML snippets from a database table and display them. It worked fine on my old web host, but after moving to a new web host I started getting (rather unhelpful) 500 Internal Server errors. Both hosts use PHP 5.2.x.
$query = "SELECT id, html FROM $tableName ORDER BY id DESC LIMIT 0, 300";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
    $myArray[] = $row;
}

foreach($myArray as $m) {
    echo $m['html'];
}

By selectively commenting out code, I narrowed the problem down to the foreach loop. I eventually found that I could get the page to display (with no 500 error) if I chopped off some of the items (see $offset below). Sometimes I have to use an offset of 50, sometimes 100 or more.
$counter = 0;
$offset = 100;
$limit = count($myArray) - $offset;
while ($counter < $limit) {
    echo $myArray[$counter]['html'];
    ++$counter;
}

This made me think there was something wrong with the individual HTML snippets. So I adjusted the offset one by one until I found the offending row (i.e., $offset=23 worked, but $offset=22 doesn't, therefore row #23 is the culprit). I looked at that row's HTML and it is perfectly fine. Not only that, but earlier in the day my script had even displayed that particular HTML snippet with no issues (this table periodically has new HTML inserted, and I'm just viewing the most recent 300 of them).
I also tried adding some basic checks before echo-ing, but it had no effect:
while ($counter < $limit) {
    if ($myArray[$counter]['html'] != false && !empty($myArray[$counter]['html'])) {
        echo $myArray[$counter]['html'];
    }
    ++$counter;
}

Any ideas why echo and/or the loop is failing? How can I see useful errors instead of a 500 server error? I have PHP display_errors turned on and I can see errors from other parts of the script when I intentionally force them (both on the page and in the error log file).
Update: Apache access log
Okay, I went to it first and manually set '$offset' to 200 (see the parameter ?o=1 in the URL) which I knew would let the page display properly. The result:
my.ip.add.ress - p [18/Jun/2010:13:27:36 -0400] "GET /test2/index.php HTTP/1.1" 200 602778 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)"
my.ip.add.ress - p [18/Jun/2010:13:27:47 -0400] "GET /test2/index.php?o=200 HTTP/1.1" 200 418127 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)"

Then I forced $offset to 1 (which would generate the 500 error) and I got this:
my.ip.add.ress - - [18/Jun/2010:13:31:06 -0400] "GET /test2/index.php?o=1 HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)"
my.ip.add.ress - p [18/Jun/2010:13:30:59 -0400] "GET /test2/index.php HTTP/1.1" 200 602731 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)"

It says 404, however the page being displayed in the browser says two things: the <title> is 500 Internal Server error, and the page body repeats this but then also mentions the 404 because it couldn't find the 500 error HTML page (which I haven't set up yet).

A: (Sorry, ideally this would have been just been a comment, sans-speculation, if I was able to post one)
I notice based on your access log that your script's output is fairly large (602778 bytes formed from what I believe is only 200 of your original 300 records), and after performing a quick test for myself, the script could potentially consume several megabytes of memory when it gets called. That's certainly nothing outrageous, but if your new host is super-stringy about their setting of memory_limit in php.ini, exceeding this value would raise E_FATAL in PHP, which could in turn generate the internal server error.
Admittedly, this scenario seems very unlikely to me, but it would explain why the problem manifested when you changed to a new host and why it 'magically' appeared after working fine earlier, provided the so-called problem HTML came from a slightly smaller result set when you viewed it before.
In any case, imaginative guessing on my part aside, you should have access to your php_error.log file, which would show if PHP was causing any sort of fatal error, and that would help debug your problem further.


text:
Q: MKMapItem.openInMaps() displays place mark exactly 50% of the time I've found that running some code to display a location in maps view MKMapItem.openInMaps() only works exactly 50% of the time.
In fact it precisely alternates between the MKPlacemark being displayed and it not being displayed.
For example every 1st, 3rd, 5th, 7th ...nth time the code runs then it displays the place mark, but every 2nd, 4th, 6th, 8th ...mth time it runs, the place mark is not displayed.
This is 100% reproducible running the code posted below.
This seems like its a bug, but if so then I'm surprised its not been reported nor fixed previously. But given the fact the failures are precisely alternating between success and failure leads me to think there's something else going on, hence I'm posting here to see if anybody is familiar with this issue or there is something one is supposed to do which is missing from the code, or there is a workaround:
override func viewDidAppear(_ animated: Bool) {
    displayMap()
}

func displayMap()
{
    let geoCoder = CLGeocoder()
    geoCoder.geocodeAddressString("1 Infinite Loop, Cupertino,California") { (placemark: [CLPlacemark]?, error: Error?) -> Void in
        if error == nil
        {
            if let placemark = placemark, placemark.count > 0
            {
                let location            = placemark.first
                let latitude            = (location?.location?.coordinate.latitude)!
                let longitude           = (location?.location?.coordinate.longitude)!
                let coordinates         = CLLocationCoordinate2DMake(latitude, longitude)

                let regionDistance:CLLocationDistance = 100000
                let regionSpan = MKCoordinateRegionMakeWithDistance(coordinates, regionDistance, regionDistance)

                let options = [
                    MKLaunchOptionsMapCenterKey: NSValue(mkCoordinate: regionSpan.center),
                    MKLaunchOptionsMapSpanKey: NSValue(mkCoordinateSpan: regionSpan.span)
                ]
                let placemark = MKPlacemark(coordinate: coordinates, addressDictionary: nil)
                let mapItem = MKMapItem(placemark: placemark)

                mapItem.name = "Apple"
                mapItem.phoneNumber = "(405) 123-4567"
                mapItem.openInMaps(launchOptions: options)
            }
        }
        else
        {
            assert(false, "Unable to geocode")
        }
    }
}

This is what the result looks like when the code is run for the first, third, fifth, seventh ... time

And this is the result when the code is run for the second, fourth, sixth, eighth... time

Notice in the failure screenshot that not only is the place mark not displayed on the map but the slide up is also empty.
(Currently observing this on 10.2 but have seen it on other versions too)

A: Disclaimer
Yes, there seem to be a bug in mapItem.openInMaps, which opens driving directions as an overlay.
As accurately described by @return0:

...I tried your code and the problem lies in the fact that once you have the location centered and showing, if you don't dismiss it and launch the app again it will not show...

More Oddities

*

*The second time around, mapItem.openInMaps does dismiss the driving directions overlay (instead showing the new location)

*If the user closes said overlay, Map is no longer confused (*)
(*) A further oddity to that situation is that once that overlay is closed, the location disappears.
Bug? → Workaround!
Force the directions overlay to go away by requesting more than one location. In practice, it means invoking Maps with twice the same location:
MKMapItem.openMaps(with: [mapItem, mapItem], launchOptions: options)

Workaround bonus
Even if the user taps on the anchor and requests driving direction, subsequent invocation to Maps from your application to that or a different location will not leave it hanging. In other words, it works as expected.

Complete Swift 3 Source Code
func displayMap(_ address:String, name:String, tph:String)
{
    let geoCoder = CLGeocoder()
    geoCoder.geocodeAddressString(address) { (placemark: [CLPlacemark]?, error: Error?) -> Void in
        assert(nil == error,  "Unable to geocode \(error)")
        if error == nil
        {
            if let placemark = placemark, placemark.count > 0
            {
                let location            = placemark.first
                let latitude            = (location?.location?.coordinate.latitude)!
                let longitude           = (location?.location?.coordinate.longitude)!
                let coordinates         = CLLocationCoordinate2DMake(latitude, longitude)

                let regionDistance:CLLocationDistance = 10000
                let regionSpan = MKCoordinateRegionMakeWithDistance(coordinates, regionDistance, regionDistance)

                let options = [
                    MKLaunchOptionsMapCenterKey: NSValue(mkCoordinate: regionSpan.center),
                    MKLaunchOptionsMapSpanKey: NSValue(mkCoordinateSpan: regionSpan.span)
                ]
                let placemark = MKPlacemark(coordinate: coordinates, addressDictionary: nil)
                let mapItem = MKMapItem(placemark: placemark)

                mapItem.name = name
                mapItem.phoneNumber = tph
                MKMapItem.openMaps(with: [mapItem, mapItem], launchOptions: options)
            } else {
                print("Something wrong with \(placemark)")
            }
        }
    }
}

...and invocation
@IBAction func doApple() {
    displayMap("1 Infinite Loop, Cupertino, California", name: "Apple", tph: "(408) 996–1010")
}

@IBAction func doMicrosoft() {
    displayMap("One Microsoft Way, Redmond, WA", name: "Microsoft", tph: "1-800-MICROSOFT")
}

@IBAction func doIBM() {
    displayMap("1 New Orchard Road. Armonk, New York", name: "IBM", tph: "(914) 499-1900")
}

A: On iOS 10.3.2 this issue still persists for me. However, this workaround is making mapItem not to disappear:
MKMapItem.openMaps(with: [mapItem], launchOptions: options)


text:
Q: How to create objects with multiple relationships in BootStrap.groovy init I want to generate some dummy content that i can test with in BootStrap.groovy, but I'm struggling to get it to work when I have more than one relationship.
I have 3 domain classes: User, Book and Author
A user has many books.
An author has many books.
I have it set up like the following:
class User {
    static hasMany = [books:Book]
}
class Author {
    static hasMany = [books:Book]
}
class Book {
    static belongsTo = [author:Author, user:User]
}

I want BootStrap.groovy to create and save a few books but i cant get it to work. Heres what I have:
def init = { servletContext ->
    def u1 = new User(login:"mrx", password:"p", name:"Mr X")
    def u2 = new User(login:"mry", password:"p", name:"Mr Y")

    def a1 = new Author(name:"Mary Shelley")
    def a2 = new Author(name:"Stephen King")

    def b1 = new Book(title:"Frankenstein")
    def b2 = new Book(title:"The Shining")
    def b3 = new Book(title:"Misery")

    a1.addToBooks(b1)
    a2.addToBooks(b2)
    a2.addToBooks(b3)

    u1.addToBooks(b1)
    u1.addToBooks(b3)
    u2.addToBooks(b2)

    a1.save()
    a2.save()

    u1.save()
    u2.save()
}

When i view Book/index (which is the scaffold and should just display a list of all books) I dont get any errors, but no books appear in the list. What am I doing wrong?

A: It seems you don't have Book instance to add.  I usually just create instances with the references instead of using addTo method. E.g.
new Book(author:a1, user:u1, title:'Test', isbn:'test').save()

The relationship will be there later after the BootStrap


text:
Q: Django form fields as template variables The main question is if it is possible to specifify specific form fields at different given locations in your html template in any smooth way. e.g. {{ form.password }} However, that does not seem to work. (I swear that I have seen this somewhere, but I just can't find it anymore on the internet)
My view for signing up new users is inheriting from UserCreationForm and looks kind of like this:
views.py
def signup(request):
if request.method == "POST":
    form = UserCreationForm(request.POST)
    if form.is_valid():
        form.save()
        username = form.cleaned_data.get('username')
        raw_password = form.cleaned_data.get('password1')
        user = authenticate(username=username, password=raw_password)
        login(request, user)
        return redirect('home')

else:
    form = UserCreationForm()
return render(request, 'core/authentication/registration_form.html', {'form': form})

It sends this form straight to the template registration_form.html, this is how I wish it worked:
<form class="form" method="POST" action="">

            {{ form.first_name }}

This is how it actually works (for now):
<form class="form" method="POST" action="">

            <input type="text" class="form-control" placeholder="First Name...">

This might be a stupid question, but oh well I am curious.
Thank you in advance

A: If i've understood your question correctly, here is how django says you should render django form fields manually.
{{ form.non_field_errors }}  # here django renders errors which do not belong to any field

    {{ form.field_1.errors }}  # here django renders errors which belong to field_1
    {{ form.field_1.label_tag }}  # label element
    {{ form.field_1 }}  # input element

# some html

    {{ form.field_2.errors }}
    {{ form.field_2.label_tag }}
    {{ form.field_2}}

You can read this here in the lower half.
Each field ( each label, input, error elements ) can be rendered with custom classes and widgets.


text:
Q: Copy offset range in for loop I have a script that loops through a list of ID numbers to check if there is a matching ID in another list, if there is a matching ID, it copies the email in the adjacent column and pastes it in another range. I am having trouble copying an offset range since it doesn't appear to be pasting any values. This script is not throwing any errors:
Sub tryThis()

Dim lookHere As Range, pasteHere As Range, cell As Range, searchList As Range

Set List1 = Range(Range("A1"), Range("A1").End(xlDown))
Set List2 = Range(Range("C1"), Range("C1").End(xlDown))

For Each cell In List1

    Set found = List2.Find(what:=cell, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)

    If Not found Is Nothing Then

        cell.Offset(, 1).Resize(, 1).Copy Destination:=Cells(Rows.Count, "G").End(xlUp)

    End If
Next cell

End Sub

A: This:
cell.Offset(, 1).Resize(, 1).Copy _
      Destination:=Cells(Rows.Count, "G").End(xlUp)

will copy the value into the same cell each run, since End(xlUp) takes you to the last occupied cell in the column, not the first empty cell.  You need to Offset() one down to the next empty position.  Also can do this with a direct value assignment:
Cells(Rows.Count, "G").End(xlUp).Offset(1, 0).Value = cell.Offset(0, 1).Value

Edit: if the cell you want to copy is from List 2 then:
Cells(Rows.Count, "G").End(xlUp).Offset(1, 0).Value = found.Offset(0, 1).Value


text:
Q: How access to app from controller/EJS? Express.js I want to access to app.routes from my controller or EJS view, but app var don't exists there.
Do you know how can I access to all the routes that I defined myself in config/routes.js?
Thank you.
PS: I'm using sails.js, based on express.js.

A: You can use request.app:
app.get('/foo', function (request, response, next) {
  console.log(request.app.routes);
  next();
});

A: Here is the final solution:
module.exports = {
    index: function (req, res) {
        return res.view({
            layout: 'layout',
            title: 'Trip Analyzer',
            routes: req.app.routes
        });
    }
};

EJS view in Javascript:
console.log(<%- JSON.stringify(routes) %>);

Thanks!


text:
Q: How to change font size of secondaryText only? I want to change the Menu title font size so I defined property in custom theme NavigationView but its also change the font size of headerLayout text . How can I change font size for menu title only ? I am beginner !

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <include
        layout="@layout/app_bar_main2"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:layout_marginLeft="-64dp"
        android:fitsSystemWindows="true"
        android:theme="@style/NavigationView"
        app:itemTextAppearance="@style/ItemFont"
        app:itemTextColor="@color/state_color"
        app:itemIconTint="@color/colorAccent"
        app:headerLayout="@layout/nav_header_main2"
        app:menu="@menu/activity_main2_drawer"
        >
        <include layout="@layout/nav_header_main2"/>
        </android.support.design.widget.NavigationView>

</android.support.v4.widget.DrawerLayout>

styles.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:itemBackground">@color/state_color</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="actionMenuTextColor">@color/white</item>
</style>
<!--Navigation Title font-->
<style name="NavigationView">
    <item name="android:textSize">10.5pt</item>
    <item name="android:textColorSecondary">@color/colorPrimary</item>
</style>
<!--Item font-->
<style name="ItemFont">
    <item name="android:textSize">7.5pt</item>
</style>

A: Replace the following line
android:theme="@style/NavigationView"
with

app:theme="@style/NavigationView"


text:
Q: FFMPEG how to Add timecode Track after Concatenation ffmpeg -i input1.mp4 -i input2.webm -i input3.mov \
-filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0][2:v:0] \
[2:a:0]concat=n=3:v=1:a=1[outv][outa]" \
-map "[outv]" -map "[outa]" output.mkv

How to add the Timecode track after concatenation.
    timecode : 09:59:59:10
ffmpeg -ss 00:00:00.000 -t 00:01:00.000 -i Input1.mp4 -ss 00:01:00.001 -t 00:01:00.000 -i Input2.mp4 -filter_complex "[0:v:0] [0:a:0] [1:v:0] [1:a:0] concat=n=2:v=1:a=1[v] [a]" -map "[v]" -c:v libx264 -aspect 4:3 -s 352:288 -coder 1 -profile:v main -level 3.1 -pix_fmt yuv420p -preset ultrafast -video_track_timescale 25 -g 12 -r 25 -bf 2 -refs 1 -x264-params "keyint_min=12:nal-hrd=cbr:b-pyramid=0" -b:v 2000k -minrate 2000k -maxrate 2000k  -map "[a]" -codec:a libfdk_aac -b:a 192k -vbr 4 -ac 2 -async 1 -timecode 09:59:59:10 -f mov 18785_V1.mov

Media Info:
Other
ID                                       : 3
Type                                     : Time code
Format                                   : QuickTime TC
Duration                                 : 2 min 0 s
Time code of first frame                 : 09:59:59:10
Time code, striped                       : Yes
Language                                 : English
Default                                  : No   >> how do I make it as default?
enter image description here

A: The timecode is written as a generic tag in Matroska, so
ffmpeg -i input1.mp4  ... -map "[outa]" -timecode 09:09:55:00 output.mkv

ffprobe and mediainfo will show this as part of global metadata.


text:
Q: If MSSQL Table Column is NULL, Change CSS Style Using JS using PHP If Statement is Not Working I am trying to use a PHP Query to get an image name from my MSSQL table column. The queried image name is put into an  tag. If the column is empty, it should set the empty column to the image noimageishereforgbmtrailerserviceltd999.png, which is a blank .png image and make the link unclickable. I am doing this to essentially hide the image from the user if there is no image set, so the user doesn't see a big X inside of where an image should be. The code currently changes the column to noimageishereforgbmtrailerserviceltd999.png correctly, but does not change the css styles of the link around it. Here is the PHP code I'm using:
$job_posname = "SELECT * FROM new_trailers1 WHERE orderid = '$sn'";
$query=mssql_query( $job_posname, $connection);
$array=mssql_fetch_assoc($query);

        $job_posname7=stripslashes($array['photo1']);

        if ($job_posname7['photo1']===NULL || ctype_space($job_posname7['photo1'])){
            $job_posname7 = "noimageishereforgbmtrailerserviceltd999.png";
            echo "";
            echo "";
        } else {
            $job_posname7=stripslashes($array['photo1']);
        }

    ?>

<a id="picca2" href="unitimages/<? echo $job_posname7; ?>" onclick="swap(this); return false;"><img id="pica2" src="unitimages/<? echo $job_posname7; ?>" width=50 height=50>

Thank you for any help. All help is appreciated.

A: Can't you default the noimageishereforgbmtrailerserviceltd999.png on all columns, and just change it if the image exists on the database? I am assuming you are generating the columns dynamically.
Or, just add a class on a PHP variable if the condition is set.
Make a .class in css and just call it depending on what you need.
For example
$job_posname = "SELECT * FROM new_trailers1 WHERE orderid = '$sn'";
$query=mssql_query( $job_posname, $connection);
$array=mssql_fetch_assoc($query);

    $job_posname7=stripslashes($array['photo1']);

    if ($job_posname7['photo1']===NULL || ctype_space($job_posname7['photo1'])){
        $job_posname7 = "noimageishereforgbmtrailerserviceltd999.png";
        echo "";
        echo "";
       $my_css_class_that_hides_image = "hide";
    } else {
        $job_posname7=stripslashes($array['photo1']);
    }

?>

<a id="picca2" href="unitimages/<? echo $job_posname7; ?>" class="<? echo $my_css_class_that_hides_image; ?>" onclick="swap(this); return false;"><img id="pica2" src="unitimages/<? echo $job_posname7; ?>" width=50 height=50>

... And define it on your style sheet:
.hide{
       /** Style here **/
 }


text:
Q: How to fix this sql to show only the last row instead of all that fulfill the query conditional? I use the following sql, to show the active users that browsed a website the last 5 minutes. The rows then are presented with the browsed page. However, if a user (hash) browses many pages in 5 minutes, all are displayed.
What I want to show is only the last page per user. How can I do this?
The limit 1 does not work because I want to show the last page for all active users. Not only 1 user.
SELECT behaviour.hash,
       behaviour.page
FROM   active
       inner join behaviour
               ON active.hash = behaviour.hash
WHERE  active.last_active >= Now() - interval 10 second
       AND behaviour.timestamp >= Now() - interval 5 minute
ORDER  BY behaviour.timestamp DESC

A: I think this will work for what you are doing:
SELECT b.hash, b.page
FROM active a join
     behaviour b
     ON a.hash = b.hash join
     (select b2.hash, max(timestamp) as maxts
      from behavior b2
      where timestamp >= Now() - interval 5 minute
      group by b2.hash
     ) bh
     ON bh.hash = b.hash and bh.maxts = b.timestamp
WHERE  a.last_active >= Now() - interval 10 second
ORDER BY b.timestamp DESC ;

It gets the maximum timestamp in a subquery and joins that back in.


text:
Q: Distribution of Azure Functions From the product development/ISV point of view, I wanted to understand if there is any recommended approach to create a Distributable package (installable) for Azure Functions. I found one post on TechNet but its very old (2017).
Also, is there any marketplace for Azure functions?
Thanks

A: The "Zip deployment for Azure Functions" option could be possibly useful and there are few more options mentioned under the "deploy" section of the documentation.
https://learn.microsoft.com/en-us/azure/azure-functions/deployment-zip-push
This looks similar to what I was referring to the marketplace:
https://serverlesslibrary.net/

A: Thank you Venkatesh, Posting your suggestion as an answer to help other community members.
the above suggested steps in the shared article are working fine by the distributing azure functions in our local environment with last version of visual code 2019 and the documented steps were working pretty fine and this should work for you as well.