text:
require "cases/helper"
require 'models/developer'
require 'models/project'
require 'models/company'
require 'models/customer'
require 'models/order'
require 'models/categorization'
require 'models/category'
require 'models/post'
require 'models/author'
require 'models/tag'
require 'models/tagging'
require 'models/parrot'
require 'models/pirate'
require 'models/treasure'
require 'models/price_estimate'
require 'models/club'
require 'models/member'
require 'models/membership'
require 'models/sponsor'
require 'models/country'
require 'models/treaty'
require 'active_support/core_ext/string/conversions'

class ProjectWithAfterCreateHook < ActiveRecord::Base
  set_table_name 'projects'
  has_and_belongs_to_many :developers,
    :class_name => "DeveloperForProjectWithAfterCreateHook",
    :join_table => "developers_projects",
    :foreign_key => "project_id",
    :association_foreign_key => "developer_id"

  after_create :add_david

  def add_david
    david = DeveloperForProjectWithAfterCreateHook.find_by_name('David')
    david.projects << self
  end
end

class DeveloperForProjectWithAfterCreateHook < ActiveRecord::Base
  set_table_name 'developers'
  has_and_belongs_to_many :projects,
    :class_name => "ProjectWithAfterCreateHook",
    :join_table => "developers_projects",
    :association_foreign_key => "project_id",
    :foreign_key => "developer_id"
end

class ProjectWithSymbolsForKeys < ActiveRecord::Base
  set_table_name 'projects'
  has_and_belongs_to_many :developers,
    :class_name => "DeveloperWithSymbolsForKeys",
    :join_table => :developers_projects,
    :foreign_key => :project_id,
    :association_foreign_key => "developer_id"
end

class DeveloperWithSymbolsForKeys < ActiveRecord::Base
  set_table_name 'developers'
  has_and_belongs_to_many :projects,
    :class_name => "ProjectWithSymbolsForKeys",
    :join_table => :developers_projects,
    :association_foreign_key => :project_id,
    :foreign_key => "developer_id"
end

class DeveloperWithCounterSQL < ActiveRecord::Base
  set_table_name 'developers'
  has_and_belongs_to_many :projects,
    :class_name => "DeveloperWithCounterSQL",
    :join_table => "developers_projects",
    :association_foreign_key => "project_id",
    :foreign_key => "developer_id",
    :counter_sql => 'SELECT COUNT(*) AS count_all FROM projects INNER JOIN developers_projects ON projects.id = developers_projects.project_id WHERE developers_projects.developer_id =#{id}'
end

