text:
Q: Ruby on rails use devise display error on heroku I'm trying to deploy my app on Heroku, but there is an error.
I've tried to add require 'devise' in config/application.rb but it didn't work.
Link to the project on Github: https://github.com/qjpioneer/12in12-blog
Gemfile
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use sqlite3 as the database for Active Record

group :development do
  gem 'sqlite3'
end
group :production do
  gem 'pg'
  gem 'rails_12factor'
end
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platform: :mri
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console'
  gem 'listen', '~> 3.0.5'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'devise'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Error after git push heroku master
Counting objects: 73, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (69/69), done.
Writing objects: 100% (73/73), 518.43 KiB | 0 bytes/s, done.
Total 73 (delta 41), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
remote: -----> Installing dependencies using bundler 1.11.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Fetching gem metadata from https://rubygems.org/..........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Using concurrent-ruby 1.0.2
remote:        Using i18n 0.7.0
remote:        Using minitest 5.9.0
remote:        Using thread_safe 0.3.5
remote:        Using builder 3.2.2
remote:        Using erubis 2.7.0
remote:        Using mini_portile2 2.1.0
remote:        Using pkg-config 1.1.7
remote:        Using rack 2.0.1
remote:        Using nio4r 1.2.1
remote:        Using websocket-extensions 0.1.2
remote:        Using mime-types-data 3.2016.0521
remote:        Using arel 7.1.2
remote:        Using json 2.0.2
remote:        Using mimemagic 0.3.2
remote:        Using coffee-script-source 1.10.0
remote:        Using execjs 2.7.0
remote:        Using method_source 0.8.2
remote:        Using thor 0.19.1
remote:        Installing rake 11.3.0
remote:        Installing bcrypt 3.1.11 with native extensions
remote:        Using multi_json 1.12.1
remote:        Using subexec 0.2.3
remote:        Using pg 0.18.4
remote:        Using puma 3.6.0
remote:        Using bundler 1.11.2
remote:        Using rails_serve_static_assets 0.0.5
remote:        Using rails_stdout_logging 0.0.5
remote:        Using sass 3.4.22
remote:        Using tilt 2.0.5
remote:        Using turbolinks-source 5.0.0
remote:        Using tzinfo 1.2.2
remote:        Using nokogiri 1.6.8
remote:        Using websocket-driver 0.6.4
remote:        Using mime-types 3.1
remote:        Using rack-test 0.6.3
remote:        Installing orm_adapter 0.5.0
remote:        Using sprockets 3.7.0
remote:        Using coffee-script 2.4.1
remote:        Using uglifier 3.0.2
remote:        Using mini_magick 3.8.0
remote:        Using rails_12factor 0.0.3
remote:        Using turbolinks 5.0.1
remote:        Using activesupport 5.0.0.1
remote:        Using loofah 2.0.3
remote:        Using mail 2.6.4
remote:        Using rails-dom-testing 2.0.1
remote:        Using globalid 0.3.7
remote:        Using activemodel 5.0.0.1
remote:        Using jbuilder 2.6.0
remote:        Using rails-html-sanitizer 1.0.3
remote:        Using activejob 5.0.0.1
remote:        Using activerecord 5.0.0.1
remote:        Using carrierwave 0.11.2
remote:        Using actionview 5.0.0.1
remote:        Using actionpack 5.0.0.1
remote:        Using actioncable 5.0.0.1
remote:        Using actionmailer 5.0.0.1
remote:        Using railties 5.0.0.1
remote:        Using sprockets-rails 3.2.0
remote:        Using coffee-rails 4.2.1
remote:        Installing warden 1.2.6
remote:        Using jquery-rails 4.2.1
remote:        Using rails 5.0.0.1
remote:        Using sass-rails 5.0.6
remote:        Installing responders 2.3.0
remote:        Installing devise 4.2.0
remote:        Bundle complete! 21 Gemfile dependencies, 67 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (6.31s)
remote:        Cleaning up the bundler cache.
remote:        Removing rake (11.2.2)
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        Sass::SyntaxError: File to import not found or unreadable: bootstrap-sprockets.
remote:        (sass):17
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:67:in `rescue in import'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:45:in `import'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:28:in `imported_file'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:37:in `css_import?'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:313:in `visit_import
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `block in visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/stack.rb:79:in `block in with_base'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/stack.rb:115:in `with_frame'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/stack.rb:79:in `with_base'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `map'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `visit_children'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:169:in `block in visit_children'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:181:in `with_environment'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:168:in `visit_children'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `block in visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:188:in `visit_root'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:159:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:8:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/root_node.rb:36:in `css_tree'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/root_node.rb:20:in `render'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/engine.rb:281:in `render'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/sass_compressor.rb:48:in `call'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/sass_compressor.rb:28:in `call'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `yield'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:66:in `find_asset'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:142:in `block in find'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `each'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `stat_directory
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:227:in `stat_tree'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `each'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `each'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `logical_paths'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:140:in `find'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:185:in `compile'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/rake/sprocketstask.rb:147:in `with_logger'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
remote:        Sass::SyntaxError: File to import not found or unreadable: bootstrap-sprockets.
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:65:in `import'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:28:in `imported_file'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb:37:in `css_import?'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:313:in `visit_import
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `block in visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/stack.rb:79:in `block in with_base'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/stack.rb:115:in `with_frame'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/stack.rb:79:in `with_base'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `map'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:52:in `visit_children'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:169:in `block in visit_children'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:181:in `with_environment'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:168:in `visit_children'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `block in visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:188:in `visit_root'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:159:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:8:in `visit'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/root_node.rb:36:in `css_tree'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/tree/root_node.rb:20:in `render'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sass-3.4.22/lib/sass/engine.rb:281:in `render'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/sass_compressor.rb:48:in `call'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/sass_compressor.rb:28:in `call'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `yield'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:66:in `find_asset'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:142:in `block in find'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `each'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `stat_directory
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:227:in `stat_tree'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `each'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `each'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `logical_paths'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:140:in `find'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:185:in `compile'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/rake/sprocketstask.rb:147:in `with_logger'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote:        /tmp/build_e0078c6c5e92289f77b7a5fa93263a6a/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
remote:        Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to lit-cliffs-80047.
remote:
To https://git.heroku.com/lit-cliffs-80047.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/lit-cliffs-80047.git'

A: I don't see the gem bootstrap-sass in your gemfile. Put gem 'bootstrap-sass'in your gemfile and bundle. This should fix your problem.


text:
Q: SQL вставка только что отредактированных записей в таблицу Прошу вашей помощи в работе с триггерами.
Есть база данных, состоящая из двух таблиц: реестр и история изменений. Мне необходимо создать триггер, который при изменении записи в реестре добавлял бы эту же запись в таблицу истории. Триггер after update я написал, но он вставляет все содержащиеся в реестре записи, а не только измененную.
Возможно ли так написать триггер, чтобы при обновлении реестра в историю вставлялась только обновленная запись (может это делается через Where)? Заранее благодарю.
Вот текущий код, который вставляет все записи, а не только отредактированную:
ALTER TRIGGER [dbo].[ReestrTrigger]
   ON  [dbo].[Реестр]
   AFTER UPDATE
AS
BEGIN
    SET NOCOUNT ON;
    INSERT INTO dbo.История_записей (Дата_записи,Время_записи,Инв_номер,Статус) SELECT GETDATE(),CURRENT_TIMESTAMP,Инв_номер,Статус FROM dbo.Реестр;
END

A: В MS SQL предусмотрены две специальные временные таблицы, доступные только из триггеров: inserted и deleted
В триггерах на update таблица inserted содержит новые версии всех измененных строка, а deleted — старые.
В вашем случае код получается такой:
ALTER TRIGGER [dbo].[ReestrTrigger]
   ON  [dbo].[Реестр]
   AFTER UPDATE
AS
BEGIN
    SET NOCOUNT ON;
    INSERT INTO dbo.История_записей (Дата_записи,Время_записи,Инв_номер,Статус)
    SELECT GETDATE(),CURRENT_TIMESTAMP,Инв_номер,Статус
    FROM inserted;
END

A: Для этих целей лучше использовать темпоральные таблицы.
Тут можно посмотреть про них.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Deci and Centi Seconds parsing in java I have time stamp as string "2013-01-28 11:01:56.9". Here 56.9 seconds are mentioned.
.9 seconds = 900 milliseconds
we can say it's 9 deci-seconds or 90 centi-seconds
But in java...
String string = "2013-01-28 11:01:56.9";
String pattern = "yyyy-MM-dd hh:mm:ss.S";
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
Date date = formatter.parse(string);
System.out.println(date.getTime());

Output is : 1359388916009
Here 9 is parsed as 009 milliseconds because "S" (Capital-S) is used for milliseconds.
Similarly if .95 seconds are provided as and parsed with "SS" pattern, it gives "095" milliseconds instead of "950" milliseconds.

*

*Why java does not provide pattern to parse/format deci-seconds and centi-seconds to make things easier?

*What is the decent way to do so?

