text:
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/payments/content/payment_request_state.h"

#include <algorithm>
#include <set>
#include <utility>

#include "base/bind.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_data_util.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/geo/autofill_country.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/validation.h"
#include "components/payments/content/autofill_payment_app_factory.h"
#include "components/payments/content/content_payment_request_delegate.h"
#include "components/payments/content/payment_app_service.h"
#include "components/payments/content/payment_app_service_factory.h"
#include "components/payments/content/payment_manifest_web_data_service.h"
#include "components/payments/content/payment_response_helper.h"
#include "components/payments/content/service_worker_payment_app.h"
#include "components/payments/core/autofill_card_validation.h"
#include "components/payments/core/autofill_payment_app.h"
#include "components/payments/core/error_strings.h"
#include "components/payments/core/features.h"
#include "components/payments/core/method_strings.h"
#include "components/payments/core/payment_app.h"
#include "components/payments/core/payment_request_data_util.h"
#include "components/payments/core/payments_experimental_features.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/content_features.h"

namespace payments {
namespace {

// Invokes the |callback| with |status|.
void CallStatusCallback(PaymentRequestState::StatusCallback callback,
                        bool status) {
  std::move(callback).Run(status);
}

// Posts the |callback| to be invoked with |status| asynchronously.
void PostStatusCallback(PaymentRequestState::StatusCallback callback,
                        bool status) {
  base::ThreadTaskRunnerHandle::Get()->PostTask(
      FROM_HERE,
      base::BindOnce(&CallStatusCallback, std::move(callback), status));
}

}  // namespace

PaymentRequestState::PaymentRequestState(
    content::WebContents* web_contents,
    content::RenderFrameHost* initiator_render_frame_host,
    const GURL& top_level_origin,
    const GURL& frame_origin,
    const url::Origin& frame_security_origin,
    PaymentRequestSpec* spec,
    Delegate* delegate,
    const std::string& app_locale,
    autofill::PersonalDataManager* personal_data_manager,
    ContentPaymentRequestDelegate* payment_request_delegate,
    const ServiceWorkerPaymentApp::IdentityCallback& sw_identity_callback,
    JourneyLogger* journey_logger)
    : web_contents_(web_contents),
      initiator_render_frame_host_(initiator_render_frame_host),
      top_origin_(top_level_origin),
      frame_origin_(frame_origin),
      frame_security_origin_(frame_security_origin),
      app_locale_(app_locale),
      spec_(spec),
      delegate_(delegate),
      personal_data_manager_(personal_data_manager),
      journey_logger_(journey_logger),
      are_requested_methods_supported_(
          !spec_->supported_card_networks().empty()),
      payment_request_delegate_(payment_request_delegate),
      sw_identity_callback_(sw_identity_callback),
      profile_comparator_(app_locale, *spec) {
  PopulateProfileCache();

  // |web_contents_| is null in unit tests.
  PaymentAppService* service = PaymentAppServiceFactory::GetForContext(
      web_contents_ ? web_contents_->GetBrowserContext() : nullptr);
  number_of_payment_app_factories_ = service->GetNumberOfFactories();
  service->Create(weak_ptr_factory_.GetWeakPtr());

  spec_->AddObserver(this);
}

PaymentRequestState::~PaymentRequestState() {}

content::WebContents* PaymentRequestState::GetWebContents() {
  return web_contents_;
}

ContentPaymentRequestDelegate* PaymentRequestState::GetPaymentRequestDelegate()
    const {
  return payment_request_delegate_;
}

PaymentRequestSpec* PaymentRequestState::GetSpec() const {
  return spec_;
}

const GURL& PaymentRequestState::GetTopOrigin() {
  return top_origin_;
}

const GURL& PaymentRequestState::GetFrameOrigin() {
  return frame_origin_;
}

const url::Origin& PaymentRequestState::GetFrameSecurityOrigin() {
  return frame_security_origin_;
}

content::RenderFrameHost* PaymentRequestState::GetInitiatorRenderFrameHost()
    const {
  return initiator_render_frame_host_;
}

const std::vector<mojom::PaymentMethodDataPtr>&
PaymentRequestState::GetMethodData() const {
  return GetSpec()->method_data();
}

scoped_refptr<PaymentManifestWebDataService>
PaymentRequestState::GetPaymentManifestWebDataService() const {
  return GetPaymentRequestDelegate()->GetPaymentManifestWebDataService();
}

const std::vector<autofill::AutofillProfile*>&
PaymentRequestState::GetBillingProfiles() {
  return shipping_profiles_;
}

bool PaymentRequestState::IsRequestedAutofillDataAvailable() {
  return is_requested_autofill_data_available_;
}

bool PaymentRequestState::MayCrawlForInstallablePaymentApps() {
  return PaymentsExperimentalFeatures::IsEnabled(
             features::kAlwaysAllowJustInTimePaymentApp) ||
         !spec_->supports_basic_card();
}

void PaymentRequestState::OnPaymentAppInstalled(const url::Origin& origin,
                                                int64_t registration_id) {
  sw_identity_callback_.Run(origin, registration_id);
}

void PaymentRequestState::OnPaymentAppCreated(std::unique_ptr<PaymentApp> app) {
  if (app->type() == PaymentApp::Type::AUTOFILL) {
    journey_logger_->SetEventOccurred(
        JourneyLogger::EVENT_AVAILABLE_METHOD_BASIC_CARD);
  } else if (base::Contains(app->GetAppMethodNames(), methods::kGooglePay) ||
             base::Contains(app->GetAppMethodNames(), methods::kAndroidPay)) {
    journey_logger_->SetEventOccurred(
        JourneyLogger::EVENT_AVAILABLE_METHOD_GOOGLE);
  } else {
    journey_logger_->SetEventOccurred(
        JourneyLogger::EVENT_AVAILABLE_METHOD_OTHER);
  }
  available_apps_.emplace_back(std::move(app));
}

void PaymentRequestState::OnPaymentAppCreationError(
    const std::string& error_message) {
  get_all_payment_apps_error_ = error_message;
}

bool PaymentRequestState::SkipCreatingNativePaymentApps() const {
  return false;
}

void PaymentRequestState::OnCreatingNativePaymentAppsSkipped(
    content::PaymentAppProvider::PaymentApps unused_apps,
    ServiceWorkerPaymentAppFinder::InstallablePaymentApps
        unused_installable_apps) {
  NOTREACHED();
}

void PaymentRequestState::OnDoneCreatingPaymentApps() {
  DCHECK_NE(0U, number_of_payment_app_factories_);
  if (--number_of_payment_app_factories_ > 0U)
    return;

  SetDefaultProfileSelections();

  get_all_apps_finished_ = true;
  has_enrolled_instrument_ =
      std::any_of(available_apps_.begin(), available_apps_.end(),
                  [](const auto& app) { return app->HasEnrolledInstrument(); });
  are_requested_methods_supported_ |= !available_apps_.empty();
  NotifyOnGetAllPaymentAppsFinished();
  NotifyInitialized();

  // Fulfill the pending CanMakePayment call.
  if (can_make_payment_callback_)
    std::move(can_make_payment_callback_).Run(are_requested_methods_supported_);

  // Fulfill the pending HasEnrolledInstrument call.
  if (has_enrolled_instrument_callback_)
    std::move(has_enrolled_instrument_callback_).Run(has_enrolled_instrument_);

  // Fulfill the pending AreRequestedMethodsSupported call.
  if (are_requested_methods_supported_callback_)
    CheckRequestedMethodsSupported(
        std::move(are_requested_methods_supported_callback_));
}

void PaymentRequestState::OnPaymentResponseReady(
    mojom::PaymentResponsePtr payment_response) {
  delegate_->OnPaymentResponseAvailable(std::move(payment_response));
}

void PaymentRequestState::OnPaymentResponseError(
    const std::string& error_message) {
  delegate_->OnPaymentResponseError(error_message);
}

void PaymentRequestState::OnSpecUpdated() {
  autofill::AutofillProfile* selected_shipping_profile =
      selected_shipping_profile_;
  autofill::AutofillProfile* selected_contact_profile =
      selected_contact_profile_;

  if (spec_->current_update_reason() ==
      PaymentRequestSpec::UpdateReason::RETRY) {
    if (spec_->has_shipping_address_error() && selected_shipping_profile) {
      invalid_shipping_profile_ = selected_shipping_profile;
      selected_shipping_profile_ = nullptr;
    }

    if (spec_->has_payer_error() && selected_contact_profile) {
      invalid_contact_profile_ = selected_contact_profile;
      selected_contact_profile_ = nullptr;
    }
  }

  if (spec_->selected_shipping_option_error().empty()) {
    selected_shipping_option_error_profile_ = nullptr;
  } else {
    selected_shipping_option_error_profile_ = selected_shipping_profile;
    selected_shipping_profile_ = nullptr;
    if (spec_->has_shipping_address_error() && selected_shipping_profile) {
      invalid_shipping_profile_ = selected_shipping_profile;
    }
  }

  is_waiting_for_merchant_validation_ = false;
  UpdateIsReadyToPayAndNotifyObservers();
}

void PaymentRequestState::CanMakePayment(StatusCallback callback) {
  if (!get_all_apps_finished_) {
    DCHECK(!can_make_payment_callback_);
    can_make_payment_callback_ = std::move(callback);
    return;
  }

  PostStatusCallback(std::move(callback), are_requested_methods_supported_);
}

void PaymentRequestState::HasEnrolledInstrument(StatusCallback callback) {
  if (!get_all_apps_finished_) {
    DCHECK(!has_enrolled_instrument_callback_);
    has_enrolled_instrument_callback_ = std::move(callback);
    return;
  }

  PostStatusCallback(std::move(callback), has_enrolled_instrument_);
}

void PaymentRequestState::AreRequestedMethodsSupported(
    MethodsSupportedCallback callback) {
  if (!get_all_apps_finished_) {
    are_requested_methods_supported_callback_ = std::move(callback);
    return;
  }

  base::ThreadTaskRunnerHandle::Get()->PostTask(
      FROM_HERE,
      base::BindOnce(&PaymentRequestState::CheckRequestedMethodsSupported,
                     weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}

void PaymentRequestState::OnAbort() {
  // Reset supported method callback when the merchant calls abort before
  // OnDoneCreatingPaymentApps().
  if (are_requested_methods_supported_callback_)
    are_requested_methods_supported_callback_.Reset();
}

void PaymentRequestState::CheckRequestedMethodsSupported(
    MethodsSupportedCallback callback) {
  DCHECK(get_all_apps_finished_);

  // Don't modify the value of |are_requested_methods_supported_|, because it's
  // used for canMakePayment().
  bool supported = are_requested_methods_supported_;
  if (supported && is_show_user_gesture_ &&
      base::Contains(spec_->payment_method_identifiers_set(),
                     methods::kBasicCard) &&
      !has_non_autofill_app_ && !has_enrolled_instrument_ &&
      PaymentsExperimentalFeatures::IsEnabled(
          features::kStrictHasEnrolledAutofillInstrument)) {
    supported = false;
    get_all_payment_apps_error_ = errors::kStrictBasicCardShowReject;
  }

  std::move(callback).Run(supported, get_all_payment_apps_error_);
}

std::string PaymentRequestState::GetAuthenticatedEmail() const {
  return payment_request_delegate_->GetAuthenticatedEmail();
}

void PaymentRequestState::AddObserver(Observer* observer) {
  CHECK(observer);
  observers_.AddObserver(observer);
}

void PaymentRequestState::RemoveObserver(Observer* observer) {
  observers_.RemoveObserver(observer);
}

void PaymentRequestState::GeneratePaymentResponse() {
  DCHECK(is_ready_to_pay());

  // Once the response is ready, will call back into OnPaymentResponseReady.
  response_helper_ = std::make_unique<PaymentResponseHelper>(
      app_locale_, spec_, selected_app_, payment_request_delegate_,
      selected_shipping_profile_, selected_contact_profile_, this);
}

void PaymentRequestState::OnPaymentAppWindowClosed() {
  DCHECK(selected_app_);
  response_helper_.reset();
  selected_app_->OnPaymentAppWindowClosed();
}

void PaymentRequestState::RecordUseStats() {
  if (ShouldShowShippingSection()) {
    DCHECK(selected_shipping_profile_);
    personal_data_manager_->RecordUseOf(*selected_shipping_profile_);
  }

  if (ShouldShowContactSection()) {
    DCHECK(selected_contact_profile_);

    // If the same address was used for both contact and shipping, the stats
    // should only be updated once.
    if (!ShouldShowShippingSection() || (selected_shipping_profile_->guid() !=
                                         selected_contact_profile_->guid())) {
      personal_data_manager_->RecordUseOf(*selected_contact_profile_);
    }
  }

  selected_app_->RecordUse();
}

void PaymentRequestState::SetAvailablePaymentAppForRetry() {
  DCHECK(selected_app_);
  base::EraseIf(available_apps_, [this](const auto& payment_app) {
    // Remove the app if it is not selected.
    return payment_app.get() != selected_app_;
  });
  is_retry_called_ = true;
}

void PaymentRequestState::AddAutofillPaymentApp(
    bool selected,
    const autofill::CreditCard& card) {
  auto app =
      AutofillPaymentAppFactory::ConvertCardToPaymentAppIfSupportedNetwork(
          card, weak_ptr_factory_.GetWeakPtr());
  if (!app)
    return;

  available_apps_.push_back(std::move(app));
  journey_logger_->SetEventOccurred(
      JourneyLogger::EVENT_AVAILABLE_METHOD_BASIC_CARD);

  if (selected) {
    SetSelectedApp(available_apps_.back().get(),
                   SectionSelectionStatus::kAddedSelected);
  }
}

void PaymentRequestState::AddAutofillShippingProfile(
    bool selected,
    const autofill::AutofillProfile& profile) {
  profile_cache_.push_back(
      std::make_unique<autofill::AutofillProfile>(profile));
  // TODO(tmartino): Implement deduplication rules specific to shipping
  // profiles.
  autofill::AutofillProfile* new_cached_profile = profile_cache_.back().get();
  shipping_profiles_.push_back(new_cached_profile);

  if (selected) {
    SetSelectedShippingProfile(new_cached_profile,
                               SectionSelectionStatus::kAddedSelected);
  }
}

void PaymentRequestState::AddAutofillContactProfile(
    bool selected,
    const autofill::AutofillProfile& profile) {
  profile_cache_.push_back(
      std::make_unique<autofill::AutofillProfile>(profile));
  autofill::AutofillProfile* new_cached_profile = profile_cache_.back().get();
  contact_profiles_.push_back(new_cached_profile);

  if (selected) {
    SetSelectedContactProfile(new_cached_profile,
                              SectionSelectionStatus::kAddedSelected);
  }
}

void PaymentRequestState::SetSelectedShippingOption(
    const std::string& shipping_option_id) {
  spec_->StartWaitingForUpdateWith(
      PaymentRequestSpec::UpdateReason::SHIPPING_OPTION);
  // This will inform the merchant and will lead to them calling updateWith with
  // new PaymentDetails.
  delegate_->OnShippingOptionIdSelected(shipping_option_id);
}

void PaymentRequestState::SetSelectedShippingProfile(
    autofill::AutofillProfile* profile,
    SectionSelectionStatus selection_status) {
  spec_->StartWaitingForUpdateWith(
      PaymentRequestSpec::UpdateReason::SHIPPING_ADDRESS);
  selected_shipping_profile_ = profile;

  // Changing the shipping address clears shipping address validation errors
  // from retry().
  invalid_shipping_profile_ = nullptr;

  // The user should not be able to click on pay until the callback from the
  // merchant.
  is_waiting_for_merchant_validation_ = true;

  // Start the normalization of the shipping address.
  payment_request_delegate_->GetAddressNormalizer()->NormalizeAddressAsync(
      *selected_shipping_profile_, /*timeout_seconds=*/2,
      base::BindOnce(&PaymentRequestState::OnAddressNormalized,
                     weak_ptr_factory_.GetWeakPtr()));
  IncrementSelectionStatus(JourneyLogger::Section::SECTION_SHIPPING_ADDRESS,
                           selection_status);
}

void PaymentRequestState::SetSelectedContactProfile(
    autofill::AutofillProfile* profile,
    SectionSelectionStatus selection_status) {
  selected_contact_profile_ = profile;

  // Changing the contact information clears contact information validation
  // errors from retry().
  invalid_contact_profile_ = nullptr;

  UpdateIsReadyToPayAndNotifyObservers();

  if (IsPaymentAppInvoked()) {
    delegate_->OnPayerInfoSelected(
        response_helper_->GeneratePayerDetail(profile));
  }
  IncrementSelectionStatus(JourneyLogger::Section::SECTION_CONTACT_INFO,
                           selection_status);
}

void PaymentRequestState::SetSelectedApp(
    PaymentApp* app,
    SectionSelectionStatus selection_status) {
  selected_app_ = app;
  UpdateIsReadyToPayAndNotifyObservers();
  IncrementSelectionStatus(JourneyLogger::Section::SECTION_PAYMENT_METHOD,
                           selection_status);
}

void PaymentRequestState::IncrementSelectionStatus(
    JourneyLogger::Section section,
    SectionSelectionStatus selection_status) {
  switch (selection_status) {
    case SectionSelectionStatus::kSelected:
      journey_logger_->IncrementSelectionChanges(section);
      break;
    case SectionSelectionStatus::kEditedSelected:
      journey_logger_->IncrementSelectionEdits(section);
      break;
    case SectionSelectionStatus::kAddedSelected:
      journey_logger_->IncrementSelectionAdds(section);
      break;
    default:
      NOTREACHED();
  }
}

const std::string& PaymentRequestState::GetApplicationLocale() {
  return app_locale_;
}

autofill::PersonalDataManager* PaymentRequestState::GetPersonalDataManager() {
  return personal_data_manager_;
}

autofill::RegionDataLoader* PaymentRequestState::GetRegionDataLoader() {
  return payment_request_delegate_->GetRegionDataLoader();
}

bool PaymentRequestState::IsPaymentAppInvoked() const {
  return !!response_helper_;
}

autofill::AddressNormalizer* PaymentRequestState::GetAddressNormalizer() {
  return payment_request_delegate_->GetAddressNormalizer();
}

bool PaymentRequestState::IsInitialized() const {
  return get_all_apps_finished_;
}

void PaymentRequestState::SelectDefaultShippingAddressAndNotifyObservers() {
  // Only pre-select an address if the merchant provided at least one selected
  // shipping option, and the top profile is complete. Assumes that profiles
  // have already been sorted for completeness and frecency.
  if (!shipping_profiles().empty() && spec_->selected_shipping_option() &&
      profile_comparator()->IsShippingComplete(shipping_profiles_[0])) {
    selected_shipping_profile_ = shipping_profiles()[0];
  }
  // Record the missing required fields (if any) of the most complete shipping
  // profile.
  profile_comparator()->RecordMissingFieldsOfShippingProfile(
      shipping_profiles().empty() ? nullptr : shipping_profiles()[0]);
  UpdateIsReadyToPayAndNotifyObservers();
}

bool PaymentRequestState::ShouldShowShippingSection() const {
  if (!spec_->request_shipping())
    return false;

  return selected_app_ ? !selected_app_->HandlesShippingAddress() : true;
}

bool PaymentRequestState::ShouldShowContactSection() const {
  if (spec_->request_payer_name() &&
      (!selected_app_ || !selected_app_->HandlesPayerName())) {
    return true;
  }
  if (spec_->request_payer_email() &&
      (!selected_app_ || !selected_app_->HandlesPayerEmail())) {
    return true;
  }
  if (spec_->request_payer_phone() &&
      (!selected_app_ || !selected_app_->HandlesPayerPhone())) {
    return true;
  }

  return false;
}

base::WeakPtr<PaymentRequestState> PaymentRequestState::AsWeakPtr() {
  return weak_ptr_factory_.GetWeakPtr();
}

void PaymentRequestState::PopulateProfileCache() {
  std::vector<autofill::AutofillProfile*> profiles =
      personal_data_manager_->GetProfilesToSuggest();

  std::vector<autofill::AutofillProfile*> raw_profiles_for_filtering;
  raw_profiles_for_filtering.reserve(profiles.size());

  // PaymentRequest may outlive the Profiles returned by the Data Manager.
  // Thus, we store copies, and return a vector of pointers to these copies
  // whenever Profiles are requested.
  for (size_t i = 0; i < profiles.size(); i++) {
    profile_cache_.push_back(
        std::make_unique<autofill::AutofillProfile>(*profiles[i]));
    raw_profiles_for_filtering.push_back(profile_cache_.back().get());
  }

  contact_profiles_ = profile_comparator()->FilterProfilesForContact(
      raw_profiles_for_filtering);
  shipping_profiles_ = profile_comparator()->FilterProfilesForShipping(
      raw_profiles_for_filtering);

  // Set the number of suggestions shown for the sections requested by the
  // merchant.
  if (ShouldShowContactSection()) {
    bool has_complete_contact =
        contact_profiles_.empty()
            ? false
            : profile_comparator()->IsContactInfoComplete(contact_profiles_[0]);
    is_requested_autofill_data_available_ &= has_complete_contact;
    journey_logger_->SetNumberOfSuggestionsShown(
        JourneyLogger::Section::SECTION_CONTACT_INFO, contact_profiles_.size(),
        has_complete_contact);
  }
  if (ShouldShowShippingSection()) {
    bool has_complete_shipping =
        shipping_profiles_.empty()
            ? false
            : profile_comparator()->IsShippingComplete(shipping_profiles_[0]);
    is_requested_autofill_data_available_ &= has_complete_shipping;
    journey_logger_->SetNumberOfSuggestionsShown(
        JourneyLogger::Section::SECTION_SHIPPING_ADDRESS,
        shipping_profiles_.size(), has_complete_shipping);
  }
}

void PaymentRequestState::SetDefaultProfileSelections() {
  // Contact profiles were ordered by completeness in addition to frecency;
  // the first one is the best default selection.
  if (!contact_profiles().empty() &&
      profile_comparator()->IsContactInfoComplete(contact_profiles_[0]))
    selected_contact_profile_ = contact_profiles()[0];

  // Record the missing required fields (if any) of the most complete contact
  // profile.
  profile_comparator()->RecordMissingFieldsOfContactProfile(
      contact_profiles().empty() ? nullptr : contact_profiles()[0]);

  // Sort apps.
  PaymentApp::SortApps(&available_apps_);

  selected_app_ = nullptr;
  if (!available_apps_.empty() && available_apps_[0]->CanPreselect()) {
    selected_app_ = available_apps_[0].get();
    UpdateIsReadyToPayAndNotifyObservers();
  }

  // Record the missing required payment fields when no complete payment
  // info exists.
  if (available_apps_.empty()) {
    if (spec_->supports_basic_card()) {
      // All fields are missing when basic-card is requested but no card exits.
      base::UmaHistogramSparse("PaymentRequest.MissingPaymentFields",
                               CREDIT_CARD_EXPIRED | CREDIT_CARD_NO_CARDHOLDER |
                                   CREDIT_CARD_NO_NUMBER |
                                   CREDIT_CARD_NO_BILLING_ADDRESS);
    }
  } else if (available_apps_[0]->type() == PaymentApp::Type::AUTOFILL) {
    // Record the missing fields (if any) of the most complete app when
    // it's autofill based. SW based apps are always complete.
    static_cast<const AutofillPaymentApp*>(available_apps_[0].get())
        ->RecordMissingFieldsForApp();
  }

  SelectDefaultShippingAddressAndNotifyObservers();

  journey_logger_->SetNumberOfSuggestionsShown(
      JourneyLogger::Section::SECTION_PAYMENT_METHOD, available_apps().size(),
      selected_app_);
}

void PaymentRequestState::UpdateIsReadyToPayAndNotifyObservers() {
  is_ready_to_pay_ =
      ArePaymentDetailsSatisfied() && ArePaymentOptionsSatisfied();
  NotifyOnSelectedInformationChanged();
}

void PaymentRequestState::NotifyOnGetAllPaymentAppsFinished() {
  for (auto& observer : observers_)
    observer.OnGetAllPaymentAppsFinished();
}

void PaymentRequestState::NotifyOnSelectedInformationChanged() {
  for (auto& observer : observers_)
    observer.OnSelectedInformationChanged();
}

bool PaymentRequestState::ArePaymentDetailsSatisfied() {
  // There is no need to check for supported networks, because only supported
  // apps are listed/created in the flow.
  return selected_app_ != nullptr && selected_app_->IsCompleteForPayment();
}

bool PaymentRequestState::ArePaymentOptionsSatisfied() {
  if (is_waiting_for_merchant_validation_)
    return false;

  if (ShouldShowShippingSection() &&
      (!spec_->selected_shipping_option() ||
       !profile_comparator()->IsShippingComplete(selected_shipping_profile_))) {
    return false;
  }

  if (ShouldShowContactSection() &&
      !profile_comparator()->IsContactInfoComplete(selected_contact_profile_)) {
    return false;
  }

  return true;
}

void PaymentRequestState::OnAddressNormalized(
    bool success,
    const autofill::AutofillProfile& normalized_profile) {
  delegate_->OnShippingAddressSelected(
      data_util::GetPaymentAddressFromAutofillProfile(normalized_profile,
                                                      app_locale_));
}

}  // namespace payments

redpajama_set_name: RedPajamaGithub


One of the problems that can lead to disaster within personal finances is car loans that become anchors around the necks of car owners. Many people refer to this as upside down or underwater loans. This condition can be applied to any machine that has a motor in it. The value of a vehicle can go down (depreciation) up to 60% during the first 4 years of ownership. Everything from the newest SUV, motorcycle, or aquatic vehicle can become the bane of every personal financial budget.
Sell the vehicle yourself through a private sell. You can get more cash selling this way versus a trade in. The difference can be paid by borrowing cash from a local community bank or credit union in a smaller amount to bridge the gap. It is a small loan to clean up a large loan situation.
Know how far your vehicle is underwater. Subtract the value of the car from the loan balance. The difference between the two numbers is the amount of money you would need to come up with to pay off your loan if you sell or trade in your vehicle. This amount is also called your negative equity. This is the beginning of putting together a plan that can lead you out of a bad situation. Online and digital options are also available to help with this step.
Keep the vehicle if you want to pick the best solution. If you keep the car until the loan is paid off there is no risk you will be upside down because you don't owe anything on the car.
Get a new loan at a lower interest from a local bank or credit union. You will likely still need some cash to bring the balance of the loan closer to the vehicle's value. If you aren't able to refinance your loan, you can always voluntarily make higher monthly payments to pay your loan off faster.
As a last resort, trade the car in. Look for incentives such as extra cash, which can help pay off your negative equity. The smartest financial choice is to keep the car as long as possible or until the value equals the loan.
If you are looking for a better way to manage money for your family, have experienced a change in your family situation, or need help setting up a budget, click on Lighthouse Financial Coaching or call (512) 971-6739 for a no-charge introductory appointment and start getting organized with your money today.


text:
Published on: March 17, 2019 March 17, 2019 by RRadmin7 Category:Nearing Midnight
Modern Monetary Theory
During the past several years, the Federal Reserve has been managing our growing national debt by using a series of financial terms. The shell game started with the Fed taking on the role of our rich uncle and did Quantitative Easing. The Fed reinflated the stock market by loaning the Treasury $3.5 trillion.
Then came Operation Twist in 2011 where the Fed sold short-term Treasury securities and bought long-term Treasuries. By selling a two-year bond and buying a 30-year bond, the Fed was giving Washington 28 years to balance its financial books.
Next came Quantitative Tightening where the Fed would sell off the bond it had on its balance sheet. When Wall Street had a negative reaction to the actual unloading of bonds, the Fed said our credit is so good, it would end the program and hold onto the bonds forever.
The new term that is becoming popular in Washington is Modern Monetary Theory. The core teaching of MMT is that a nation with the ability to print its own money can never go bankrupt. It can always fund its spending by printing more money. The nation's deficit can be managed by simply printing money to pay for the shortfall.
MMT can trace its origins back over 100 years, but it has gained renewed popularity in recent months thanks to freshman Democratic Congresswoman Alexandria Ocasio-Cortez and economist Stephanie Kelton. When people add the cost of her proposed Green New Deal to an insane $22 trillion-dollar national debt, AOC said we can use MMT to pay for her program.
Some would argue that the Federal Reserve would never fall for MMT, but former head Ben Bernanke has already laid out the framework for how MMT could work. Bernanke traveled to Tokyo in July 2016 and suggested a way to stimulate the Japanese economy. He said the Ministry of Finance, Japan's equivalent to our Treasury, should issue non-marketable perpetual bonds with a zero-coupon that the Bank of Japan would buy with printed money. The Japanese government could then use the money from these bond sales to pay its bills.
A perpetual zero-coupon bond means the principal never has to be repaid, and no interest payment is ever due. Bernanke was basically suggesting the issuance of a new form of currency. Cash never matures, and you do not have to pay interest for holding it. He should have just said that Japan should print vast amounts of yen.
Abraham Lincoln once posed the question: "If you call a dog's tail a leg, how many legs does it have?" and then answered his own query: "Four, because calling a tail a leg doesn't make it one." Abe would have felt lonely on Wall Street. MMT is simply the printing of money for the purposes of funding government spending. It has been tried hundreds of times and has always led to massive inflation.
The Treasury Department is currently using "extraordinary measures" to prevent the US from breaching the debt ceiling. As of the 9th of March, the US officially hit the debt ceiling, capping the national debt at just over $22 trillion. The Treasury can fund the government until late September or early October by using an array of bookkeeping tricks.
The US is not the only nation that is allying MMT to its government spending. Last month, China unleashed a massive credit expansion. In what was dubbed the Shanghai Accord 2.0, the People's Bank of China announced it had flooded the economy with a gargantuan 4.64 trillion yuan in various new forms of debt. Injecting nearly $700 billion in credit in one month was more than the GDP of Saudi Arabia. In the past 40 years, Beijing has increased the money supply by an amazing 10,000-fold.
Since assuming the premiership in 2013, President Xi Jinping has been a consistent critic of the large-scale stimulus that their predecessors launched in response to the 2008 financial crisis. It is dumbfounding to traders that Xi complains about the dangerous increase in debt by others, and then does the same thing himself.
In a normal world, any attempt to implement MMT would mean instant financial disaster. The same basic financial rule has worked for thousands of years. If you print too much of your own currency, its value will collapse.
The ability of the world's central banks to throw all cares to the wind is not the result of some new economic miracle. I am convinced that the rapture is the reason why such reckless spending is going unpunished. Everything is to remain calm right up to the moment the Church is removed. To reach the irrational level of MMT spending, it tells us that the end must be very near.
"Therefore be ye also ready: for in such an hour as ye think not the Son of man cometh" (Mat. 24:44).
Third Temple and Trump
For as the rain and the snow come down from heaven, And do not return there without watering the earth And making it bear and sprout, And furnishing seed to the sower and bread to the eater; So will My word be which goes forth from My mouth; It will not return to Me empty, Without accomplishing what I desire, And without succeeding in the matter for which I sent it. (Isaiah 50:10-11)
God has spoken the precise consummation of history. His Word about these matters will come to pass. The world's global elite might not like it; the diplomats of the world might resent it. God's word about the wind-up of history, however, cannot–will not–be changed.
In filming documentaries on prophecy, whether it's about Bible prophecy, or prophecy by the Nostradamuses of their times throughout history, the documentarians make sure a certain statement is made in summation: "These prophecies are given as a warning. They are given so we can alter things we as human beings do in order that these terrible things not come to pass. Man can change the outcome if he only strives to do so."
The Lord of all Creation says: "So will My word be which goes forth from My mouth; It will not return to Me empty, Without accomplishing what I desire, And without succeeding in the matter for which I sent it." His Word says further: "yea, let God be true, but every man a liar" (Romans 3:4).
God's prophetic Word will come to pass–100 percent, even if it comes to pass in ways and through people, places, and things we don't necessarily foresee or understand.
Developments of a profound nature seem in the making. some who observe things going on behind the scenes in Israel believe those developments are farther along than might be suspected by those of us who are most diligent in observing and reporting on the prophetic weather. I must admit that I don't particularly like the way things are shaping–that is, I don't like to have dissolved my neat, little order of how I perceive prophecy unfolding.
The Lord doesn't always proceed in neat, little ways in order to get things done. Looks like I would have figured that out in 76-plus years of living. He, as often as not, uses the good, bad, and the ugly to work in fulfilling His ultimate will.
While not a sure thing, it looks to some as if He might be allowing the unfolding of a couple of prophecies, using all three ingredients to bring about stage-setting for the Tribulation and Armageddon.
Movement toward the building of the Third Temple in Jerusalem is almost certainly and swiftly racing forward. My friend, Tom Horn, CEO of SkyWatch TV is, in my estimation, among those leading in the examination of developments in Jerusalem concerning building of the Third Temple. Recent developments indicate just how near the Tribulation era might be, based upon apparent Temple planning.
Horn states on his ministry website that developments in the plans for the Third Temple "are, in fact, earth-shattering, and will accomplish nothing less than altering the course of history. What is about to unfold could set in motion arrival of Antichrist and Armageddon, followed by the Second Coming of Jesus Christ."
Regarding intrigues in Temple planning, he writes further, "It's happening right now behind the scenes in clandestine negotiations between global powers and religious leaders." Horn and others observe that some of the Jewish clerical hierarchy are convinced that American President Donald Trump equates to the reincarnation of a Cyrus-like figure. Cyrus was a king whom some rabbis believe the God of Israel raised up to initiate the Messianic era and construction of the Third Temple.
On a more cautious note, I'll report that Tom Horn offers that Saudi Arabia, Jewish religious leaders, and Donald Trump are negotiating behind the scenes to transfer control of Israel's holy sites—including the Temple Mount—to the Saudis, to complete a "peace covenant" that could result in, among other things, the building of the Third Temple. This unverifiable conjecture–as I view it at this point–has yet to be seen, but it is worthy of consideration because of other developments of significance.
A Jerusalem Post article reports the following:
A senior reporter for the Al Riyadh, one of Saudi Arabia's most prominent newspapers, claimed that the US President Donald Trump's "Deal of the Century" will divide Jerusalem.
The reporter Hadeel Oueis wrote on her twitter account that "The Old City of Jerusalem will be divided in half: the Arab and Christian quarters will go to the PA [Palestinian Authority], while the Jewish and Armenian quarters will fall under Israeli control."…
Oueis further tweeted that "Arab areas adjacent to Palestinian Area A and B will go to a future Palestinian capital in East Jerusalem."
Saudi Arabia has been in touch with the US administration regarding the peace initiative, as it was rumored that the deal will include recognition of Israel by surrounding Arab countries. ("The U.S. Peace Plan Will Divide Jerusalem," Hadeel Oueis [@hadeelOueiss] March 5, 2019])
It is quite disconcerting to yours truly that this president could be complicit in developing plans that God's Word says will leave to His bringing all nations into the Valley of Jehosephat and the killing fields of Armageddon. However, the Lord's prophetic Word will be accomplished, regardless of the people, places, and things involved in its fulfillment.
You and I need not be a part of that history-ending conflict and all the carnage leading up to that bloodiest of all wars. Simply and genuinely believe that Jesus Christ died to redeem you from the dread sway of sin. Then confess with your mouth that God has raised Him from death, and you will be saved. You will go to be with Christ instantaneously when your heart beats its last beat, or at that glorious moment of Rapture when the living and dead are called into His presence forever.
This entry was posted in Nearing Midnight
Bookmark this article Mar 18, 2019
Prior Updates

redpajama_set_name: RedPajamaCommonCrawl


* This is a high quality realistic military 3d model.
*The scene measurements are in cm.
* This model contains 82414 polygons and 86494 verts.
Product contains 7 separate objects.
* Lights and cameras are included in the file.
* Hair and Fur modifiers for eyelashes.


Two new species of Disperis from Central West Africa.
Stucture and development of inter- and intraxylary phloem in Leptadenia reticulata.
Comparative cytogenetic study of some grass genera of the subfamily Pooideae in Iran.
Spring communities of of the Vel'ka Fatra Mts and their relationship to Central European spring vegetation.
Chrysophyte stomatocysts from gypsum damp vegetation in southern Poland.
Pertusaria lactescens, a lichen species new to Central Europe.
Some overlooked and rare xylariaceous fungi from Poland.
Phleogena faginea in Poland- notes on ecology and distributon.
Dianthus campestris, a species new to Poland.
Notes on Leptogiumand and Dermatocarpon species from basalt outcrop in Mały Śnieżny Kocioł cirque.


Well as you know today was payday, wooo to the hoooo!
I have decided to show the full extent of my finances by comparing my income versus my outgoings.
So after everything has been taken out and accounted for I am left with £35 for miscellaneous spending.
As long as I have food and shelter accounted for then I will be fine.
To be in profit after all the bills (some more fun then others) have been taken out is a great feeling.
I am happy. I don't have room for error, I notice if as little as 1p is missing from my purse, but I have 'surplus' money each month. I'm prioritising my debts, things will be fine. I hope.
Profit warning needs to be issued. Thats a massive up from the 20p. Treat yourself (at the end of the month).
I wish, that would break my No Spend Year goal. I may decide to go out for a meal with my boyfriend for Valentines day though.
It is a good goal, and it is definitely times like these when you wish you could break it. You're doing so well though – I shouldn't encourage breaking it.


text:
Barbera je stara sorta grožđa s porijeklom u Italiji.

Vino postiže kvalitetu tek kad je pravljeno od reduciranog uroda u toplijoj klimi. Ima visoku razinu kiseline i skoro ljubičastu boju koja je nestalna te se može dodatno stabilizirati barikiranjem kako bi se povećala siromašna razina tanina.

Barbera može razviti privlačnu aromu ribiza, šljive, višnje ili kupine, ali inače je prelagane arome i koristi se za miješanje s vinom "jačih" sorti.

Vanjske poveznice
Mali podrum  - Barbera; hrvatska vina i proizvođači

Izvori

Crne sorte grožđa

redpajama_set_name: RedPajamaWikipedia


The 3-Bin system at Oakland Tech is a BIG project, and it takes all parties together to make is a successful implementation. Interns welcomed 5 custodians into their meeting to invite them to join their team as they continue to take steps forward to get the 3-Bins in place in all Oakland Tech classrooms. The job of a custodian is not an easy one, so interns set out to learn more about it and lend a helping hand for the day to get their daily tasks done. Custodial Staff lead the way as they dispersed around the school to complete their clean up routes, each custodian got the help from 4-5 interns. Together, interns and staff FLEW through their routes, and after joined us for an interactive educational activity and discussion.
Interns led the 3-Bin system sorting activity educating custodial staff on how to properly sort common trash items at Oakland Tech. Interns also shared the importance of recycling, composting and the negative effects that landfills can have on our environment. This knowledge will be the driver in the success of this project, and interns aren't stopping here, the whole school must know!
To close the meeting off, interns facilitated a discussion with Custodial Staff. The role of the interns will be to represent the custodians, teachers, staff, and peers. Interns and Custodial Staff are eager to continue this project, and empowered finding out they are one of the first big high schools in the Oakland School District that will have a 3-Bin System in all classrooms!
Thank you for reading! Keep a look out for next weeks blog as interns complete their last set of pre-project data with a school wide waste audit!


text:
import sys
import os
import subprocess

from pyevernote.EvernoteMetadata import EvernoteMetadata, ActionEnum

class GitGenerator(ActionEnum.Visitor):
    """Visitor class to convert note history entries to git actions"""