class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
  fixtures :accounts, :companies, :categories, :posts, :categories_posts, :developers, :projects, :developers_projects,
           :parrots, :pirates, :treasures, :price_estimates, :tags, :taggings

  def setup_data_for_habtm_case
    ActiveRecord::Base.connection.execute('delete from countries_treaties')

    country = Country.new(:name => 'India')
    country.country_id = 'c1'
    country.save!

    treaty = Treaty.new(:name => 'peace')
    treaty.treaty_id = 't1'
    country.treaties << treaty
  end

  def test_should_property_quote_string_primary_keys
    setup_data_for_habtm_case

    con = ActiveRecord::Base.connection
    sql = 'select * from countries_treaties'
    record = con.select_rows(sql).last
    assert_equal 'c1', record[0]
    assert_equal 't1', record[1]
  end

  def test_should_record_timestamp_for_join_table
    setup_data_for_habtm_case

    con = ActiveRecord::Base.connection
    sql = 'select * from countries_treaties'
    record = con.select_rows(sql).last
    assert_not_nil record[2]
    assert_not_nil record[3]
    if current_adapter?(:Mysql2Adapter, :OracleAdapter)
      assert_match %r{\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}}, record[2].to_s(:db)
      assert_match %r{\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}}, record[3].to_s(:db)
    else
      assert_match %r{\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}}, record[2]
      assert_match %r{\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}}, record[3]
    end
  end

  def test_should_record_timestamp_for_join_table_only_if_timestamp_should_be_recorded
    begin
      Treaty.record_timestamps = false
      setup_data_for_habtm_case

      con = ActiveRecord::Base.connection
      sql = 'select * from countries_treaties'
      record = con.select_rows(sql).last
      assert_nil record[2]
      assert_nil record[3]
    ensure
      Treaty.record_timestamps = true
    end
  end

  def test_has_and_belongs_to_many
    david = Developer.find(1)

    assert !david.projects.empty?
    assert_equal 2, david.projects.size

    active_record = Project.find(1)
    assert !active_record.developers.empty?
    assert_equal 3, active_record.developers.size
    assert active_record.developers.include?(david)
  end

  def test_triple_equality
    assert !(Array === Developer.find(1).projects)
    assert Developer.find(1).projects === Array
  end

  def test_adding_single
    jamis = Developer.find(2)
    jamis.projects.reload # causing the collection to load
    action_controller = Project.find(2)
    assert_equal 1, jamis.projects.size
    assert_equal 1, action_controller.developers.size

    jamis.projects << action_controller

    assert_equal 2, jamis.projects.size
    assert_equal 2, jamis.projects(true).size
    assert_equal 2, action_controller.developers(true).size
  end

  def test_adding_type_mismatch
    jamis = Developer.find(2)
    assert_raise(ActiveRecord::AssociationTypeMismatch) { jamis.projects << nil }
    assert_raise(ActiveRecord::AssociationTypeMismatch) { jamis.projects << 1 }
  end

  def test_adding_from_the_project
    jamis = Developer.find(2)
    action_controller = Project.find(2)
    action_controller.developers.reload
    assert_equal 1, jamis.projects.size
    assert_equal 1, action_controller.developers.size

    action_controller.developers << jamis

    assert_equal 2, jamis.projects(true).size
    assert_equal 2, action_controller.developers.size
    assert_equal 2, action_controller.developers(true).size
  end

  def test_adding_from_the_project_fixed_timestamp
    jamis = Developer.find(2)
    action_controller = Project.find(2)
    action_controller.developers.reload
    assert_equal 1, jamis.projects.size
    assert_equal 1, action_controller.developers.size
    updated_at = jamis.updated_at

    action_controller.developers << jamis

    assert_equal updated_at, jamis.updated_at
    assert_equal 2, jamis.projects(true).size
    assert_equal 2, action_controller.developers.size
    assert_equal 2, action_controller.developers(true).size
  end

  def test_adding_multiple
    aredridel = Developer.new("name" => "Aredridel")
    aredridel.save
    aredridel.projects.reload
    aredridel.projects.push(Project.find(1), Project.find(2))
    assert_equal 2, aredridel.projects.size
    assert_equal 2, aredridel.projects(true).size
  end

  def test_adding_a_collection
    aredridel = Developer.new("name" => "Aredridel")
    aredridel.save
    aredridel.projects.reload
    aredridel.projects.concat([Project.find(1), Project.find(2)])
    assert_equal 2, aredridel.projects.size
    assert_equal 2, aredridel.projects(true).size
  end

  def test_adding_uses_default_values_on_join_table
    ac = projects(:action_controller)
    assert !developers(:jamis).projects.include?(ac)
    developers(:jamis).projects << ac

    assert developers(:jamis, :reload).projects.include?(ac)
    project = developers(:jamis).projects.detect { |p| p == ac }
    assert_equal 1, project.access_level.to_i
  end

  def test_habtm_attribute_access_and_respond_to
    project = developers(:jamis).projects[0]
    assert project.has_attribute?("name")
    assert project.has_attribute?("joined_on")
    assert project.has_attribute?("access_level")
    assert project.respond_to?("name")
    assert project.respond_to?("name=")
    assert project.respond_to?("name?")
    assert project.respond_to?("joined_on")
    # given that the 'join attribute' won't be persisted, I don't
    # think we should define the mutators
    #assert project.respond_to?("joined_on=")
    assert project.respond_to?("joined_on?")
    assert project.respond_to?("access_level")
    #assert project.respond_to?("access_level=")
    assert project.respond_to?("access_level?")
  end

  def test_habtm_adding_before_save
    no_of_devels = Developer.count
    no_of_projects = Project.count
    aredridel = Developer.new("name" => "Aredridel")
    aredridel.projects.concat([Project.find(1), p = Project.new("name" => "Projekt")])
    assert aredridel.new_record?
    assert p.new_record?
    assert aredridel.save
    assert !aredridel.new_record?
    assert_equal no_of_devels+1, Developer.count
    assert_equal no_of_projects+1, Project.count
    assert_equal 2, aredridel.projects.size
    assert_equal 2, aredridel.projects(true).size
  end

  def test_habtm_saving_multiple_relationships
    new_project = Project.new("name" => "Grimetime")
    amount_of_developers = 4
    developers = (0...amount_of_developers).collect {|i| Developer.create(:name => "JME #{i}") }.reverse

    new_project.developer_ids = [developers[0].id, developers[1].id]
    new_project.developers_with_callback_ids = [developers[2].id, developers[3].id]
    assert new_project.save

    new_project.reload
    assert_equal amount_of_developers, new_project.developers.size
    assert_equal developers, new_project.developers
  end

  def test_habtm_unique_order_preserved
    assert_equal developers(:poor_jamis, :jamis, :david), projects(:active_record).non_unique_developers
    assert_equal developers(:poor_jamis, :jamis, :david), projects(:active_record).developers
  end

  def test_build
    devel = Developer.find(1)
    proj = assert_no_queries { devel.projects.build("name" => "Projekt") }
    assert !devel.projects.loaded?

    assert_equal devel.projects.last, proj
    assert devel.projects.loaded?

    assert proj.new_record?
    devel.save
    assert !proj.new_record?
    assert_equal devel.projects.last, proj
    assert_equal Developer.find(1).projects.sort_by(&:id).last, proj  # prove join table is updated
  end

  def test_build_by_new_record
    devel = Developer.new(:name => "Marcel", :salary => 75000)
    proj1 = devel.projects.build(:name => "Make bed")
    proj2 = devel.projects.build(:name => "Lie in it")
    assert_equal devel.projects.last, proj2
    assert proj2.new_record?
    devel.save
    assert !devel.new_record?
    assert !proj2.new_record?
    assert_equal devel.projects.last, proj2
    assert_equal Developer.find_by_name("Marcel").projects.last, proj2  # prove join table is updated
  end

  def test_create
    devel = Developer.find(1)
    proj = devel.projects.create("name" => "Projekt")
    assert !devel.projects.loaded?

    assert_equal devel.projects.last, proj
    assert !devel.projects.loaded?

    assert !proj.new_record?
    assert_equal Developer.find(1).projects.sort_by(&:id).last, proj  # prove join table is updated
  end

  def test_create_by_new_record
    devel = Developer.new(:name => "Marcel", :salary => 75000)
    proj1 = devel.projects.build(:name => "Make bed")
    proj2 = devel.projects.build(:name => "Lie in it")
    assert_equal devel.projects.last, proj2
    assert proj2.new_record?
    devel.save
    assert !devel.new_record?
    assert !proj2.new_record?
    assert_equal devel.projects.last, proj2
    assert_equal Developer.find_by_name("Marcel").projects.last, proj2  # prove join table is updated
  end

  def test_creation_respects_hash_condition
    # in Oracle '' is saved as null therefore need to save ' ' in not null column
    post = categories(:general).post_with_conditions.build(:body => ' ')

    assert        post.save
    assert_equal  'Yet Another Testing Title', post.title

    # in Oracle '' is saved as null therefore need to save ' ' in not null column
    another_post = categories(:general).post_with_conditions.create(:body => ' ')

    assert        !another_post.new_record?
    assert_equal  'Yet Another Testing Title', another_post.title
  end

  def test_uniq_after_the_fact
    dev = developers(:jamis)
    dev.projects << projects(:active_record)
    dev.projects << projects(:active_record)

    assert_equal 3, dev.projects.size
    assert_equal 1, dev.projects.uniq.size
  end

  def test_uniq_before_the_fact
    projects(:active_record).developers << developers(:jamis)
    projects(:active_record).developers << developers(:david)
    assert_equal 3, projects(:active_record, :reload).developers.size
  end

  def test_uniq_option_prevents_duplicate_push
    project = projects(:active_record)
    project.developers << developers(:jamis)
    project.developers << developers(:david)
    assert_equal 3, project.developers.size

    project.developers << developers(:david)
    project.developers << developers(:jamis)
    assert_equal 3, project.developers.size
  end

  def test_deleting
    david = Developer.find(1)
    active_record = Project.find(1)
    david.projects.reload
    assert_equal 2, david.projects.size
    assert_equal 3, active_record.developers.size

    david.projects.delete(active_record)

    assert_equal 1, david.projects.size
    assert_equal 1, david.projects(true).size
    assert_equal 2, active_record.developers(true).size
  end

  def test_deleting_array
    david = Developer.find(1)
    david.projects.reload
    david.projects.delete(Project.find(:all))
    assert_equal 0, david.projects.size
    assert_equal 0, david.projects(true).size
  end

  def test_deleting_with_sql
    david = Developer.find(1)
    active_record = Project.find(1)
    active_record.developers.reload
    assert_equal 3, active_record.developers_by_sql.size

    active_record.developers_by_sql.delete(david)
    assert_equal 2, active_record.developers_by_sql(true).size
  end

  def test_deleting_array_with_sql
    active_record = Project.find(1)
    active_record.developers.reload
    assert_equal 3, active_record.developers_by_sql.size

    active_record.developers_by_sql.delete(Developer.find(:all))
    assert_equal 0, active_record.developers_by_sql(true).size
  end

  def test_deleting_all
    david = Developer.find(1)
    david.projects.reload
    david.projects.clear
    assert_equal 0, david.projects.size
    assert_equal 0, david.projects(true).size
  end

  def test_removing_associations_on_destroy
    david = DeveloperWithBeforeDestroyRaise.find(1)
    assert !david.projects.empty?
    assert_nothing_raised { david.destroy }
    assert david.projects.empty?
    assert DeveloperWithBeforeDestroyRaise.connection.select_all("SELECT * FROM developers_projects WHERE developer_id = 1").empty?
  end

  def test_additional_columns_from_join_table
    assert_date_from_db Date.new(2004, 10, 10), Developer.find(1).projects.first.joined_on.to_date
  end

  def test_destroying
    david = Developer.find(1)
    active_record = Project.find(1)
    david.projects.reload
    assert_equal 2, david.projects.size
    assert_equal 3, active_record.developers.size

    assert_difference "Project.count", -1 do
      david.projects.destroy(active_record)
    end

    assert_equal 1, david.reload.projects.size
    assert_equal 1, david.projects(true).size
  end

  def test_destroying_array
    david = Developer.find(1)
    david.projects.reload

    assert_difference "Project.count", -Project.count do
      david.projects.destroy(Project.find(:all))
    end

    assert_equal 0, david.reload.projects.size
    assert_equal 0, david.projects(true).size
  end

  def test_destroy_all
    david = Developer.find(1)
    david.projects.reload
    assert !david.projects.empty?
    david.projects.destroy_all
    assert david.projects.empty?
    assert david.projects(true).empty?
  end

  def test_deprecated_push_with_attributes_was_removed
    jamis = developers(:jamis)
    assert_raise(NoMethodError) do
      jamis.projects.push_with_attributes(projects(:action_controller), :joined_on => Date.today)
    end
  end

  def test_associations_with_conditions
    assert_equal 3, projects(:active_record).developers.size
    assert_equal 1, projects(:active_record).developers_named_david.size
    assert_equal 1, projects(:active_record).developers_named_david_with_hash_conditions.size

    assert_equal developers(:david), projects(:active_record).developers_named_david.find(developers(:david).id)
    assert_equal developers(:david), projects(:active_record).developers_named_david_with_hash_conditions.find(developers(:david).id)
    assert_equal developers(:david), projects(:active_record).salaried_developers.find(developers(:david).id)

    projects(:active_record).developers_named_david.clear
    assert_equal 2, projects(:active_record, :reload).developers.size
  end

  def test_find_in_association
    # Using sql
    assert_equal developers(:david), projects(:active_record).developers.find(developers(:david).id), "SQL find"

    # Using ruby
    active_record = projects(:active_record)
    active_record.developers.reload
    assert_equal developers(:david), active_record.developers.find(developers(:david).id), "Ruby find"
  end

  def test_include_uses_array_include_after_loaded
    project = projects(:active_record)
    project.developers.class # force load target

    developer = project.developers.first

    assert_no_queries do
      assert project.developers.loaded?
      assert project.developers.include?(developer)
    end
  end

  def test_include_checks_if_record_exists_if_target_not_loaded
    project = projects(:active_record)
    developer = project.developers.first

    project.reload
    assert ! project.developers.loaded?
    assert_queries(1) do
      assert project.developers.include?(developer)
    end
    assert ! project.developers.loaded?
  end

  def test_include_returns_false_for_non_matching_record_to_verify_scoping
    project = projects(:active_record)
    developer = Developer.create :name => "Bryan", :salary => 50_000

    assert ! project.developers.loaded?
    assert ! project.developers.include?(developer)
  end

  def test_find_in_association_with_custom_finder_sql
    assert_equal developers(:david), projects(:active_record).developers_with_finder_sql.find(developers(:david).id), "SQL find"

    active_record = projects(:active_record)
    active_record.developers_with_finder_sql.reload
    assert_equal developers(:david), active_record.developers_with_finder_sql.find(developers(:david).id), "Ruby find"
  end

  def test_find_in_association_with_custom_finder_sql_and_multiple_interpolations
    # interpolate once:
    assert_equal [developers(:david), developers(:jamis), developers(:poor_jamis)], projects(:active_record).developers_with_finder_sql, "first interpolation"
    # interpolate again, for a different project id
    assert_equal [developers(:david)], projects(:action_controller).developers_with_finder_sql, "second interpolation"
  end

  def test_find_in_association_with_custom_finder_sql_and_string_id
    assert_equal developers(:david), projects(:active_record).developers_with_finder_sql.find(developers(:david).id.to_s), "SQL find"
  end

  def test_find_with_merged_options
    assert_equal 1, projects(:active_record).limited_developers.size
    assert_equal 1, projects(:active_record).limited_developers.find(:all).size
    assert_equal 3, projects(:active_record).limited_developers.find(:all, :limit => nil).size
  end

  def test_dynamic_find_should_respect_association_order
    # Developers are ordered 'name DESC, id DESC'
    low_id_jamis = developers(:jamis)
    middle_id_jamis = developers(:poor_jamis)
    high_id_jamis = projects(:active_record).developers.create(:name => 'Jamis')

    assert_equal high_id_jamis, projects(:active_record).developers.find(:first, :conditions => "name = 'Jamis'")
    assert_equal high_id_jamis, projects(:active_record).developers.find_by_name('Jamis')
  end

  def test_dynamic_find_order_should_override_association_order
    # Developers are ordered 'name DESC, id DESC'
    low_id_jamis = developers(:jamis)
    middle_id_jamis = developers(:poor_jamis)
    high_id_jamis = projects(:active_record).developers.create(:name => 'Jamis')

    assert_equal low_id_jamis, projects(:active_record).developers.find(:first, :conditions => "name = 'Jamis'", :order => 'id')
    assert_equal low_id_jamis, projects(:active_record).developers.find_by_name('Jamis', :order => 'id')
  end

  def test_dynamic_find_all_should_respect_association_order
    # Developers are ordered 'name DESC, id DESC'
    low_id_jamis = developers(:jamis)
    middle_id_jamis = developers(:poor_jamis)
    high_id_jamis = projects(:active_record).developers.create(:name => 'Jamis')

    assert_equal [high_id_jamis, middle_id_jamis, low_id_jamis], projects(:active_record).developers.find(:all, :conditions => "name = 'Jamis'")
    assert_equal [high_id_jamis, middle_id_jamis, low_id_jamis], projects(:active_record).developers.find_all_by_name('Jamis')
  end

  def test_dynamic_find_all_order_should_override_association_order
    # Developers are ordered 'name DESC, id DESC'
    low_id_jamis = developers(:jamis)
    middle_id_jamis = developers(:poor_jamis)
    high_id_jamis = projects(:active_record).developers.create(:name => 'Jamis')

    assert_equal [low_id_jamis, middle_id_jamis, high_id_jamis], projects(:active_record).developers.find(:all, :conditions => "name = 'Jamis'", :order => 'id')
    assert_equal [low_id_jamis, middle_id_jamis, high_id_jamis], projects(:active_record).developers.find_all_by_name('Jamis', :order => 'id')
  end

  def test_dynamic_find_all_should_respect_association_limit
    assert_equal 1, projects(:active_record).limited_developers.find(:all, :conditions => "name = 'Jamis'").length
    assert_equal 1, projects(:active_record).limited_developers.find_all_by_name('Jamis').length
  end

  def test_dynamic_find_all_order_should_override_association_limit
    assert_equal 2, projects(:active_record).limited_developers.find(:all, :conditions => "name = 'Jamis'", :limit => 9_000).length
    assert_equal 2, projects(:active_record).limited_developers.find_all_by_name('Jamis', :limit => 9_000).length
  end

  def test_dynamic_find_all_should_respect_readonly_access
    projects(:active_record).readonly_developers.each { |d| assert_raise(ActiveRecord::ReadOnlyRecord) { d.save!  } if d.valid?}
    projects(:active_record).readonly_developers.each { |d| d.readonly? }
  end

  def test_new_with_values_in_collection
    jamis = DeveloperForProjectWithAfterCreateHook.find_by_name('Jamis')
    david = DeveloperForProjectWithAfterCreateHook.find_by_name('David')
    project = ProjectWithAfterCreateHook.new(:name => "Cooking with Bertie")
    project.developers << jamis
    project.save!
    project.reload

    assert project.developers.include?(jamis)
    assert project.developers.include?(david)
  end

  def test_find_in_association_with_options
    developers = projects(:active_record).developers.find(:all)
    assert_equal 3, developers.size

    assert_equal developers(:poor_jamis), projects(:active_record).developers.find(:first, :conditions => "salary < 10000")
    assert_equal developers(:jamis),      projects(:active_record).developers.find(:first, :order => "salary DESC")
  end

  def test_replace_with_less
    david = developers(:david)
    david.projects = [projects(:action_controller)]
    assert david.save
    assert_equal 1, david.projects.length
  end

  def test_replace_with_new
    david = developers(:david)
    david.projects = [projects(:action_controller), Project.new("name" => "ActionWebSearch")]
    david.save
    assert_equal 2, david.projects.length
    assert !david.projects.include?(projects(:active_record))
  end

  def test_replace_on_new_object
    new_developer = Developer.new("name" => "Matz")
    new_developer.projects = [projects(:action_controller), Project.new("name" => "ActionWebSearch")]
    new_developer.save
    assert_equal 2, new_developer.projects.length
  end

  def test_consider_type
    developer = Developer.find(:first)
    special_project = SpecialProject.create("name" => "Special Project")

    other_project = developer.projects.first
    developer.special_projects << special_project
    developer.reload

    assert developer.projects.include?(special_project)
    assert developer.special_projects.include?(special_project)
    assert !developer.special_projects.include?(other_project)
  end

  def test_update_attributes_after_push_without_duplicate_join_table_rows
    developer = Developer.new("name" => "Kano")
    project = SpecialProject.create("name" => "Special Project")
    assert developer.save
    developer.projects << project
    developer.update_attribute("name", "Bruza")
    assert_equal 1, Developer.connection.select_value(<<-end_sql).to_i
      SELECT count(*) FROM developers_projects
      WHERE project_id = #{project.id}
      AND developer_id = #{developer.id}
    end_sql
  end

  def test_updating_attributes_on_non_rich_associations
    welcome = categories(:technology).posts.first
    welcome.title = "Something else"
    assert welcome.save!
  end

  def test_habtm_respects_select
    categories(:technology).select_testing_posts(true).each do |o|
      assert_respond_to o, :correctness_marker
    end
    assert_respond_to categories(:technology).select_testing_posts.find(:first), :correctness_marker
  end

  def test_updating_attributes_on_rich_associations
    david = projects(:action_controller).developers.first
    david.name = "DHH"
    assert_raise(ActiveRecord::ReadOnlyRecord) { david.save! }
  end

  def test_updating_attributes_on_rich_associations_with_limited_find_from_reflection
    david = projects(:action_controller).selected_developers.first
    david.name = "DHH"
    assert_nothing_raised { david.save! }
  end

  def test_updating_attributes_on_rich_associations_with_limited_find
    david = projects(:action_controller).developers.find(:all, :select => "developers.*").first
    david.name = "DHH"
    assert david.save!
  end

  def test_join_table_alias
    assert_equal 3, Developer.find(:all, :include => {:projects => :developers}, :conditions => 'developers_projects_join.joined_on IS NOT NULL').size
  end

  def test_join_with_group
    group = Developer.columns.inject([]) do |g, c|
      g << "developers.#{c.name}"
      g << "developers_projects_2.#{c.name}"
    end
    Project.columns.each { |c| group << "projects.#{c.name}" }

    assert_equal 3, Developer.find(:all, :include => {:projects => :developers}, :conditions => 'developers_projects_join.joined_on IS NOT NULL', :group => group.join(",")).size
  end

  def test_find_grouped
    all_posts_from_category1 = Post.find(:all, :conditions => "category_id = 1", :joins => :categories)
    grouped_posts_of_category1 = Post.find(:all, :conditions => "category_id = 1", :group => "author_id", :select => 'count(posts.id) as posts_count', :joins => :categories)
    assert_equal 4, all_posts_from_category1.size
    assert_equal 1, grouped_posts_of_category1.size
  end

  def test_find_scoped_grouped
    assert_equal 4, categories(:general).posts_grouped_by_title.size
    assert_equal 1, categories(:technology).posts_grouped_by_title.size
  end

  def test_find_scoped_grouped_having
    assert_equal 2, projects(:active_record).well_payed_salary_groups.size
    assert projects(:active_record).well_payed_salary_groups.all? { |g| g.salary > 10000 }
  end

  def test_get_ids
    assert_equal projects(:active_record, :action_controller).map(&:id).sort, developers(:david).project_ids.sort
    assert_equal [projects(:active_record).id], developers(:jamis).project_ids
  end

  def test_get_ids_for_loaded_associations
    developer = developers(:david)
    developer.projects(true)
    assert_queries(0) do
      developer.project_ids
      developer.project_ids
    end
  end

  def test_get_ids_for_unloaded_associations_does_not_load_them
    developer = developers(:david)
    assert !developer.projects.loaded?
    assert_equal projects(:active_record, :action_controller).map(&:id).sort, developer.project_ids.sort
    assert !developer.projects.loaded?
  end

  def test_assign_ids
    developer = Developer.new("name" => "Joe")
    developer.project_ids = projects(:active_record, :action_controller).map(&:id)
    developer.save
    developer.reload
    assert_equal 2, developer.projects.length
    assert_equal [projects(:active_record), projects(:action_controller)].map(&:id).sort, developer.project_ids.sort
  end

  def test_assign_ids_ignoring_blanks
    developer = Developer.new("name" => "Joe")
    developer.project_ids = [projects(:active_record).id, nil, projects(:action_controller).id, '']
    developer.save
    developer.reload
    assert_equal 2, developer.projects.length
    assert_equal [projects(:active_record), projects(:action_controller)].map(&:id).sort, developer.project_ids.sort
  end

  def test_scoped_find_on_through_association_doesnt_return_read_only_records
    tag = Post.find(1).tags.find_by_name("General")

    assert_nothing_raised do
      tag.save!
    end
  end

  def test_has_many_through_polymorphic_has_manys_works
    assert_equal [10, 20].to_set, pirates(:redbeard).treasure_estimates.map(&:price).to_set
  end

  def test_symbols_as_keys
    developer = DeveloperWithSymbolsForKeys.new(:name => 'David')
    project = ProjectWithSymbolsForKeys.new(:name => 'Rails Testing')
    project.developers << developer
    project.save!

    assert_equal 1, project.developers.size
    assert_equal 1, developer.projects.size
    assert_equal developer, project.developers.find(:first)
    assert_equal project, developer.projects.find(:first)
  end

  def test_self_referential_habtm_without_foreign_key_set_should_raise_exception
    assert_raise(ActiveRecord::HasAndBelongsToManyAssociationForeignKeyNeeded) {
      Member.class_eval do
        has_and_belongs_to_many :friends, :class_name => "Member", :join_table => "member_friends"
      end
    }
  end

  def test_dynamic_find_should_respect_association_include
    # SQL error in sort clause if :include is not included
    # due to Unknown column 'authors.id'
    assert Category.find(1).posts_with_authors_sorted_by_author_id.find_by_title('Welcome to the weblog')
  end

  def test_counting_on_habtm_association_and_not_array
    david = Developer.find(1)
    # Extra parameter just to make sure we aren't falling back to
    # Array#count in Ruby >=1.8.7, which would raise an ArgumentError
    assert_nothing_raised { david.projects.count(:all, :conditions => '1=1') }
  end

  def test_count
    david = Developer.find(1)
    assert_equal 2, david.projects.count
  end

  def test_count_with_counter_sql
    developer  = DeveloperWithCounterSQL.create(:name => 'tekin')
    developer.project_ids = [projects(:active_record).id]
    developer.save
    developer.reload
    assert_equal 1, developer.projects.count
  end

  unless current_adapter?(:PostgreSQLAdapter)
    def test_count_with_finder_sql
      assert_equal 3, projects(:active_record).developers_with_finder_sql.count
      assert_equal 3, projects(:active_record).developers_with_multiline_finder_sql.count
    end
  end

  def test_association_proxy_transaction_method_starts_transaction_in_association_class
    Post.expects(:transaction)
    Category.find(:first).posts.transaction do
      # nothing
    end
  end

  def test_caching_of_columns
    david = Developer.find(1)
    # clear cache possibly created by other tests
    david.projects.reset_column_information
    assert_queries(0) { david.projects.columns; david.projects.columns }
    # and again to verify that reset_column_information clears the cache correctly
    david.projects.reset_column_information
    assert_queries(0) { david.projects.columns; david.projects.columns }
  end