A: 1) Nobody knows why Java does not provide pattern to parse/format deci-seconds and centi-seconds. But I personally suspect, that though your case is very interesting, it is a very particular case of formatting.
It is hard to imagine such convenient formatting style, which will allow to distinguish case, when . symbol is delimiter between integer and float parts, and when it is just delimiter between date's parts.
2) About decent way. It seems to me, that this simple preprocessing should help you:
public static String preprocess(String date) {
    int pIndex = date.lastIndexOf(".") + 1;
    String millis = date.substring(pIndex);
    for (int i = millis.length(); i < 3; i++)
        millis += "0";
    return date.substring(0, pIndex) + millis;
}

UPD: It could be written more simple:
public static String preprocess(String date) {
    String millis = date.substring(date.lastIndexOf(".") + 1);
    for (int i = millis.length(); i < 3; i++)
        date += "0";
    return date;
}


text:
Q: SELECT statement not returning MAX number I'm having an issue with the SELECT statement in the following code (this is in my database helper class):
public Cursor selectMaxAreaNumber (long inspectionId) {
String inspectionIdString = String.valueOf(inspectionId);
String[] tableColumns = new String[] {
        AREA_NUMBER,
        "(SELECT max(" + AREA_NUMBER + ") FROM " + AREAS_TABLE + ") AS max"
    };
String whereClause = INSPECTION_LINK + " = ?";
String[] whereArgs = new String[] {
        inspectionIdString
    };
Cursor c = rmDb.query(AREAS_TABLE, tableColumns, whereClause, whereArgs,
        null, null, null);

if (c != null) {
    c.moveToFirst();
}
c.close();
return c;

}
I then call this in my activity as follows:
Cursor c = rmDbHelper.selectMaxAreaNumber(inspectionId);
    startManagingCursor(c);
    c.moveToFirst();
    nextAreaNumber = c.getInt(c.getColumnIndex("max")) + 1;

It is pulling the maximum number from the table, so it seems the WHERE statement is failing.  However, I can't see what the issue is.
As part of this question, can anyone confirm if I am doing the right thing by converting the ID into a String before it is used in the query and do I need to write c.moveToFirst() in both bits?
Many thanks in advance!

A: Try change
"(SELECT max(" + AREA_NUMBER + ") FROM " + AREAS_TABLE + ") AS max"
to
"SELECT max(" + AREA_NUMBER + ") AS max FROM " + AREAS_TABLE

A: Try this instead:
public Cursor selectMaxAreaNumber (long inspectionId) {
    String[] tableColumns = new String[] {
        "Max(" + AREA_NUMBER + ") AS max"
    };
    String whereClause = INSPECTION_LINK + " = ?";
    String[] whereArgs = new String[] {
        String.valueOf(inspectionId);
    };
    return rmDb.query(AREAS_TABLE, tableColumns, whereClause, whereArgs,
        null, null, null);
}

This will return a Cursor with the largest AREA_NUMBER that has the appropriate inspectionId.
A couple notes:

*

*When you use a function like Max() you only get one row as a result, there is no need to ask for AREA_NUMBERS and Max(AREA_NUMBERS)

*A Cursor might be empty, but it won't be null

*Don't close a Cursor before you have used it

So you don't need this:
if (c != null) {
    c.moveToFirst();
}
c.close();

Understand that if c somehow was null, you will still receive a NullPointerException on c.close()

(Optional) You could remove the whereArgs and just use:
String whereClause = INSPECTION_LINK + " = " + inspectionId;

(Only because inspectionId is long data type, you need a String to perform an injection attack.)

Finally you should check for an empty Cursor here:
Cursor c = rmDbHelper.selectMaxAreaNumber(inspectionId);
startManagingCursor(c);
if(c.moveToFirst())
    nextAreaNumber = c.getInt(c.getColumnIndex("max")) + 1;
else //empty Cursor, return a default value
    nextAreaNumber = 0;


text:
Q: Database validation for a user input text field in oracle UCM | WCC I'm new to Oracle WCC.
In Oracle WCC/UCM( Universal content management), I have one table named CreateStudent has 2 columns StudentID and StudentName.
One metadata custom field XXStudent_Info for which user will pass the value on Checkin page.
We need to validate the value of XXStudent_Info to database column StudentID, if it matches then checkin possible otherwise restrict on checkin itself.
How can i do this in WCC via out of the box functionality or will i have to create a custom service/query for this DB validation. Please give steps in detail

A: Is the custom metadata field XXStudent_Info based on an option list which uses a view which is based on the table? If so, you should be able to restrict it to only valid values.


text:
Q: Smarty get array from index number I am trying to do something like this:
{$order.delivery_country.options.labels[$order.delivery_country.value]}

