text:
<?php

/**
 * @method Ess_M2ePro_Model_Listing_Product getParentObject()
 */
class Ess_M2ePro_Model_Amazon_Listing_Product extends Ess_M2ePro_Model_Component_Child_Amazon_Abstract
{
    const INSTRUCTION_TYPE_CHANNEL_STATUS_CHANGED        = 'channel_status_changed';
    const INSTRUCTION_TYPE_CHANNEL_QTY_CHANGED           = 'channel_qty_changed';
    const INSTRUCTION_TYPE_CHANNEL_REGULAR_PRICE_CHANGED = 'channel_regular_price_changed';

    const IS_AFN_CHANNEL_NO  = 0;
    const IS_AFN_CHANNEL_YES = 1;

    const IS_REPRICING_NO  = 0;
    const IS_REPRICING_YES = 1;

    const VARIATION_PARENT_IS_AFN_STATE_ALL_NO  = 0;
    const VARIATION_PARENT_IS_AFN_STATE_PARTIAL = 1;
    const VARIATION_PARENT_IS_AFN_STATE_ALL_YES = 2;

    const VARIATION_PARENT_IS_REPRICING_STATE_ALL_NO  = 0;
    const VARIATION_PARENT_IS_REPRICING_STATE_PARTIAL = 1;
    const VARIATION_PARENT_IS_REPRICING_STATE_ALL_YES = 2;

    const IS_ISBN_GENERAL_ID_NO  = 0;
    const IS_ISBN_GENERAL_ID_YES = 1;

    const IS_GENERAL_ID_OWNER_NO  = 0;
    const IS_GENERAL_ID_OWNER_YES = 1;

    const SEARCH_SETTINGS_STATUS_IN_PROGRESS     = 1;
    const SEARCH_SETTINGS_STATUS_NOT_FOUND       = 2;
    const SEARCH_SETTINGS_STATUS_ACTION_REQUIRED = 3;

    const GENERAL_ID_STATE_SET = 0;
    const GENERAL_ID_STATE_NOT_SET = 1;
    const GENERAL_ID_STATE_ACTION_REQUIRED = 2;
    const GENERAL_ID_STATE_READY_FOR_NEW_ASIN = 3;

    const BUSINESS_DISCOUNTS_MAX_RULES_COUNT_ALLOWED = 5;

    /**
     * @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager
     */
    protected $_variationManager = null;

    /**
     * @var Ess_M2ePro_Model_Amazon_Listing_Product_Repricing
     */
    protected $_repricingModel = null;

    //########################################

    public function _construct()
    {
        parent::_construct();
        $this->_init('M2ePro/Amazon_Listing_Product');
    }

    //########################################