end


Saint Leo the Great School is a place for all its members to encounter the Living God through the proclamation of the Gospel of Jesus Christ. Its sacred mission is the formation of youth entrusted to its care through spiritual, educational, social and athletic activities.
Administrators, Faculty and Staff, in imitation of the Lord Jesus, lovingly guide students to a deeper knowledge and practice of the Faith. The gradual process of integration of internalized values is concretely expressed through service to God and community.
We believe in the capacity of the individual to lead with compassion, learn with commitment, and act with courage. Focusing on the needs of each child, we achieve our purpose by word and deed. Students are inspired to achieve the highest standards in intellectual achievement through developmentally appropriate instruction that allows for individual differences and learning styles. They are encouraged to be active participants in their commitment to God, kindness to each other, and pursuit of knowledge.
PASTOR Reverend John T. Folchetti, D. Min.


text:
Q: How to read POST data in the Guile web server In Guile's web server I can't seem to find any documentation on reading POST data. It seems to be sent to my entrypoint function as "body" along with the "request". It looks like body is encoded as a bytevector and I can decode it into a string:
(use-modules (rnrs bytevectors))
(utf8->string body)

So from here I could proceed to parse the string, but that seems rather tedious and error prone. Is there no way to read the POST data as a list of some kind?

A: Here is the code of decode procedure which will convert a BODY into an association list of lists where the key is the name of the form field and the value is a list of values associated with that key. Mind the fact that the "value" associated with a given key in the assoc returned by decode is always a list.
(define-module (web decode))

(use-modules (ice-9 match))
(use-modules (rnrs bytevectors))
(use-modules (srfi srfi-1))
(use-modules (srfi srfi-26))
(use-modules (web uri))