So using the delivery_country.value I would like to return the option label. How could I do this in Smarty?
when I manually write {$order.delivery_country.options.labels.358} it works perfectly, although abviously this need to be dynamic and use the .value
[delivery_country] => Array
            (
                [name] => orders.order_delivery_country
                [value] => 358
                [label] => Delivery Country
                [message] =>
                [default] => 58
                [options] => Array
                    (
                        [name] => country-names
                        [labels] => Array
                            (
                                [0] => --- Select ---
                                [1] => Afghanistan
                                [2] => Aland Islands
                                [3] => Albania
                                [4] => Algeria
                                [5] => American Samoa
                                [6] => Andorra
                                [7] => Angola
                                [8] => Anguilla
                                [9] => Antarctica
                                [10] => Antigua and Barbuda
                                [11] => Argentina
                                [12] => Armenia
                                [13] => Aruba
                                [14] => Ascension Island
                                [15] => Australia
                                [16] => Austria
                                [17] => Azerbaijani
                                [18] => Azores
                                [19] => Azores
                                [20] => Azores
                                [21] => Bahamas
                                [22] => Bahrain
                                [23] => Bangladesh
                                [24] => Barbados
                                [25] => Belarus
                                [26] => Belgium
                                [27] => Belize
                                [28] => Benin
                                [29] => Bermuda
                                [30] => Bhutan
                                [31] => Bolivia
                                [32] => Bosnia and Herzegowina
                                [33] => Botswana
                                [34] => Bouvet Island
                                [35] => Brazil
                                [36] => Brunei Darussalam
                                [37] => Bulgaria
                                [38] => Burkina Faso
                                [39] => Burundi
                                [40] => Cambodia
                                [41] => Cameroon
                                [42] => Canada
                                [43] => Canada
                                [44] => Cape Verde
                                [45] => Cayman Islands
                                [46] => Central African Republic
                                [47] => Chad
                                [48] => Chile
                                [49] => China
                                [50] => Christmas Island
                                [51] => Cocos (Keeling) Islands
                                [52] => Colombia
                                [53] => Comoros
                                [54] => Congo, Democratic Republic of
                                [55] => Congo, People's Republic of
                                [56] => Cook Islands
                                [57] => Costa Rica
                                [58] => Cote d'Ivoire
                                [59] => Croatia
                                [60] => Cuba
                                [61] => Cyprus
                                [62] => Czech Republic
                                [63] => Denmark
                                [64] => Diego Garcia
                                [65] => Djibouti
                                [66] => Dominica
                                [67] => Dominican Republic
                                [68] => Dominican Republic
                                [69] => East Timor
                                [70] => Ecuador
                                [71] => Egypt
                                [72] => El Salvador
                                [73] => Equatorial Guinea
                                [74] => Eritrea
                                [75] => Estonia
                                [76] => Ethiopia
                                [77] => Falkland Islands
                                [78] => Faroe Islands
                                [79] => Fiji
                                [80] => Finland
                                [81] => France
                                [82] => French Guiana
                                [83] => French Polynesia
                                [84] => Gabon
                                [85] => Gambia
                                [86] => Georgia
                                [87] => Germany
                                [88] => Ghana
                                [89] => Gibraltar
                                [90] => Greece
                                [91] => Greenland
                                [92] => Grenada
                                [93] => Guadeloupe
                                [94] => Guam
                                [95] => Guatemala
                                [96] => Guinea
                                [97] => Guinea-Bissau
                                [98] => Guyana
                                [99] => Haiti
                                [100] => Heard and McDonald Islands
                                [101] => Holy See (Vatican City State)
                                [102] => Honduras
                                [103] => Hong Kong
                                [104] => Hungary
                                [105] => Iceland
                                [106] => India
                                [107] => Indonesia
                                [108] => Iran
                                [109] => Iraq
                                [110] => Ireland
                                [111] => Israel
                                [112] => Italy
                                [113] => Jamaica
                                [114] => Japan
                                [115] => Jordan
                                [116] => Kazakhstan
                                [117] => Kenya
                                [118] => Kiribati
                                [119] => Korea, Democratic People's Republic of
                                [120] => Korea, Republic of
                                [121] => Kuwait
                                [122] => Kyrgyzstan
                                [123] => Laos
                                [124] => Latvia
                                [125] => Lebanon
                                [126] => Lesotho
                                [127] => Liberia
                                [128] => Libya
                                [129] => Liechtenstein
                                [130] => Lithuania
                                [131] => Luxembourg

I would normally use this below in a booking create page, although I need only the country name on the booking confirm page.
<select id="delivery_country" name="{$order.delivery_country.formname}">
    {html_options values=$order.delivery_country.options.values output=$order.delivery_country.options.labels selected=$order.delivery_country.value}
</select>

Update with var_dump output showing types
["delivery_country"]=>
array(15) {
  ["name"]=>
  string(29) "orders.order_delivery_country"
  ["value"]=>
  string(3) "358"
  ["label"]=>
  string(16) "Delivery Country"
  ["input"]=>
  string(6) "select"
  ["message"]=>
  string(0) ""
  ["options"]=>
  array(3) {
    ["name"]=>
    string(13) "country-names"
    ["labels"]=>
    array(249) {
      [0]=>
      string(14) "--- Select ---"
      [1]=>
      string(11) "Afghanistan"
      [2]=>
      string(13) "Aland Islands"
      [3]=>
      string(7) "Albania"
      [4]=>
      string(7) "Algeria"
      [5]=>
      string(14) "American Samoa"
      [6]=>
      string(7) "Andorra"
      [7]=>
      string(6) "Angola"
      [8]=>
      string(8) "Anguilla"
      [9]=>
      string(10) "Antarctica"
      [10]=>
      string(19) "Antigua and Barbuda"
      [11]=>
      string(9) "Argentina"
      [12]=>
      string(7) "Armenia"
      [13]=>
      string(5) "Aruba"
      [14]=>
      string(16) "Ascension Island"
      [15]=>
      string(9) "Australia"
      [16]=>
      string(7) "Austria"
      [17]=>
      string(11) "Azerbaijani"
      [18]=>
      string(6) "Azores"
      [19]=>
      string(6) "Azores"
      [20]=>
      string(6) "Azores"
      [21]=>
      string(7) "Bahamas"
      [22]=>
      string(7) "Bahrain"
      [23]=>
      string(10) "Bangladesh"
      [24]=>
      string(8) "Barbados"
      [25]=>
      string(7) "Belarus"
      [26]=>
      string(7) "Belgium"
      [27]=>
      string(6) "Belize"
      [28]=>
      string(5) "Benin"
      [29]=>
      string(7) "Bermuda"
      [30]=>
      string(6) "Bhutan"
      [31]=>
      string(7) "Bolivia"
      [32]=>
      string(22) "Bosnia and Herzegowina"
      [33]=>
      string(8) "Botswana"
      [34]=>
      string(13) "Bouvet Island"
      [35]=>
      string(6) "Brazil"
      [36]=>
      string(17) "Brunei Darussalam"
      [37]=>
      string(8) "Bulgaria"
      [38]=>
      string(12) "Burkina Faso"
      [39]=>
      string(7) "Burundi"
      [40]=>
      string(8) "Cambodia"
      [41]=>
      string(8) "Cameroon"
      [42]=>
      string(6) "Canada"
      [43]=>
      string(6) "Canada"
      [44]=>
      string(10) "Cape Verde"
      [45]=>
      string(14) "Cayman Islands"
      [46]=>
      string(24) "Central African Republic"
      [47]=>
      string(4) "Chad"
      [48]=>
      string(5) "Chile"
      [49]=>
      string(5) "China"
      [50]=>
      string(16) "Christmas Island"
      [51]=>
      string(23) "Cocos (Keeling) Islands"
      [52]=>
      string(8) "Colombia"
      [53]=>
      string(7) "Comoros"
      [54]=>
      string(29) "Congo, Democratic Republic of"
      [55]=>
      string(27) "Congo, People's Republic of"
      [56]=>
      string(12) "Cook Islands"
      [57]=>
      string(10) "Costa Rica"
      [58]=>
      string(13) "Cote d'Ivoire"
      [59]=>
      string(7) "Croatia"
      [60]=>
      string(4) "Cuba"
      [61]=>
      string(6) "Cyprus"
      [62]=>
      string(14) "Czech Republic"
      [63]=>
      string(7) "Denmark"
      [64]=>
      string(12) "Diego Garcia"
      [65]=>
      string(8) "Djibouti"
      [66]=>
      string(8) "Dominica"
      [67]=>
      string(18) "Dominican Republic"
      [68]=>
      string(18) "Dominican Republic"
      [69]=>
      string(10) "East Timor"
      [70]=>
      string(7) "Ecuador"
      [71]=>
      string(5) "Egypt"
      [72]=>
      string(11) "El Salvador"
      [73]=>
      string(17) "Equatorial Guinea"
      [74]=>
      string(7) "Eritrea"
      [75]=>
      string(7) "Estonia"
      [76]=>
      string(8) "Ethiopia"
      [77]=>
      string(16) "Falkland Islands"
      [78]=>
      string(13) "Faroe Islands"
      [79]=>
      string(4) "Fiji"
      [80]=>
      string(7) "Finland"
      [81]=>
      string(6) "France"
      [82]=>
      string(13) "French Guiana"
      [83]=>
      string(16) "French Polynesia"
      [84]=>
      string(5) "Gabon"
      [85]=>
      string(6) "Gambia"
      [86]=>
      string(7) "Georgia"
      [87]=>
      string(7) "Germany"
      [88]=>
      string(5) "Ghana"
      [89]=>
      string(9) "Gibraltar"
      [90]=>
      string(6) "Greece"
      [91]=>
      string(9) "Greenland"
      [92]=>
      string(7) "Grenada"
      [93]=>
      string(10) "Guadeloupe"
      [94]=>
      string(4) "Guam"
      [95]=>
      string(9) "Guatemala"
      [96]=>
      string(6) "Guinea"
      [97]=>
      string(13) "Guinea-Bissau"
      [98]=>
      string(6) "Guyana"
      [99]=>
      string(5) "Haiti"
      [100]=>
      string(26) "Heard and McDonald Islands"
      [101]=>
      string(29) "Holy See (Vatican City State)"
      [102]=>
      string(8) "Honduras"
      [103]=>
      string(9) "Hong Kong"
      [104]=>
      string(7) "Hungary"
      [105]=>
      string(7) "Iceland"
      [106]=>
      string(5) "India"
      [107]=>
      string(9) "Indonesia"
      [108]=>
      string(4) "Iran"
      [109]=>
      string(4) "Iraq"
      [110]=>
      string(7) "Ireland"
      [111]=>
      string(6) "Israel"
      [112]=>
      string(5) "Italy"
      [113]=>
      string(7) "Jamaica"
      [114]=>
      string(5) "Japan"
      [115]=>
      string(6) "Jordan"
      [116]=>
      string(10) "Kazakhstan"
      [117]=>
      string(5) "Kenya"
      [118]=>
      string(8) "Kiribati"
      [119]=>
      string(38) "Korea, Democratic People's Republic of"
      [120]=>
      string(18) "Korea, Republic of"
      [121]=>
      string(6) "Kuwait"
      [122]=>
      string(10) "Kyrgyzstan"
      [123]=>
      string(4) "Laos"
      [124]=>
      string(6) "Latvia"
      [125]=>
      string(7) "Lebanon"
      [126]=>
      string(7) "Lesotho"
      [127]=>
      string(7) "Liberia"
      [128]=>
      string(5) "Libya"
      [129]=>
      string(13) "Liechtenstein"
      [130]=>
      string(9) "Lithuania"
      [131]=>
      string(10) "Luxembourg"
      [132]=>
      string(5) "Macao"
      [133]=>
      string(9) "Macedonia"
      [134]=>
      string(10) "Madagascar"
      [135]=>
      string(7) "Madeira"
      [136]=>
      string(6) "Malawi"
      [137]=>
      string(8) "Malaysia"
      [138]=>
      string(8) "Maldives"
      [139]=>
      string(4) "Mali"
      [140]=>
      string(5) "Malta"
      [141]=>
      string(16) "Marshall Islands"
      [142]=>
      string(10) "Martinique"
      [143]=>
      string(10) "Mauritania"
      [144]=>
      string(9) "Mauritius"
      [145]=>
      string(7) "Mayotte"
      [146]=>
      string(6) "Mexico"
      [147]=>
      string(31) "Micronesia, Federated States of"
      [148]=>
      string(13) "Midway Island"
      [149]=>
      string(20) "Moldova, Republic of"
      [150]=>
      string(6) "Monaco"
      [151]=>
      string(8) "Mongolia"
      [152]=>
      string(10) "Montserrat"
      [153]=>
      string(7) "Morocco"
      [154]=>
      string(10) "Mozambique"
      [155]=>
      string(7) "Myanmar"
      [156]=>
      string(7) "Namibia"
      [157]=>
      string(5) "Nauru"
      [158]=>
      string(5) "Nepal"
      [159]=>
      string(11) "Netherlands"
      [160]=>
      string(20) "Netherlands Antilles"
      [161]=>
      string(13) "New Caledonia"
      [162]=>
      string(11) "New Zealand"

A: in Smarty3 you could do
{$order.delivery_country.options.labels.{$order.delivery_country.value}}

in Smarty2 you could do
{assign var="_country_value" value=$order.delivery_country.value}
{$order.delivery_country.options.labels.$_country_value}

A: Perhaps like this:
{assign var=labelIndex value=$order.delivery_country.value}
{$order.delivery_country.options.labels.$labelIndex}


text:
Q: How to get data based on two columns from same table in SQL I wanted to retrieve some data from a table based on two columns see the below table structure
Update
    i want the output data based on two condition
    1. if the code value is having 'Web' or 'Offline'.
    2. Memo column is having data same as Pre_memo column.

Output should be as shown below

So far i got the output by using same table two times but i wanted to get the output result by using the table only 1 time to avoid performance related issues as this table is having huge data.
select distinct OrderTable.Memo,
max(OrderTable.Memo_Date) as Date1,
max(ot.Pre_Memo_Date) as Date2
from OrderTable,
OrderTable ot
where OrderTable.code in ('Web')
and ot.code in ('Offline')
and OrderTable.Memo = ot.Pre_Memo
group by OrderTable.Memo

Can anyone help on this?  With the use of OrderTable only once in the query and filter based on memo and pre_memo column as it's having same data?

A: You can use union all and do the conditional aggregation :
select Memo, max(case when code = 'Offline' then Date end) as Memo_date,
             max(case when code = 'Web' then Date end) as Per_Memo_date
from (select Date, 'Web' as code, Pre_memo as Memo
      from OrderTable o
      where code = 'Web'
      union all
      select Date, 'Offline', Memo
      from OrderTable o
      where code = 'Offline'
    ) t
group by Memo;

A: "I wanted to retrieve some data from a table based on two columns see the below table structure"
Providing a sample is sufficient to illustrate the problem (and it is desirable to do so on SO) but it is not sufficient and thus not a replacement for defining the problem, which you have failed to do.
Absent such definition of the problem, we can only guess what you're trying to achieve.  E.G.

*

*from the subset of tuples that have 'Offline' for 'code' value, take the MAX() 'Date' value per appearing value of 'Memo'.

*Match that (using some matching condition) to the subset of tuples that have 'Web' for 'code value and retain the 'Date' value from those as 'Memo_date' in the result set.

*matching condition being that 'Memo' value of [a tuple in] the former is equal to 'Pre_memo' value in [the matching tuple in] the latter.

If all that is correct, then that explains why it is impossible to do this in SQL without having at least two references.  You cannot avoid doing some kind of matching, and matching by definition takes two distinct things to match (even if the two distinct things are distinct subsets of one and the same thing).  In fact it is almost certainly a fundamental design mistake for you to have those two distinct things in one single table, probably under the totally misguided belief that "having everything in one table makes things easier".
"So far i got the output by using same table two times but i wanted to get the output result by using the table only 1 time to avoid performance related issues as this table is having huge data"
From the way you have presented the question, I suspect that you were hoping for some means to exploit the fact that those 'Offline' tuples are "the next" after a 'Web' tuple, and that you could write the SQL in such a way that the engine could then derive a sort of "single pass" algorithm (which you probably assume would go faster).
It does not work like that.  SQL tables have no inherent ordering and as a consequence there simply ain't no such thing as "the next" in a table.


text:
Q: netstat command doesnt work anymore on the new dedicated server I was using the following command on my previous dedicated server with the same version of the FreeBSD installation:
# uname -a
FreeBSD 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

The command is following:
netstat -ntu -f inet

Output:
netstat: illegal option -- t

Why doesn't it work anymore? I dont have an access to my previous dedicated server so I can't use the man to check the differences...

A: You can check man on the freebsd website
in short review i see that -t was removed in 9.X branch for some reasons


text:
Q: JQuery selector to match table having N rows I have a div with two tables.  I want to select the rows from only the one table having N rows.
In XPath I would use:
//div[@class="div1"]/table[count(tr) = 2]/tr

Is there a jQuery selector expression that will do the same thing?
Here's the HTML snippet:

Line 1

Line 1

Line 2

I was hoping this could be done in a single jQuery selector expression (e.g., understood in this Interactive JQuery Tester ).   My starting point is:
'div.div1 ul li'

but that also selects the rows from the first table which only has 1 row.
Of course, the "right way" to do this is add IDs or something else to the HTML so that the table can be identified uniquely, however in this instance I have no control over the HTML I am grabbing the data from.  The only way I can tell which of the multiple tables to use is from the row count.

A: Yes, you can do this with a single jQuery selector.
In your case you could just combine the :has() selector, the :eq() selector, and the :last-child pseudo class in order to select a ul element that has two li children elements. Keep in mind that the :eq() selector accepts an index that is zero-based (which means that we would use an index of 1 in order to select the second li element). The :last-child pseudo class is then used in order to ensure that the second li is in fact the last child element.
$('.div1 ul:has(li:eq(1):last-child)')

Snippet:

$('.div1 ul:has(li:eq(1):last-child)').addClass('selected');
.selected { color: #f00; }

Line 1

Line 1

Line 2

Line 1

Line 2

Line 3

Alternatively, you could also utilize the :nth-child() pseudo class as well.
$('.div1 ul:has(li:nth-child(2):last-child)')

Snippet:

$('.div1 ul:has(li:nth-child(2):last-child)').addClass('selected');
.selected { color: #f00; }

Line 1

Line 1

Line 2

Line 1

Line 2

Line 3


text:
Q: Equilibria of the system Calculus of Variations

*The harmonic oscillator is described by the action functional
$$J[x] = \int_{t_0}^{t_1}\left(mx'^2 −\frac{1}{2}kx^2\right) dt$$
where $m$ is the mass and $k$ is the spring constant.
a. Show that the equation of motion is $mx'' + \frac{1}{2}kx = 0$.
b. What is the Hamiltonian and what are Hamilton's equations of motion?
c. What are the equilibria of the system?
I did problems a and b but I am stuck on c. I might be overthinking how to find the equilibria. Any help would be great!!!

A: To find the equilibrium point of the system you have to consider the potential energy associated to the Lagrangian of the functional $J[x]$ namely the Lagrangian is the difference between the kinetic energy and the potential energy : $L=T-V$ so in your problem, the potential energy is identified with the second term of your lagrangian, which is also physically correct since is the potential energy of an harmonic oscillator. So then you can apply Fermat's theorem to the potential energy V, by that I mean $V'(x)=0$, so you determine the critical point of the derivative. After that you must substitute the value you have found into the underived V(x) and see which is the sign of the $V(x)$, the sign of the $V(x)$ will then decide the nature of the critical point so the equilibrium of the system.

A: The system is in equilibrium when $x$ doesn't change, i.e. if $x''=0$. That yields a simple equation for $x$. The equilibrium is stable if $k\gt0$ and unstable if $k\lt0$.


text:
Q: gd2 not showing in phpinfo, is showing in php -i I'm trying to get the gd2 extension to work on a WAMP stack (Win7(x64), Apache 2.4, PHP 5.3.26)
I've enabled extension=php_gd2.dll in php.ini and restarted Apache.
I believe my extension directory is reachable as I'm able to load other extensions (eg., curl, mbstring, etc.,) from the same location.
Oddly, php -i lists gd as enabled, but there's no mention of it in phpinfo():
gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.4.10
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.2.50
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 0 => 0

Any ideas?
Will update if I find a solution, and many thanks in advance!
Nao


text:
Q: MySQL datetime to echo on PHP I want to show in my page that the database they were looking at was last modified on a certain date & time. I have the following code for that:
 $lastUpdate = $pdo->prepare("SELECT lastUpdate FROM bng WHERE lastUpdate IN
                            (SELECT max(lastUpdate) FROM bng)");
$lastUpdate->execute();

As I mentioned in the title, I want to echo the result on my page, I tried:
<?php
echo '
Database Last Modified  on '.date("l, d F Y - h:i:s A",strtotime($lastUpdate)).'
';
?>

but it gives me the wrong data and an error message

Warning: strtotime() expects parameter 1 to be string,

Hope this question makes sense. Thanks in advance.

A: $lastUpdate is a PDO statement, not the value from the database. You need to call fetch() and then extract the value from the row.
$lastUpdate = $pdo->prepare("SELECT max(lastUpdate) AS lastUpdate FROM bng");
$lastUpdate->execute();
$row = $lastUpdate->fetch(PDO::FETCH_ASSOC);
echo '
Database Last Modified  on '.date("l, d F Y - h:i:s A",strtotime($row['lastUpdate'])).'
';

A: It is working fine check your variable $lastUpdate and change that date into string
echo '
Database Last Modified  on '.date("l, d F Y - h:i:s A",strtotime("1-1-2017")).'
';

Fetch Query from database check this link


text:
Q: ArrayList doesn't change it's value, is scope is the matter I don't know why the value of ArrayList 'lalala' doesn't change outside of the onDataChange function in the onCreateView..
I expected 2 in the line "Log.d("lalala_size", String.valueOf(lalala.size()));" but, it shows 0
I thought the scope of the ArrayList lalala but I can't fix this problem.
I wanted to get the address of images in the firebase realtime database..
please help me
public class Fragment2  extends Fragment implements ImageAdapter.OnListItemSelectedInterface, ImageAdapter.OnListItemLongSelectedInterface{
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
GridView gridView;
static int screenWidth;
private ImageView imageView;
RecyclerView recyclerView;
GridLayoutManager gridLayoutManager;
private GalleryManager mGalleryManager;
public ArrayList<imgFormat> localPhotoList;

private DatabaseReference mDatabaseRef;

private ArrayList<Item> list = new ArrayList<>();
ArrayList<ImageUrl> lalala = new ArrayList<>();
static ArrayList<ImageUrl> imageUrlList = new ArrayList<>();

FirebaseDatabase mFirebaseDatabase;
DatabaseReference mDatabaseReference;

FirebaseStorage storage;
StorageReference storageReference;

// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;

public Fragment2() {
    // Required empty public constructor
}

// TODO: Rename and change types and number of parameters
public static Fragment2 newInstance(String param1, String param2) {
    Fragment2 fragment = new Fragment2();
    Bundle args = new Bundle();
    args.putString(ARG_PARAM1, param1);
    args.putString(ARG_PARAM2, param2);
    fragment.setArguments(args);
    return fragment;
}

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        mParam1 = getArguments().getString(ARG_PARAM1);
        mParam2 = getArguments().getString(ARG_PARAM2);
    }
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    //Log.d("dispsize", "calculate the display size");
    //DisplayMetrics metrics = this.getResources().getDisplayMetrics();
    //screenWidth = metrics.widthPixels;
    //Log.d("dispsize", String.valueOf(screenWidth));
    View v = inflater.inflate(R.layout.fragment_2, container, false);

    imageView = (ImageView) v.findViewById(R.id.imageView);
    recyclerView = (RecyclerView) v.findViewById(R.id.recyclerView2);
    gridLayoutManager = new GridLayoutManager(getActivity().getApplicationContext(), 3);
    recyclerView.setLayoutManager(gridLayoutManager);

    mDatabaseRef = FirebaseDatabase.getInstance().getReference("name_list");
    mDatabaseRef.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
            for(DataSnapshot postSnapshot: dataSnapshot.getChildren()){
                String key=postSnapshot.getKey();
                FirebasePost get=postSnapshot.getValue(FirebasePost.class);
                String[] info={get.name,get.number,get.img};
                Item result= new Item(info[0],info[1]);

                list.add(result);
                if(info[2]!=null){
                    ImageUrl imageUrl = new ImageUrl();
                    imageUrl.setImageUrl(info[2]);
                    imageUrlList.add(imageUrl);
                    lalala.add(imageUrl);
                    Log.d("imgSaved", String.valueOf(imageUrlList.size()));
                }
            }
        }
        @Override
        public void onCancelled(@NonNull DatabaseError databaseError) {
            //Toast.makeText(fragement,"Error", Toast.LENGTH_SHORT).show();
        }
    });

    Log.d("lalala_size", String.valueOf(lalala.size())); // THIS IS THE PROBLEMATIC LINE... i expected 2 but the log shows 0
    for (int i = 0; i < imageUrlList.size(); i++){
        Log.d("images", ">> " + imageUrlList.get(i).getImageUrl());
    }
    Log.d("images", "List count: " + imageUrlList.size());

    // Inflate the layout for this fragment
    return v;
}

Thank you


text:
Q: Why can I type alias functions and use them without casting? In Go, if you define a new type e.g.:
type MyInt int

You can't then pass a MyInt to a function expecting an int, or vice versa:
func test(i MyInt) {
    //do something with i
}

func main() {
    anInt := 0
    test(anInt) //doesn't work, int is not of type MyInt
}

Fine. But why is it then that the same does not apply to functions? e.g.:
type MyFunc func(i int)
func (m MyFunc) Run(i int) {
    m(i)
}

func run(f MyFunc, i int) {
    f.Run(i)
}

func main() {
    var newfunc func(int) //explicit declaration
    newfunc = func(i int) {
        fmt.Println(i)
    }
    run(newfunc, 10) //works just fine, even though types seem to differ
}

Now, I'm not complaining because it saves me having to explicitly cast newfunc to type MyFunc, as I would have to do in the first example; it just seems inconsistent. I'm sure there is a good reason for it; can anyone enlighten me?
The reason I ask is mainly because I would like to shorten some of my rather long function types in this way, but I want to make sure it's expected and acceptable to do this :)

A: Both the question and answer are pretty enlightening. However, I'd like to bring up a distinction which is not clear in lytnus's answer.

*

*Named Type is different from Unnamed Type.

*Variable of Named Type is assignable to variable of Unnamed Type, vice versa.

*Variable of different Named Type is not assignable to each other.
http://play.golang.org/p/uaYHEnofT9
import (
    "fmt"
    "reflect"
)

type T1 []string
type T2 []string

func main() {
    foo0 := []string{}
    foo1 := T1{}
    foo2 := T2{}
    fmt.Println(reflect.TypeOf(foo0))
    fmt.Println(reflect.TypeOf(foo1))
    fmt.Println(reflect.TypeOf(foo2))

    // Output:
    // []string
    // main.T1
    // main.T2

    // foo0 can be assigned to foo1, vice versa
    foo1 = foo0
    foo0 = foo1

    // foo2 cannot be assigned to foo1
    // prog.go:28: cannot use foo2 (type T2) as type T1 in assignment
    // foo1 = foo2
}

A: Turns out, this is a misunderstanding that I had about how Go dealt with types, which can be resolved by reading the relevant part of the spec:
http://golang.org/ref/spec#Type_identity
The relevant distinction that I was unaware of was that of named and unnamed types.
Named types are types with a name, such as int, int64, float, string, bool. In addition, any type you create using 'type' is a named type.
Unnamed types are those such as []string, map[string]string, [4]int. They have no name, simply a description corresponding to how they are to be structured.
If you compare two named types, the names must match in order for them to be interchangeable. If you compare a named and an unnamed type, then as long as the underlying representation matches, you're good to go!
e.g. given the following types:
type MyInt int
type MyMap map[int]int
type MySlice []int
type MyFunc func(int)

the following is invalid:
var i int = 2
var i2 MyInt = 4
i = i2 //both named (int and MyInt) and names don't match, so invalid

the following is fine:
is := make([]int)
m := make(map[int]int)
f := func(i int){}

//OK: comparing named and unnamed type, and underlying representation
//is the same:
func doSlice(input MySlice){...}
doSlice(is)

func doMap(input MyMap){...}
doMap(m)

func doFunc(input MyFunc){...}
doFunc(f)

I'm a bit gutted I didn't know that sooner, so I hope that clarifies the type lark a little for someone else! And means much less casting than I at first thought :)

A: If the ultimate(as type of a type maybe a case)underlying type is a primitive type GO will not allow direct assignment of variable of one type to the another type directly and vice versa. However the value can be casted to the destination type and used.
package main
import (
    "fmt"
)

type T int

type U T

type V U

type UU U

func main() {

    var s int
    var t T
    var u U
    var uu UU

    s = 9
    t = 10
    u = 11
    uu = 111

    fmt.Println(s)
    fmt.Println(t)
    fmt.Println(u)
    fmt.Println(uu)

    fmt.Println("========")

    //s = t
    //u = s
    //v = s

    u = (U)(uu)

    //fmt.Println(s)
    //fmt.Println(u)
    fmt.Println(u)

}

A: Like the other people said anInt := 0 chooses a type for 0 rather than just a number. The only way I know to keep it without a type is to use const. If you use const instead of := then this can work.
func main() {
    const anInt = 0
    test(anInt)
}


text:
Q: someone can tell me why I can't get the cpp log in dmesg or logcat? I add some code log at below in android automotive10 source code

      diff --git a/frameworks/av/services/audiopolicy/service/AudioPolicyService.cpp b/frameworks/av/services/audiopolicy/service/AudioPolicyService.cpp
index ad452434af..78ee4f80f6 100755
--- a/frameworks/av/services/audiopolicy/service/AudioPolicyService.cpp
+++ b/frameworks/av/services/audiopolicy/service/AudioPolicyService.cpp
@@ -16,7 +16,10 @@

 #define LOG_TAG "AudioPolicyService"
 //#define LOG_NDEBUG 0
-
+//I add
+#include <android/log.h>
+#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
+// end
 #include "Configuration.h"
 #undef __STRICT_ANSI__
 #define __STDINT_LIMITS
@@ -65,6 +68,10 @@ AudioPolicyService::AudioPolicyService()

 void AudioPolicyService::onFirstRef()
 {
+//I add
+       printf("------------liwx:AudioPolicyService::onFirstRef");
+       char * log =(char*) "liwx_tag";
+       LOGI("------------liwx AudioPolicyService::onFirstRef,%s\n",log);
     {
         Mutex::Autolock _l(mLock);

I knew some C++ log code can't capture Android, so I add .H file, but it was unuseless
someone can help me, thanks


text:
Q: Why do Guillemin and Pollack avoid the term "submanifold with boundary"? On p. 60 of the book "Differential Topology" by named authors they state:

Theorem. Let $f$ be a smooth map of a manifold $X$ with boundary onto a boundaryless manifold $Y$, and suppose that both $f:X\to Y$ and
  $\partial f:X\to Y$ are transversal with respect to a boundaryless
  submanifold $Z$ in $Y$. Then the premiage $f^{-1}(Z)$ is a manifold
  with boundary $$\partial\{f^{-1}(Z)\}=f^{-1}(Z)\cap \partial X$$ and
  the codimension of $f^{-1}(Z)$ in $X$ equals the codimension of $Z$ in
  $Y$.

Why don't they call $f^{-1}(Z)$ a submanifold of $X$ with boundary?
Would that be mathematically incorrect?
In the proof they show that around a boundary point, $f^{-1}(Z)$ is diffeomorphic to a submanifold of $\mathbb{R}^k$ intersected with the halfspace $\mathbb{H}^k$ under a chart for $X$, so I do not see why you wouldn't be able to call $f^{-1}(Z)$ a submanifold of $X$.
Same thing on p. 62:

Lemma. Suppose that S is a manifold without boundary and that $\pi:S\to \mathbb{R}$ is a smooth function with regular value $0$.
  Then the subset $\{s\in S:\pi(s) \geq 0\}$ is a manifold with
  boundary, and the boundary is $\pi^{-1}(0)$.

Why not call $\pi^{-1}(0)$ a submanifold of $S$ with boundary?


text:
Q: Get the text value of an input element in C# I want to read the text next to an input item with C#.
This is my HTML:
<p id="mpNames">
  <input id="selectMp1" type="checkbox">
  "Text next to the input element"

This is my code:
var inputWeList = drv.FindElements(By.CssSelector("#mpNames > input"));
foreach (var inputItem in inputWeList)
{
       var inputItemText = inputItem.GetAttribute("value");  // gives "on"
       ...
}

My second try:
var inputWeList = drv.FindElements(By.CssSelector("#mpNames > input"));
foreach (var inputItem in inputWeList)
{
       var inputItemText = inputItem.Text();  // gives ""
       ...
}

How do I get "Text next to the input element"?

A: Make use of inputItem.InnerHtml or inputItem.innerText instead for GetAttribute("value");  and .Text(), Here is the difference between both:

Unlike innerText, though, innerHTML lets you work with HTML rich text
  and doesn't automatically encode and decode text. In other words,
  innerText retrieves and sets the content of the tag as plain text,
  whereas innerHTML retrieves and sets the same content but in HTML
  format

A: Seems the text "Text next to the input element" is out of the <input> tag. So instead of :
var inputWeList = drv.FindElements(By.CssSelector("#mpNames > input"));

You can try :
var inputWeList = drv.FindElements(By.XPath("//p[@id='mpNames' and not(@type='checkbox')]"));

A: You need to get them by JavaScript because the text are under the same parent. JavaScript need to walk through child nodes of the < id="mpNames" and returns all child nodes which are text nodes.   See my example below.
var script = @"function getTextNode(rootNode) {
    var nodes = rootNode.childNodes;
    var fieldNames = [];
    var count=0;
    for (var i = 0; i < nodes.length; i++) {
        if ((nodes[i].nodeType == Node.TEXT_NODE)) {
                let text = nodes[i].textContent.trim();
                fieldNames[count++] = text;
        }
    }
    return fieldNames;
}";

var results = (drv as IJavaScriptExecutor).ExecuteScript(script) as List<string>;
results.ForEach(txt => System.Diagnostics.Debug.WriteLine(txt));


text:
Q: DateAdd and DatePart from VB6 to C# Currently working on the conversion of the VB6 to C# but encounters problems regarding DateAdd & DatePart. Hope if anyone is good in VB6 could enlighten me on this. Thanks.
Below are the VB6 codes:
dFilterDate2 = DateAdd("d", -4, dFilterDate1)
dFilterDate3 = DateAdd("y", -(DatePart("y", dFilterDate1) - 1), dFilterDate1)
dFilterDate4 = DateAdd("yyyy", -1, dFilterDate3)
dFilterDate5 = DateAdd("d", Weekday(CDate(dFilterDate1)) - 1, CDate(DateAdd("ww", Format(CDate(dFilterDate1), "ww") - 1, CDate(CDate(dFilterDate4) - Weekday(CDate(dFilterDate4))))))

And below are my code in C#.
dFilterDate2 = dFilterDate1.AddDays(-4);
dFilterDate3 = dFilterDate1.AddYears(-dFilterDate1.DayOfYear-1);
dFilterDate4 = dFilterDate3.AddYears(-1);
dFilterDate5 = ?;

A: This took me a while but this is what I go.
First, dFilterDate3 is not correct.  It is not years but days based on the day of the year.
var dFilterDate1 = DateTime.Now.AddYears(-2);
var dFilterDate2 = dFilterDate1.AddDays(-4);
var dFilterDate3 = dFilterDate1.AddDays(-(dFilterDate1.DayOfYear - 1));
var dFilterDate4 = dFilterDate3.AddYears(-1);

Second, C# does not have a built-in equivalents for weeks so I had to copy some helper functions from SO.
I also had to breakdown the code into lots of temp variables and this is what I got:
using System;
using System.Globalization;

public class Program
{
    public static void Main()
    {
        var dFilterDate1 = DateTime.Now.AddHours(-4); // UTC to EST for apples to apples testing
        var dFilterDate2 = dFilterDate1.AddDays(-4);
        var dFilterDate3 = dFilterDate1.AddDays(-(dFilterDate1.DayOfYear - 1));
        var dFilterDate4 = dFilterDate3.AddYears(-1);

        var dFilterDate5temp1 = ((int)dFilterDate1.DayOfWeek + 1) - 1; // this is for readability.  -1 is needed for C# vs VB
        var dFilterDate5temp2 = (int)dFilterDate4.DayOfWeek + 1;
        var dFilterDate5temp3 = dFilterDate4.AddDays(-dFilterDate5temp2);
        var dFilterDate5temp4 = GetWeekOfYear(dFilterDate1);
        var dFilterDate5temp5 = dFilterDate5temp3.AddDays(7 * (dFilterDate5temp4 - 1));
        var dFilterDate5 = dFilterDate5temp5.AddDays(dFilterDate5temp1);

        Console.WriteLine(dFilterDate1);
        Console.WriteLine(dFilterDate2);
        Console.WriteLine(dFilterDate3);
        Console.WriteLine(dFilterDate4);
        Console.WriteLine(dFilterDate5);
    }

    public static int GetWeekOfYear(DateTime dt)
    {
        DateTimeFormatInfo dfi = DateTimeFormatInfo.CurrentInfo;
        Calendar cal = dfi.Calendar;
        return cal.GetWeekOfYear(dt, dfi.CalendarWeekRule, dfi.FirstDayOfWeek);
    }
}

You can test it here https://dotnetfiddle.net/LFYfyG
I get this as output:
9/23/2021 11:58:07 AM
9/19/2021 11:58:07 AM
1/1/2021 11:58:07 AM
1/1/2020 11:58:07 AM
9/23/2020 11:58:07 AM

And this is from the VB6:

This is my VB6 code that shows how I broke this down
Private Sub Command1_Click()

   Dim dFilterDate1 As String
   Dim dFilterDate5temp As Integer

   dFilterDate1 = DateAdd("yyyy", -1, Now) ' I tried many different values for this - this is one year from now so it is not exactly the same as the C# example
   dFilterDate2 = DateAdd("d", -4, dFilterDate1)
   dFilterDate3 = DateAdd("y", -(DatePart("y", dFilterDate1) - 1), dFilterDate1)
   dFilterDate4 = DateAdd("yyyy", -1, dFilterDate3)
   dFilterDate5 = DateAdd("d", Weekday(CDate(dFilterDate1)) - 1, CDate(DateAdd("ww", Format(CDate(dFilterDate1), "ww") - 1, CDate(CDate(dFilterDate4) - Weekday(CDate(dFilterDate4))))))

   dFilterDate5temp1 = Weekday(CDate(dFilterDate1), vbSunday) - 1

   dFilterDate5temp2 = Weekday(CDate(dFilterDate4), vbSunday)

   dFilterDate5temp3 = CDate(dFilterDate4) - dFilterDate5temp2

   dFilterDate5temp4 = Format(CDate(dFilterDate1), "ww")

   dFilterDate5temp5 = DateAdd("ww", dFilterDate5temp4 - 1, CDate(dFilterDate5temp3))

   dFilterDate5New = DateAdd("d", dFilterDate5temp1, CDate(dFilterDate5temp5))

   Text1.Text = dFilterDate1
   Text2.Text = dFilterDate2
   Text3.Text = dFilterDate3
   Text4.Text = dFilterDate4
   Text5.Text = dFilterDate5
   Text6.Text = dFilterDate5New

End Sub

The hardest parts were Weekday and WeekOfTheYear that do not exist directly in C#.  Some of the solutions I found on SO were wrong so it lead me down the wrong path.  Note that the answer will be different based on what is the first day of the week.
Update:  I just noticed that I was testing the VB code with last year so the values are not the same.  Here is the VB6 code with the values from Now.

Also, VB6 is running on my laptop in the EST timezone while dotnetfiddle is always UTC.  I just subtracted 4 hours so the times would be the same.


text:
Q: An undecided probability problem One person ( or n persons for that matter ) equipped with a true random number generator is set to generate the first n digits of π. The probability of doing this on the first trial is of course $(\frac{1}{10})^n\\$.
If the experiment is to be repeated m times ( trials ), the probability of hitting the first n digits of π ( or a given sequence of digits ) on m independent trials is of course:
$\ 1-(1-(\frac{1}{10})^n)^{m}\\$
Now, we are going to set m as a function of n and see what happens as n approaches infinity:
We see that:
$\lim_{_{n \to \infty} } (1-(1-(\frac{1}{10})^n)^{n})=0\\$, for m=n whereas
$\lim_{_{n \to \infty} } (1-(1-(\frac{1}{10})^n)^{10^n})=1-\frac{1}{e}\\$, for  $m=10^n\\$
Indeed this probability can take any number from 0 to 1 depending on which type of infinity we use in our m independent trials.
My question is, is this a valid probability question to ask, or is it nonsense and makes no sense to ask mathematically. Thanks.


text:
Q: How to pass type which got FromJSON implemented as argument to anoter function? Here is my try:
decode :: String -> FromJSON a => BS.ByteString -> a
decode fnm iFromJSONable = do
    ymlData <- BS.readFile fnm
    let ymlDecode :: Maybe iFromJSONable
        ymlDecode = Data.Yaml.decode ymlData
    return fromJust ymlDecode

error:
Couldn't match type `a' with `IO b0'
  `a' is a rigid type variable bound by
      the type signature for
        Yaml.decode :: String -> FromJSON a => BS.ByteString -> a
      at src\Yaml.hs:46:11
Expected type: IO BS.ByteString -> (BS.ByteString -> IO b0) -> a
  Actual type: IO BS.ByteString
               -> (BS.ByteString -> IO b0) -> IO b0
In a stmt of a 'do' block: ymlData <- BS.readFile fnm

A: You are mixing up types and values here. You cannot treat a class constraint such as FromJSON as an argument (iFromJSONable) and then use it in a local type signature as well.
I guess you want this:
decode :: FromJSON a => FilePath -> IO a
decode fnm = do
    ymlData <- BS.readFile fnm
    let ymlDecode = Data.Yaml.decode ymlData
    return (fromJust ymlDecode)

You are reading data from a file specified by a string (FilePath is just a synonym for String). You are getting an IO action that can produce any type a that is an instance of the FromJSON class. Which type that is is going to be determined by the context in which you use the decode function.


text:
Q: Azure logic apps: Nullable JSON values not available as dynamic content I'm building a logic app that pulls some JSON data from a REST API, parses it with the Parse JSON block, and pushes it to Azure Log Analytics.  The main problem I'm hitting is an important JSON field can either be an object or null. Per this post I changed the relevant part of my JSON schema to something like this
"entity": {"type": ["object", "null"] }

While this works, I'm now no longer to access entity later in the logic app as dynamic content. I can access all other fields parsed by the Parse JSON block downstream in the logic (that don't have nullable field). If I remove the "null" option and just have the type set to object, I can access entity in dynamic content once again.  Does anyone know why this might be happening and/or how to access the entity field downstream?

A: Through the test, if we use "entity": {"type": ["object", "null"] }, we really cannot directly select entity in dynamic content.
But we can use the following expression to get the entity:
body('Parse_JSON')?['entity']

The test results seem to be no problem:

For a better understanding, let me cite a few more examples:
1. If your json is like this:
{
    "entity": {
        "testKey": "testValue"
    }
}

Your expression is like this:
body('Parse_JSON')?['entity']

2. If your json is like this:
{
    "test": {
        "entity": {
            "testKey": "testValue"
        }
    }
}

Your expression should like this:
body('Parse_JSON')?['test']?['entity']


text:
Q: Possible numbers of schedules based on a few parameters. I'm writing a program to brute-force a schedule for my job based on restrictions and certain parameters. To see if brute-forcing the schedule is even feasible, I decided to first calculate the total possible number of schedules based on the parameters:

*

*nEmployees - The number of employees

*nShifts - The number of shifts required per day

*nDays - The total number of days in the rotation to calculate for

For the sake of simplicity, and to get the worst-case-scenario, I'm not exluding from the calculation schedules that violate labour laws, or are otherwise impossible (like having one person work every shift for the entire rotation).
For our situation specifically, here are the parameters I want to use:

*

*nEmployees = 18

*nShifts = 6

*nDays = 90

Thinking back to this subject from years ago, my first thought was to just multiply all the numbers together. This only gave me 9720 though, which seems very low; intuitively, I was expecting a much higher number.
Then I realized that if I recall correctly, this gives me the number of schedules where order doesn't matter. The order of the days does matter though, but it doesn't make any sense for the order of shifts or people to matter; Person1 working Shift1 and Person2 working Shift2 is the same as Person2 working Shift2 and Person1 working Shift1.
I think this leaves me with something like $nDays^{nShifts*nEmployees}$ (from memory).
That gives me a massive result though, so I hope that's incorrect.
Is this the correct formula?

A: That's not exactly correct.
You've actually underestimated.
There are nShifts*nDays distinct slots you need to fill, and nEmployees which can go in each slot. Therefore there are
$nEmployees^{nShifts*nDays}$ possible combinations.
Intuitively, think of picking an employee for the first shift of the first day -- the the second shift of the first day... and so on. You'll end up repeating this nShifts*nDays times, and each time you're multiplying by nEmployees.
The reason nDays is in your exponent and not base is because you're multiplying the number of assignments for every day.
The reason you can't multiply nEmployees and nShifts is because that only counts the ways to pick one shift and one employee to fill it.


text:
Q: How can i put two divs and one nav into the header at the top-left, top-center and top- right with css I am trying to put into the  three divs: div1(logo) at the top left of the page, nav2(menu bar) at the top center of the page and div3(social networks) at the top right of the page, but i dont know how to do that. i tried this code (html):

and the css:
nav{
    background-color: #215177;
    border: 1px solid #215177;
    color: white;
    display: block;
    margin: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

#logo{
    height: 120px;
    width: 50px;
    float: left;
}

nav ul{
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
}

nav ul li {
    margin: 0;
    display: inline-block;
    list-style-type: none;
    transition: all 0.2s;
}

nav > ul > li > a {
    color: white;
    display: block;
    line-height: 2em;
    padding: 0.5em 2em;
    text-decoration: none;
}

#links{
    float: right;
    position: absolute;
    top:0;
}

A: You are definitely lacking a lot of code, and depending on whether this will be used in Mobile, will be another issue.
Here is a good starting point, make sure you start and end all DIVS and content in your layout, otherwise, you will not get a finished product properly displayed.
Here is a working example, of close to what you want, using same classes and ID's:

Logo

            Home

            About

            Blog

            Contact

Links go here

I have also added some basic CSS to the example as well for a good starting point.

A: try this:

and css:
#top{
    width:100%;
}
#logo{
    width:9%;
    float:left;
}
nav{
    width:78%;
    float:left;
}
#links{
    width:9%;
    float:right;
}

Note
if you see the total width of nav + link + logo isn't 100% in case you have applied padding in your css.


text:
Q: Meaning of "per se" I want the actual meaning of "per se". I have found the definition as
"by/of/in itself"
However, I am not getting this.
Here are some example sentences using this word. Can anyone replace the word in these sentences with simple English?

*

*It is not the money per se that makes them unhappy, but the single-minded pursuit of that money.

*It is not a pretty town per se, but it is where my family comes from, so I like it.

*Research shows that it is not divorce per se that harms children, but the continuing conflict between parents.

*There is no indication that just having a degree per se improves your chance of getting a job.

A: Note that by itself means

Alone; with nothing else added.

*

*One nail by itself won't hold up that picture frame—put another nail in on this side.

*I think this dish is fine by itself—it doesn't need a sauce.

in itself is

Without the consideration of anything else. (A shortening of the full phrase "in and of itself.")

*

*The defendant's story seems plausible in itself, but when taken alongside the testimony of the witnesses, it starts to look less and less believable.

*As a sequel, the movie does a good job of continuing the story of the first, but it fails as a cohesive, enjoyable film in itself.

of itself is

used for emphasizing that what you are saying about one particular thing is true without even considering anything else

*

*Some of the medicines were out of date, which was in itself dangerous.

*Using someone else's name is not of itself a crime, unless there is an intention to commit a fraud.

The common thread in the definitions for "by/of/in itself" is

without considering/adding anything else

Some synonyms for "per se" are

*

*essentially

*alone

*as such

*solely

*independently

So, if you were to replace per se in your example sentences

*

*It is not the money "alone" (or only the money) that makes them unhappy, but the single-minded pursuit of that money.

*It is not a pretty town as such, but it is where my family comes from, so I like it.

*

*From what you see, the town is not pretty, but I like it because it's where my family comes from

*Research shows that it is not divorce essentially that harms children, but the continuing conflict between parents.

*

*Research shows that the continuing conflict between parents harms children more than the fact that the parents got a divorce

*There is no indication that just having a degree alone improves your chance of getting a job.

*

*There is no indication that if you just have a degree, your chances of getting a job are better

A: There is a difference between a thing itself and 'stuff' that is merely related to it, such as its qualities. For example, a brick as a 'thing' is a rectangular block of material. Its 'qualities' might include being heavy and being rough to the touch. You might also talk about things that are made of bricks such as houses. Talking about roughness and houses isn't the same thing as talking about the bricks themselves (i.e. they aren't the same as talking about bricks per se).
The phrase per se tends to be used within a negative phrase - "not talking about (X) per se but instead about (Y)". Here, X might be the brick and Y might be the house.
Let's consider your first example:

It is not the money per se that makes them unhappy, but the single-minded pursuit of that money.

The 'thing' here is money. The quote says that it's not the money itself (per se) that makes them unhappy. It's something else (albeit related to money) that makes them unhappy - in this case, "the single-minded pursuit" of it.
The term per se is used to explicitly focus on the thing itself rather than what is merely related to it.

A: The literal meaning of the Latin is "through itself". Per has a range of meanings like any preposition but the basic meaning is "through".
http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A1999.04.0059%3Aentry%3Dper1
It takes the accusative so se is the accusative of sui meaning "himself","herself","itself","themselves", just like the word in French.


text:
Q: How to mount an AWS EFS volume using Chef nfs cookbook It took me some trial and error to figure out how to convert the AWS EFS mount command to using a chef resource instead so I thought I wanted to share.
command given by amazon:
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).fs-01234567.efs.us-west-2.amazonaws.com:/ efs

A: include_recipe 'nfs'

az = node['ec2']['placement_availability_zone']
region = az[0..-2] # trim last char
file_system_id = 'fs-01234567'
efs_uri = "#{az}.#{file_system_id}.efs.#{region}.amazonaws.com:/"

directory '/mnt/efs' do
  owner 'root'
  group 'root'
  mode '0755
  recursive true
  action :create