    def __init__(self, outdir):
        super(GitGenerator, self).__init__()
        self.outdir = outdir
        if not os.path.isdir(outdir):
            os.mkdir(outdir)
        else:
            subprocess.check_call(['rm', '-rf', outdir])
            os.mkdir(outdir)
        self.git('init')

    def git(self, *cmd):
        args = ['git', '-C', self.outdir] + list(cmd)
        print('==> {}'.format(' '.join(args)))
        return subprocess.check_call(args)

    def visitAll(self, actions):
        for action in actions:
            self.visit(action)

    def visit(self, action):
        print(action)
        noteFile = os.path.join(self.outdir, action.note.mdFile)
        content = action.note.textContent()
        super(GitGenerator, self).visit(action.action, action, noteFile, content)

    def visitCreated(self, action, noteFile, content):
        if not os.path.isdir(os.path.dirname(noteFile)):
            os.mkdir(os.path.dirname(noteFile))
        with open(noteFile, 'wt') as F:
            F.write(content)
        self.git('add', action.note.mdFile)
        self.git('commit', '--date', action.note.updatedTime.isoformat(), '-m', 'Adding {} [{}]'.format(action.note.title, action.note.sequence))

    def visitDeleted(self, action, noteFile, content):
        self.git('rm', action.note.mdFile)
        self.git('commit', '--date', action.note.deletedTime.isoformat(), '-m', 'Deleting {} [{}]'.format(action.note.title, action.note.sequence))