    /**
     * @return bool
     * @throws Ess_M2ePro_Model_Exception
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function isLocked()
    {
        if (parent::isLocked()) {
            return true;
        }

        if ($this->getVariationManager()->isRelationParentType()) {
            foreach ($this->getVariationManager()->getTypeModel()->getChildListingsProducts() as $child) {
                /** @var $child Ess_M2ePro_Model_Listing_Product */
                if ($child->getStatus() == Ess_M2ePro_Model_Listing_Product::STATUS_LISTED) {
                    return true;
                }
            }
        }

        return false;
    }

    /**
     * @return bool
     * @throws Ess_M2ePro_Model_Exception
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function deleteInstance()
    {
        if ($this->isLocked()) {
            return false;
        }

        if ($this->getVariationManager()->isRelationParentType()) {
            foreach ($this->getVariationManager()->getTypeModel()->getChildListingsProducts() as $child) {
                /** @var $child Ess_M2ePro_Model_Listing_Product */
                $child->deleteInstance();
            }
        }

        if ($this->isRepricingUsed()) {
            $this->getRepricing()->deleteInstance();
        }

        $this->_variationManager = NULL;

        $this->delete();
        return true;
    }

    //########################################

    public function afterSaveNewEntity()
    {
        /** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager $variationManager */
        $variationManager = $this->getVariationManager();
        $magentoProduct = $this->getMagentoProduct();

        if ($magentoProduct->isProductWithVariations() && !$variationManager->isVariationProduct()) {
            $this->getParentObject()->setData('is_variation_product', 1);
            $variationManager->setRelationParentType();
            $variationManager->getTypeModel()->resetProductAttributes(false);
            $variationManager->getTypeModel()->getProcessor()->process();
        }
    }

    //########################################

    /**
     * @return Ess_M2ePro_Model_Account
     */
    public function getAccount()
    {
        return $this->getParentObject()->getAccount();
    }

    /**
     * @return Ess_M2ePro_Model_Amazon_Account
     */
    public function getAmazonAccount()
    {
        return $this->getAccount()->getChildObject();
    }

    // ---------------------------------------

    /**
     * @return Ess_M2ePro_Model_Marketplace
     */
    public function getMarketplace()
    {
        return $this->getParentObject()->getMarketplace();
    }

    /**
     * @return Ess_M2ePro_Model_Amazon_Marketplace
     */
    public function getAmazonMarketplace()
    {
        return $this->getMarketplace()->getChildObject();
    }

    //########################################

    /**
     * @return Ess_M2ePro_Model_Listing
     */
    public function getListing()
    {
        return $this->getParentObject()->getListing();
    }

    /**
     * @return Ess_M2ePro_Model_Amazon_Listing
     */
    public function getAmazonListing()
    {
        return $this->getListing()->getChildObject();
    }

    // ---------------------------------------

    /**
     * @return Ess_M2ePro_Model_Amazon_Listing_Source
     */
    public function getListingSource()
    {
        return $this->getAmazonListing()->getSource($this->getActualMagentoProduct());
    }

    // ---------------------------------------

    /**
     * @return Ess_M2ePro_Model_Template_SellingFormat
     */
    public function getSellingFormatTemplate()
    {
        return $this->getAmazonListing()->getSellingFormatTemplate();
    }

    /**
     * @return Ess_M2ePro_Model_Amazon_Template_SellingFormat
     */
    public function getAmazonSellingFormatTemplate()
    {
        return $this->getSellingFormatTemplate()->getChildObject();
    }

    // ---------------------------------------

    /**
     * @return Ess_M2ePro_Model_Template_Synchronization
     */
    public function getSynchronizationTemplate()
    {
        return $this->getAmazonListing()->getSynchronizationTemplate();
    }

    /**
     * @return Ess_M2ePro_Model_Amazon_Template_Synchronization
     */
    public function getAmazonSynchronizationTemplate()
    {
        return $this->getSynchronizationTemplate()->getChildObject();
    }

    // ---------------------------------------

    /**
     * @return bool
     */
    public function isExistShippingTemplate()
    {
        return $this->getTemplateShippingId() > 0;
    }

    /**
     * @return Ess_M2ePro_Model_Amazon_Template_Shipping | null
     */
    public function getShippingTemplate()
    {
        if (!$this->isExistShippingTemplate()) {
            return null;
        }

        return Mage::helper('M2ePro')->getCachedObject(
            'Amazon_Template_Shipping', $this->getTemplateShippingId(), NULL, array('template')
        );
    }

    // ---------------------------------------

    /**
     * @return Ess_M2ePro_Model_Amazon_Template_Shipping_Source
     */
    public function getShippingTemplateSource()
    {
        if (!$this->isExistShippingTemplate()) {
            return null;
        }

        return $this->getShippingTemplate()->getSource($this->getActualMagentoProduct());
    }

    // ---------------------------------------

    /**
     * @return bool
     */
    public function isExistProductTaxCodeTemplate()
    {
        return $this->getTemplateProductTaxCodeId() > 0;
    }

    /**
     * @return Ess_M2ePro_Model_Amazon_Template_ProductTaxCode | null
     */
    public function getProductTaxCodeTemplate()
    {
        if (!$this->isExistProductTaxCodeTemplate()) {
            return null;
        }

        return Mage::helper('M2ePro')->getCachedObject(
            'Amazon_Template_ProductTaxCode', $this->getTemplateProductTaxCodeId(), NULL, array('template')
        );
    }

    // ---------------------------------------

    /**
     * @return Ess_M2ePro_Model_Amazon_Template_ProductTaxCode_Source
     */
    public function getProductTaxCodeTemplateSource()
    {
        if (!$this->isExistProductTaxCodeTemplate()) {
            return null;
        }

        return $this->getProductTaxCodeTemplate()->getSource($this->getActualMagentoProduct());
    }

    // ---------------------------------------

    /**
     * @return bool
     */
    public function isExistDescriptionTemplate()
    {
        return $this->getTemplateDescriptionId() > 0;
    }

    /**
     * @return Ess_M2ePro_Model_Template_Description | null
     */
    public function getDescriptionTemplate()
    {
        if (!$this->isExistDescriptionTemplate()) {
            return null;
        }

        return Mage::helper('M2ePro/Component_Amazon')->getCachedObject(
            'Template_Description', $this->getTemplateDescriptionId(), NULL, array('template')
        );
    }

    /**
     * @return Ess_M2ePro_Model_Amazon_Template_Description | null
     */
    public function getAmazonDescriptionTemplate()
    {
        if (!$this->isExistDescriptionTemplate()) {
            return null;
        }

        return $this->getDescriptionTemplate()->getChildObject();
    }

    //########################################

    /**
     * @return Ess_M2ePro_Model_Amazon_Template_Description_Source
     */
    public function getDescriptionTemplateSource()
    {
        if (!$this->isExistDescriptionTemplate()) {
            return null;
        }

        return $this->getAmazonDescriptionTemplate()->getSource($this->getActualMagentoProduct());
    }

    //########################################

    /**
     * @return Ess_M2ePro_Model_Magento_Product_Cache
     */
    public function getMagentoProduct()
    {
        return $this->getParentObject()->getMagentoProduct();
    }

    /**
     * @return Ess_M2ePro_Model_Magento_Product_Cache
     */
    public function getActualMagentoProduct()
    {
        if (!$this->getVariationManager()->isPhysicalUnit() ||
            !$this->getVariationManager()->getTypeModel()->isVariationProductMatched()
        ) {
            return $this->getMagentoProduct();
        }

        if ($this->getMagentoProduct()->isConfigurableType() ||
            $this->getMagentoProduct()->isGroupedType()) {
            $variations = $this->getVariations(true);
            if (empty($variations)) {
                throw new Ess_M2ePro_Model_Exception_Logic(
                    'There are no variations for a variation product.',
                    array(
                                                         'listing_product_id' => $this->getId()
                    )
                );
            }

            $variation  = reset($variations);
            $options    = $variation->getOptions(true);
            $option     = reset($options);

            return $option->getMagentoProduct();
        }

        return $this->getMagentoProduct();
    }

    /**
     * @param Ess_M2ePro_Model_Magento_Product_Cache $instance
     * @return Ess_M2ePro_Model_Magento_Product_Cache
     * @throws Ess_M2ePro_Model_Exception
     */
    public function prepareMagentoProduct(Ess_M2ePro_Model_Magento_Product_Cache $instance)
    {
        if (!$this->getVariationManager()->isRelationMode()) {
            return $instance;
        }

        /** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Relation_Parent $parentTypeModel */

        if ($this->getVariationManager()->isRelationParentType()) {
            $parentTypeModel = $this->getVariationManager()->getTypeModel();
        } else {
            $parentAmazonListingProduct = $this->getVariationManager()->getTypeModel()->getAmazonParentListingProduct();
            $parentTypeModel = $parentAmazonListingProduct->getVariationManager()->getTypeModel();
        }

        $instance->setVariationVirtualAttributes($parentTypeModel->getVirtualProductAttributes());
        $instance->setVariationFilterAttributes($parentTypeModel->getVirtualChannelAttributes());

        return $instance;
    }

    //########################################

    /**
     * @return Ess_M2ePro_Model_Amazon_Item
    */
    public function getAmazonItem()
    {
        return Mage::getModel('M2ePro/Amazon_Item')->getCollection()
                        ->addFieldToFilter('account_id', $this->getListing()->getAccountId())
                        ->addFieldToFilter('marketplace_id', $this->getListing()->getMarketplaceId())
                        ->addFieldToFilter('sku', $this->getSku())
                        ->setOrder('create_date', Varien_Data_Collection::SORT_ORDER_DESC)
                        ->getFirstItem();
    }

    public function getVariationManager()
    {
        if ($this->_variationManager === null) {
            $this->_variationManager = Mage::getModel('M2ePro/Amazon_Listing_Product_Variation_Manager');
            $this->_variationManager->setListingProduct($this->getParentObject());
        }

        return $this->_variationManager;
    }

    /**
     * @param bool $asObjects
     * @param array $filters
     * @param bool $tryToGetFromStorage
     * @return array
     */
    public function getVariations($asObjects = false, array $filters = array(), $tryToGetFromStorage = true)
    {
        return $this->getParentObject()->getVariations($asObjects, $filters, $tryToGetFromStorage);
    }

    //########################################

    /**
     * @return Ess_M2ePro_Model_Amazon_Listing_Product_Repricing
     */
    public function getRepricing()
    {
        if ($this->_repricingModel === null) {
            $this->_repricingModel = Mage::getModel('M2ePro/Amazon_Listing_Product_Repricing')->load($this->getId());
        }

        return $this->_repricingModel;
    }

    /**
     * @return bool
     */
    public function isRepricingUsed()
    {
        return $this->isRepricing() && $this->getRepricing()->getId();
    }

    /**
     * @return bool
     */
    public function isRepricingManaged()
    {
        return $this->isRepricingUsed() &&
            !$this->getRepricing()->isOnlineDisabled() && !$this->getRepricing()->isOnlineInactive();
    }

    /**
     * @return bool
     */
    public function isRepricingDisabled()
    {
        return $this->isRepricingUsed() && $this->getRepricing()->isOnlineDisabled();
    }

    /**
     * @return bool
     */
    public function isRepricingInactive()
    {
        return $this->isRepricingUsed() && $this->getRepricing()->isOnlineInactive();
    }

    //########################################

    /**
     * @return int
     */
    public function getTemplateDescriptionId()
    {
        return (int)($this->getData('template_description_id'));
    }

    /**
     * @return int
     */
    public function getTemplateShippingId()
    {
        return (int)($this->getData('template_shipping_id'));
    }

    /**
     * @return int
     */
    public function getTemplateProductTaxCodeId()
    {
        return (int)($this->getData('template_product_tax_code_id'));
    }

    // ---------------------------------------

    /**
     * @return string
     */
    public function getSku()
    {
        return $this->getData('sku');
    }

    /**
     * @return string
     */
    public function getGeneralId()
    {
        return $this->getData('general_id');
    }

    // ---------------------------------------

    /**
     * @return float|null
     */
    public function getOnlineRegularPrice()
    {
        return $this->getData('online_regular_price');
    }

    public function getOnlineRegularSalePrice()
    {
        return $this->getData('online_regular_sale_price');
    }

    public function getOnlineRegularSalePriceStartDate()
    {
        return $this->getData('online_regular_sale_price_start_date');
    }

    public function getOnlineRegularSalePriceEndDate()
    {
        return $this->getData('online_regular_sale_price_end_date');
    }

    // ---------------------------------------

    /**
     * @return float|null
     */
    public function getOnlineBusinessPrice()
    {
        return (float)$this->getData('online_business_price');
    }

    public function getOnlineBusinessDiscounts()
    {
        return $this->getSettings('online_business_discounts');
    }

    // ---------------------------------------

    /**
     * @return int
     */
    public function getOnlineQty()
    {
        return (int)$this->getData('online_qty');
    }

    /**
     * @return int
     */
    public function getOnlineHandlingTime()
    {
        return (int)$this->getData('online_handling_time');
    }

    public function getOnlineRestockDate()
    {
        return $this->getData('online_restock_date');
    }

    // ---------------------------------------

    /**
     * @return array
     */
    public function getOnlineDetailsData()
    {
        return $this->getSettings('online_details_data');
    }

    /**
     * @return array
     */
    public function getOnlineImagesData()
    {
        return $this->getSettings('online_images_data');
    }

    /**
     * @return bool
     */
    public function isDetailsDataChanged()
    {
        return (bool)$this->getData('is_details_data_changed');
    }

    /**
     * @return bool
     */
    public function isImagesDataChanged()
    {
        return (bool)$this->getData('is_images_data_changed');
    }

    // ---------------------------------------

    /**
     * @return bool
     */
    public function isRepricing()
    {
        return (int)$this->getData('is_repricing') == self::IS_REPRICING_YES;
    }

    /**
     * @return bool
     */
    public function isAfnChannel()
    {
        return (int)$this->getData('is_afn_channel') == self::IS_AFN_CHANNEL_YES;
    }

    /**
     * @return bool
     */
    public function isIsbnGeneralId()
    {
        return (int)$this->getData('is_isbn_general_id') == self::IS_ISBN_GENERAL_ID_YES;
    }

    /**
     * @return bool
     */
    public function isGeneralIdOwner()
    {
        return (int)$this->getData('is_general_id_owner') == self::IS_GENERAL_ID_OWNER_YES;
    }

    // ---------------------------------------

    public function getVariationParentAfnState()
    {
        return $this->getData('variation_parent_afn_state');
    }

    public function isVariationParentAfnStateNo()
    {
        return (int)$this->getVariationParentAfnState() == self::VARIATION_PARENT_IS_AFN_STATE_ALL_NO;
    }

    public function isVariationParentAfnStatePartial()
    {
        return (int)$this->getVariationParentAfnState() == self::VARIATION_PARENT_IS_AFN_STATE_PARTIAL;
    }

    public function isVariationParentAfnStateYes()
    {
        return (int)$this->getVariationParentAfnState() == self::VARIATION_PARENT_IS_AFN_STATE_ALL_YES;
    }

    // ---------------------------------------

    public function getVariationParentRepricingState()
    {
        return $this->getData('variation_parent_repricing_state');
    }

    public function isVariationParentRepricingStateNo()
    {
        return (int)$this->getVariationParentRepricingState() == self::VARIATION_PARENT_IS_REPRICING_STATE_ALL_NO;
    }

    public function isVariationParentRepricingStatePartial()
    {
        return (int)$this->getVariationParentRepricingState() == self::VARIATION_PARENT_IS_REPRICING_STATE_PARTIAL;
    }

    public function isVariationParentRepricingStateYes()
    {
        return (int)$this->getVariationParentRepricingState() == self::VARIATION_PARENT_IS_REPRICING_STATE_ALL_YES;
    }

    // ---------------------------------------

    /**
     * @return array
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getDefectedMessages()
    {
        return $this->getSettings('defected_messages');
    }

    //########################################

    public function getSearchSettingsStatus()
    {
        return $this->getData('search_settings_status');
    }

    /**
     * @return array
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getSearchSettingsData()
    {
        return $this->getSettings('search_settings_data');
    }

    // ---------------------------------------

    /**
     * @return array
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getGeneralIdSearchInfo()
    {
        return $this->getSettings('general_id_search_info');
    }

    //########################################

    public function isAllowedForRegularCustomers()
    {
        return $this->getAmazonSellingFormatTemplate()->isRegularCustomerAllowed();
    }

    public function isAllowedForBusinessCustomers()
    {
        if (!Mage::helper('M2ePro/Component_Amazon_Business')->isEnabled()) {
            return false;
        }

        if (!$this->getAmazonMarketplace()->isBusinessAvailable()) {
            return false;
        }

        if (!$this->getAmazonSellingFormatTemplate()->isBusinessCustomerAllowed()) {
            return false;
        }

        return true;
    }

    //########################################

    /**
     * @param bool $magentoMode
     * @return int
     * @throws Ess_M2ePro_Model_Exception
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getQty($magentoMode = false)
    {
        if ($this->getVariationManager()->isPhysicalUnit() &&
            $this->getVariationManager()->getTypeModel()->isVariationProductMatched()) {
            $variations = $this->getVariations(true);
            if (empty($variations)) {
                throw new Ess_M2ePro_Model_Exception_Logic(
                    'There are no variations for a variation product.',
                    array(
                        'listing_product_id' => $this->getId()
                    )
                );
            }

            /** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
            $variation = reset($variations);

            return $variation->getChildObject()->getQty($magentoMode);
        }

        /** @var $calculator Ess_M2ePro_Model_Amazon_Listing_Product_QtyCalculator */
        $calculator = Mage::getModel('M2ePro/Amazon_Listing_Product_QtyCalculator');
        $calculator->setProduct($this->getParentObject());
        $calculator->setIsMagentoMode($magentoMode);

        return $calculator->getProductValue();
    }

    //########################################

    /**
     * @return float|int
     * @throws Ess_M2ePro_Model_Exception
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getRegularPrice()
    {
        if (!$this->isAllowedForRegularCustomers()) {
            return NULL;
        }

        if ($this->getVariationManager()->isPhysicalUnit() &&
            $this->getVariationManager()->getTypeModel()->isVariationProductMatched()) {
            $variations = $this->getVariations(true);
            if (empty($variations)) {
                throw new Ess_M2ePro_Model_Exception_Logic(
                    'There are no variations for a variation product.',
                    array(
                                                         'listing_product_id' => $this->getId()
                    )
                );
            }

            /** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
            $variation = reset($variations);

            return $variation->getChildObject()->getRegularPrice();
        }

        $src = $this->getAmazonSellingFormatTemplate()->getRegularPriceSource();

        /** @var $calculator Ess_M2ePro_Model_Amazon_Listing_Product_PriceCalculator */
        $calculator = Mage::getModel('M2ePro/Amazon_Listing_Product_PriceCalculator');
        $calculator->setSource($src)->setProduct($this->getParentObject());
        $calculator->setCoefficient($this->getAmazonSellingFormatTemplate()->getRegularPriceCoefficient());
        $calculator->setVatPercent($this->getAmazonSellingFormatTemplate()->getRegularPriceVatPercent());

        return $calculator->getProductValue();
    }

    /**
     * @return float|int
     * @throws Ess_M2ePro_Model_Exception
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getRegularMapPrice()
    {
        if (!$this->isAllowedForRegularCustomers()) {
            return NULL;
        }

        if ($this->getVariationManager()->isPhysicalUnit() &&
            $this->getVariationManager()->getTypeModel()->isVariationProductMatched()) {
            $variations = $this->getVariations(true);
            if (empty($variations)) {
                throw new Ess_M2ePro_Model_Exception_Logic(
                    'There are no variations for a variation product.',
                    array(
                                                         'listing_product_id' => $this->getId()
                    )
                );
            }

            /** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
            $variation = reset($variations);

            return $variation->getChildObject()->getRegularMapPrice();
        }

        $src = $this->getAmazonSellingFormatTemplate()->getRegularMapPriceSource();

        /** @var $calculator Ess_M2ePro_Model_Amazon_Listing_Product_PriceCalculator */
        $calculator = Mage::getModel('M2ePro/Amazon_Listing_Product_PriceCalculator');
        $calculator->setSource($src)->setProduct($this->getParentObject());

        return $calculator->getProductValue();
    }

    // ---------------------------------------

    /**
     * @return float|int
     * @throws Ess_M2ePro_Model_Exception
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getRegularSalePrice()
    {
        if (!$this->isAllowedForRegularCustomers()) {
            return NULL;
        }

        if ($this->getVariationManager()->isPhysicalUnit() &&
            $this->getVariationManager()->getTypeModel()->isVariationProductMatched()) {
            $variations = $this->getVariations(true);
            if (empty($variations)) {
                throw new Ess_M2ePro_Model_Exception_Logic(
                    'There are no variations for a variation product.',
                    array(
                                                         'listing_product_id' => $this->getId()
                    )
                );
            }

            /** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
            $variation = reset($variations);

            return $variation->getChildObject()->getRegularSalePrice();
        }

        $src = $this->getAmazonSellingFormatTemplate()->getRegularSalePriceSource();

        /** @var $calculator Ess_M2ePro_Model_Amazon_Listing_Product_PriceCalculator */
        $calculator = Mage::getModel('M2ePro/Amazon_Listing_Product_PriceCalculator');
        $calculator->setSource($src)->setProduct($this->getParentObject());
        $calculator->setIsSalePrice(true);
        $calculator->setCoefficient($this->getAmazonSellingFormatTemplate()->getRegularSalePriceCoefficient());
        $calculator->setVatPercent($this->getAmazonSellingFormatTemplate()->getRegularPriceVatPercent());

        return $calculator->getProductValue();
    }

    /**
     * @return array|bool
     */
    public function getRegularSalePriceInfo()
    {
        $price = $this->getRegularPrice();
        $salePrice = $this->getRegularSalePrice();

        if ($salePrice <= 0 || $salePrice >= $price) {
            return false;
        }

        $startDate = $this->getRegularSalePriceStartDate();
        $endDate = $this->getRegularSalePriceEndDate();

        if (!$startDate || !$endDate) {
            return false;
        }

        $startDateTimestamp = strtotime($startDate);
        $endDateTimestamp = strtotime($endDate);

        $currentTimestamp = strtotime(Mage::helper('M2ePro')->getCurrentGmtDate(false, 'Y-m-d 00:00:00'));

        if ($currentTimestamp > $endDateTimestamp ||
            $startDateTimestamp >= $endDateTimestamp
        ) {
            return false;
        }

        return array(
            'price'      => $salePrice,
            'start_date' => $startDate,
            'end_date'   => $endDate
        );
    }

    // ---------------------------------------

    protected function getRegularSalePriceStartDate()
    {
        if ($this->getAmazonSellingFormatTemplate()->isRegularSalePriceModeSpecial() &&
            $this->getMagentoProduct()->isGroupedType()) {
            $magentoProduct = $this->getActualMagentoProduct();
        } else if ($this->getAmazonSellingFormatTemplate()->isRegularPriceVariationModeParent()) {
            $magentoProduct = $this->getMagentoProduct();
        } else {
            $magentoProduct = $this->getActualMagentoProduct();
        }

        $date = null;

        if ($this->getAmazonSellingFormatTemplate()->isRegularSalePriceModeSpecial()) {
            $date = $magentoProduct->getSpecialPriceFromDate();
        } else {
            $src = $this->getAmazonSellingFormatTemplate()->getRegularSalePriceStartDateSource();

            $date = $src['value'];

            if ($src['mode'] == Ess_M2ePro_Model_Amazon_Template_SellingFormat::DATE_ATTRIBUTE) {
                $date = $magentoProduct->getAttributeValue($src['attribute']);
            }
        }

        if (strtotime($date) === false) {
            return false;
        }

        return Mage::helper('M2ePro')->getDate($date, false, 'Y-m-d 00:00:00');
    }

    protected function getRegularSalePriceEndDate()
    {
        if ($this->getAmazonSellingFormatTemplate()->isRegularSalePriceModeSpecial() &&
            $this->getMagentoProduct()->isGroupedType()) {
            $magentoProduct = $this->getActualMagentoProduct();
        } else if ($this->getAmazonSellingFormatTemplate()->isRegularPriceVariationModeParent()) {
            $magentoProduct = $this->getMagentoProduct();
        } else {
            $magentoProduct = $this->getActualMagentoProduct();
        }

        $date = null;

        if ($this->getAmazonSellingFormatTemplate()->isRegularSalePriceModeSpecial()) {
            $date = $magentoProduct->getSpecialPriceToDate();

            $tempDate = new DateTime($date, new DateTimeZone('UTC'));
            $tempDate->modify('-1 day');
            $date = Mage::helper('M2ePro')->getDate($tempDate->format('U'));
        } else {
            $src = $this->getAmazonSellingFormatTemplate()->getRegularSalePriceEndDateSource();

            $date = $src['value'];

            if ($src['mode'] == Ess_M2ePro_Model_Amazon_Template_SellingFormat::DATE_ATTRIBUTE) {
                $date = $magentoProduct->getAttributeValue($src['attribute']);
            }
        }

        if (strtotime($date) === false) {
            return false;
        }

        return Mage::helper('M2ePro')->getDate($date, false, 'Y-m-d 00:00:00');
    }

    // ---------------------------------------

    /**
     * @return float|int
     * @throws Ess_M2ePro_Model_Exception
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getBusinessPrice()
    {
        if (!$this->isAllowedForBusinessCustomers()) {
            return NULL;
        }

        if ($this->getVariationManager()->isPhysicalUnit() &&
            $this->getVariationManager()->getTypeModel()->isVariationProductMatched()) {
            $variations = $this->getVariations(true);
            if (empty($variations)) {
                throw new Ess_M2ePro_Model_Exception_Logic(
                    'There are no variations for a variation product.',
                    array(
                        'listing_product_id' => $this->getId()
                    )
                );
            }

            /** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
            $variation = reset($variations);

            return $variation->getChildObject()->getBusinessPrice();
        }

        $src = $this->getAmazonSellingFormatTemplate()->getBusinessPriceSource();

        /** @var $calculator Ess_M2ePro_Model_Amazon_Listing_Product_PriceCalculator */
        $calculator = Mage::getModel('M2ePro/Amazon_Listing_Product_PriceCalculator');
        $calculator->setSource($src)->setProduct($this->getParentObject());
        $calculator->setCoefficient($this->getAmazonSellingFormatTemplate()->getBusinessPriceCoefficient());
        $calculator->setVatPercent($this->getAmazonSellingFormatTemplate()->getBusinessPriceVatPercent());

        return $calculator->getProductValue();
    }

    /**
     * @return array
     * @throws Ess_M2ePro_Model_Exception
     * @throws Ess_M2ePro_Model_Exception_Logic
     */
    public function getBusinessDiscounts()
    {
        if (!$this->isAllowedForBusinessCustomers()) {
            return NULL;
        }

        if ($this->getAmazonSellingFormatTemplate()->isBusinessDiscountsModeNone()) {
            return array();
        }

        if ($this->getVariationManager()->isPhysicalUnit() &&
            $this->getVariationManager()->getTypeModel()->isVariationProductMatched()) {
            $variations = $this->getVariations(true);
            if (empty($variations)) {
                throw new Ess_M2ePro_Model_Exception_Logic(
                    'There are no variations for a variation product.',
                    array(
                        'listing_product_id' => $this->getId()
                    )
                );
            }

            /** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
            $variation = reset($variations);

            return $variation->getChildObject()->getBusinessDiscounts();
        }

        if ($this->getAmazonSellingFormatTemplate()->isBusinessDiscountsModeTier()) {
            $src = $this->getAmazonSellingFormatTemplate()->getBusinessDiscountsSource();

            $storeId = $this->getListing()->getStoreId();
            $src['tier_website_id'] = Mage::helper('M2ePro/Magento_Store')->getWebsite($storeId)->getId();

            /** @var $calculator Ess_M2ePro_Model_Amazon_Listing_Product_PriceCalculator */
            $calculator = Mage::getModel('M2ePro/Amazon_Listing_Product_PriceCalculator');
            $calculator->setSource($src)->setProduct($this->getParentObject());
            $calculator->setSourceModeMapping(
                array(
                Ess_M2ePro_Model_Listing_Product_PriceCalculator::MODE_TIER
                    => Ess_M2ePro_Model_Amazon_Template_SellingFormat::BUSINESS_DISCOUNTS_MODE_TIER,
                )
            );
            $calculator->setCoefficient($this->getAmazonSellingFormatTemplate()->getBusinessDiscountsTierCoefficient());
            $calculator->setVatPercent($this->getAmazonSellingFormatTemplate()->getBusinessPriceVatPercent());

            return array_slice(
                $calculator->getProductValue(), 0, self::BUSINESS_DISCOUNTS_MAX_RULES_COUNT_ALLOWED, true
            );
        }

        /** @var Ess_M2ePro_Model_Amazon_Template_SellingFormat_BusinessDiscount[] $businessDiscounts */
        $businessDiscounts = $this->getAmazonSellingFormatTemplate()->getBusinessDiscounts(true);
        if (empty($businessDiscounts)) {
            return array();
        }

        $resultValue = array();

        foreach ($businessDiscounts as $businessDiscount) {
            /** @var $calculator Ess_M2ePro_Model_Amazon_Listing_Product_PriceCalculator */
            $calculator = Mage::getModel('M2ePro/Amazon_Listing_Product_PriceCalculator');
            $calculator->setSource($businessDiscount->getSource())->setProduct($this->getParentObject());
            $calculator->setSourceModeMapping(
                array(
                Ess_M2ePro_Model_Listing_Product_PriceCalculator::MODE_PRODUCT
                    => Ess_M2ePro_Model_Amazon_Template_SellingFormat_BusinessDiscount::MODE_PRODUCT,
                Ess_M2ePro_Model_Listing_Product_PriceCalculator::MODE_SPECIAL
                    => Ess_M2ePro_Model_Amazon_Template_SellingFormat_BusinessDiscount::MODE_SPECIAL,
                Ess_M2ePro_Model_Listing_Product_PriceCalculator::MODE_ATTRIBUTE
                    => Ess_M2ePro_Model_Amazon_Template_SellingFormat_BusinessDiscount::MODE_ATTRIBUTE,
                )
            );
            $calculator->setCoefficient($businessDiscount->getCoefficient());
            $calculator->setVatPercent($this->getAmazonSellingFormatTemplate()->getBusinessPriceVatPercent());

            $resultValue[$businessDiscount->getQty()] = $calculator->getProductValue();

            if (count($resultValue) >= self::BUSINESS_DISCOUNTS_MAX_RULES_COUNT_ALLOWED) {
                break;
            }
        }

        return $resultValue;
    }

    //########################################

    public function listAction(array $params = array())
    {
        return $this->processDispatcher(Ess_M2ePro_Model_Listing_Product::ACTION_LIST, $params);
    }

    public function relistAction(array $params = array())
    {
        return $this->processDispatcher(Ess_M2ePro_Model_Listing_Product::ACTION_RELIST, $params);
    }

    public function reviseAction(array $params = array())
    {
        return $this->processDispatcher(Ess_M2ePro_Model_Listing_Product::ACTION_REVISE, $params);
    }

    public function stopAction(array $params = array())
    {
        return $this->processDispatcher(Ess_M2ePro_Model_Listing_Product::ACTION_STOP, $params);
    }

    public function deleteAction(array $params = array())
    {
        return $this->processDispatcher(Ess_M2ePro_Model_Listing_Product::ACTION_DELETE, $params);
    }

    // ---------------------------------------

    protected function processDispatcher($action, array $params = array())
    {
        $dispatcherObject = Mage::getModel('M2ePro/Amazon_Connector_Product_Dispatcher');
        return $dispatcherObject->process($action, $this->getId(), $params);
    }

    //########################################
}