end

mount '/mnt/efs' do
  device efs_uri
  fstype 'nfs4'
  options 'nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2'
  action [:mount, :enable]
end


text:
Q: Automorphism groups of Hirzebruch surfaces The Hirzebruch surfaces are the $\mathbb{P}^1$ bundles $\mathbb{F_n}$ ($n\geqslant 0$) which can be obtained projectivizing the rank $2$ vector bundles $\mathcal{O}_{\mathbb{P}^1}\oplus \mathcal{O}_{\mathbb{P}^1}(n)$. Those surfaces are famous because they exhaust ($n\neq 1$) the minimal rational (smooth, projective) surfaces other than $\mathbb{P}^2$. The most familiar examples are $\mathbb{F_0}\simeq \mathbb{P}^1\times\mathbb{P}^1$ and $\mathbb{F_1}$ which is isomorphic to $\mathbb{P}^2$ blown up at a point.
Other features of Hirzebruch surfaces are apparently well-known, such as its intersection theory.
My question is about automorphism groups of Hirzebruch surfaces. For the sake of comparation, the automorphism group of $\mathbb{P}^2$ is isomorphic to $PGL(3,\mathbb{C})$ and I manage to find a very nice description of $Aut(\mathbb{F_0})$ in this answer (Automorphisms of a smooth quadric surface $Q\subset\mathbb{P}^{3}$), since a quadric smooth projective surface $Q\subset \mathbb{P}^3$ is isomorphic to $\mathbb{P}^1\times\mathbb{P}^1$.
Do we have a similar description of $Aut(\mathbb{F_n})$ for positive $n$?