;;;
;;; decode
;;;

(define (acons-list k v alist)
  "Add V to K to alist as list"
  (let ((value (assoc-ref alist k)))
    (if value
        (let ((alist (alist-delete k alist)))
          (acons k (cons v value) alist))
        (acons k (list v) alist))))

(define (list->alist lst)
  "Build a alist of list based on a list of key and values.

   Multiple values can be associated with the same key"
  (let next ((lst lst)
             (out '()))
    (if (null? lst)
        out
        (next (cdr lst) (acons-list (caar lst) (cdar lst) out)))))

(define-public (decode bv)
  "Convert BV querystring or form data to an alist"
  (define string (utf8->string bv))
  (define pairs (map (cut string-split <> #\=)
                     ;; semi-colon and amp can be used as pair separator
                     (append-map (cut string-split <> #\;)
                                 (string-split string #\&))))
  (list->alist (map (match-lambda
                      ((key value)
                       (cons (uri-decode key) (uri-decode value)))) pairs)))

redpajama_set_name: RedPajamaStackExchange


text:
THR Software Modernisation Project
Previously in 2012, alongside partner companies, we developed a system to monitor the corrosion of steel cables in post-tensioned concrete. In 2017, we were again approached by Hydro Tasmania to conduct the THR software modernisation project.
One of the major goals was to integrate the THR system into the rest of Hydro Tasmania's infrastructure. Thus the existing proprietary data controller had to be replaced with a Campbell Scientific logger and required changes to the interfacing hardware.
We worked alongside the same partners (Custom & Contract Power Solutions (CCPS), Independent Integrity Testing (i2t) and Entura) to bring the software modernisation project to fruition.
Devious Solutions installed the new system in the Repulse Power Station. Repulse is upstream from the previous project in Meadowbank Power Station on the River Derwent.
Replacing the existing controller required us to undertake the following tasks:
changing the control language from C to CRBasic
meeting the end client's data requirements
updating the communications protocol to be compatible with CRBasic's best practises
first full on-site integration testing
adapt to any unforeseen integration issues at install
post installation support
Devious Solutions delivered the project on time and on budget. As of October 2018, the project is still in the prototype phase and is still being reviewed by Hydro Tasmania and Entura. We're looking forward to deploying more systems in the future!
THR Monitoring System
In 2012, a pilot scheme was initiated by Hydro Tasmania to establish a suitable, non-destructive monitoring technique to determine the health of steel cables in post-tensioned concrete. At that time, the methodology consisted of manually inspecting the cables once per annum. The process would take a team a few days to complete.
Some of the hydro-electric dams have been in use for at least half a century and were expected to have a range of steel cable corrosion.
Working in conjunction with Custom & Contract Power Solutions (CCPS) and Independent Integrity Testing (i2t), a prototype system was developed to automatically monitor the state of health of the steel cables in post-tensioned concrete. Design and development of the system began in May 2012, and the first on-site readings were taken in June.
Devious Solutions was responsible for developing the embedded monitoring system. The monitoring system consisted of an embedded Linux device performing various duties:
communicating with CCPS' proprietary sensors over RS-485
providing external FTP access to allow the client to collect data
providing a web interface for managing the system
developing an online system to aggregate and display recorded data
Other responsibilities included:
liaising with the end client to produce software requirements
designing, implementing and testing the system
providing on-going support during the prototyping phase of the project
Most readings are taken daily, some (like temperature data) are taken more regularly. The data is stored locally in the monitors but provides an Ethernet port for remote access and control. The system is self-contained and thus not connected to the outside world.
When the team arrived on site, they worked alongside Entura to deploy the system.
Whilst originally conceived as a 12-month feasibility study, the sensors installed in Meadowbank Power Station are still in use at the time of writing (September 2018).
The monitoring system had to be low power, and this came with some compromises for the hardware platform, including limited storage memory and not having a memory management unit.
Due to the nature of the site, the non-destructive monitoring system software and hardware platform had to be robust. The system had to be able to withstand sudden data loss. Although the system had an inbuilt battery backup, it was within the scope of the project that the batteries would deteriorate over time and might not keep the system sufficiently powered during a prolonged shutdown. This necessitated the use of a real-time clock (RTC). Due to the limitations of the hardware platform, the time had to be queried via RS-485 from a dedicated chip if the embedded monitor lost its time.
The system also had to be IP 67 rated (dustproof and waterproof). In fact, it would later transpire that one of the sensors became entirely submerged due to heavy rains!
The project was delivered on time and on budget. Initially, the prototype phase was to last until June 2013 but was extended until the end of 2013. The prototype system is still functional and to be used indefinitely.
In 2017, Hydro Tasmania sought to install more sensors in another hydro-electric dam (Repulse) and sought to better integrate the THR sensors with their existing SCADA infrastructure. At the time of writing, it is their intention to deploy the system across more assets. Read more about the extension project here.
© Copyright 2018 Devious Solutions
This site runs by using cookies - and not just the edible kind. By continuing to use this site - we need your consent. more information
Okay - begone little box

redpajama_set_name: RedPajamaCommonCrawl


text:
Home / Blog / Article
Obama's Overtime Rule is Down, but Not Out
Patrice L. Onwuka
Just when it looked like a costly new workplace rule that erodes flexibility in the workplace was done for, the Obama Administration is seeking a last-ditch effort to keep it alive.
The overtime rule, which expanded the number of American workers who would be eligible for time-and-a-half, was halted last week by a federal judge, who found that the Department of Labor had overstepped its authority in drastically changing the overtime rules by making heretofore ineligible people elbible. This authority should belong to Congress.
As part of his workforce reform, overhauling overtime is a measure that President Obama is defending. Department of Labor officials reportedly just filed an appeal of the federal injunction with a federal court in Texas. The Administration hopes that the block will be lifted and they can push forward with implementing this sweeping national rule affecting about 4 million U.S. workers before the next administration arrives. The White House remains defiant:
NPR's Scott Horsley quoted White House spokesman Josh Earnest as saying the Obama administration isn't giving up:
"That injunction was granted to some large businesses and Republican governors who had colluded to try to disrupt the implementation of this rule. And essentially continue to take advantage of more than 4 million of the hardest-working Americans."
The DOL rule would redefine upward those who must be paid overtime. The DOL rules would lower the threshold for American workers who can receive overtime pay from $23,660 to $47,476 a year. This would make more than a million new workers eligible for overtime.
The DOL rules would mean that supervisors would watch employees who had previously had flexibility like hawks to make sure they didn't trigger overtime. Many people who are considered management and have salaries appropriate for management and are expected to take on duties appropriate to management and career advancement will now be treated like hourly workers. To say that businesses are taking advantage of people promoted into management positions and compensated accordingly is unfair to businesses.
Some companies made shifts to their staffing such as moving workers from salary to hourly to better track their time. Others boosted pay for those workers – although not for all of the other workers.
Sweeping changes like the overtime rule may be celebrated by some, but have far-reaching implications that hurt many others. We hope that this rule is not revived in the short-term and will overturned in the long-run by the next Administration.


text:
Valentines in good times and bad8 min read
By Catholic Herald|2021-02-15T15:58:21-06:00February 19, 2021|Local News|
Ed and Geraldine Boziel, Arbor Vitae, are pictured with their family for the celebration of their 70th wedding anniversary in November. (Submitted photo)
Jenny Snarski
Catholic Herald Staff
"Marriage is love, health, hard work and togetherness."
Those words are how Geraldine Boziel, a parishioner at Holy Family Catholic Church in Woodruff, describes marriage.
Geraldine and her husband, Ed, celebrated their 70th wedding anniversary on Nov. 18.
The couple, who grew up in the same neighborhood in the Milwaukee area, has lived in Arbor Vitae since their retirement in 1984. One of their two sons lives in nearby St. Germain, and the other still lives near Milwaukee.
"It was a hot August night," Ed said, setting the scene for the first time he asked Geraldine out. A group of neighborhood teens were at South Shore Park to swim.
Eighteen years old and recently out of seminary high school, Boziel asked 17-year-old Geraldine if she wanted to go dancing.
She abruptly said no, but as he returned from swimming, she approached him and asked if they could go see a show instead.
Boziel described the Sunday night they went to the movies: "She looked in my eyes, and I looked in hers, and that was it."
Geraldine acknowledged it was "love at first sight," while also expressing her own sense of initiative.
The young couple dated for two years before marrying in November 1950, but Ed recounted how, while he was laying tile with his future father-in-law, Geraldine came up and announced to them both, "We're getting married Nov. 18."
"You never asked me," Ed repeated his reaction and Geraldine's response that followed – simply that she didn't have to – and they both laughed.
The Boziels say they miss the simpler days of the past, the beautiful, peaceful country they were raised in, with different predominant values where family came first and marriage as a lifelong commitment was a given.
Their love story is not without hardship. Not long after the couple was married, Ed was called on the serve his country in the military and spent the next two years in Korea.
Geraldine lived right near her parents and had a job to keep her busy, but Ed chimed in that it wasn't easy to miss two Christmases, two Thanksgivings and birthdays.
Today, the means of communication between servicemen and -women are nothing like "back then." Letters were the spouses' only way to communicate, and when things changed while the mail was en route, there was no quicker form of updating information sent home.
Boziel told his wife when to stop writing based on when he was expected to make his way back to the U.S.
Wait and wait and wait was all Geraldine could do when two weeks had passed beyond the date her husband expected to return.
"You didn't get information like you do today," she said. It was suggested she ask the Red Cross for help, but they informed the young bride they didn't have any way of knowing where to try and contact Ed if he were en route.
The two were reunited two weeks later, one full month past his scheduled arrival.
The cause of his delay? Weather. What should have been a 12-day crossing, given it was January, took much longer – there were 60-foot swells and terrible, terrible storms, Boziel added. "Sicker than a dog," he said, all they could do was pray, try to get some fresh air and keep a little food down.
Saying "only veterans can understand" stories like these, which the average person would not have ever encountered, Boziel was grateful to return to the same job with the Milwaukee County Park Commission.
In 1956, the couple welcomed the first of their two sons and life moved on – "the beautiful old days," as Ed put it.
One of their two grandsons was involved in helping to pull off a small family surprise celebration for their November anniversary. Another unforeseen weather event – this time in their favor – allowed for a beautiful, 60-degree afternoon visiting near the beach.
Geraldine shared that their granddaughter-in-law arranged for the gift of a "beautiful keepsake" for the occasion – a papal blessing, which now hangs in their home's dining room in a frame handcrafted by their grandson.
Asked about what advice they could give on marriage, the couple's conversation moved back to differences in generational understanding and appreciation of what is important in life.
The Boziels mentioned respect, understanding the need take care of one's physical health and to enjoy life, to enjoy the outdoors, a sense of community and positivity.
"You got hard times and good times," said Geraldine, with Ed assenting in the background. "The good times override the bad ones, but everybody goes through that and you work yourself out of it. Nobody's perfect."
They also agreed, "Old age is not for sissies." You have to be healthy in body and mind – take one day at a time and just do your best.


The 2013 Steven's Hope for Children Drives To Save Lives Golf Classic will be held at the beautiful Red Hill Country Club on Monday, May 20. The event was moved this year to the Rancho Cucamonga golf course.
This year, former Los Angeles Laker and NBA Hall Of Fame Member, James Worthy will be the featured guest speaker at the auction and banquet following the tournament. Known as "Big Game" James will be sharing stories of his time sharing the hardword with other Laker stars on their way to winning NBA Championships. Entry to the banquet is included with the fee to play in the golf tournament. Individual tickets to the banquet are available on a very limited basis for $75 each.
However, Mr. Worthy won't be the only celebrity attending the day's festivities. Several NFL and MLB stars are scheduled to attend the tournament and will be playing with selected sponsors. Some celebrities may be available to play with foursomes as a "fifth" by upgrading to "Celebrity" status with the payment of an additional $1000 to Steven's Hope. The tournament is expected to sell out again this year.
AMPM returns again as the Presenting Sponsor for the golf classic. Sponsorships vary in benefit and price. Remaining sponsorships include an Event Sponsor which includes golf for 8, two celebrities to play with, signage, and more for $5,000. Dinner, Cart, Grand Prize sponsors are $3,000 and include one foursome, signage, a celebrity and much more. Additional sponsorships range from $100 to $2500. Individual players are $250 each and a foursome is $1,000.
The banquet and auction will take place in the main dining room of Red Hill Country Club. Prizes that will be auctioned off include a suite for the Rancho Cucamonga Quakes, dinner for 8 with James Worthy, and golf for four at Spyglass and Pebble Beach Golf Courses. Business are encouraged to contact Steven's Hope to discuss any in-kind donations that could be made for the auction.
The golf tournament began eleven years ago as the first event hosted by Steven's Hope to raise funds and awareness for the Upland based charity. Steven's Hope was started by Tony & Sandy Cappelli after the death of their son, Steven. Since then, the tournament has grown in popularity and was renamed to the Drives To Save Lives Golf Classic.
Registration will open at 8:30 and following the ceremonial balloon release the shotgun start will begin at 10:30 with the banquet following at 4:00PM.
Here's a quick and easy way to help brighten a child's face on Christmas Day. Sign up to Host a Toy Drive, Adopt a child or just Donate a new toy, present or gift card to Steven's Hope. We have the biggest request list ever and we need help filling all the requests. We are short on toys for the younger kids and are desperately in need of gift cards for teenagers. Just a $25 gift card to WalMart, Target or BestBuy goes a long way.
This year, deliveries are planned to Loma Linda University Medical Center, Pomona Valley Medical Center, Arrowhead Regional Medical Center, Kaiser Permanente Fontana, San Antonio Communtiy Hospital and City of Hope. For more info call the office about helping Winter Wonderland.
For more info, click here or call the office at 909-373-0678.
Steven's Hope has announced a new project designed to help families of seriously ill children throuighout the year. The project called Wonderland All Year, or The WAY Project will assist families with $100 of grocery cards, gas cards and clothing cards to the Children's Boutique at Steven's Hope every month. Additionally, families will receive additional benefits at birthdays and various holidays. The project will begin January 1, 2013 and will benefit ten families from southern California.
Seven local area hospitals will be receiving toys from the Steven's Hope Winter Wonderland Project. Early estimates are to deliver over $70,000 of toys to seriously ill or injured children and their siblings. Toy drives are being organized by individuals, groups, schools and clubs to help fulfill the need for toys. Some children/families are available for "adoption" for Christmas gifts. For more information click here.
Steven's Hope for Children is offering tickets to the Concerts Under The Stars presented by the Hafif Family Foundation. The annual event helps to raise funds for numerous nonprofit groups throughout the Southern California Area. Charities like Steven's Hope benefit by selling tickets to the outdoor concerts in La Verne and receive 100% of ticket proceeds. All expenses of the concert and dinner are paid for by the Hafif Family Foundation.
Concert dates are July 14 and 21 and August 4. Ticket prices are $55 each and include dinner. Beverages including wine will be available for purchase at the event.
The concert takes place on the 100 acre estate of Herb & Kay Hafif. The venue features statues and lush landscaping which creates a comfortable and beautiful setting for the outdoor concert.
Tickets are available on a first come-first served basis. For information, call Lulu at the SHFC office.


text:
Q: Audio Track keep playing sound after audio track released I am using an Audio Track to play a sound.I am initializing the Audio Track in this way.
numSamples = duration * sampleRate;
sample = new double[numSamples];
generatedSnd = new byte[2 * numSamples];
length_snd = generatedSnd.length;
audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate,
                AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT,
                length_snd, AudioTrack.MODE_STATIC);

Then i am generating the sound in this way.
for (int i = 0; i < numSamples; ++i) {
    freqOfTone = freqOfTone + 1;
    sample[i] = Math.sin(2 * Math.PI * i / (sampleRate / freqOfTone));

    if(freqOfTone > 22500){
        freqOfTone = 10000;
    }
}
int idx = 0;
for (final double dVal : sample) {
    // scale to maximum amplitude
    final short val = (short) ((dVal * 32767));
    // in 16 bit wav PCM, first byte is the low order byte
    generatedSnd[idx++] = (byte) (val & 0x00ff);
    generatedSnd[idx++] = (byte) ((val & 0xff00) >>> 8);
}

Now i am playing the sound like :
audioTrack.write(generatedSnd, 0, generatedSnd.length);
audioTrack.play();

And stopping the track like the way:
audioTrack.release();
audioTrack.flush();
System.out.println("!!running"+audioTrack.getPlayState());
audioTrack = null;

Now problem is that if I do the process(play and stop) continuously some time audio is playing after the track has released.I have checked the play state which is showing 1 at the time of release but audio is still playing.
Thanks In Advance.

A: Following code works to me.
audioTrack.stop();
audioTrack.flush();
audioTrack.release();
audioTrack = null;


Why I've Joined Reboot with Joe: I am hoping to find a way to regain my health. I am 5 years out from breast cancer and I have hypothyroid. I am carrying 50 additional pounds. I am on a journey to become healthy again.


text:
Otto Heinz Brückner (* 8. März 1900 in Dresden; † 19. April 1968) war ein deutscher SS-Führer, der in der Volksdeutschen Mittelstelle das Amt VI (Sicherung Deutschen Volkstums im Reich) leitete. Im Prozess Rasse- und Siedlungshauptamt der SS (RuSHA-Prozess) wurde Brückner 1948 zu einer Haftstrafe von 15 Jahren verurteilt, aber schon Anfang 1951 freigelassen.

Leben
Heinz Brückner trat zum 1. Mai 1933 der NSDAP (Mitgliedsnummer 3.545.880) und 1940 der SS bei, er erreichte dort den Rang eines SS-Sturmbannführers. Nach dem Zweiten Weltkrieg behauptete er, sein Beitritt sei im Zusammenhang mit der von ihm geleiteten Umsiedlung von "Volksdeutschen" aus Litauen in das Deutsche Reich 1940 notwendig gewesen, da die Sowjets darauf bestanden hätten, auf höherer Ebene nur mit Uniformträgern mit Offiziersrang zu verhandeln. Dies war – wie auch bei anderen SS-Leuten in der Volksdeutschen Mittelstelle (VoMi) – eine Schutzbehauptung; der Beitritt zur Allgemeinen SS war auch in der VoMi freiwillig und nicht notwendige Voraussetzung für eine Leitungsfunktion. Zum Beispiel traten zwei andere VoMi-Amtschefs – Adolf Puls und Lothar Heller – der SS erst 1944 bei.

Im RuSHA-Prozess, einem der zwölf Nürnberger Nachfolgeprozesse wurde Brückner 1947 wegen (1) Kriegsverbrechen, (2) Verbrechen gegen die Menschlichkeit und (3) Mitgliedschaft in einer verbrecherischen Organisation angeklagt. Am 10. März 1948 wurde er in allen drei Anklagepunkten für schuldig befunden. Insbesondere wurden ihm seine Verantwortung für die Entführung von nicht-deutschen Kindern, für die Erschwerung der Fortpflanzung von Nicht-Deutschen, die Zwangsvertreibung und -umsiedlung von Ausländern, die Zwangs-"Eindeutschung" von Ausländern und die Zwangsarbeit von Ausländern sowie seine Mitgliedschaft in der verbrecherischen SS zur Last gelegt. Als Strafmaß wurden 15 Jahre Haft festgesetzt. Brückner wurde am 3. Januar 1951 aus dem Kriegsverbrechergefängnis Landsberg freigelassen.

Literatur
 Valdis O. Lumans: Himmler's Auxiliaries : the Volksdeutsche Mittelstelle and the German National Minorities of Europe, 1933–1945. University of North Carolina Press, Chapel Hill 1993, ISBN 0-8078-2066-0.
 Trials of War Criminals before the Nuernberg Military Tribunals under Control Council Law No. 10, Vol. IV ("The RuSHA Case"). United States Government Printing Office, District of Columbia 1950, S. 597–1185. (Band 4 (PDF; 56,9 MB) der "Green Series")
 Trials of War Criminals before the Nuernberg Military Tribunals under Control Council Law No. 10, Vol. V ("The RuSHA Case continued."). US Government Printing Office, District of Columbia 1950, S. 1–192. (Band 5 (PDF; 31,0 MB) der "Green Series")
 Harry Stossun, Die Umsiedlungen der Deutschen aus Litauen während des zweiten Weltkrieges  : Untersuchungen zum Schicksal einer deutschen Volksgruppe im Osten, Marburg/Lahn : J.G. Herder-Institut 1993 ISBN 3-87969-231-9

Weblinks
 Urteil gegen Heinz Brückner. In: Trials of War Criminals before the Nuernberg Military Tribunals, Vol. V, S. 159f. (englisch)

Einzelnachweise

NSDAP-Mitglied
SS-Mitglied
Verurteilte Person (Nürnberger Prozesse)
Person (deutsche Besetzung Litauens 1941–1945)
Verurteilte Person (NS-Kriegsverbrechen)
Deutscher
Geboren 1900
Gestorben 1968
Mann

redpajama_set_name: RedPajamaWikipedia


Sell my house fast Tampa FL - We Buy Houses in Tampa!
We Want To Buy Your House In Tampa FL!
No matter what condition the property is in, we can help!
If you have thought about selling in the past, now is the time to do it! We are ready to make you an offer now, without any fees or red-tape to contend with. Selling can be a simple, fast and even enjoyable process. Let us show you how!
Learn More About Our Fast and Fair Process Here.
After years in the local real estate industry, we realized… listing doesn't make sense for every house. Some properties fare much better by selling via a direct offer. This is why we started Offer4Cash.com. We wanted to help homeowners in the Tampa area, who felt burdened or stuck with a rundown house. We have since streamlined and perfected the process. We are now able to help people in foreclosure, people dealing with divorce and people who simply want to sell without the delays and hassles of listing. We have been able to help homeowners and also help revitalize neighborhoods. By providing a straightforward offer, without the use of an agency or lender, we are able to close quickly all while saving you a ton of money.
You can stop throwing away money on a house you don't want to own any longer. A property you are consistently sinking money into will only cause you stress in the long run. At some point, you have to cut your losses and walk away from a burdensome house!
Are you the recipient of an unwanted inheritance? We can help you figure out what to do with it!
Do you need to move because of work or other personal reason? We can help with a fast sale!
Does the property need more repairs than you can afford? You don't need to keep putting band-aids on a property that's falling apart!
Is foreclosure knocking at your door… literally? We can help save your credit.
Do you need to downsize a property that is too large for your current needs?
When Selling Your House in Tampa, You Have Options Other Than Listing!
No need to clean up. We will take care of everything.
What we offer is exactly what you'll get. There are no fees, commission or other charges to worry about.
We close on your terms, you decide the closing date… but we are ready in only 7 days!
If you decide to list, you need to be prepared for the sale to fall through. Statistically, more and more sales are falling through each year! With us, you don't have to worry about that. We will pay you directly, without the need for bank financing.
Let us make you an offer now! There is no hassle or obligation!
Offer4Cash.com is buying houses right now in Tampa FL. Are you ready to sell a property you no longer want to own? If you're ready to sell, we will give you a no-obligation, no-hassle offer today! Know your options!


text:
/*
 * Created on 29/06/2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package br.com.dlp.framework.util;

import br.com.dlp.framework.exception.BaseTechnicalError;

/**
 * @author PLDarcio
 *
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class FrameworkAcheUtilError extends BaseTechnicalError {

	/**
	 *
	 */
	private static final long serialVersionUID = -8321542189817164363L;

	/**
	 * @param message
	 */
	public FrameworkAcheUtilError(String message) {
		super(message);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param message
	 * @param messageKey
	 */
	public FrameworkAcheUtilError(String message, String messageKey) {
		super(message, messageKey);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param message
	 * @param throwable
	 */
	public FrameworkAcheUtilError(String message, Throwable throwable) {
		super(message, throwable);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param message
	 * @param throwable
	 * @param messageKey
	 */
	public FrameworkAcheUtilError(String message, Throwable throwable,
			String messageKey) {
		super(message, throwable, messageKey);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param throwable
	 */
	public FrameworkAcheUtilError(Throwable throwable) {
		super(throwable);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param throwable
	 * @param messageKey
	 */
	public FrameworkAcheUtilError(Throwable throwable, String messageKey) {
		super(throwable, messageKey);
		// TODO Auto-generated constructor stub
	}
}

redpajama_set_name: RedPajamaGithub


text:
UN launches hunt for startups and enterprises changing the face of food systems
10-05-2021 13:59:00 | Door: Pie Kamau | Hits: 6658 | Tags:
Food & Retail
Lisez cet article ici en français
The UN Food Systems Summit has announced a competition to identify the best small and medium-sized enterprises (SMEs) from across the world who are transforming food systems for a better tomorrow.
The Summit has launched a unique contest, named "Best Small Business: Good Food for All", which will surface and name 50 small and medium-sized businesses worldwide whose work best exemplifies the Summit's aim of delivering all 17 Sustainable Development Goals (SDGs) by providing healthy, sustainable food and livelihoods for all.
The competition recognises those playing a key role in "building back better" from the pandemic while calling attention to the challenges they have been battling to overcome. The pandemic has disproportionately affected smaller businesses across the globe, especially those led by women. For example, the revenues of European SMEs alone saw reductions by as much as 70 per cent, according to one survey, while the World Bank estimates that businesses in developing countries were especially hard hit, with revenues down 70 per cent at the peak of the crisis, compared to only 45 per cent in OECD countries.
The Summit will celebrate those playing their part to transform through innovation the way small businesses produce, consume and dispose of food, offering lessons for building greater economic resilience and sustainability.
Dr. Agnes Kalibata, Special Envoy of the UN Secretary-General for the 2021 Food Systems Summit: "All around the world, leaders need to pay attention to the 'hidden' contribution of the smaller businesses that are nourishing communities, creating jobs and regenerating nature. These everyday businesses and their employees are the vanguard of efforts to strengthen our food systems and the small business competition aims to celebrate these efforts and to showcase their inspirational stories. In line with the Summit that is open to people everywhere and leaving no one behind, we encourage such enterprises to raise their voices and help us understand what support they need in order to flourish."
The competition will provide an opportunity for the Summit to showcase the best small businesses at the Pre-Summit to be held in Rome in July 2021.
Listening to the diverse voices of small businesses – from veterinary surgeries to cafes, producer cooperatives and digital startups – is a key component of the Summit process to identify bold, new solutions for improving food systems.
The competition will uncover not only the small businesses leading the charge for more sustainable, inclusive and resilient food systems but also ways in which they can be supported to scale up their trades sustainably.
Enterprises around the world that help provide healthy food to their communities and create jobs for local people are invited to apply and share ideas and suggestions for how their countries and economies can maximize their positive impact.
Each submission will help inform global leaders with the priorities and resources these businesses need to thrive, and all applicants will be invited to future Food Systems Summit events.
Further details about the competition and application process can be viewed here.
Contact: Katie Taft katie.taft@un.org
About the 2021 UN Food Systems Summit
The UN Food Systems Summit was announced by the UN Secretary-General, António Guterres, on World Food Day last October as a part of the Decade of Action for delivery on the SDGs by 2030. The aim of the Summit is to deliver progress on all 17 of the SDGs through a food systems approach, leveraging the interconnectedness of food systems to global challenges such as hunger, climate change, poverty and inequality. More information about the 2021 UN Food Systems Summit and a list of Advisory Committee and Scientific Group members can be found online.
www.un.org


text:
Q: Asp.net web application with vb.net in codebehind VS2005 I´d like to know if there is any way to edit the codebehind of an Asp.net web application while debugging?
When I try this, a message is displayed on the status bar saying "cannot currently modify this text in the editor. It is read-only".

A: The application is actually running off of a compiled version of your code. If you modify it it will have to recompile it in order for your changes to work, which means that it will need to swap out the running version for the new compiled version. This is a pretty hard problem - which is why I think Microsoft has made it impossible to do. It's more to protect you from THINKING some changes were made when they really weren't.


text:
Q: Does balanceTags() provide any escaping / protection? I'm just getting into WordPress and keep seeing sample code with balanceTags() used when echoing out a variable.
Am I right in thinking it does nothing in terms of output validation?
Thank you

A: Right, so it will simply do its best to close any unclosed tag - that's it. Nothing more.
As you can see if you look at the source code, all the function does is make sure to balance out the tags that might not be. It's also explained in the codex. ("force_balance_tags" is the real function that does the work; "balanceTags" defers to it if the options or attributes ask it to)
Hope this helps!


text: __all__ = ["container", "containermix", "utils", "cli"]


The O2/N2 Ratio and CO2 Airborne Southern Ocean (ORCAS) Study was an NSF sponsored airborne field campaign conducted with the NCAR/NSF GV aircraft with research flights from Punta Arenas, Chile during January and February 2016. A major goal of ORCAS is to gain a more quantitative understanding of the dominant role that the Southern Ocean plays in the uptake of anthropogenic carbon and to provide the basis for a better representation of this process in global atmospheric models. ACOM scientists provided key measurements of a wide range of VOCs (Apel, Hornbrook, and Hills) using the Trace Organic Gas Analyzer (TOGA).
Figure 1 shows a subset of the ORCAS observations as binned altitude profiles of VOC mixing ratios observed by TOGA. The data in each altitude bin are also separated by the corresponding observed CO2 mixing ratio (high CO2 ≥ 399 ppm > low CO2) according to the CO2 averaged over the timescale of the respective VOC measurement. In Figure 1(a and b), the vertical profiles of acetone and acetonitrile show higher mixing ratios were observed in air with higher CO2. NMHC less susceptible to ocean uptake such as benzene (Figure 1c), indicate no correlation with CO2 in the lower troposphere and marine boundary layer, and a small correlation in the mid- and upper troposphere with CO2. The findings are consistent with continental emissions and interhemispheric transport influencing the mixing ratios of both longer- and shorter-lived gases in the middle and upper troposphere, and loss to the oceans impacting mixing ratios of more soluble gases in the middle and lower troposphere.
The ocean is a primary source for bromoform (CHBr3) and dibromomethane (CH2Br2) [e.g., Goodwin et al., 1997], species that have a large impact on natural stratospheric ozone destruction. Figure 1(d and e) shows that bromoform and dibromomethane were anticorrelated with CO2 in the ORCAS domain in the boundary layer and mid-troposphere to ≈ 6 km. This anticorrelation of ocean-emitted species with CO2 in the lower atmosphere is consistent with increased ocean uptake of CO2 in air that has had more interaction with the ocean surface. The ORCAS dataset provides a means to identify biological processes responsible for the emissions and uptake of reactive (VOCs) and non-reactive (CO2, O2) gases and explore the relationships and commonalities between the two.
The relationships shown between CO2 and reactive VOCs demonstrate that the air masses sampled in the ORCAS domain are not uniformly influenced by continental sources or air-sea exchange in marine environments, and provide a mechanism to constrain the relative influence of the ocean surface and long-range transport on the observations of longer-lived gases measured during ORCAS.


Have you ever dated someone who never got off the couch?
You knew he had amazing potential, but he never did anything with it. Trying to motivate him was a waste of time.
Someone whose time was scheduled down to the minute.
He never did anything spontaneously; it all had to be planned in advance. He was amazingly productive but an imperfect boyfriend. He had too many other priorities.
Gretchin Rubin noticed these patterns when she was writing her 2015 bestseller, Better Than Before. She was examining why we find it so hard to establish desired habits and break bad ones.
She found that some people are really disciplined. They're good at living up to expectations. It's a point of honor to them. You don't let anyone down.
These people were also really good at structuring their own time. They set their own goals and worked hard to meet them.
But then there were people who could not follow the rules. They thought discipline and habits were for sheep. They wanted to do what they wanted to do when they wanted to do it.
Rubin realized that how a person responds to expectations puts them into one of four categories: Upholder, Questioner, Obliger, and Rebel.
Understand your tendency, and you understand an important component of what makes you tick.
Understand his tendency, and your relationship gets a whole lot easier.
One of the challenges of relationships is working with each other's quirks and preferences. You have to be able to plan things and organize your time together without driving each other crazy.
If you have different tendencies—a different relationship to discipline, rules, habits and expectations—then you can find yourself caught up in endless arguments.
When Beth was growing up, rules kept her family life flowing smoothly. Whenever there was a problem that kept cropping up, whether it was forgetting coats at school or leaving shoes by the door where someone could trip, her mother laid down a new rule.
So when she fell in love with Jeremy and they decided to move in together, she wanted to set down some ground rules. Having rules would help them live together more harmoniously … or so she thought.
But Jeremy was outraged. He accused her of trying to control him. In fact, every time she tried to establish a rule, he went out of his way to break it.
Beth was in tears. She wondered if they were completely wrong for each other.
I didn't think so. They just needed to understand each other's tendencies.
Beth was an Upholder, while Jeremy was a Rebel.
For their relationship to work, Beth could certainly set rules for herself, but that wasn't going to work for Jeremy. She had to learn to be more indirect about getting Jeremy on board, while Jeremy had to learn that his distaste for the rules didn't make Beth's desire for rules wrong.
The most common tendencies are Questioners and Obligers.
Questioners question all rules, following only those that make sense to them. Obligers are great at following other people's rules but struggle to make themselves do anything on their own.
She couldn't understand how her husband could be so disciplined at work yet unmotivated when he was off the clock.
Anya herself wasn't like that. She was incredibly disciplined when it came to her own pet projects and goals. But she struggled to give her work the kind of obedience she saw in others. She wanted to know that a task made sense before she put time into it.
Anya was relieved upon learning that her husband was different from her. It was a big relief. She realized she'd been judging him for not being more like her.
Understanding each other's tendency helps you accept one another for who you are. It also helps you speak each other's language when it comes to motivating each other to achieve.
Upholder, Rebel, Questioner or Obliger?
Can you see how your tendency might have played out in past relationships? Let us know in the comments.
 Gretchen Rubin, The Four Tendencies (New York: Harmony Books, 2017).
My man is an upholder through and through… hmmm no wonder he gets so frustrated with me!!
I agree wholeheartedly with Jessica. I think it would be great to see more in depth examples / real life solutions of how different couple tendencies have made it work for them.
And what about same tendency couples – what do they do? Because i could imagine things could get too boring if they are both the same? Do you think so?
I'm glad you found this article interesting. I'll start with your second question…same-tendency couples. These couples are living life by the same rule-book, so to speak. They don't find it boring. They both speak the same language when it comes to meeting obligations, following agreed guidelines, etc. This leads to harmony (most of the time).
One of the things I've discovered from years of deep consultation with people about their inner world of thoughts is that people are more different on the inside than we are on the outside. So the key really isn't a long list of combinations and examples for making it work. The key is the awareness itself. It frees you to love each other rather than resisting the differences.
Ok, great. Thanks for your clarity. Much appreciated! I hope it helps me with my future partner!
I am definitely a questioner and the man I am in love with is an upholder.
I loved learning about this! It is a relief to know that my man and I are two different types instead of thinking we weren't meant to be. I'd love to read another one about the 4 types going into more depth if possible.


text:
Home/LIFE STYLE/Keep You Safe From Mosquito Bites At Home and When Travelling
Keep You Safe From Mosquito Bites At Home and When Travelling
Mia Richard Follow on Twitter Send an email April 22, 2022
c. Polyester is great for mosquito netting products but not in shirts! Polyester is extremely durable and can be cleaned easily. Polyester is not a natural fiber, so dirt can be cleaned easily. If used throughout the year, it can also be washed periodically for a more thorough wash. There are generally 156 or 25 holes per sq. inch. These numbers are World Health Organization guidelines and are generally followed by all manufacturers.
There are many ways to make mosquito netting look great, such as jackets. Some hats have face masks, plain netting to cover decks and gazebos, and then there are the mosquito nets. mosquito net for double bed When one is working or hiking near swamps with mosquitoes, protective jackets and hats are very helpful! Night-time mosquito nets – whether they are round (conical) or rectangular, or even just a single net tent – can be a great way to keep them away.
The insecticide is another factor that is being used today. It is often added to the surface of the net and sometimes into the fabric. Insecticides manufactured by manufacturers have been approved by the World Health Organization. These insecticides are made from natural resources. They are safe for almost everyone but can irritate allergy sufferers. For a detailed overview of WHO's findings, you can search the WHO website for "Insecticide Treated Mosquito Nets".
You don't have to use this insecticide. However, you can be as safe with or without it. Although treated nets are not essential, they play an important role in reducing malaria-infected mosquito populations in areas that have high levels of deaths and illness. In addition to insecticide sprays, treated mosquito nets are helping to decrease the likelihood of someone contracting malaria. According to the "Roll Back Malaria Program", whereas there used to be one to two million people dying annually from malaria every year, today there are less than nine hundred thousand.
Consider what you will need and research the options. Then, choose the products that will help you avoid mosquito bites while you are on the move, at home, or outdoors.
American Idol's first and most star-studded fundraiser, "Idol Gives Back", was launched in April 2007 and raised more than $76 million. The special had the goal of raising money for impoverished communities across Africa and the United States, as well as those affected by Hurricane Katrina. All ticket proceeds went to the fund.
It encouraged viewers to make donations online and via toll-free telephone numbers. Coca-Cola and AT&T, sponsors of the program, donated money towards the Charity Projects Entertainment Fund. This fund distributed the money to different charities in Africa and the United States. Malaria No More was one of the charities that received the money. This organization provides mosquito nets, as well other resources, to aid in the prevention and treatment of malaria.
Mosquito Nets For Malaria No More
Malaria No More, a charitable organization, received a portion from "Idol Gives Back." This charity's purpose is to increase awareness of malaria in Africa. It also aims to provide resources to communities to purchase mosquito nets and prevent other mosquito-related diseases.
Malaria can be transmitted by a bite of an infected mosquito. Africa is home to the most powerful mosquitoes that spread the disease. mosquito net for single bed While malaria can be prevented and treated, it continues to cause over 1,000,000 deaths per year in Africa. Most of these deaths are children. Africa's annual burden of malaria is more than $12 million US. It could be controlled with a fraction.
Over $9 million was raised to support Malaria No More. $8 million was raised to support other malaria-related causes. Malaria No More was able, in addition to the financial gain, to share its important message with 60 million viewers and educate them about the topic of malaria. The precious donations enabled this organization to provide mosquito nets as well as other vital resources to over one million children in Angola Mali, Madagascar Madagascar, Uganda, and Zambia.
Idol Recommends
American Idol's 2nd installment of "Idol Gives Back" was held in April 2008. Malaria No More was once more a recipient. The special, which was more ambitious than ever, featured small clips from the African trips taken by Jordin Sparks, Melinda Doolittle, Elliot Yamin, and Melinda Doolittle, past Idol finalists. Ex-Idols were stunned when they discovered how simple a mosquito net could be used to aid in the country's ongoing fight against malaria.
A Former Idol Continues to Cause
Brooke White, an ex-Idol contestant, joined forces with Malaria No More to launch the Save the World Summer campaign. mosquito net price The campaign encourages students to raise funds during their summer vacation for charity. While they don't have the obligation to donate to Malaria No More, they can still choose to support any other charity that they feel is worthy. Malaria No More also offers an incentive: The person who raises more money for mosquito nets will get two tickets to the American Idol final.
Read Also: The Best Way To Prevent Mosquitoes From Entering Your Bed Is With A Mosquito Net
mosquito net for double bed mosquito net for single bed mosquito net price
Avast Firewall Won't Turn on Windows 10? Here's How to Fix It
How to get Netflix on DirecTV?


If you like freshly prepared Chinese food, moderately priced in a casual environment "Lily's Cuisine" in Welland is the right place for you.
This is her husband's second venture who was schooled in Cantonese Cuisine in China. Lily's Cuisine uses only the freshest vegetables and quality meats.
Café (Cafe) Amalia is an Italian place which brings all the good memories to the old country back. Order a delicious sandwich. Beer and wine are also available. Watch the slide show!


There are many reasons why you would consider changing the weatherstripping on your C4. Over time, the rubber breaks down, hardens and cracks, leaving an unpleasant appearance, poor seal, wind noise, and the dreaded drip.
If you own a C4 and actually drive it in the rain, you will eventually experience the dreaded drip, leaving your floor soaked and pant leg soggy. No matter how slick the paint, or well maintained the machine may be, dry, cracked weatherstrip will be the last detail, often overlooked and leaving an otherwise stunning car to just be rather ho-hum.
The good news is, curing the dreaded drip and taking years away from the appearance of your car is a great weekend project that any do-it-yourselfer can tackle with the help of products and tools from Corvette Central. Our weekend adventure began with a call to Corvette Central for a weatherstrip kit (p/n 634565), which also comes with a tube of adhesive. We ordered a weatherstrip tool kit (p/n 634588), and a pair of outer upper door seals (p/n 284067).
With parts on hand, we ventured out to the garage. We broke it down into sections starting with the doors, then the windshield, B pillar, and finally the rear window hatch. The first order of business was to remove the door panels. With the door panels removed we have access to the upper portion of the door strips and the outer window seal. It is a good idea to get a few sandwich bags and label them with specific screws and hardware removed from each section, as the hardware will be needed to reinstall the parts.
While it is possible to replace the outer seal strip without removing the door glass, we opted to pull our glass to make the replacement as clean as possible. We know we will have to adjust the glass upon final assembly to get the best possible seal against the new rubber. Once the aluminum accessory plate is removed from the door shell, the three nuts securing the window are easily accessible with a 10mm socket. We removed the anti-rattle pads, positioned the glass to remove the window glass stud (which requires an Allen wrench and vise grips) then separated the glass away from the regulator and pulled the glass out through the top of the door.
The outer seal strip is held in place by three rivets. There are notches in the door frame to allow access for drilling and removing the rivets. The old strip can be pried free from the door via the retainer clips and discarded. The new strip comes with the retainers and replacement rivets. It simply pops in place and is riveted in the original location. Reverse the process to slide the window back in place. While your glass adjustment is subject to change with the new strips, it is a good idea to observe the markings left from the fastener's previous location and tighten them back where they were. This will provide a good base for final adjustment. The aluminum accessory panel can be reinstalled, as there is access to the adjustment points even when it is in place.
Next, we located and removed the weatherstrip retaining screws at each end of the door strip. The upper corners of the strip will be glued down about six inches on each side of the door frame leading to the retaining push clips. Your weatherstrip tool kit includes a handy clip remover that makes quick work of popping the strip free from the door. Once the strip is removed, take a few moments and scrape the excess glue from the door frame. With the door frame clean, we pulled the new strip out and test fit the piece in preparation for permanent assembly. We pushed the clips in place along the bottom and sides of the door strip leaving the upper portion loose.
There is a process to getting weatherstrip adhesive to work. A thin layer must be spread on the door frame and weatherstrip. Allow the surface to get tacky, then apply another thin bead on either surface and press the strip against the frame. With the glue beginning to set, we inserted the retaining screws and snugged them in place. We repeated the process on the other side.
Moving onto the windshield, or A pillar, both doors need to stay open and the roof panel needs to be removed. The rearview mirror should be unplugged (if lighted) and removed. The plastic garnish around the inside of the windshield and trim inserts along the top where the roof panel secures must be removed. Unless you are also replacing the sun visors, there is no need to remove them at this point. Once the center upper windshield garnish is loose, it can rest on the sun visor posts with ample room to access the weatherstrip.
Grab your plastic bag and tag it for the A pillar hardware, as some of the retainers have a specific purpose and location. You will want to return them to the appropriate place. We tagged our hardware and began peeling the old strip out of the channel. The strip is held in place by retaining screws, pinch welt, and adhesive. This is where the removal tools come in handy, as you have to put some elbow grease into getting the channels clean and ready for new seals.
While not a requirement for the weatherstrip replacement, we decided to take advantage of the opportunity to inspect the metal frame below the windshield trim. After removing the upper windshield strip trim screws and prying it free from the frame we found a disaster waiting to happen. Years of moisture trapped under the strip had developed rust along the entire upper windshield frame. The good news is, this was just surface rust and was easily fixable with a grinding disc across the top and fresh coat of black Rustoleum paint. Reinstalling the windshield trim channel requires either high quality two-sided seal tape, or an ample bead of sealant between the trim and windshield frame to prevent future moisture intrusion. If you venture down this route, be prepared to deal with retaining screws that strip or break off when removed. Have a drill handy and some one-size-over screws in the spots that need to be drilled out.
Now is a good time to have a helper handy. Start the reassembly process by first test-fitting the new strip across the windshield. This is tricky as it takes more than two hands to hold each side in place. The goal is to determine where the center, corners, and edges fall so once the adhesive is applied, everything slides into the right place. A spot of masking tape can be used to mark alignment points for the perfect location to install the strips. Once again, apply a thin coat of adhesive across the entire windshield channel and the backside of the weatherstrip. Allow this to tack for a few minutes, then apply another thin coat of adhesive on the windshield trim side just prior to assembly. This is where the helper really comes in handy. Carefully drape the strip across the car and position from the center and work your way out. We used a plastic body filler spreading tool to press the edges of the strip under the channel lip. Be careful with metal tools as sharp edges can rip and tear the rubber.
Work quickly from the inside out with your helper keeping the edges from flopping. It is easy to work from front edge to rear edge of the strip, slipping and pushing it in place. It is okay to apply extra adhesive in the corners where it turns down the side of the windshield. Work the strip in and install the retaining screws as soon as possible. You have a few minutes before the adhesive fully hardens to continue sliding and moving the strip even across the mounting channel. Once the retainer screws are back in place, the inner windshield garnish and rearview mirror can be reinstalled. Be very careful not to overtighten the garnish screws to avoid cracking any of the plastic trim.
With two areas down and two to go, we moved onto the B pillar, which runs across the top of the car, sealing the top of the rear of the doors, back edge of the glass, and roof panel to the car. There is no garnish trim removal necessary for this install. Remove the retaining screws from the lower corners of the old strip and pry it free from the car. Using the scraping tools, remove all excess adhesive from the weatherstrip-mounting channel. Again, with the assistance of a helper, test fit the new strip and determine the center. Make your marks and remove the strip. Apply a thin bead of adhesive to the channel and to the back of the strip. An extra amount of adhesive is a good idea where the upper channel and side channel meets on the corner of each side. Allow that to tack, and then apply another thin bead to the trim on the car. With your helper, carefully lift the sticky strip over the car and into place. Using the plastic spreader or spatula, press the strip into the channel groove from the center out. Replace the fasteners at each lower corner and take a break. One strip left to go.
The rear window uses a different kind of weatherstrip that incorporates a pinch welt glued to the strip that fastens to the body rim around the rear hatch opening. First, open the rear window and find a suitable prop rod, as the struts will have to be disconnected. We took a piece of one-inch PVC pipe measured to length with the window open and positioned it between the floor and the latch striker on the glass. With the window secure we snapped the retainer clips and released the strut rods from the car side and twisted them out of the way. We grabbed our handy sandwich bag and used it to collect all the retainer trim screws holding the three rear plastic garnish trim pieces. The old strip came out easily.
The new weatherstrip is not marked top or bottom, so take a few moments to test fit. Be very careful not to tug, pull, or stretch the piece. After the correct location has been determined, the new weatherstrip presses in place starting at the lower corners of the window opening and is secured by the pinch welt trim. Press it around the opening and continue going around until it is fully secured. Reinstall the rear hatch trim, fasteners, and struts. Reconnect defogger if equipped.
The weak spot for the C4 coupe is in the lower corner where the strip comes together. We applied adhesive to the corner of the strip and pressed it tight to the body on each side to help secure it from being torn as use and time takes its toll.
Although our targa top strips were in good shape, new ones are available from Corvette Central (p/n 634562) and are not included in the coupe kit. However, changing them is a snap.
Following the same process already described, remove and save the retainers, peel out the old strips, and scrape the adhesive. Apply a thin bead on both surfaces, allow it to tack, then apply a bead to the roof panel and press the new strip in place. Reinstall the fasteners and mount the panel back on the car.
Once all the strips are in place you can carefully close the doors with the windows rolled up and the roof panel fastened in place. Observe the general fit of the glass. If the window is not lined up in the opening, close yourself or a helper in the car and access the three 10 mm nuts holding the glass to the regulator.
Loosen the nuts and slide the window around until it is evenly pressing on the A and B pillar strips. This goes much faster with a helper. Test run the window up and down a few times to make sure nothing shifts or slips after it has been adjusted. The felt strips along the top of the doorframe can be adjusted to apply pressure to the glass and make it press tighter against the body seals. This is a trial and error process, so no need to rush. Once the fit is satisfactory, re-install the inner door panel.
Now it's time to roll the car outside and test. Run a hose around the glass and strips looking for leaks. Use an unrestricted water flow and start at the base of the glass and seal area working up with a helper inside the car spotting for leaks. Once a leak is detected, mark the area with a grease pencil and continue on until the whole car has been checked.
An alternative includes putting baby powder on the seals and gently closing the doors. Open the doors and inspect for areas that have not made a transfer contact. Finally, go for a quick spin and listen for air leaks. Mark the spot of the leak with a piece of tape or grease pencil until you can return home and remedy the problem.
While there is some adjustment possible by rolling the weatherstrip back, loosening the mounting screw and sliding the entire assembly in and out, that isn't always possible due to the risk of damage to the strip and frozen screws or limited movement due to the weatherstrip retaining being glued to the A or B pillar. An easy solution for sealing leaks can be accomplished by shimming the strip out with a piece of rubber, vacuum, or small fuel hose behind the void in the strip. We found an air leak along the lower portion of the A pillar. The problem was solved by slipping a 16-inch section of 5/16-inch fuel line in the void causing the strip to spring out tighter to the glass. We also found a minor leak in the passenger B pillar rear window section, simply solved with a piece of ¼-inch vacuum hose stuffed in the void.
Once the strip is in and sealed, you can keep it in like new condition by regularly applying weatherstrip lubricant (p/n 101232) on the surface. Now stand back and enjoy your handiwork, knowing that you will not have to make any more excuses for your wet pant leg. You will be in awe of the huge change this simple weekend project has made.
It is important to follow the adhesive application directions for maximum bond. Here we are putting the final layer of adhesive in before gluing the weatherstrip down.
Test fitting the A pillar weatherstrip.
Applying the adhesive to the A pillar strip.
Inserting a 5/16-inch rubber line behind the void in the A pillar eliminated gaps that could create wind noise and leaks.
Pressing the rear window hatch weatherstrip over the pinch welt.
An old body filler spreader works well to press the strip in place, and is much safer than using a metal object or tool. An old credit card will work just the same.
The C4 weatherstrip kit (p/n 634565) comes with the main weatherstripping for around the doors, over the windshield pillar and the B pillar, as well as the rear hatch window seal.
These four tools, found in the weatherstrip tool kit (p/n 634588), will greatly aid in removal of the old weatherstripping and installing the new.
Upper door seals (p/n 284067) like these will typically crack over time and you'll start to notice getting "pinched" more often if you rest your arm out the window of your C4.
Targa top seals (p/n 634562) are simple to replace and will complement the other new seals, but they don't come in the main weatherstrip kit so don't forget to order them!
I replaced my C4 weatherstrip (perhaps with epdm but I'm unsure) and it became cracked, spongy and nearly useless within two years! Words truly fail! I don't mind paying for quality. Is a warranty offered? Please advise? Thank you!
Steve, send us a message to mail@corvettecentral.com if you have the invoice number that will help, or at least provide a customer number.
I have a 91 convertible. I had the top replaced, however, the weatherstrip has not fit well. Especially, the vertical strips on the rear part of the windows. They appear to be too short and the windows do not go under the top part of the strip as they should, compressing the top portion. I bought the strips from Corvette Central. Could they actually be too short? Could they be for another model year? Is there a different in length for C-4 convertibles based on year?
I want to change the waterstrip in targa top. Corvette 1988. The old weather strip has inside. Two plastic pieces front and rear. Is necessary to replace this plastic in new waterstrip?
How close is the quality of your weatherstrip compared to OEM from GM?
You can compare the majority of our weatherstripping to OEM and not tell a difference. We offer the best weatherstrip on the market.
I have a 1994 corvette with removal top. The top has not been removed in 15 years and I feel the top is vacuum sealed. I tried removing all bolts but it will not budge leading me to my conclusion. Any ideas on getting the vacuum released, I realize I will need to replace weather stripping but dealership was way too high in the cost to remove and install weather stripping. Any home remedies?
If the top hasn't been removed in 15 years it may take some force to be removed. Try using heat from a hair dryer then pry around until it budges.
Hi, I have a 1990 convertible. All the rubber is looking rough. I am wondering what a kit is worth. I am Canadian, do you ship to Canada? If not, would you ship to Indiana or Montana?