redpajama_set_name: RedPajamaGithub


Skiddle have recently released a new feature to help true music get tickets for popular events – introducing our new queue system.
We have all been there, waiting for tickets to go on sale for someone we've been dying to see, logging onto the event page early and keep refreshing. As the clock counts down to on sale time we press f5 only to see either a) a blank screen as the website doesn't load or b) the tickets all sold out!.
Our new queue system gives all our customers a fairer chance at buying tickets no matter where you are, what your internet connection is like or if you arrived an hour before or 1 minute before on sale time.
For any high traffic event, our queue system will be switched on so anyone trying to access the event page will be redirected to a dedicated waiting room. Once the onsale time arrives everyone in the waiting room will be assigned a random place in the queue, this means it doesn't matter what time you arrived in the waiting room (as long as it's before the onsale time), you have an equal chance at being in the front of the queue.
Once you have been assigned a position in the queue, we'll take you to a page that shows you your position, approximately how long you will be waiting until you are at the front of the queue and what percentage of tickets are left.
When you hit the front of the queue, you will be able to go through to the event page and make your purchase. If you accidentally close your browser, fear not, when you re-open your browser, we will remember that you were at the front so you won't go to the back of the queue.
At Skiddle we believe the customer experience is the most important factor when designing any new features. In fact, we've won multiple awards in recognition of this.
We spent weeks careful crafting the best experience we could imagine – a far cry from the solutions currently being used.
We tested with real people to gauge their feedback, then kept going until everyone loved it.
Our system is built entirely on AWS. The waiting room and queue are built in REACT that are stored on AWS S3, behind a CloudFront distribution so it is highly scalable. To store everyone's positions we use either MySQL Aurora or Dynamo DB. The API that updates your positions and wait-time is on its own EC2 instances behind Application Load Balancers which again can be scaled up with demand.
AWS CloudWatch is used to monitor the queue, ensuring everyone is getting a good experience.