A: For $n \ge 2$ the surface $\mathbb{F}_n$ is the blowup of the weighted projective plane $\mathbb{P}(1,1,n)$ at its singular point. Because of that
$$
Aut(\mathbb{F}_n) \cong Aut(\mathbb{P}(1,1,n)).
$$
The automorphism group of $\mathbb{P}(w_1,w_2,\dots,w_m)$ is the group of non-degenerate $m$-by-$m$ matrices with the $(i,j)$-entry being a polynomial of degree $w_i - w_j$, up to simultaneous rescaling.


text:
Q: Java 8 to Java 11 migration issues with JAXB API We are in process of migrating our projects from Java 8 to Java 11. One of the APIs is dependent on a library that utilizes JAXB. As we know JAXB was removed from JAVA 11 we started to include the JAXB dependencies in the POM of the library.
 <!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api -->
  <!-- API -->
  <dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>2.3.3</version>
  </dependency>
  <!-- Runtime -->
  <dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.2</version>
  </dependency>

All works fine when we run the API project with

mvn spring-boot:run

However when the API is deployed in QA servers and is started using a start script with -

java -jar Sample-api-3.0.0-SNAPSHOT.jar

The API throws the following error when invoking the library that is dependent on JAXB -
Caused by: javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.

*

*with linked exception:

 [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:269)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:412)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:721)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:662)
      at com.eoriginal.ecore.client.documents.SearchDocumentHistoryAPI$RequestParameters.toMap(SearchDocumentHistoryAPI.java:344)
      ... 14 more
    Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
      at javax.xml.bind.ServiceLoaderUtil.nullSafeLoadClass(ServiceLoaderUtil.java:122)
      at javax.xml.bind.ServiceLoaderUtil.safeLoadClass(ServiceLoaderUtil.java:155)
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:267)