    def visitRenamed(self, action, noteFile, content):
        self.git('mv', action.extra, action.note.mdFile)
        with open(noteFile, 'wt') as F:
            F.write(content)
        self.git('add', action.note.mdFile)
        self.git('commit', '--date', action.note.updatedTime.isoformat(), '-m', 'Renaming {} --> {} [{}]'.format(action.extra, action.note.title, action.note.sequence))

    def visitUpdated(self, action, noteFile, content):
        with open(noteFile, 'rt') as F:
            old_content = F.read()
        if content != old_content:
            with open(noteFile, 'wt') as F:
                F.write(action.note.textContent())
            self.git('add', action.note.mdFile)
            self.git('commit', '--date', action.note.updatedTime.isoformat(), '-m', 'Updating {} [{}]'.format(action.note.title, action.note.sequence))

def toGit(syncdata, outdir):
    """Convert Evernote metadata in specified location to git repository in specified location"""
    meta = EvernoteMetadata(syncdata)
    gg = GitGenerator(outdir)
    gg.visitAll(meta.cleanHistory())
    gg.git('gc')  # garbage collect to compact repository

if __name__ == '__main__':
    if len(sys.argv) < 3:
        print("USAGE: python -m pyevernote.EvernoteToGit syncData gitDir")
        sys.exit(1)
    toGit(sys.argv[1], sys.argv[2])


text:
Justice Department Sued For Docs On Obama DOJ's Efforts To Shut Down Clinton Foundation Investigation
Don't think that with the raid on a Clinton Foundation / Uranium One whistleblower's home by the FBI that it was for anything but to cover for Hillary Clinton. However, now government watchdog group Judicial Watch has filed a Freedom of Information Act (FOIA) lawsuit against the Department of Justice to obtain DOJ documents on the efforts of Loretta Lynch and those under her to shut down an investigation into the Clinton Foundation.
The DOJ has routinely been passing deadlines for providing FOIA requests, as have other government agencies, such as the State Department. This has led to additional court costs through lawsuits in order to obtain them, and Judicial Watch has been at the tip of the spear in garnering this information.
Earlier this year, Judicial Watch issued an FOIA request for the following:
All records of communication, including but not limited to e-mails (whether sent or received on .gov or non-.gov e-mail accounts), text messages, or instant chats, sent between officials in the offices of the FBI Director, Deputy Director and General Counsel on the one hand, and officials in the offices of the Attorney General, Deputy Attorney General and or Principal Associate Deputy Attorney General on the other hand, regarding the closure or possible closure of an investigation into the Clinton Foundation.
The timeframe of the request was given as between January 1, 2016 and December 31, 2016.
Keep in mind that it was this organization using the same methods of FOIA lawsuits that led to the disclosure of Hillary Clinton's illegal private email server which she knowingly sent and received classified information through and that information was read by those without the proper security clearance, including her maid.
Judicial Watch also reports that its FOIA lawsuits have been effective in breaking other stories with documentation.
In August 2016, a related Judicial Watch FOIA lawsuit broke open the story and began making conflict of interest documents public, showing that in April 2009 controversial Clinton Foundation official Doug Band pushed for a job for an associate. In the email Band tells Hillary Clinton's former aides at the State Department Cheryl Mills and Huma Abedin that it is "important to take care of [Redacted]. Band is reassured by Abedin that "Personnel has been sending him options." Band was co-founder of Teneo Strategy with Bill Clinton and a top official of the Clinton Foundation, including its Clinton Global Initiative.
Included in that document production was a 2009 email in which Band, directs Abedin and Mills to put Lebanese-Nigerian billionaire and Clinton Foundation donor Gilbert Chagoury in touch with the State Department's "substance person" on Lebanon. Band notes that Chagoury is "key guy there [Lebanon] and to us," and insists that Abedin call Amb. Jeffrey Feltman to connect him to Chagoury.
Judicial Watch has since uncovered many other instances of seeming pay-to-play and favoritism for the Clinton Foundation at the Clinton State Department.
While the FBI did begin an investigation into the Clinton Foundation beyond the email probe, agents were told they didn't have "enough evidence to move forward" with their investigation of the Foundation.
However, what we now know from a DOJ Inspector General report from February 2018 is that the FBI was told to shut down the investigation by the Justice Department.
McCabe [fired former deputy director of the FBI] told the OIG that on August 12, 2016, he received a telephone call from PADAG [Principal Associate Deputy Attorney General, likely Matthew Axelrod] regarding the FBI's handling of the CF [Clinton Foundation] Investigation (the "PADAG call"). McCabe said that PADAG expressed concerns about FBI agents taking overt steps in the CF Investigation during the presidential campaign. According to McCabe, he pushed back, asking "are you telling me that I need to shut down a validly predicated investigation?" McCabe told us that the conversation was "very dramatic" and he never had a similar confrontation like the PADAG call with a high-level Department official in his entire FBI career.
It seems the Justice Department continued to engage in obstruction of justice long after Eric Holder left office.
Of course, all of that followed on the heels of the infamous tarmac meeting between Bill Clinton and Loretta Lynch, which Judicial Watch also sued for information on, which the FBI set up. Judicial Watch then released 29 pages of documents on the tarmac. The DOJ continued to hide information on that meeting and the NSA was no help in getting information on it either.
Judicial Watch also reported on what took place later:
Reportedly, senior DOJ officials refused FBI requests to issue subpoenas on Clinton Foundation issues in 2016.
In January 2018, reports surfaced that the FBI reportedly launched a new investigation into potential Clinton Foundation pay-to-play but there has been no indication it is proceeding.
In October 18, 2018, Representative Bob Goodlatte, Chairman of the House Judiciary Committee announced the release of former FBI Deputy Director Andrew McCabes' disciplinary file, which "reminds us how the Obama Justice Department sought to shut down the Clinton Foundation investigation during the 2016 presidential election." [Emphasis added]
"The record shows the Obama Justice Department suppressed a public corruption investigation into the Clinton Foundation," said Judicial Watch President Tom Fitton. "It's time for the DOJ to stop shielding the Clintons and produce records on this miscarriage of justice."
That's exactly right, and this is not a partisan issue, it's a corruption issue.
Courtesy of Freedom Outpost
Tim Brown is an author and Editor at FreedomOutpost.com, SonsOfLibertyMedia.com, GunsInTheNews.com and TheWashingtonStandard.com. He is husband to his "more precious than rubies" wife, father of 10 "mighty arrows", jack of all trades, Christian and lover of liberty. He resides in the U.S. occupied Great State of South Carolina. . Follow Tim on Twitter. Also check him out on Gab, Minds, MeWe, Spreely, Mumbl It and Steemit
Previous articleObama Administration Dropped Terror Funding Case Against Islamic Relief – One Of World's Largest Islamic Charities
Next articleDHS: Feds Catch Convicted Murderer In Migrant Caravan – 600 Criminals Identified In Caravan


text:
Q: Changing the background color of a  section I'm trying to use jQuery to change the background color of a
 section when pressing on a button, and below is the code to do that. Why isn't it working?
HTML file

<input type="button" id="bgcolor" value="Change color"/>

Abder-Rahman

script.js
$("bgcolor").click(function(){
    $("#name").animate(
        {backgroundColor: '#8B008B'},
        "fast");}
);

Thanks.

A: You have several problems:

*

*Your selector is wrong: $("#bgcolor")

*You're missing a closing
 tag.

*You need jQueryUI to animate background-color.

HTML:
<input type="button" id="bgcolor" value="Change color"/>

Abder-Rahman

JS:
$("#bgcolor").click(function(){
    $("#name").animate(
        {backgroundColor: '#8B008B'},
        "fast");}
);

Your code, fixed (and working with jQueryUI included): http://jsfiddle.net/andrewwhitaker/rAVj9/

A: From the jQuery website:

All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality. (For example, width, height, or left can be animated but background-color cannot be.)

Use jquery UI package to animate colors.

A: Ensure you include the CSS selector inside the jQuery that you wish to target.
$("bgcolor").click(function(){

Should be:
$("#bgcolor").click(function(){

Because you are targeting an ID.

redpajama_set_name: RedPajamaStackExchange


With a positive and progressive attitude to customer's curiosity, our organization repeatedly improves our products top quality to meet the wants of consumers and further focuses on safety, reliability, environmental necessities, and innovation of Promotional Pens And Pads , promotional pens and pads , Promotion Necklace And Bracelets , We expect to provide products and services to more users in global aftermarket markets; we launched our global branding strategy by providing our excellent products all over the world by virtue of our well reputed partners letting global users keep pace with technology innovation and achievements with us.
"Along with the ""Client-Oriented"" small business philosophy, a rigorous high-quality handle system, highly developed producing machines and a powerful R&D group, we always supply high-quality products and solutions, fantastic services and aggressive costs for Promotional Pens And Pads , promotional pens and pads , Promotion Necklace And Bracelets , Each customer's satisfactory is our goal. We've been looking for long-term cooperation with each customer. To meet this we keep up our quality and give extraordinary customer service. Welcome to our company we are expecting to cooperate with you.


text:
South Tahoe splits league doubleheader at home
Local Sports Local-sports |
Courtesy Mark Pado
Baseball Standings
Elko 9-0
Lowry 8-4 (Lowry holds tiebreaker with Fallon)
Fallon 8-4
Truckee 4-4
So Tahoe 5-6
Fernley 4-5
Sparks 3-6
Sp. Creek 2-7
Dayton 1-8
Remaining Series
Spring Creek at Elko, April 26 and April 27 (DH)
Fernley vs. Dayton, April 24 and April 26 (DH)
Truckee vs. South Tahoe, April 30
Sparks vs. Truckee, April 24 and April 27 (DH)
The table has been set for one final regular-season showdown.
In a Mount Rose League doubleheader filled with emotion Saturday, the South Tahoe and Truckee baseball teams split the pair, with the Vikings blowing open the first game in the middle innings en route a 10-0 win and the Wolverines outlasting the hosts, 11-8, in the nightcap.
The Division I-A rivals will square off one more time at Aces Ballpark on April 30 to end the regular season, with possible homefield advantage in the postseason on the line. Playoff seeding is based on records within the Division I-A; South Tahoe is 5-6, with only the one game against the Wolverines, and Truckee is 4-4 in the DI-A, with four games remaining.
Game 1 on Saturday began as a pitchers' duel between Truckee's Erik Holmer and South Tahoe's Jordan Mann, both of whom held the opposition scoreless through four innings.
Holmer ran into trouble in the fifth, however. The Vikings scored five runs, highlighted by a two-run home run by Cody Higgins off of the storage container beyond right field.
The Vikings were not done. They scored five more runs in the sixth to end the game on the 10-run mercy rule.
Truckee managed just five hits off of Mann, who struck out five and walked three in six innings. Chris Towle went 2-for-3, while Holmer and Teagan Pado each had one hit.
Following the home run by Higgins, Holmer fired a pitch behind the back of Tyler Sharp. He then hit Mann with a pitch.
Sergio Burgueno went 2-for-4 with two RBI and two runs. Dominic Diana added a two-run triple and came across the plate twice. Liam Loftis contributed a double and two runs. Mann and RJ Rivera went 2-for-3 with Mann knocking in two RBI and Rivera adding two runs.
The Wolverines committed three errors in the game.
In Game 2, South Tahoe jumped out to an early 3-1 lead and held it through four innings, before Truckee exploded for a seven-run fifth. Truckee added a run in the sixth and another in the seventh, while South Tahoe scored four times in the bottom of the seventh to make it close.
Riley Guiragossian started and earned the win for the Wolverines. The junior went 4 1/3 innings, giving up four runs (three earned) on five hits and a walk.
South Tahoe finished with 10 hits, led by Sharp and Mann, who both contributed two hits and an RBI apiece with Sharp smacking a double. Burgueno blasted an RBI triple, and Higgins contributed a clutch two RBI single. Christian Coats put down an RBI single and Loftis also contributed a hit.
Each team committed three errors, with Truckee's coming early in the game and South Tahoe's coming late.
Truckee coach Mike Ellis found himself riled up on a couple of occasions, once in the fourth inning when Aaron Pado was picked off of first and the coach thought he was safe, and then again in the fifth when Holmer hit a Texas-leaguer to right field with the bases loaded but was called out on the infield fly rule.
The Vikings are now 11-11-1 overall, and the Wolverines are 11-11-1.
UP NEXT: South Tahoe is scheduled to host a non-conference game against Portola on Wednesday at 4 p.m. The Vikings will then travel to North Tahoe for a doubleheader on Saturday at 11 a.m. and 1 p.m.


Books and other materials for the library collection are a nice way to remember someone. Talk to us about purchasing items in the person's areas of interest. For each item, a bookplate will be in the cover in memory of the person and listing you as the donor, if you wish. Contact us for more information or use Wish List to make your contribution.
Looking for a unique gift for a birthday, wedding, thank you or other special occasion? Consider donating a book or other item to the library's collection in the person's honor. A bookplate will be placed on the item with the person's name and listing you as the donor, if you wish. We will send the person a letter telling them of the donation. Contact us for more information or use Wish List to make your contribution.
All memorial and honorarium gifts are tax-deductible.


Why is ICANN Tax Exempt?
ICANN, as we all know, is a California non-profit that is tax exempt in the US as a charity, under section 501(c)(3) of the US tax code. But it's a rather unusual charity. Typical charities support the arts, or education, or sports, or relief for the poor. ICANN doesn't do anything like that. So what's the basis for its tax exemption? We don't have to guess, it's all in the application they filed in 1999.
That was all certainly true in 2000 when the exemption was granted, but will it be true after the IANA transition? The whole point of the transition is that the US government is getting out of domain name management. Indeed, one of NTIA's explicit requirements for the transition is that the new oversight is not by a group of governments.
So if the reason for ICANN's tax exemption goes away, what are ICANN's options?
One possibility would be to change to a trade association, known as a 501(c)(6) "business league" in tax law. It seems to me that ICANN would certainly qualify, it already looks a lot like a domain name trade association, so now it would just make the theory agree with the reality. The organizational rules for a business league are pretty much the same as for a charity, with the only significant difference being that if a business league takes contributions, they're not tax deductible. (Payments such as registry and registrar domain fees are deductible as business expenses, no difference there.) icann shows about $2M in contributions in its form 990, but those appear to be mostly or entirely from ccTLDs which, being outside the US, aren't affected by US tax law.
Another would be to forget the whole tax exempt thing and just be an ordinary corporation. ICANN's surpluses would become taxable profits, but since they've always claimed to be setting budgets to cover expenses, any profits would either be negligible, or perhaps just a lucky mistake so who cares if some of them are taxed away. More interestingly, a corporation has shareholders, perhaps the SO and AC members could be issued stock. (I realize this could present issues for the GAC and ALAC.) Or they could be a B Corporation, one whose bylaws recognize public benefit goals, which California corporation law specifically allows.
Regardless of what kind of corporation ICANN became, it would make the issues of who's got influence over what a lot clearer, since now it would be about who's got the stockholder votes to install board members who favor their positions, not the current squishy policy stuff.
John - An interesting proposition, but one has to remember that the "US government is getting out of domain name management" precisely because (and enabled by) ICANN's success. This has been a key goal of ICANN since formation, and we're now potentially at the point of realization.
"[w]hen a particular activity has been engaged in by a governmental unit on a regular basis for a significant length of time before it is taken over by an organization, it may be apparent that the activity is a burden of government."
i.e. the fact that the functions are being done by ICANN with or without a direct USG relationship is likely not germane, so long as the IRS considers the history of the functions indicative of potential governmental burden.
I agree that ICANN's tax exemption isn't going away, if for no other reason than that the Commerce Dept and Treasury Dept don't talk to each other.
In the longer term, the IANA functions are clearly what the USG would be doing otherwise, the other 98% of ICANN not so much.
John - Excellent point, as I was indeed referring to the IANA functions aspect of ICANN, and not per se the ICANN roles of DNS trade association doing policy development, nor ICANN the shared services organization for that community.
"The exempt purposes set forth in section 501(c)(3) are charitable, religious, educational, scientific, literary, testing for public safety, fostering national or international amateur sports competition, and preventing cruelty to children or animals. The term charitable is used in its generally accepted legal sense and includes relief of the poor, the distressed, or the underprivileged; advancement of religion; advancement of education or science; erecting or maintaining public buildings, monuments, or works; lessening the burdens of government; lessening neighborhood tensions; eliminating prejudice and discrimination; defending human and civil rights secured by law; and combating community deterioration and juvenile delinquency."
Maintaining the root zone file for use by the public seems a good fit.
I'm often accused of being juvenile, but ICANN has provided me with many opportunities to avoid being delinquent. So there's a second choice there.
Like I said to John Curran, that certainly describes the IANA function. But what about the other 98% of what ICANN does?
I'm not sure how you arrive at a figure of 98% as being unrelated to that function. Formulating policy in relation to the namespace, administering registry and registrar contracts, etc., all relate in some way to that function.
I understand very few deities see much of the cash collected by religious organizations.
Local Time: Friday, April 19, 2019 01:29 PM PDT – Page Load: 0.3304 Sec.


text:
__author__ = '{{ cookiecutter.full_name }}'
__email__ = '{{ cookiecutter.email }}'
__version__ = '{{ cookiecutter.version }}'

from .tapioca_{{ cookiecutter.service_name|lower|replace(' ', '_') }} import {{ cookiecutter.service_name|title|replace(' ', '') }}  # noqa