Unfortunately, thousands of Americans suffer dog bite injuries every single year. In many cases, these injuries are minor and can be resolved on their own. In other instances, the bite injury may be serious and the person bitten by the dog may want to take legal action against the owner. As you can imagine, these types of cases are quite complicated and require the knowledge and expertise of a good personal injury lawyer. It is important to note that dog bite laws differ from state to state. In Texas, dog bite victims can seek compensation from whoever is liable for the attack, usually the dog owner.
If you have been bitten by an animal, the very first thing you should do is seek medical attention. You likely do not know if the dog is up-to-date on his or her shots, which could put you at risk of serious injury, infection, or even death. After you have received medical attention, it may be time to call a lawyer. A good personal injury attorney will be able to tell you right away if you have a case on your hands and, if so, what damages you may be owed.
Texas is one of the harshest states in the nation regarding dog bites. In fact, the Lone Star State carries some of the largest penalties for owners of dogs that have attacked or bitten someone. When looking at dog bite cases in Texas, perhaps the most important thing to consider is that Texas is a "one bite rule" state. This means that a dog bite victim has the right to recover compensation if that dog has bitten someone before, or even acted as if they were going to injure someone. However, it can be difficult to prove these circumstances, which is yet another reason why you should have a dog bite lawyer on your side.
If you are considering moving forward with a dog bite personal injury case, you must be able to prove negligence. That is, you must have evidence that shows the dog bite owner was negligent or acted irresponsibly, resulting in the dog lashing out and biting someone. Another example of this would be if you brought a stray dog into your home and it injured someone. Because you acted recklessly, you may be liable for any damages.
Furthermore, you must also be able to prove that the defendant is the owner of the dog. While this is usually relatively easy, it can be difficult if the animal is not registered. Once you have shown who the dog owner is, you can then work on providing this individual had a duty to prevent the animal from harming anyone. If you can, you may have a personal injury case on your hands.
Does the dog bite owner believe he or she will be held liable?
What is the estimated amount a jury would award to a dog bite victim after a trial?
To learn more about dog bite settlements or lawsuits, please contact Green Law today. One of our personal injury lawyers can answer any questions you may have and help you move forward with your case today.


text:
Dupree, Reverend Derek Bernard
December 5, 1971 - February 23, 2021
You May Visit Reverend Dupree Friday, March 5, 2021 – Noon – 8:00pm The Sims-Kirkland Suite at Tree of Life 1051 S. Handley Drive –…
Robinson, Elder Darrell Roy
February 9, 1959 - February 27, 2021
You May Visit Elder Robinson Friday, March 5, 2021 – Noon – 8:00pm The Lowery Suite at Tree of Life 1051 S. Handley Drive – Fort…
Hamilton, Jr., Mr. Henry D.
April 26, 1947 - February 23, 2021
You May Visit Mr. Hamilton FRiday, March 5, 2021 – Noon – 8:00pm The Harris Suite at Tree of Life 1051 S. Handley Drive – Fort…
Thompson, Mother Fannie Mae
You May Visit Mother Thompson Thursday, March 4, 2021 – Noon – 8:00pm The Wilson Suite at Tree of Life 1051 S. Handley Drive – Fort…
Hayes-Smith, Mrs. Ester Rae
August 3, 1956 - February 23, 2021
You May Visit Mrs. Hayes-Smith Thursday, March 4, 2021 – Noon – 8:00pm The Lowery Suite at Tree of Life 1051 S. Handley Drive –…
Applewhite, Mr. Charles Andrew
You May Visit Mr. Applewhite Wednesday, March 3, 2021 – Noon – 6:00pm The Lowery Suite at Tree of Life 1051 S. Handley Drive – Fort…

redpajama_set_name: RedPajamaCommonCrawl


text:
UN climate talks stagger towards 'mediocre' outcome
International Sunday 15th December 2019 12:33 PM REPORT
You are now following the details of the UN climate talks stagger towards 'mediocre' outcome news and now we leave you with the details
Mohamed Nass - Cairo - A UN climate summit in Madrid stumbled towards the finish line Sunday after marathon talks between countries exposed deeper divides than ever over how to enact humanity's plan to avert global warming disaster.
More than 36 hours after the negotiations were due to end, delegates were close to agreement on contentious issues, including how ambitious each nation is in its individual plan to fight climate change.
Faced with fire-alarm warnings from science, deadly extreme weather made worse by climate change, and weekly strikes by millions of young people, negotiations in Madrid were under pressure to send a clear signal that governments were willing to double down in tackling the crisis.
But observers and delegates from nations already bearing the brunt of climate-related disasters said the COP 25 in Madrid had resolutely failed to live up to its own slogan: Time for action.
"We wanted provisions that were in the Paris agreement to remain and what we see at every COP it just seems to be another opportunity to erode those," Grenada envoy Simon Stiell told AFP.
"There are one or two parties that seem hell bent on ensuring any calls for ambition, action, environmental integrity are rolled back," he added.
– Unprecedented disconnect –
Delegates from nearly 200 nations are in Madrid to finalise the rulebook for the 2015 Paris agreement, which aims to limit global temperature rises to well below two degrees Celsius (3.6 Fahrenheit).
The accord enters in to action next year, and it had been hoped COP 25 would show the world that governments had listened to the weekly protests, irrefutable science and more extreme weather events to redouble their efforts.
Yet the key issue of ambition — how far each country is willing to slash carbon emissions or assist less wealthy peers to do likewise — has largely failed to materialize.
Veteran observers of UN climate talks were stunned by the state of play.
And youth activists, who held several protests during the summit, called out governments dragging their feet.
Alexandria Villasenor, a 14-year-old climate activist, said she was "disappointed" in the lack of action at COP 25.
"The difference between the youth on the streets and the negotiations is that the youth on the streets are acting with urgency," she told AFP.
"COP 25 has failed us and it's another year of failure."
The push for a strengthening of voluntary carbon cutting plans is led by small-island and least-developed states, along with the European Union.
These have called out nations they see as blocking consensus for all countries to step up, notably the United States, Australia and Saudi Arabia.
China and India, the world's No. 1 and No. 4 carbon emitters, have made it clear they see no need to improve on their current emissions reduction plans, which run to 2030.
These emerging giants have chosen instead to emphasize the historical responsibility of rich nations to lead the way and provide financing to poor countries.
"It seems like it's inching along but it's not the strong call for climate ambition that we needed to come out of this," said Catherine Abreu, executive director of Climate Action Network Canada.
"It will be a pretty mediocre outcome."
The COP 25 summit was also meant to finalise a chapter on carbon markets in the Paris rulebook.
Some nations, notably Brazil and Australia, want to count carbon credits accumulated under a previous climate deal as part of their commitments under the Paris goals.
Discussions over markets were at an impasse Sunday and the issue is likely to be handed over to next year's COP 26 in Glasgow.
– US labelled spoiler –
The US, which is leaving the Paris deal next year, was accused of playing spoiler on a number of issues vital to climate-vulnerable nations.
This included so-called "loss and damage" funding to help disaster-hit countries repair and rebuild.
"The US has not come here in good faith," said Harjeet Singh, climate lead with charity ActionAid.
"They continue to block the world's efforts to help people whose lives have been turned upside down by climate change."
Even if nations in Madrid snatch victory from the jaws of defeat and agree to implement their pledges on paper, Earth is on course to warm more than 3C by 2100.
Image: AFP / PIERRE-PHILIPPE MARCOU Demonstrators expressed their anger at the lack of protest in protests Friday
These were the details of the news UN climate talks stagger towards 'mediocre' outcome for this day. We hope that we have succeeded by giving you the full details and information. To follow all our news, you can subscribe to the alerts system or to one of our different systems to provide you with all that is new.
It is also worth noting that the original news has been published and is available at egypt independent and the editorial team at AlKhaleej Today has confirmed it and it has been modified, and it may have been completely transferred or quoted from it and you can read and follow this news from its main source.
PREV Hunt for buried survivors after Indonesia quake
Pope urges more nations to join UN treaty banning nuclear weapons
Wednesday 20th January 2021 06:34 PM
Trump ends tumultuous term under cloud, faces uncertain future
Armed men try to storm governor's house in Sudan's Darfur
Iran's Rouhani says "ball in US court" over nuclear dispute
Mastercard is working with Riot Games and CLOAK to thank the...
Thursday 29th October 2020 11:19 PM
Genshin Impact Wish Trick can increase the likelihood of getting 5...
Saturday 07th November 2020 02:43 AM
PlayStation 5 HD Camera: Why You Need the PS5 Camera for...
Thursday 12th November 2020 11:49 PM