UPDATE :
I added the Maven Shade plugin to generate the JAR with all the dependencies but when the line of code is executed to create the JAXBContext the error still persists -
JAXBContext jaxbc = JAXBContext.newInstance(new Class[]{Abc.class});

A: JAXB needs javax.activation module, which became jakarta.activation after rebranding to JakartaEE. Inlcuding this dependency should help:
<dependency>
    <groupId>jakarta.activation</groupId>
    <artifactId>jakarta.activation-api</artifactId>
    <version>2.0.0</version>
</dependency>

A: Add this dependency to POM:
<dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-runtime</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1.1</version>
    </dependency>


text:
Q: Delphi: convert TDate to other format var MyDate:TDate;
   MyDate:=Date;

How can I convert local myDate to my format: 31/12/2011?
RecodeDate?
Thanks!!!

A: Check the FormatDateTime function in your case you try this
FormatDateTime('dd/mm/yyyy',MyDate);


text:
Q: how to find index by value in json nested python body = {
    'a': 1,
    'b': 'apple',
    'child': [
        {
            'a': 12,
            'b': 'banana',
            'child': [
                {
                    'a': 121,
                    'b': 'mango',
                    'child': [
                        {
                            'a': 1211,
                            'b': 'coconut',
                            'child': [dynamic nested]
                        }
                    ]
                },
                {
                    'a': 122,
                    'b': 'papaya',
                    'child': [
                        {
                            'a': 1221,
                            'b': 'lemon',
                            'child': [dynamic nested]
                        }
                    ]
                }
            ]
        },
        {
            'a': 13,
            'b': 'orenge',
            'child': [
                dynamic nested
            ]
        }
    ]
}

if i want know index of 'coconut' or 'lemon' (json body dynamic children sub child i don't know dee child, but khow 'a' or 'b' for find index deep)
how to get index with python?
ex1: index of 'coconut' = [0,0,0]
ex2: index of 'lemon' = [0,1,0]

A: def find(child, value, index=False):
     # First element in nested object is searched value
     if child["b"] == value:
         return []
     if len(child["child"]) == 0:
         return False
     for i in range(len(child["child"])):
         if child["child"][i]["b"] == value:
             index = [i]
             break
         else:
             index = find(child["child"][i], value, index)
             if index != False:
                  index = [i] + index
                 break
     return index
print(find(body, "coconut"))

Use a recursive function

A: For educational purposes, the same Akane's algorithm but in a little bit more Pythonic style:
def find_fruit(child, value, index=False):
    if child["b"] == value:
        return []
    for i, ch in enumerate(child["child"]):
        if ch["b"] == value:
            return [i]
        index = find_fruit(ch, value, index)
        if index:
            return [i] + index

print(find(body, "coconut"))


text:
Q: Zappa deployment error - troposphere==2.7.1 didn't help AttributeError: 'Template' object has no attribute 'add_description' I have migrated my python project from 2.7 to 3.8. and I am trying to deploy using zappa.
But, as soon as it's starting updating Lambda function configs  it hits this error.
Updating Lambda function configuration..
Oh no! An error occurred! :(

==============

Traceback (most recent call last):
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/cli.py", line 3422, in handle
    sys.exit(cli.handle())
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/cli.py", line 588, in handle
    self.dispatch_command(self.command, stage)
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/cli.py", line 644, in dispatch_command
    self.vargs["docker_image_uri"],
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/cli.py", line 1194, in update
    endpoint_configuration=self.endpoint_configuration,
  File "/Users/leilakarimi/Projects/ATGWSams/venv/lib/python3.7/site-packages/zappa/core.py", line 2417, in create_stack_template
    self.cf_template.add_description("Automatically generated with Zappa")
AttributeError: 'Template' object has no attribute 'add_description'

I found this question and tried to downgrade troposphere as suggested in this post  but again I face a new error as below:
   ERROR: Command errored out with exit status 1:
     command: /Users/leilakarimi/Projects/ATGWSams/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/2q/m5qvgtkj1872r4695zkbpln80000gn/T/pip-install-w9uojyvq/troposphere_527f0b9692da4c9ca1d6451190752408/setup.py'"'"'; __file__='"'"'/private/var/folders/2q/m5qvgtkj1872r4695zkbpln80000gn/T/pip-install-w9uojyvq/troposphere_527f0b9692da4c9ca1d6451190752408/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/2q/m5qvgtkj1872r4695zkbpln80000gn/T/pip-pip-egg-info-hguo5f3y
         cwd: /private/var/folders/2q/m5qvgtkj1872r4695zkbpln80000gn/T/pip-install-w9uojyvq/troposphere_527f0b9692da4c9ca1d6451190752408/
    Complete output (1 lines):
    error in troposphere setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/35/a1/cfb1f6b2f271213da05fd5c67cda0256d7d841ba0edbfa815ae517c6235d/troposphere-2.2.0.tar.gz#sha256=b2e322063e2278e7d69822943d230b683ce9a0438db8ad017f610d344998453d (from https://pypi.org/simple/troposphere/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement troposphere==2.7.1 (from versions: 0.1.2, 0.2.0, 0.3.0, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.7.2, 1.0.0, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.7.0, 2.7.1, 3.0.0, 3.0.1, 3.0.2, 3.0.3)
ERROR: No matching distribution found for troposphere==2.7.1

Any thoughts/help is much appreciated.
thanks

A: setuptools 58 broke support for use_2to3. Therefore, you should add setuptools<58 to your requirements file along with troposphere<3. If you still get the same issue, downgrade setuptools first and then install troposphere with the other requirements.
Related question: Error while downloading the requirements using pip install (setup command: use_2to3 is invalid.)

A: We have forked zappa and removed the pinned requirement for Werkzeug. Zappa project been restarted but they have been late to update. You can read how to do this at this blog