text:
Let's Move (faster) on childhood obesity
Michelle Obama chose well and aimed high when she took on childhood obesity four years ago.
First lady Michelle Obama hosts local children on the South Lawn of the White House in Washington, Tuesday, Oct. 11, 2011, as they attempt to break the...
Jan. 28, 2013, 8:14 AM UTC
By Geoffrey Cowley
Michelle Obama chose well and aimed high when she took on childhood obesity four years ago. There is no clearer threat to America's long-term health, and no question about the need for collective action. A third of the nation's children are now overweight and 17% are obese—a threefold increase in just four decades. Kids haven't changed fundamentally since the 1970s, but their world has. It's now a carnival of cheap calories—brightly packaged, aggressively marketed, nutritionally bankrupt—that make healthful eating an unlikely act of resistance. "We need you all to step it up," the first lady urged food manufacturers after launching her "Let's Move" initiative in early 2010. "We need you not just to tweak around the edges but to entirely rethink the products that you're offering, the information that you provide about these products and how you market those products to our children…What does it mean when so many parents are finding that their best efforts are undermined by an avalanche of advertisements?"
That bold spirit vanished at critical moments during President Obama's first term. Despite some major advances in food policy—notably an overhaul of the federal school lunch program and a national rule requiring chain restaurants to post calorie counts on menus—the administration has dropped or delayed other nutritional measures to appease the food and beverage industries. And Let's Move has become more a jumping-jacks campaign than reform movement. With guns, immigration and climate change crowding the president's second-term agenda, health advocates fear that food and nutrition issues may be sidelined yet again. But with focus and resolve, this administration could still reverse the obesity pandemic. Here are three ideas that stalled during his first term, and some prospects for reviving them in the second.
1. Stop pushing junk food on children.
The first lady's "avalanche" quip wasn't just hyperbole. The nation's food and beverage makers spend nearly $2 billion a year targeting children and teens, and the impact has been extensively documented. "There is strong evidence that television advertising influences the food and beverage beliefs, preferences and requests of children ages 2–11 years," the Institute of Medicine (IOM) declared in a 2006 report. Specifically, the IOM's expert panel found that "television advertising influences children to prefer and request high-calorie and low-nutrient foods and beverages."
Some countries regulate child-targeted ads, since kids lack the skills to assess them critically, but U.S. policymakers have generally stuck to voluntary measures. The 2006 IOM report urged industry to "work with government, scientific, public health, and consumer groups" to stop undermining children's health—adding that if voluntary efforts failed to "[shift] the emphasis away from high-calorie and low-nutrient foods and beverages, Congress should enact legislation mandating the shift on both broadcast and cable television." In the wake of the IOM report, Congress directed four federal agencies to establish voluntary standards to help the industry improve its record on child advertising. The agencies—CDC, FDA, USDA and the Federal Trade Commission—formed a working group, which reported back in 2011 with some proposals for public review.
The group's report set out two simple ideas: first, that "foods marketed to children should provide a meaningful contribution to a healthful diet," and, second, that food makers should minimize ingredients that "have a negative impact on health or weight." Specifically, the agencies proposed that foods hocked to children include at least one healthful ingredient (such as a fruit, vegetable, nut, seed, or low-fat dairy product), and minimal amounts of salt, sugar and unhealthy fats. In an April 2011 press release soliciting public comments, the group stressed that "the proposed principles are voluntary and do not call for government regulation of food marketing."
Even so, the food makers took the report as a declaration of war. Over the next few months, they mobilized congressional allies to condemn the proposals as an attack on free speech and a back-door scheme to ban products. Some 40% of all House members and 30% of senators wrote letters of condemnation, according to an analysis by the Sunlight Foundation, and industry executives descended on the White House. Meanwhile, 97% of public comments on the proposals were positive. But instead of defending the effort, the administration folded its hand. "This was a modest initiative," says Margo Wootan of the Center for Science in the Public Interest (CSPI), "but the opposition was the fiercest I've seen in 20 years here. The industry came down hard and no one seemed to push back. The White House just went silent."
A few months later, in December 2011, Congress effectively killed the initiative by demanding a companion study of the potential costs to business. No one expects that to happen—federal health agencies aren't equipped to cost out food companies' manufacturing options—but the administration could take other steps to keep the issue alive. Obama could work to seed new technologies that let parents block junk-food ads from their televisions—a prerogative that even libertarians might welcome. And though the administration has ceded oversight of marketing practices, the president could the industries accountable simply by speaking out as he has against the gun lobby.
The food makers have taken steps to police themselves since the IOM first sounded the alarm in 2006. Recent research by the Federal Trade Commission shows that the industry's Children's Food and Beverage Advertising Initiative sparked some welcome improvements from 2006 to 2009. But the progress has been modest. In a 2009 analysis, CSPI found that most of products blessed by the industry failed to meet a single third-party benchmark for nutritional quality.
2. Turn the food stamp program into a nutrition program.
Five years ago, Congress renamed the nation's 49-year-old food stamp program to reflect a basic fact of 21st century life. "The challenge for low-income families in today's food environment is [no longer] obtaining enough food," Dr. David Ludwig of Boston Children's Hospital wrote recently, but to find "dependable access to high-quality food." Hunger was still pervasive when Congress passed the National Food Stamp Act in 1964, but the mass production of low-quality food has changed the face of poverty. A low-income child is now seven times more likely to be obese than underweight. By re-branding the food stamp program as SNAP—the Supplemental Nutrition Assistance Program—Congress acknowledged that food stamps should actually nourish people. And with 47 million Americans now relying on food stamps, up from 27 million at the start of the recession, the stakes could hardly be higher. If SNAP promoted healthy food, it would change the nation's diet. Unfortunately, it often does just the opposite.
SNAP is by far the biggest of the federal government's three major food programs. During Obama's first term, both the National School Lunch Program and WIC (which serves women, infants and children) were revamped to combat obesity and support good nutrition. But aside from its bans on tobacco, alcohol, vitamins and prepared food, SNAP still lacks nutritional standards. One result is that it bankrolls some 20 million servings of soda and other sugary drinks every day—at an annual cost of $4 billion. Besides lacking nutritional value, sugar-sweetened beverages are the biggest single source of excess calories in the American diet. As Yale University obesity expert Kelly Brownell observes, the soda subsidy promotes obesity and chronic disease among people who are at increased risk of both. Yet to date, the Obama administration blocked all efforts to redirect the money.
True, the politics are difficult. When New York City proposed a pilot study to see what would happen if it dropped sugary drinks from its SNAP program, anti-hunger groups protested as loudly as the beverage industry. The New York initiative would not have reduced anyone's benefits, but the advocates saw the measure as paternalistic and discriminatory. With the soda industry taunting the city for trying to "tell people what they can and can't drink" and hunger groups saying the exclusion would trample the rights of the poor, the USDA rejected it, citing easily resolved technical challenges, a lack of "clear evidence that small businesses would not be disproportionately affected," and its own preference for incentives over restrictions.
The soda subsidy won't end anytime soon. USDA has now rejected nine out of nine state efforts to discontinue it, and health advocates aren't in a position to force the issue during the second term. But there are other ways to put some N into SNAP. In a recently published report, a coalition of leading nutrition experts offers 10 good suggestions. The first is simply to preserve the program's funding—a critical priority when one American in seven lacks steady access to nutritious food. Others include rules to ensure that retailers carry fresh produce, expanded discounts for healthful foods, and a restoration of SNAP Ed, a nascent healthy-eating initiative that got slashed by a third during last year's budget dramas. "It's challenging to eat well if you can't spend your day preparing food from scratch," says Tracy Fox, a Washington-based food policy consultant. "SNAP Ed was just starting to help people deal with that issue when the rug got pulled."
3. Devise a nutrition label that promotes healthy eating.
If you like to construct mental spread sheets, the nutrition labels on packaged food can come in really handy. Suppose you're shopping for crackers. First you plot out the total amounts of fat, cholesterol, sodium, potassium, fiber, sugar and protein you'll need over the course of the day. Then you decide how much of each nutrient you'd like to get from crackers, and add those percentages to the ones you'll draw from other foods. Presto—you'll see how this brand of cracker suits your lifestyle. To compare several brands, you simply repeat the process for each. If you stick to the same assumptions about the non-cracker portion of your diet, the calculations will show how each candidate cracker affects the bottom line.
Alas, few of us shop this carefully. By buying the most expertly marketed products, we end up over-consuming calories, sodium, sugar and unhealthy fats while scrimping on other nutrients—a tendency that has huge collective consequences. Health officials have long dreamed of a clear, simple rating system that would help consumers size up a product's overall nutritional value at a glance. At the government's behest, experts convened by the Institute of Medicine have now devised a system that could revolutionize food shopping by scoring packaged foods on three simple criteria. Under the proposed regimen, detailed breakdowns could still appear on the back of the pack, but every product would sport a simple, standardized rating—from zero to four points—right on the front of the package.
Manufacturers and interest groups have recently festooned packaged foods with their own front-of-pack seals of wholesomeness. If the FDA adopted this one, it would replace them all with one easy-to-read label listing calories and three "nutrients of concern"—salt, sugar and unhealthy added fats. And instead of detailing grams, milligrams and percentages of daily values, the label would simply indicate whether the three ingredients were held below reasonable thresholds. A product could earn up to three points, which would appear as instantly recognizable stars or checks or rhino heads. And if a product exceeded any single threshold egregiously enough, it would forfeit all its points. Soda, for example, would sweeten itself off the chart despite low levels of sodium and an absence of fat.
The manufacturers have dismissed the IOM's three-point plan as unnecessary, claiming that their own "facts up front" labeling scheme better addresses consumers' needs, but they've shown none of the vitriol that greeted the child-marketing proposals. Some experts predict the industry will be content to soften the front-of-pack standards rather than kill them. And any objective standard will give manufacturers a strong incentive to formulate healthier products. "It's like a dance," says Ellen Wartella, the Northwestern University psychologist who headed the IOM's labeling panel. "Once the music starts, companies won't want to be left out." But that assumes the White House will let FDA press the initiative. The IOM submitted its proposal 15 months ago (in October 2011), and the FDA has yet to respond. The agency hasn't signaled its plans (the labeling issue doesn't appear on its 2013 legislative calendar), but it has begun some consumer research, and Wartella remains optimistic. "I don't read the silence as rejection," she says. "We suggested that they study this before putting anything out."
A four-year term can slip away fast, and the new administration's faces tough choices about where to invest its finite political resources. But the obesity pandemic warrants more than a well-intentioned awareness campaign. If recent trends continue, the number of obese American will rise by 65 million between now and 2030. Millions of today's children will experience disability and early death from cancer, diabetes, heart disease and stroke, and the associated health care costs will approach $68 billion. The forces driving this scourge are now deeply ingrained our economy and our politics. Taming them will take intense focus and a stiff spine. But if the administration can reassert the spirit of Let's Move's heady debut, progress is still within reach.


Floralife will ship your product via the best method available. Our shipping methods currently included USPS and Fedex.
Q. Why are my shipping charges so much?
a. Floralife currently sends via ground delivery rates to keep your charges lower. Our shipping rates are determined by the weight of your package(s).
Q. How long will it take to get my shipment?
a. Floralife strives to ship your package as soon as possible. It will usually take us 3 to 5 business days to pull your items and process your package. When your package ships, your city/state falls into the following shipping zones. The following map shows your package(s) estimated travel days. Please keep in mind that actual deliveries may depend on volume, weather and delivery location, such as residential areas.
We want you to enjoy what you ordered, but if something is not correct, let us know. Our top priority is to provided the best possible service. If for any reason you are not satisfied with your purchase, you may return the unopened item for a refund. Returns must included a receipt and items must be in the original condition, including tags and labels. One we receive the returned merchandise, we will credit your account within 10 business days. Shipping charges are not included in the refunded price. We will be glad to replace any damaged or defective products, please contact us if there is any damage to your package. We may ask you to return the package and its contents to verify shipping claims.


It has been more than two weeks since I came to India. It is hard to find time to do embroidery. Another Sunday has come and gone and next stitch was also announced. At last a few samples of Norwich stitch could be worked. The working of this 14th stitch is on Queenie's blog.
To understand the stitch, the first row of samples were worked. The next row of samples are worked over five holes with a hole left untouched, still in the mode of familiarising with the stitch. The third row has Norwich stitch worked over four holes.
It was time to try the upright version of this stitch on the first set of samples. What if two colour threads are used alternatively? The basic crosses are worked in one colour and the overlapping crosses are worked in another colour. The third row has bigger Norwich stitch samples worked in two colours. A few trials of Norwich stitch were done in the last row.
The whole sampler. It is hard to think about variations in Chennai with so many activities.


text:
Forum Discussions Tow-Pac Inc Enjoy RS3gold runescape gold sell with $10 voucher till Apr13
rs3gold00
Enjoy RS3gold runescape gold sell with $10 voucher till Apr13 (N/A)
I strongly [url=https://www.rs3gold.com/rs3-gold]rs 3 gold[/url] believe that if a school has been built on a government land, like Bishop Cottons Boys School, then there is no need to collect donations. My book Breakdown, Breakthrough: The Professional Woman's Guide to Claiming a Life of Passion, Power and Purpose, explores the 12 hidden challenges working women face today and how to overcome them..
Despite the ban, LeT continues to operate in Pakistani controlled Kashmir.. The first bank includes the CompactLogix controller in the far left position. Last year price of the property in this region has increased by Rs 300 to Rs.500. Kastelik and colleagues27 noted that esophageal dysmotility is common in patients with GER related chronic cough.
Unitech Unihomes 2 is a unique residential project by the Unitech group. We have signed one of the best young players in the Conference and we look forward to him developing further through the philosophy and coaching environment that underpins our football operation.".
Unitech Unihomes 2 is offering 2BHK 3BHK apartments created with excellent designs and concept. The rupee has weakened by 74 paise, or 1.17 per cent, against the dollar in the past three weeks. In this form it produces 285 hp and 265 lb/ft of torque.
"I have the honour to inform you that you have committed the same mistake which was committed by UTV, who had to pay compensation to a leading football player of the state of J namely Mohammad Yousuf Dar. I think it would great.". We would be honored to have you give the invocation at the start of the meeting.
For inflation constantly catches up with the metals that are used to mint coins. He called Gilberto raw talent who is only going to get better. The transformation occurred during unmaintained follow up in one patient in the control group, and the remaining eight patients had all received at least one line of salvage therapy.
Local fishermen like Kotawadekar, who owns two trawlers and whose family has been in the trade for generations, fear that the project could cause irreparable damage to the region's environment and marine ecology. 488591, the price for diesel models are between Rs.
The tax code generally allows the IRS to audit three years back, and six in some cases. Finally, there are alternative recovery and repair disks such as the Ultimate Boot CD or Hiren's that provide extra, Windows oriented tools right out of the box.
"We have the highest opinion of ourselves but we're our own worst critics," Teibert said on Thursday. For 76.7% of these cases, physicians answered that they did not perceive their act as euthanasia, whereas for 17.9% they gave the reason that reporting is too much of an administrative burden, 11.9% that the legal due care requirements had possibly not all been met, and 9% that euthanasia is a private matter between physician and patient (8.7%).
[b]WOW guys !How can you forget to join RS3gold Easter Celebration [/b][b]: [/b]Up to $10 discount code "[b]ECR10[/b]" for [b] you all buying RS3 gold,RS 2007 gold or other products on RS3gold.com [/b]with safe and fast delivery from Apr 8 to Apr 13.2019.Notes:
[b]ECR3-$3 cash [/b] code (If you order over $40+,$40 included);
[b]ECR10-$10 cash [/b] code (If you order over $110+,$110 included).
And you can buy 2019 Summer Deadman gold with "SDM8" off code now.
What's more,You can obtain RS3 gold [b], RS 2007 gold and other products[/b] from [url=https://www.rs3gold.com/rs3-gold]https://www.rs3gold.com/rs3-gold[/url] on mobile.
And there is another news you can grasp,click the following
[url=https://www.rs3gold.com/news/find-all-osrs-april-fools-2019-pranks-on-official-wiki-page]https://www.rs3gold.com/news/find-all-osrs-april-fools-2019-pranks-on-official-wiki-page[/url]
[b][img]https://www.rs3gold.com/uploads/RS3gold/EDM/readyforeaster_seo.jpg[/img]


text:
WHAV (https://whav.net/2015/09/01/michitson-says-haverhill-needs-a-triple-play-to-advance/)
Michitson Says Haverhill Needs a 'Triple Play' to Advance
By WHAV News Staff | September 1, 2015
Haverhill City Council President John A. Michitson.
Haverhill City Council President John A. Michitson says Haverhill needs a "triple play" in economic development, public education and public safety to make it to the next level.
He is expected to explain during a re-election kickoff fundraiser from 5:30 until 8 p.m., Wednesday, Sept. 9, at Maria's Galleria Banquet Room, 81 Essex St.
"He has been a leader in all three areas, leading Haverhill's current push to reduce violent crimes in our neighborhoods following a brutal murder on High Street, stumping door to door for the new Hunking School facility and being a catalyst for a capital improvements plan that addresses all of our school and city buildings, and most notably pounding the drums for economic development to provide good jobs at all levels and expand the commercial tax base," a press release reads.
Michitson said he worked with the House Ways and Means Chairman Brian Dempsey, the Massachusetts Technology Collaborative and the Greater Haverhill Foundation to secure a $150,000 grant to launch Haverhill's first comprehensive economic development plan in decades to attract new businesses and retain existing businesses. During the fundraiser, he will "discuss a proof of concept hands-on project that he led to develop a new strategy to match innovators from innovation hot spots, such as Boston's Innovation District and Cambridge's Kendall Square, with advanced manufacturing in Haverhill. The invention and inventors of a new product to enable first responders to see and sense what is in the room before entering it will be on hand to exemplify the new strategy."
The suggested donation is $25. Seniors will be admitted free.
5 thoughts on "Michitson Says Haverhill Needs a 'Triple Play' to Advance"
Chairmanoftheboard on September 2, 2015 at 1:45 pm said:
and now its back…..weird.
Chairmanoftheboard on September 2, 2015 at 11:04 am said:
I'll pass on his re-election "party" – my suggested 'donation' to any and all incumbents is DON'T. My suggested action is to refuse to vote for 1 incumbent at all.
When it came to increased parking fees – they all voted to take more of your money
When it came time to increase water rates – they all voted to take more of your money.
When it came time to increase sewer rates – they all voted to to take more of your money.
They are all gutless and none deserve your vote OR your time.
Jack Haverhill on September 1, 2015 at 12:33 pm said:
John, while you're at it, maybe you can name just one issue that you weren't a rubber stamp for this tax and spend mayor. JUST ONE !! Where were you on his recent proposal to increase parking fees? Where were you when he was implementing a meals tax? Can you name one fiscal year budget where you took the lead to cut his out of control spending????
Finding ways to secure state tax funds by piggy backing on the guy who determines where those funds go is NOT an accomplishment John!! Nice try though. That will probably impress those folks who aren't paying attention.
If public education is your focus John, maybe you can reveal your plan on how the City of Haverhill can stop getting whacked every year by outrageous special education costs? Have you made a proposal to the Haverhill State Rep delegates to propose making changes to that law at the state level? What have you done? Anything?
I replied to you earlier Jack and posted a comment, but it seems WHAV took it down – I guess the Mayor has got to them too.
Welcome to Stalingrad!
News Editor on September 2, 2015 at 2:17 pm said:
No comments are taken down unless there are personal attacks or certain four-letter words. WHAV suspects page "caching" (showing old pages in place of newer ones as a means of reducing load on the server) by its independent web host to be the culprit.


According to The New York Times, 10 moderates, 15 conservatives and eight other Republicans would have voted against the Republican bill to repeal and replace Obamacare. So, then, 15 or so conservatives made it impossible to pass the bill favored by nearly every other Republican and President Donald Trump.
If that is the case, what we have here is another conservative example of purism and principle ruining another major opportunity to do good.
The first purist conservative example were the Never-Trumpers, who believed it was better for Hillary Clinton to be elected president and for the left to have four more years of presidential power than for Trump to win.
There were valid reasons to wonder whether Trump was a conservative and valid reasons to oppose him in the primaries. There were no valid reasons to oppose him in the general election. I said all these things then and have thus far been validated beyond my wildest dreams.
In terms of policy, Trump is a conservative dream. From appointing a conservative to the Supreme Court; to approving the Keystone XL pipeline; to weakening the hysterical and tyrannical Environmental Protection Agency; to appointing an ambassador to the UN who has moral contempt for that immoral institution; to backing Israel; to seeking to reduce economy-choking regulations on business, all of which are essentially everything conservatives would wish for in a president, Donald Trump is almost too good to be true.
But he's still not good enough for those conservatives who remain Never-Trumpers or the members of the House Freedom Caucus, at least with regard to the bill to repeal and replace Obamacare that he worked so hard to have passed.
It is quite possible that I and most other conservatives who supported the bill agree with just about every criticism of the bill that House conservatives made. But just as the question in the general election wasn't whether candidate Trump was our ideal, the question now wasn't whether the bill was our ideal.
The question during the election was: What will happen if the Democrats and the left win the presidency again?
The question now is: What will happen if the Republicans don't pass a bill favored by all but about 30 Republican congressmen and, most importantly, by President Trump?
But purists don't ask such questions. They live in a somewhat different world than the rest of us who actually agree with them on everything because we don't ask what is ideologically pure and true to our principles. We ask: What is closest to our ideology and our principles?
To put it another way, we have one larger principle than even the conservative principles we share with the purists: defeating the left because that is the No. 1 priority of those who cherish Western civilization and regard America as the last best hope for humanity.
The conservative Never-Trumpers and conservatives who voted for Trump had everything in common except for that overriding principle. Conservatives who voted for Trump believed that defeating the left is the overriding moral good of our time. We are certain that the left (not the traditional liberals) is destroying Western civilization.
The external enemy of Western civilization is Islamists (the tens or perhaps hundreds of millions of Muslims who wish to see the world governed by sharia), and the internal enemy of the West is the left. What the left has done to universities and Western culture at the universities is a perfect example.
Passing even a tepid first bill to begin the process of dismantling the crushing burden of Obamacare would have been an important first step in weakening the left, not only by beginning to repeal Obamacare but also by strengthening the Trump presidency and the president's ability to go forward with tax reform and other parts of his conservative agenda.
The president is now damaged, and the Republican Party looks ludicrous — what other word can one use to describe the party that has voted more than 60 times in seven years to repeal Obamacare and can't pass a bill to repeal or replace it when it is given the House, the Senate and the presidency?
Make no mistake, ye of pure heart: This may well be the last time in your lifetimes that Republicans control both houses of Congress and have a conservative president. Understand that time is not on our side; there are congressional elections in a year and nine months.
Providence or luck made it possible to have a conservative president.


text:
Part One: The Best City in Kor..
February In Review
Why Sisters Make the Best Trav..
CAPTURING MOMENTS || FEBRUARY 2016
2.3 (Our Big Move to Ho Chi Minh City, Vietnam)
Moved to Ho Chi Minh City, Vietnam – the last and final stop of the Asian adventure (… for now)
Got hired by a great company and started working after seven months of unemployment
Found a beautiful top-floor serviced apartment in the heart of Saigon run by the sweetest landlady
FEATURED SNAPSHOT
STREET ART, Ho Chi Minh City, Vietnam @ 12:05 pm
THE EXPATRIATES by Janice Y.K. Lee
"That's the shock, and the surprise, to a lot of repatriates: No one back home cares. There's an initial, shallow interestin what life is like abroad, but most Americans aren't actually interested, at all."
Synopsis: A powerful observation on the uprooted lives of expatriates in modern-day Hong Kong. The narrative follows the lives of three American women: Mercy is a Columbia graduate, haunted by a terrible accident in her past which launches a series of painful consequences in her future. Margaret, a mother of three beautiful children, struggles to deal with her new reality after a devastating loss. And Hilary, a wealthy but insecure housewife with an inability to conceive, weighs her options to adopt as a way to save her crumbling marriage. As these women find themselves in the depths of despair, their paths will cross and will change their lives forever.
While stumbling upon the title on a must-read list for different personality types, I purchased the book to see if a fictional account of Asian expatriates could compare to my own real-life experience living as an expat in Vietnam. As I flipped the pages, I was immediately hooked on the beautifully accurate portrayal about the inner lives of women, especially those based overseas. While the three title characters are as facile as they come, you as the reader can identify with their feelings of isolation and frustration in their troubling situations. Their dealings with loss, betrayal, inadequacy, and misfortune, perfectly set the stage for all the drama that unfolds. . The three women are antagonizing creatures, yet their actions and pretensions are justified based on the chain-of-events. It was troubling that I noticed a likeness to these tragic women. Their flawed personalities helped me to address the demons I face being separated from my support network. I appreciated how all the men in the story take a backseat to the female characters. Each chapter focuses solely on one titular character creating a dialogue among these separate, yet fatefully intertwined women. With the story being told from three different perspectives, the tension feels almost palpable since you see every piece of the story from three different sides so its hard to pledge all your allegiance to just one character. You don't know who to affix the label of protagonist or the antagonist to. They all somewhat encompass both labels at the same time. For all the tenseness you suffer throughout the read, the ending comes as very much of a letdown which was my only gripe with the text. Otherwise what I extracted from the book did contain a word of truth to my on-the-ground experience as an expat. I believe that the superficial quality of the characters and the plot were essential to describing the sad truth about expat-hood: that our lives abroad can never match the substance of our lives at home. They will always just be shallow recreations.
rating ✪✪✪✪✪✪✪✪✪✪
If you need to see something uplifting, look at this compilation of 50 Captivating Photos of Girls Going to School Around the World. Equality now. Education is a powerful and beautiful thing.
We know of the witches of Salem past but what about the witches of Salem today? Covered by a dear friend of mine, Haley Houseman brings to light The Real Witches of Salem, MA.
As a tribute to my new stomping grounds and penchant for #foodporn, I bring you @saigonesekitchen, a striking assembly of some of the best food shots in and around Ho Chi Minh City.
A nominee of mine for the Liebster Award, Kyle of Go Drift Away penned this Why You Should Only Fall For Travelers if You Can Give Them The World, detailing reasons why you should practice caution before pursuing a vagabonding soul.
Lauren Klarfield's blog-turned-book-project, Last Words For The Road is a collection of quotes given to her by fellow travelers looking to impart wisdom, or as she puts it, 'to transmit' hope. Add your quote to the pile today!
UP NEXT MONTH: A month full of our first visitors in Vietnam! xoxo Izzy
february, good reads, itinerary, links i love, month in review, monthly recap, one second everyday, snapshot, year in review
Millette
Millette Pulido is a Bay Area-based, Boston-bred Filipina who loves to vagabond. At 29, the former expat has traded in her nomadic ways for a semi-grounded life in San Jose, CA. These days, she's focusing on balancing travel with a full-time job, all while planning her 2019 destination wedding in Oaxaca, Mexico. She lives for good times, good food, and good peeps. Find out her #wheretonext on Instagram @thenextsomewhere.
48 Hours in Montreal: What To See, Do, and Eat
I'm so glad to hear that you've settled in well and are enjoying life in Vietnam; I look forward to reading more about your teaching experiences. The book you've been reading sounds really interesting, I might give it a go – Andrew is very interested in one day teaching in Hong Kong, so it could serve as inspiration!
Izzy Pulido
Awww thank you so much Amy! I feel like you've been a part of the Vietnam journey ever since I touched down here and it really means a lot to me every time I get a comforting message from you. Right now, teaching has been strange since we were hired to work for a language center that hasn't officially even opened yet! So its been a bit tough dealing with so much uncertainty but I'm looking forward to seeing how things go 🙂


The ingenious structure of this book—two narrative timelines, one of them told backwards—infuses the work with a creepy tension, as do the settings: Australia's outback and an unnamed island off the coast of Britain where sheep are mysteriously dying. The book I've most recommended this year.
My Book, The Movie: All the Birds, Singing.


text:
Home > Turkish Journal of Electrical Engineering and Computer Sciences > Vol. 30 (2022) > No. 7
Turkish Journal of Electrical Engineering and Computer Sciences
Identification of initial events of cascading failures using graph theory methods
MOJTABA FEKRI
JAVAD NIKOUKAR
GEVORK BABAMALEK GHAREHPETIAN
10.55730/1300-0632.3959
In power systems, the unintentional outage of a grid element can lead to overload and outage of other equipment and, through a domino effect, all or a large part of a power system may collapse. The resulting events are called cascading, consecutive, or sequential failures. So far, various methods have been proposed to identify the initial events of cascading failures with different levels of accuracy and computational load. In this paper, an effective approach is employed which, by calculating the maximum flow of independent paths between generators and loads in the network graph, identifies the critical lines and transformers of the network so-called the initial events of cascade failures. To validate this method, the enumeration method is utilized. The proposed method is implemented in IEEE 118-bus test system and the results are indicative of its efficiency, accuracy and fastness compared to other methods.
FEKRI, MOJTABA; NIKOUKAR, JAVAD; and GHAREHPETIAN, GEVORK BABAMALEK (2022) "Identification of initial events of cascading failures using graph theory methods," Turkish Journal of Electrical Engineering and Computer Sciences: Vol. 30: No. 7, Article 10. https://doi.org/10.55730/1300-0632.3959
Available at: https://journals.tubitak.gov.tr/elektrik/vol30/iss7/10
Computer Engineering Commons, Computer Sciences Commons, Electrical and Computer Engineering Commons
Call for special issue on Revolutionizing Artificial Intelligence Approaches
in Image Processing - NEW
All Issues Vol. 31, No. 1 Vol. 30, No. 7 Vol. 30, No. 6 Vol. 30, No. 5 Vol. 30, No. 4 Vol. 30, No. 3 Vol. 30, No. SI-1 Vol. 30, No. 1 Vol. 29, No. SI-1 Vol. 29, No. 7 Vol. 29, No. 5 Vol. 29, No. 4 Vol. 29, No. 3 Vol. 29, No. 2 Vol. 29, No. 1 Vol. 28, No. 6 Vol. 28, No. 5 Vol. 28, No. 4 Vol. 28, No. 3 Vol. 28, No. 2 Vol. 28, No. 1 Vol. 27, No. 6 Vol. 27, No. 5 Vol. 27, No. 4 Vol. 27, No. 3 Vol. 27, No. 2 Vol. 27, No. 1 Vol. 26, No. 6 Vol. 26, No. 5 Vol. 26, No. 4 Vol. 26, No. 3 Vol. 26, No. 2 Vol. 26, No. 1 Vol. 25, No. 6 Vol. 25, No. 5 Vol. 25, No. 4 Vol. 25, No. 3 Vol. 25, No. 2 Vol. 25, No. 1 Vol. 24, No. 6 Vol. 24, No. 5 Vol. 24, No. 4 Vol. 24, No. 3 Vol. 24, No. 2 Vol. 24, No. 1 Vol. 23, No. Sup. 1 Vol. 23, No. 6 Vol. 23, No. 5 Vol. 23, No. 4 Vol. 23, No. 3 Vol. 23, No. 2 Vol. 23, No. 1 Vol. 22, No. 6 Vol. 22, No. 5 Vol. 22, No. 4 Vol. 22, No. 3 Vol. 22, No. 2 Vol. 22, No. 1 Vol. 21, No. Sup. 2 Vol. 21, No. Sup. 1 Vol. 21, No. 6 Vol. 21, No. 5 Vol. 21, No. 4 Vol. 21, No. 3 Vol. 21, No. 2 Vol. 21, No. 1 Vol. 20, No. Sup. 2 Vol. 20, No. Sup. 1 Vol. 20, No. 6 Vol. 20, No. 5 Vol. 20, No. 4 Vol. 20, No. 3 Vol. 20, No. 2 Vol. 20, No. 1 Vol. 19, No. 6 Vol. 19, No. 5 Vol. 19, No. 4 Vol. 19, No. 3 Vol. 19, No. 2 Vol. 19, No. 1 Vol. 18, No. 6 Vol. 18, No. 5 Vol. 18, No. 4 Vol. 18, No. 3 Vol. 18, No. 2 Vol. 18, No. 1 Vol. 17, No. 3 Vol. 17, No. 2 Vol. 17, No. 1 Vol. 16, No. 3 Vol. 16, No. 2 Vol. 16, No. 1 Vol. 15, No. 3 Vol. 15, No. 2 Vol. 15, No. 1 Vol. 14, No. 3 Vol. 14, No. 2 Vol. 14, No. 1 Vol. 13, No. 3 Vol. 13, No. 2 Vol. 13, No. 1 Vol. 12, No. 3 Vol. 12, No. 2 Vol. 12, No. 1 Vol. 11, No. 3 Vol. 11, No. 2 Vol. 11, No. 1 Vol. 10, No. 3 Vol. 10, No. 2 Vol. 10, No. 1 Vol. 9, No. 2 Vol. 9, No. 1 Vol. 8, No. 2 Vol. 8, No. 1 Vol. 7, No. 1-3 Vol. 6, No. 3 Vol. 6, No. 2 Vol. 6, No. 1 Vol. 5, No. 3 Vol. 5, No. 2 Vol. 5, No. 1 Vol. 4, No. 1-2-3 Vol. 3, No. 2-3


text:
package pl.morecraft.dev.datagrammer.commands;

import pl.morecraft.dev.datagrammer.engine.Command;
import pl.morecraft.dev.datagrammer.misc.Consoler;

import java.io.IOException;
import java.net.DatagramSocket;

import static pl.morecraft.dev.datagrammer.misc.Config.DEFAULT_PACKET_SIZE;

public class PacketSize extends Command {

    @SuppressWarnings("Duplicates")
    @Override
    public void setup() {
        addAlias("packet size", false);
        addAlias("ps", false);
        setArgsCount(1);
        setArgsInfo("[packetsize]");
        setShortInfo("Sets socket packet size to [packetsize] bytes");
        mustBeBound(false);
        mustBeConnected(false);
        mustBeNotClosed(false);
        mustBeNotNull(false);
    }

    @Override
    public DatagramSocket execute(DatagramSocket socket, Consoler out) throws IOException {
        DEFAULT_PACKET_SIZE = Integer.valueOf(getArgs()[0]);
        out.println("Default size of packet set to " + DEFAULT_PACKET_SIZE + " bytes");
        return socket;
    }

}


text:
Hamit: LepreCon 38
A Con The Way They Used To Be
Joe and Gay Haldeman
By Francis Hamit: LepreCon 38, held April 5th through 8th in Tempe, Arizona, was, in many ways, a return to the kind of science fiction/fantasy convention that got me into Fandom in 1978. Leigh and I have not been going to many conventions in recent years, so this was only my 108th. The WorldCon in Reno, where we spent almost all of our time in the poker room at the Peppermill, was one of two we attended in 2011, followed by Bubonicon in Albuquerque a week later. Neither was the kind of friendly, welcoming experience you want to repeat and both carried a sense of 'been there, done that' that made us wonder why we'd bothered. Certainly it was not money well spent, but since it was part of a longer book tour, we endured anyway.
LepreCon 38 invited us, and wanted us both on the program, and we hadn't been to a previous one for many years. But we remembered those kindly as small relaxicons where interesting programs and great conversations were to be had. Tempe is where Arizona State University is, and the hotel, the Tempe Mission Palms, is right next to the campus and the Mill Street neighborhood half a block away reminded me of Iowa City when I first lived there in the mid 1960s. Very mellow, positive vibes.
The hotel is also very fan friendly, with a very soft security posture, great rooms and plenty of opportunities for that writers' sport of people watching. It is an aircrew and military pilot hotel, with a good restaurant. One need not leave the whole weekend, but if one does, Mill Street is nearby. I made early morning pilgrimages to the local Starbucks.
Patti Hultstrand did an outstanding job of putting together a program that would do a much larger convention proud. Some panels, unfortunately, outnumbered the audience, and some were cancelled because no audience appeared. This was especially true for readings where one lesser-known author after another found themselves addressing an almost empty room. One of the frustrations for panelists I heard more than once was that a panel they wanted to attend was often opposite one they were on, which might account for the low attendance at so many of them. I was in five events, but only made one panel as audience member. It was a very diverse program with lots of options, but perhaps, next time, "less is more"?
I have the impression that a much larger attendance was anticipated than actually came. Certainly there were almost none of the usual suspects from Los Angeles , which is only a seven hour drive away. Aside from myself, my roommate and editor Leigh Strother-Vien, and Michael Donahue, I don't recall seeing another L.A fan there. That might be because of the current economic problems, but it's a pity because it was a very good event.
Mike Donahue only came over for one day, and that was because the convention very kindly scheduled a panel with the both of us about our forthcoming motion picture Marlowe, which is based on my 1988 stage play, "MARLOWE: An Elizabethan Tragedy". Since becoming a film director, Mike has thrown himself into one low-budget project after another and now is in various stages of completion with three features. Only one, Pool Time, has been released. Complicating matters was the looming demise of Barry Workman, a close friend of his. But people were very interested and showed up for that panel, which is helpful in creating "buzz", and we also sold a few copies of the first-draft screenplay at a signing and from a dealer's table.
I was also on a military-related panel with Joe Haldeman, who was the Author Guest of Honor. So were seven other people. Joe being there was another reason for me to attend. He and I were classmates at the Iowa Writers Workshop in the 1970s. We were on a similar panel at the 2008 WorldCon in Denver, after which he became very ill. He was a combat engineer in Vietnam and Agent Orange put him in the hospital with a near-fatal bout of pancreatitis. In Reno he was still obviously suffering from the aftermath, so it was very good to see him looking healthy again in Tempe. I had been worried about him. I had my own illness last fall, after Reno, not as serious, but still very scary. The panel was nine guys who'd all been in the military, and started by outnumbering the audience, but eventually filled even. Joe and I were not the only ones on that panel old enough to be Vietnam veterans. There were a surprising number of ex-military, some of them with long careers, on the program and at the convention. It gave us something to talk about. War stories were exchanged. Nor was it entirely a male conversation. There were at least two other female veterans aside from Leigh.
The proximity to ASU should have drawn some new fans, but there was a noticeable "graying of Fandom" at work. Very few kids and very few young adults and teenagers. The hotel is a little on the pricy side, but the security was kind enough to look the other way from those who chose to sleep in the courtyard or some of the smaller lobbies. The convention security, colorfully designated "The Watch", was also abundant and well-run. Steve Lapota, another ex-combat engineer in Vietnam , was in charge and also a genial host.
The media guest of honor was Steven Furst, of Animal House and Babylon 5 fame, and he was, if not entirely one of us (I am told it was a paid appearance), an interested tourist who decided to throw an Animal House style Toga Party. That was right after my third panel of the day and, in deference to my own months-long recovery from complex pneumonia, I went to bed instead. Mr. Furst also gave panels on film directing and related topics.
The Green Room/ Staff Lounge and the Consuite were at opposite ends of a long hallway on the second floor and on the other side of the hotel from the room where Leigh and I were staying. Some of the function rooms with program items were also there, while the Dealers' Room, Art Show and Registration were across the courtyard on the ground level. It made for a lot of walking, but was not as tiring as it might have been. Con-kibble was plentiful, as were sandwiches and hot entrees, and a generous selection of soft drinks and bottled water.
So this was, for me, a return to the kind of convention that first got me to be a convention-going fan. These days, age and health have a big impact on whether or not we're going to go to one, and like, Jerry Pournelle, I'm not inclined to go unless I can contribute by being on a program item or two…and sometimes, not then. (We no longer do LASFS events.)
But this was one I'd be happy to repeat. Everyone was very nice, and no one was promoting any kind of agenda or trying to bully anyone else. Fandom the way it used to be.
LepreCon registration.
Patti Huldstrand handing out program assignments.
This entry was posted in Conventions and tagged Francis Hamit, Joe Haldeman, LepreCon by Mike Glyer. Bookmark the permalink.