text:
package org.broadleafcommerce.core.offer.service.processor;

import org.broadleafcommerce.common.money.Money;
import org.broadleafcommerce.core.offer.dao.CustomerOfferDao;
import org.broadleafcommerce.core.offer.dao.OfferCodeDao;
import org.broadleafcommerce.core.offer.dao.OfferDao;
import org.broadleafcommerce.core.offer.domain.CandidateItemOffer;
import org.broadleafcommerce.core.offer.domain.CandidateItemOfferImpl;
import org.broadleafcommerce.core.offer.domain.Offer;
import org.broadleafcommerce.core.offer.domain.OfferImpl;
import org.broadleafcommerce.core.offer.domain.OfferQualifyingCriteriaXref;
import org.broadleafcommerce.core.offer.domain.OfferTargetCriteriaXref;
import org.broadleafcommerce.core.offer.domain.OrderItemAdjustment;
import org.broadleafcommerce.core.offer.domain.OrderItemAdjustmentImpl;
import org.broadleafcommerce.core.offer.domain.OrderItemPriceDetailAdjustment;
import org.broadleafcommerce.core.offer.service.OfferDataItemProvider;
import org.broadleafcommerce.core.offer.service.OfferServiceImpl;
import org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl;
import org.broadleafcommerce.core.offer.service.discount.CandidatePromotionItems;
import org.broadleafcommerce.core.offer.service.discount.domain.PromotableCandidateItemOffer;
import org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl;
import org.broadleafcommerce.core.offer.service.discount.domain.PromotableOrder;
import org.broadleafcommerce.core.offer.service.discount.domain.PromotableOrderItem;
import org.broadleafcommerce.core.offer.service.type.OfferDiscountType;
import org.broadleafcommerce.core.offer.service.type.OfferItemRestrictionRuleType;
import org.broadleafcommerce.core.order.dao.FulfillmentGroupItemDao;
import org.broadleafcommerce.core.order.dao.OrderItemDao;
import org.broadleafcommerce.core.order.domain.DiscreteOrderItem;
import org.broadleafcommerce.core.order.domain.FulfillmentGroupItem;
import org.broadleafcommerce.core.order.domain.Order;
import org.broadleafcommerce.core.order.domain.OrderItem;
import org.broadleafcommerce.core.order.domain.OrderItemPriceDetail;
import org.broadleafcommerce.core.order.domain.OrderMultishipOption;
import org.broadleafcommerce.core.order.service.FulfillmentGroupService;
import org.broadleafcommerce.core.order.service.OrderItemService;
import org.broadleafcommerce.core.order.service.OrderMultishipOptionService;
import org.broadleafcommerce.core.order.service.OrderService;
import org.broadleafcommerce.core.order.service.call.FulfillmentGroupItemRequest;
import org.easymock.EasyMock;
import org.easymock.IAnswer;

import java.util.ArrayList;
import java.util.List;
import java.util.TimeZone;

import junit.framework.TestCase;

/**
 *
 * @author jfischer
 *
 */
public class ItemOfferProcessorTest extends TestCase {

    protected OfferDao offerDaoMock;
    protected OrderItemDao orderItemDaoMock;
    protected OrderService orderServiceMock;
    protected OfferServiceImpl offerService;
    protected OrderItemService orderItemServiceMock;
    protected FulfillmentGroupItemDao fgItemDaoMock;
    protected OfferDataItemProvider dataProvider = new OfferDataItemProvider();
    protected FulfillmentGroupService fgServiceMock;
    protected OrderMultishipOptionService multishipOptionServiceMock;
    protected OfferTimeZoneProcessor offerTimeZoneProcessorMock;

    protected ItemOfferProcessorImpl itemProcessor;

    @Override
    protected void setUp() throws Exception {

        CustomerOfferDao customerOfferDaoMock = EasyMock.createMock(CustomerOfferDao.class);
        OfferCodeDao offerCodeDaoMock = EasyMock.createMock(OfferCodeDao.class);
        offerDaoMock = EasyMock.createMock(OfferDao.class);
        orderItemDaoMock = EasyMock.createMock(OrderItemDao.class);
        orderServiceMock = EasyMock.createMock(OrderService.class);
        orderItemServiceMock = EasyMock.createMock(OrderItemService.class);
        fgItemDaoMock = EasyMock.createMock(FulfillmentGroupItemDao.class);
        fgServiceMock = EasyMock.createMock(FulfillmentGroupService.class);
        multishipOptionServiceMock = EasyMock.createMock(OrderMultishipOptionService.class);
        offerTimeZoneProcessorMock = EasyMock.createMock(OfferTimeZoneProcessor.class);

        OfferServiceUtilitiesImpl offerServiceUtilities = new OfferServiceUtilitiesImpl();
        offerServiceUtilities.setOfferDao(offerDaoMock);
        offerServiceUtilities.setPromotableItemFactory(new PromotableItemFactoryImpl());

        itemProcessor = new ItemOfferProcessorImpl();
        itemProcessor.setOfferDao(offerDaoMock);
        itemProcessor.setOrderItemDao(orderItemDaoMock);
        itemProcessor.setOfferTimeZoneProcessor(offerTimeZoneProcessorMock);
        itemProcessor.setPromotableItemFactory(new PromotableItemFactoryImpl());
        itemProcessor.setOfferServiceUtilities(offerServiceUtilities);

        offerService = new OfferServiceImpl();

        OrderOfferProcessorImpl orderProcessor = new OrderOfferProcessorImpl();
        orderProcessor.setOfferDao(offerDaoMock);
        orderProcessor.setPromotableItemFactory(new PromotableItemFactoryImpl());
        orderProcessor.setOfferTimeZoneProcessor(offerTimeZoneProcessorMock);
        orderProcessor.setOrderItemDao(orderItemDaoMock);
        orderProcessor.setOfferServiceUtilities(offerServiceUtilities);

        offerService.setCustomerOfferDao(customerOfferDaoMock);
        offerService.setOfferCodeDao(offerCodeDaoMock);
        offerService.setOfferDao(offerDaoMock);
        offerService.setOrderOfferProcessor(orderProcessor);
        offerService.setItemOfferProcessor(itemProcessor);
        offerService.setPromotableItemFactory(new PromotableItemFactoryImpl());
        offerService.setOrderService(orderServiceMock);
    }

    public void replay() throws Exception {
        EasyMock.expect(orderItemDaoMock.createOrderItemPriceDetail()).andAnswer(OfferDataItemProvider.getCreateOrderItemPriceDetailAnswer()).anyTimes();
        EasyMock.expect(orderItemDaoMock.createOrderItemQualifier()).andAnswer(OfferDataItemProvider.getCreateOrderItemQualifierAnswer()).anyTimes();
        EasyMock.expect(offerDaoMock.createOrderItemPriceDetailAdjustment()).andAnswer(OfferDataItemProvider.getCreateOrderItemPriceDetailAdjustmentAnswer()).anyTimes();

        EasyMock.expect(fgServiceMock.addItemToFulfillmentGroup(EasyMock.isA(FulfillmentGroupItemRequest.class), EasyMock.eq(false))).andAnswer(OfferDataItemProvider.getAddItemToFulfillmentGroupAnswer()).anyTimes();
        EasyMock.expect(orderServiceMock.removeItem(EasyMock.isA(Long.class), EasyMock.isA(Long.class), EasyMock.eq(false))).andAnswer(OfferDataItemProvider.getRemoveItemFromOrderAnswer()).anyTimes();
        EasyMock.expect(orderServiceMock.save(EasyMock.isA(Order.class), EasyMock.isA(Boolean.class))).andAnswer(OfferDataItemProvider.getSaveOrderAnswer()).anyTimes();

        EasyMock.expect(orderServiceMock.getAutomaticallyMergeLikeItems()).andReturn(true).anyTimes();

        EasyMock.expect(orderItemServiceMock.saveOrderItem(EasyMock.isA(OrderItem.class))).andAnswer(OfferDataItemProvider.getSaveOrderItemAnswer()).anyTimes();
        EasyMock.expect(fgItemDaoMock.save(EasyMock.isA(FulfillmentGroupItem.class))).andAnswer(OfferDataItemProvider.getSaveFulfillmentGroupItemAnswer()).anyTimes();

        EasyMock.expect(multishipOptionServiceMock.findOrderMultishipOptions(EasyMock.isA(Long.class))).andAnswer(new IAnswer<List<OrderMultishipOption>>() {

            @Override
            public List<OrderMultishipOption> answer() throws Throwable {
                return new ArrayList<OrderMultishipOption>();
            }
        }).anyTimes();

        multishipOptionServiceMock.deleteAllOrderMultishipOptions(EasyMock.isA(Order.class));
        EasyMock.expectLastCall().anyTimes();
        EasyMock.expect(fgServiceMock.collapseToOneShippableFulfillmentGroup(EasyMock.isA(Order.class), EasyMock.eq(false))).andAnswer(OfferDataItemProvider.getSameOrderAnswer()).anyTimes();
        EasyMock.expect(fgItemDaoMock.create()).andAnswer(OfferDataItemProvider.getCreateFulfillmentGroupItemAnswer()).anyTimes();
        fgItemDaoMock.delete(EasyMock.isA(FulfillmentGroupItem.class));
        EasyMock.expectLastCall().anyTimes();
        EasyMock.expect(offerTimeZoneProcessorMock.getTimeZone(EasyMock.isA(OfferImpl.class))).andReturn(TimeZone.getTimeZone("CST")).anyTimes();

        EasyMock.replay(offerDaoMock);
        EasyMock.replay(orderItemDaoMock);
        EasyMock.replay(orderServiceMock);
        EasyMock.replay(orderItemServiceMock);
        EasyMock.replay(fgItemDaoMock);
        EasyMock.replay(fgServiceMock);
        EasyMock.replay(multishipOptionServiceMock);
        EasyMock.replay(offerTimeZoneProcessorMock);
    }

    public void verify() {
        EasyMock.verify(offerDaoMock);
        EasyMock.verify(orderItemDaoMock);
        EasyMock.verify(orderServiceMock);
        EasyMock.verify(orderItemServiceMock);
        EasyMock.verify(fgItemDaoMock);
        EasyMock.verify(fgServiceMock);
        EasyMock.verify(multishipOptionServiceMock);
        EasyMock.verify(offerTimeZoneProcessorMock);
    }

    public void testFilterItemLevelOffer() throws Exception {
        replay();

        List<PromotableCandidateItemOffer> qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        List<Offer> offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
                OfferDiscountType.PERCENT_OFF,
            null,
            null
        );

        PromotableOrder order = dataProvider.createBasicPromotableOrder();
        itemProcessor.filterItemLevelOffer(order, qualifiedOffers, offers.get(0));

        //test that the valid order item offer is included - legacy format - no qualifier
        //since there's no qualifier, both items can apply
        // This line is commented out because we are no longer creating legacy offers.
        //assertTrue(qualifiedOffers.size() == 2 && qualifiedOffers.get(0).getOffer().equals(offers.get(0)) && qualifiedOffers.get(1).getOffer().equals(offers.get(0)));

        qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        );
        itemProcessor.filterItemLevelOffer(order, qualifiedOffers, offers.get(0));

        //test that the valid order item offer is included
        //there is a qualifier and the item qualifying criteria requires only 1, therefore there will be only one qualifier in the qualifiers map
        //we don't know the targets yet, so there's only one CandidateItemOffer for now
        assertTrue(qualifiedOffers.size() == 1 && qualifiedOffers.get(0).getOffer().equals(offers.get(0)) && qualifiedOffers.get(0).getCandidateQualifiersMap().size() == 1);

        // Add a subtotal requirement that will be met by the item offer.
        qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        );

        offers.get(0).setQualifyingItemSubTotal(new Money(1));
        itemProcessor.filterItemLevelOffer(order, qualifiedOffers, offers.get(0));

        //test that the valid order item offer is included
        //there is a qualifier and the item qualifying criteria requires only 1, therefore there will be only one qualifier in the qualifiers map
        //we don't know the targets yet, so there's only one CandidateItemOffer for now
        assertTrue(qualifiedOffers.size() == 1 && qualifiedOffers.get(0).getOffer().equals(offers.get(0)) && qualifiedOffers.get(0).getCandidateQualifiersMap().size() == 1);

        // Add a subtotal requirement that will not be met by the item offer.
        qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        );

        offers.get(0).setQualifyingItemSubTotal(new Money(99999));
        itemProcessor.filterItemLevelOffer(order, qualifiedOffers, offers.get(0));

        // Since the item qualification subTotal is not met, the qualified offer size should
        // be zero.
        assertTrue(qualifiedOffers.size() == 0);

        qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test5\"), MVEL.eval(\"toUpperCase()\",\"test6\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test5\"), MVEL.eval(\"toUpperCase()\",\"test6\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        );
        itemProcessor.filterItemLevelOffer(order, qualifiedOffers, offers.get(0));

        //test that the invalid order item offer is excluded
        assertTrue(qualifiedOffers.size() == 0);

        verify();
    }

    public void testCouldOfferApplyToOrder() throws Exception {
        replay();

        PromotableOrder order = dataProvider.createBasicPromotableOrder();
        List<Offer> offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            null,
            null
        );

        boolean couldApply = itemProcessor.couldOfferApplyToOrder(offers.get(0), order, order.getDiscountableOrderItems().get(0), order.getFulfillmentGroups().get(0));
        //test that the valid order item offer is included
        assertTrue(couldApply);

        offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()==0",
            OfferDiscountType.PERCENT_OFF,
            null,
            null
        );
        couldApply = itemProcessor.couldOfferApplyToOrder(offers.get(0), order, order.getDiscountableOrderItems().get(0), order.getFulfillmentGroups().get(0));
        //test that the invalid order item offer is excluded
        assertFalse(couldApply);

        verify();
    }

    public void testCouldOrderItemMeetOfferRequirement() throws Exception {
        replay();

        PromotableOrder order = dataProvider.createBasicPromotableOrder();
        List<Offer> offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        );

        OfferQualifyingCriteriaXref xref = offers.get(0).getQualifyingItemCriteriaXref().iterator().next();
        boolean couldApply = itemProcessor.couldOrderItemMeetOfferRequirement(xref.getOfferItemCriteria(), order.getDiscountableOrderItems().get(0));
        //test that the valid order item offer is included
        assertTrue(couldApply);

        offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test5\"), MVEL.eval(\"toUpperCase()\",\"test6\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test5\"), MVEL.eval(\"toUpperCase()\",\"test6\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        );
        xref = offers.get(0).getQualifyingItemCriteriaXref().iterator().next();
        couldApply = itemProcessor.couldOrderItemMeetOfferRequirement(xref.getOfferItemCriteria(), order.getDiscountableOrderItems().get(0));
        //test that the invalid order item offer is excluded
        assertFalse(couldApply);

        verify();
    }

    public void testCouldOfferApplyToOrderItems() throws Exception {
        replay();

        PromotableOrder order = dataProvider.createBasicPromotableOrder();
        List<Offer> offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        );
        List<PromotableOrderItem> orderItems = new ArrayList<PromotableOrderItem>();
        for (PromotableOrderItem orderItem : order.getDiscountableOrderItems()) {
            orderItems.add(orderItem);
        }
        CandidatePromotionItems candidates = itemProcessor.couldOfferApplyToOrderItems(offers.get(0), orderItems);
        //test that the valid order item offer is included
        //both cart items are valid for qualification and target
        assertTrue(candidates.isMatchedQualifier() && candidates.getCandidateQualifiersMap().size() == 1 &&
                candidates.getCandidateQualifiersMap().values().iterator().next().size() == 2 &&
                candidates.isMatchedTarget() && candidates.getCandidateTargetsMap().size() == 1 &&
                candidates.getCandidateTargetsMap().values().iterator().next().size() == 2);

        offers = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test5\"), MVEL.eval(\"toUpperCase()\",\"test6\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test5\"), MVEL.eval(\"toUpperCase()\",\"test6\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        );
        candidates = itemProcessor.couldOfferApplyToOrderItems(offers.get(0), orderItems);
        //test that the invalid order item offer is excluded because there are no qualifying items
        assertFalse(candidates.isMatchedQualifier() && candidates.getCandidateQualifiersMap().size() == 1);

        verify();
    }

    private int checkOrderItemOfferAppliedCount(Order order) {
        int count = 0;
        for (OrderItem item : order.getOrderItems()) {
            for (OrderItemPriceDetail detail : item.getOrderItemPriceDetails()) {
                count = count + (detail.getOrderItemPriceDetailAdjustments().size() * detail.getQuantity());
            }
        }
        return count;
    }

    private int checkOrderItemOfferAppliedQuantity(Order order, Offer offer) {
        int count = 0;
        for (OrderItem item : order.getOrderItems()) {
            for (OrderItemPriceDetail detail : item.getOrderItemPriceDetails()) {
                for (OrderItemPriceDetailAdjustment adjustment : detail.getOrderItemPriceDetailAdjustments()) {
                    if (adjustment.getOffer().getId().equals(offer.getId())) {
                        count += detail.getQuantity();
                    }
                }
            }
        }
        return count;
    }

    private int countPriceDetails(Order order) {
        int count = 0;
        for (OrderItem item : order.getOrderItems()) {
            count = count + item.getOrderItemPriceDetails().size();
        }
        return count;
    }

    public void testApplyAllItemOffers() throws Exception {

        replay();

        Order order = dataProvider.createBasicOrder();

        Offer offer1 = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        ).get(0);
        offer1.setId(1L);

        List<Offer> offers = new ArrayList<Offer>();
        offers.add(offer1);

        List<PromotableCandidateItemOffer> qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offers, order);

        assertTrue(order.getTotalAdjustmentsValue().getAmount().doubleValue() > 0);

        order = dataProvider.createBasicOrder();

        qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        offer1.setApplyDiscountToSalePrice(false);
        ((DiscreteOrderItem) order.getOrderItems().get(0)).getSku().setSalePrice(new Money(1D));
        ((DiscreteOrderItem) order.getOrderItems().get(1)).getSku().setSalePrice(new Money(1D));
        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offers, order);

        assertTrue(order.getTotalAdjustmentsValue().getAmount().doubleValue() == 0);

        verify();
    }

    public void testApplyAdjustments() throws Exception {
        replay();

        Order order = dataProvider.createBasicOrder();

        Offer offer1 = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        ).get(0);
        offer1.setId(1L);
        OfferQualifyingCriteriaXref xref = offer1.getQualifyingItemCriteriaXref().iterator().next();
        xref.getOfferItemCriteria().setQuantity(2);
        offer1.setCombinableWithOtherOffers(false);
        Offer offer2 = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        ).get(0);
        offer2.setId(2L);

        List<Offer> offerListWithOneOffer = new ArrayList<Offer>();
        offerListWithOneOffer.add(offer1);

        List<Offer> offerListWithTwoOffers = new ArrayList<Offer>();
        offerListWithTwoOffers.add(offer1);
        offerListWithTwoOffers.add(offer2);

        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithOneOffer, order);
        assertTrue(checkOrderItemOfferAppliedCount(order) == 1);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer1) == 1);

        // Add the second offer.   The first was nonCombinable so it should still be 1
        order = dataProvider.createBasicOrder();
        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithTwoOffers, order);
        assertTrue(checkOrderItemOfferAppliedCount(order) == 2);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer2) == 2);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer1) == 0);

        // Reset offer1 to combinable.   Now both should be applied.
        offer1.setCombinableWithOtherOffers(true);
        order = dataProvider.createBasicOrder();
        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithTwoOffers, order);
        assertTrue(checkOrderItemOfferAppliedCount(order) == 2);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer2) == 2);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer1) == 0);

        // Offer 1 back to nonCombinable but don't allow discount to the sale price
        // and make the sale price a better overall offer
        offer1.setCombinableWithOtherOffers(false);
        offer1.setApplyDiscountToSalePrice(false);
        order = dataProvider.createBasicOrder();
        ((DiscreteOrderItem) order.getOrderItems().get(1)).getSku().setSalePrice(new Money(10D));
        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithOneOffer, order);
        assertTrue(checkOrderItemOfferAppliedCount(order) == 0);

        // Try again with two offers.   The second should be applied.
        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithTwoOffers, order);
        assertTrue(checkOrderItemOfferAppliedCount(order) == 2);

        // Trying with 2nd offer as nonCombinable.
        offer1.setCombinableWithOtherOffers(true);
        ((DiscreteOrderItem) order.getOrderItems().get(1)).getSku().setSalePrice(null);
        offer2.setCombinableWithOtherOffers(false);

        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithOneOffer, order);
        assertTrue(checkOrderItemOfferAppliedCount(order) == 1);

        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithTwoOffers, order);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer2) == 2);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer1) == 0);

        // Set qualifying criteria quantity to 1
        // Set qualifying target criteria to 2
        order = dataProvider.createBasicOrder();
        xref = offer1.getQualifyingItemCriteriaXref().iterator().next();
        xref.getOfferItemCriteria().setQuantity(1);

        OfferTargetCriteriaXref targetXref = offer1.getTargetItemCriteriaXref().iterator().next();
        targetXref.getOfferItemCriteria().setQuantity(2);
        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithOneOffer, order);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer1) == 2);

        // Reset both offers to combinable and the qualifiers as allowing duplicate QUALIFIERs
        // and Targets
        offer1.setCombinableWithOtherOffers(true);
        offer2.setCombinableWithOtherOffers(true);
        offer1.setOfferItemQualifierRuleType(OfferItemRestrictionRuleType.QUALIFIER_TARGET);
        offer1.setOfferItemTargetRuleType(OfferItemRestrictionRuleType.QUALIFIER_TARGET);
        offer2.setOfferItemQualifierRuleType(OfferItemRestrictionRuleType.QUALIFIER_TARGET);
        offer2.setOfferItemTargetRuleType(OfferItemRestrictionRuleType.QUALIFIER_TARGET);
        order = dataProvider.createBasicOrder();
        order.updatePrices();
        offerService.applyAndSaveOffersToOrder(offerListWithTwoOffers, order);
        assertTrue(checkOrderItemOfferAppliedCount(order) == 4);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer2) == 2);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer1) == 2);

        verify();
    }

    public void testApplyItemQualifiersAndTargets() throws Exception {
        replay();

        List<PromotableCandidateItemOffer> qualifiedOffers = new ArrayList<PromotableCandidateItemOffer>();
        Offer offer1 = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        ).get(0);
        offer1.setId(1L);
        Offer offer2 = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        ).get(0);
        offer2.setId(2L);

        OfferTargetCriteriaXref targetXref = offer2.getTargetItemCriteriaXref().iterator().next();
        targetXref.getOfferItemCriteria().setQuantity(4);
        offer2.getQualifyingItemCriteriaXref().clear();
        offer2.setOfferItemTargetRuleType(OfferItemRestrictionRuleType.TARGET);
        Offer offer3 = dataProvider.createItemBasedOfferWithItemCriteria(
            "order.subTotal.getAmount()>20",
            OfferDiscountType.PERCENT_OFF,
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))",
            "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))"
        ).get(0);

        PromotableOrder promotableOrder = dataProvider.createBasicPromotableOrder();
        itemProcessor.filterItemLevelOffer(promotableOrder, qualifiedOffers, offer1);
        assertTrue(qualifiedOffers.size() == 1 && qualifiedOffers.get(0).getOffer().equals(offer1) && qualifiedOffers.get(0).getCandidateQualifiersMap().size() == 1);

        itemProcessor.filterItemLevelOffer(promotableOrder, qualifiedOffers, offer2);
        assertTrue(qualifiedOffers.size() == 2 && qualifiedOffers.get(1).getOffer().equals(offer2) && qualifiedOffers.get(1).getCandidateQualifiersMap().size() == 0);

        itemProcessor.filterItemLevelOffer(promotableOrder, qualifiedOffers, offer3);
        assertTrue(qualifiedOffers.size() == 3 && qualifiedOffers.get(2).getOffer().equals(offer3) && qualifiedOffers.get(2).getCandidateQualifiersMap().size() == 1);

        // Try with just the second offer.   Expect to get 4 targets based on the offer having no qualifiers required
        // and targeting category test1 or test2 and that the offer requires 4 target criteria.
        Order order = dataProvider.createBasicOrder();
        List<Offer> offerList = new ArrayList<Offer>();
        offerList.add(offer2);
        offerService.applyAndSaveOffersToOrder(offerList, order);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer2) == 4);
        assertTrue(countPriceDetails(order) == 3);

        // Now try with both offers.   Since the targets can be reused, we expect to have 4 targets on offer2
        // and 1 target on offer1
        order = dataProvider.createBasicOrder();
        offerList.add(offer1); // add in second offer (which happens to be offer1)

        offerService.applyAndSaveOffersToOrder(offerList, order);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer2) == 4);
        assertTrue(countPriceDetails(order) == 3);

        // All three offers - offer 3 is now higher priority so the best offer (offer 2) won't be applied
        order = dataProvider.createBasicOrder();
        offerList.add(offer3); // add in second offer (which happens to be offer1)
        offer3.setPriority(-1);
        offerService.applyAndSaveOffersToOrder(offerList, order);
        assertTrue(checkOrderItemOfferAppliedQuantity(order, offer3) == 2);
        assertTrue(countPriceDetails(order) == 4);

        verify();
    }

    public class Answer implements IAnswer<CandidateItemOffer> {

        @Override
        public CandidateItemOffer answer() throws Throwable {
            return new CandidateItemOfferImpl();
        }

    }

    public class Answer2 implements IAnswer<OrderItemAdjustment> {

        @Override
        public OrderItemAdjustment answer() throws Throwable {
            return new OrderItemAdjustmentImpl();
        }

    }
}


text:
Title: How Fatigued Truckers Can Save Correctional Administrators Time and Money
Journal: Corrections Today Volume:63 Issue:1 Dated:February 2001 Pages:114-116,118
Author(s): Lee Mockensturm
Editor(s): Susan L. Clayton
Date Published: February 2001
Annotation: This article reviews an innovative technology, the pupillometry device (the measurement of pupil parameters), named EyeCheck, which has been shown to be an accurate predictor of drug use offering corrections a valid, quick, noninvasive method for drug testing.
Abstract: This article looks at how correctional agencies have shown critical interest in the pupillometry device, EyeCheck, being tested by the Michigan State Police that measures the fatigue level in truck drivers. This same technology can be used as a noninvasive drug-testing device, which could save correctional administrators both time and money. The device resembles a pair of binoculars plugged into a laptop computer. The binocular component measures the pupils' response to light and stores the information, which then is retrieved and read by the laptop computer. The process takes about one minute. The technology was then tested, by the West Virginia Department of Corrections (DOC), to see whether it would be as reliable and accurate as urinalysis, the primary method for drug testing by the West Virginia DOC. The results showed that the pupillometry device is an accurate predictor of drug use when compared to urinalysis and other testing methods. The device requires an initial outlay of money, which could be prohibitive, but the potential savings would be substantial. In addition, the device was shown to take significantly less time than it would take to collect samples (50-man block in about one-half hour). The article noted that the results from this technology have not been tested in court and are limited to probable cause findings. References
Main Term(s): Drug testing
Index Term(s): Comparative analysis; Drug abuse in correctional facilities; Science and Technology; Urinalysis

redpajama_set_name: RedPajamaCommonCrawl


There has been controversy on the topic of Hormone Replacement Therapy (HRT) for the last 15 years. Negative attitudes drastically dominate the media since 2002. Combine this with the Women's Health Initiative (WHI) study that was halted three years ago because of health risks, it has caused a confusion for women trying to make an informed decisions on their health.
Lets shed a little light on the confusion. First, the WHI study and the subsequent media reports about HRT are based on Commercial HRT only. They are based off findings about the combination of conjugated estrogens and medroxyprogesterone (called PremPro). Thus, when you hear about HRT in the news, this is what they are referring to.
There are alternatives. Over-the-counter, there are products containing phytoestrogens, and topical products containing low-dose progesterone. These will provide temporary relief in PMS, perimenopausal, and menopausal symptoms. Long-term benefits and improved health can be achieved through Bio-Equivalent Hormone Replacement Therapy, a prescription alternative.
Bio-Equivalent Hormone Replacement Therapy (HRT) is a prescription alternative to conventional hormone replacement therapy (conjugated estrogens, medroxyprogesterone, etc.).
Bio-Equivalent medications are plant-derived, and chemically changed in a laboratory until they are identical to what your body would naturally produce. HRT is customizable; in other words, it can be adjusted to fit your needs, unlike conventional HRT, which has a few standard dosage strengths.
What are the goals of HRT?


With the unstoppable popularity of SUVs, it's no surprise that nearly every automaker on the planet wants to sell one. Now some, like Acura, formed partnerships to re-badge an existing SUV to quickly establish a presence. But in an increasingly crowded and fickle market, they learned that buyers are looking for something unique. And, it's hard to call something your own when it's running around under two or three different names. So for Acura, the answer was to hit the drawing board with one goal in mind, to create an Acura SUV that would set new benchmarks in luxury SUV performance. And they call it the MDX.
And we call the 2001 Acura MDX one of the smoothest running and handling SUVs on the planet. As Acura designers and engineers have struck a near perfect balance between a sophisticated sedan and capable sport utility. And it's evident the instant you open the door and slide into the wide, roomy interior. Once behind the wheel, you'll appreciate the comfort and support offered by the 8-way power, perforated leather bucket seat. Choose the MDX touring package, and the front passenger seat gains power adjustments, too. Seat heat for both is standard. The center stack to the right provides a home for the automatic climate controls, Acura's DVD-Satellite Navigation system, and a cassette/CD stereo.
Move to the back and again you'll immediately notice how easy it is to enter and exit. And while the seat bottoms are rather flat and firm, the seat backs are reclinable, and there is plenty of leg room. Should you decide to take on a couple of extra passengers, the MDX can handle them too. With these clever third row seats that pull up out of the floor when needed. Fold both the third and second row seats and the MDX will accommodate 81.5 cubic feet of your most treasured stuff.
And with this smooth 3.5 liter, single overhead-cam, 24-valve, VTEC, V-6 under the hood, move them just about anywhere you want in a civilized manner. This 50 state ultra-low emissions engine is deceptively powerful too. With 240 horsepower and 245 pound-feet of torque on tap, the MDX took us to 60 in only 7.6 seconds, and on through the quarter mile in 15.9 seconds at 87 mph. The wide ratio 5-speed automatic transmission delivers seamless shifts, although a more aggressive downshift would inspire more confidence when passing.
But there's no lack of confidence when it comes to the MDX's lightweight, Variable Torqe Management four-wheel drive system. VTM-4 uses an open front differential and electronically controlled clutch packs to deliver power to the rear wheels when needed. But, unlike some systems that are activated only when wheel slippage is detected, the VTM-4 system anticipates the need for all-wheel drive and engages the rear wheels before wheel slip occurs. The system seems perfect for all-weather on-road applications, and modest off-road work.
The driver can also temporarily lock the front and rear axles together to help extract the MDX if it gets stuck. The gearshift must be in first, second, or reverse, and the system unlocks at 18 mph. Once unstuck and up to speed, with 4-wheel disc, 4-channel ABS brakes, the MDX is fully capable of bringing you quickly to a halt. But it's not without a little drama. With average stops from 60 of 132 feet, our drivers noticed a tendency for the rear end to step out slightly, causing the need for a bit of correction.
The same stepping out characteristic was noticed in runs through our low speed slalom as well. Due most likely to the soft springs of the fully independent suspension and the MDX's healthy 4,328 pound curb weight. But out on the road, that softly sprung suspension pays big dividends. As the MDX offers a ride that rivals the best mid-size sedan.
Acura is expecting the MDX to pay big dividends in the showroom as well. And with a well equipped model priced at an estimated $35,000, their sales goal of 35,000 to 40,000 units in the first year should be no problem.
With an increasingly selective, but still SUV-thirsty public enjoying the ride of a robust economy, the 2001 Acura MDX is another tantalizing choice at the burgeoning sport-ute buffet. And while Acura may be a bit late to the SUV party, at least this time they're coming in their own ride.


"I know that when I want a certain color, or a coordinate, I can go to eQuilter and use their Browse and Design Board options to find exactly what I want. I love it !!"
"The team at eQuilter will go the extra mile to help when you are having trouble finding or re-ordering fabrics from their store. Have recommended this site to many friends and will..."
"I just received my first, fast, well packaged order from you. I am hooked! The quality of your fabric is above average and I know it will be a pleasure to create something beautiful...."


Home / SOM / Strain / Types / What is Strain? What are Types of Strain?
Hope you are doing well. In our last lecture, we have studied about stress and strain. We have learned about the basic concept behind it. Strain is a measurement quantity which is the ratio of change in length to original length under loading condition. But when we stretch a body, its dimensions changes in all directions. According to it, strain can be divided into two types. There are many other factors on which we can be categorized strain. So today we will learn about the types of strain. Hope you like it.
Strain can be categorized into the following aspects.
Let's try to learn with an example. Take a rubber piece of L length and B width. Apply a pull load on its two parallel faces along its length and observe it. The length of the rubber piece slightly increases, suppose it is ∆L. We also observed some little change in the width and height as they both decrease slightly. Suppose the change in width is ∆B and change in height is ∆W. So we have observed three value of the change in length in all three directions. According to it, strain can be divided into two types.
The ratio of change in length to its original length in the direction of loading is known as longitudinal strain. In the above example, longitudinal strain can be represented by.
According to the types of loading, strain can be divided into three types.
It can further divided into two types.
Strain measure under compressive loading is known as compressive strain. It tends to increase the cross-section area and decrease the length of the body.
Strain measure under tensile loading is known as tensile strain. It tends to decrease the cross-section and increase the length of the body.
When the shear stress is applied to a body, it tends to deform the shape of the body as shown in the figure. The change in tangential angle in the direction of the loading is called shear strain.
The ratio of change in volume to the original volume under normal loading condition is known as volumetric strain.
This is all about types of strain. If you have any query regarding this article, ask by commenting. If you find something missing or wrong, inform us through commenting. If you like this article, don't forget to share it on social networks. Subscribe our website for more informative articles. Thanks for reading it.


text:
James B. Kelly
Explore Concordia
Séamus in Irish
James B. Kelly on Parliament, the Charter of Rights , and the Judicialization of Politics
Brother, can you spare 6-months? Is this what Charter 'dialogue theory' has become?
Now that the Supreme Court of Canada (SCC) has ruled on the request by the Trudeau government to seek a 6-month extension to comply with Carter v. Canada (Carter II), and the Trudeau government has accepted the court order without reservation, what does the ruling say about the SCC and the Trudeau government, as it relates to the Charter of Rights?
I'll start by saying that I largely agree with the recent insightful commentary provided by Michael Plaxton in Policy Options. My comments will focus on other issues within the broader context of the judicialization of politics and the Charter of Rights, such as:
The justification provided by the SCC for partially granting the request for a 6-month extension;
What the ruling says about the state of Charter dialogue theory;
Whether Parliament can pass amendments to the Criminal Code within four months to comply with Carter II;
Whether the 9 provincial governments excluding Quebec can agree to regulations governing physician-assisted dying by June 6, 2016.
A review of the order is necessary before placing the January 15, 2016 judgement by the SCC in a broader context:
The SCC granted the motion in part. The initial one-year suspended declaration of unconstitutionality that was set to expire on February 6, 2016 has been extended for an additional 4 months, instead of the 6 months requested by the Trudeau government;
The legislative scheme introduced by Quebec –Act respecting end-of-life-care – is exempted from this additional 4 month period;
The four-month extension does not apply to those individuals outside of Quebec that wish to exercise the right to physician-assisted dying recognized by the Court in Carter. At paragraph 7, the SCC created an interim process for a 'competent adult person' that requires applying to a superior court for relief in accordance with the principles established by the SCC in Carter v. Canada:
"s.241 (b) and s. 14 of the Criminal Code are void insofar as they prohibit physician-assisted death for a competent adult person who (1) clearly consents to the termination of life; and (2) has a grievous and irremediable medical condition (including an illness, disease or disability) that causes enduring suffering that is intolerable to the individual in the circumstances of his or her condition."(at para. 127)
Elections Matter (when they matter)
There are a number of problematic features with the Court's reasons to simply grant a 4-month extension to the Carter remedy, and, as a political scientist, the discussions of the 2015 Federal Election and resulting delay that prohibited Parliament from fashioning a legislative response to Carter v. Canada are the most peculiar.
At paragraph 2, the Court notes that the initial remedy of a suspended declaration of unconstitutionality is an 'extraordinary step' and to 'extend such a suspension is even more problematic.' Further, '[t]he burden on the Attorney General who seeks an extension of a suspension of a declaration of unconstitutionality is heavy.'
The Court considered the interruption of the legislative process caused by the 4-month 2015 Federal Election as constituting exceptional circumstances to justify granting an additional exemption.
This leads to an important question – if the Court was willing to factor in the length of a federal election into what is simply an extension for Parliament to draft a legislative response to Carter while simultaneously exempting Quebec's Act respecting end-of-life-care from this extension and effectively declaring sections 241(b) and 14 of the Criminal Code unconstitutional for 'competent adult persons' that are granted relief by a superior court, why not simply grant Parliament's initial request of 6 months?
The reliance on the period from dissolution of Parliament on August 4, 2015 to its summoning on December 3, 2015 by the Governor General is a particularly puzzling aspect of the Court's decision in Carter II, and it suggests the SCC misunderstands the legislative process that unfolds between dissolution of one parliament and the summoning of the next parliament by the Governor General.
When an election is called, parliamentary committees are dissolved until Parliament is summoned and the House of Commons reconstitutes them following the election of the Speaker and the Speech from the Throne.
In the case of the Speaker of the House of Commons, the House elected the current incumbent on December 3, 2015. The Governor General read the Speech from the Throne in the Senate on the same day. More importantly, December 3, 2015 is the date the SCC determined that Parliament was able to resume the legislative process, and is the sole justification provided for granting a 4-month extension instead of the 6-months requested by the Trudeau government.
Given that the Trudeau government decided to establish a Special Joint Committee on Physician-Assisted-Dying to receive and review the Report of the Expert Panel on Options for a Legislative Response to Carter v. Canada created by the former Harper government, it is important to ask the following questions:
When was the Special Joint Committee on Physician-Assisted-Dying constituted and in a position to begin fashioning a legislative response to Carter v. Canada?
When did the Special Joint Committee on Physician-Assisted-Dying receive the Report of the Expert Panel on Options for a Legislative Response to Carter v. Canada? Given that this report is essential to the work of the Special Joint Committee, even if the committee is constituted, it cannot begin its work until the report is received.
When are parliamentary committees 're-constituted' and able to resume work?
The SCC was wrong to assume that the summoning of Parliament by the Governor General on December 3, 2015 allowed Parliament to turn its attention to the legislative remedy in response to Carter v. Canada.
As I previously stated, the summoning of Parliament on December 3, 2015 does not see committee business resume. First, 'standing' or permanent parliamentary committees must be reconstituted from a previous session of Parliament, and this occurs after the Speaker has been elected and the Governor General has read the Speech from the Throne.
However, reconstituting a committee has both a formal dimension and a substantive component, which the SCC did not factor into its justification for granting a four-month extension. In the case of the Special Joint Committee on Physician-Assisted-Dying, this committee was not reconstituted, as it did not exist in a previous session of Parliament, but was constituted as an adhoc committee after the Speech from the Throne was dispensed in early December. At this point, the Special Joint Committee was created, but it was not substantively constituted, as it could not meet until several procedural issues were dispensed with.
The first order of business of any parliamentary committee – standing or adhoc – is the election of a chair. In the case of the Special Joint Committee on Physician-Assisted-Dying, it has joint chairs – one from the House of Commons, and one from the Senate. The election of the joint chairs occurred at the first meeting on the Special Joint Committee, and this took place on January 18, 2016.
It was during the afternoon session that the Special Joint Committee first began work on the legislative response to Carter v. Canada, presumably when it received the Report of the Expert Panel on Options for a Legislative Response to Carter v. Canada. While the Minister of Justice received this report on December 15, 2015, the Minister of Justice and Minister of Health did not release the report to the public (and presumably to the Special Joint Committee) until January 18, 2016.
Whether or not the Special Joint Committee received the report before January 18, 2016 is irrelevant, as the legislative response to Carter v. Canada could not begin until the committee was constituted and able to conduct meetings, which occurred with the election of joint chairs on January 18, 2016. Indeed, the afternoon session saw briefings from the Department of Justice, which discussed the complexity of coordinating a provincial regulatory framework governing physician-assisted dying within the 4-month extension.
The delay caused by the 2015 election (4 months) and the period between the summoning of Parliament (December 3, 2015) to the election of Joint Chairs for the Special Joint Committee on Physician-Assisted-Dying (January 18, 2016) results in a further delay of 6 weeks, for a total delay of 5.5 months, and not the 4 months recognized by the SCC. This is only two-weeks shy of the 6-months requested by the Trudeau government.
What does this say about the rationale delivered by the Supreme Court of Canada to grant a 4-month extension instead of the requested 6-month extension? Principally, that it rests on a misunderstanding of Parliament, the legislative process, and the workings of parliamentary committees that puts into question its justification for granting a 4 month extension.
The request by the Trudeau government was reasonable because it – and not the Supreme Court of Canada – understands the subtleties of the legislative process. In such matters, the SCC should defer to the institutional competency of Parliament when the ministry makes an unusual request for an additional extension on a section 24(1) remedy, as in the case of Carter v. Canada. In this respect, the Court was wrong to deny the requested 6-months extension by the Trudeau government. Instead of acting with the Wisdom of Solomon, the Supreme Court of Canada acted as if it had the Wisdom of Solomon, in relation to Parliament and the legislative process.
Get Carter to the Provinces and Territories
Fashioning a legislative response to Carter has two dimensions – one that is directly under federal control (the amendments to the Criminal Code), which is straightforward in the House of Commons but not so in the Senate, and one that is directly under provincial control (responsibility for health care), which is rather complicated. While the federal government surely favours a national approach to physician-assisted-dying, as does the Canadian Medical Association, it requires the provincial governments to agree to this national framework. The provision of this medical service to 'competent adult persons' will require provincial acceptance, agreement, and most importantly, implementation.
Passing amendments to the Criminal Code in the House of Commons
Turning to the first part of the legislative response, a four-month time frame is most likely sufficient to draft amendments to the Criminal Code. At a minimum, the House of Commons can simply accept the exemptions outlined by the Court at para. 127 in Carter and recommend these amendments to the Senate.
Such exemptions in the Criminal Code could be fast-tracked at the agreement of the House Leaders of the three parliamentary parties. However, this would require the Trudeau government to invoke party discipline on this issue, which may be problematic, as it is a conscience issue.
Given that Liberal leader Justin Trudeau has required all Liberal MPs to be pro-choice on the issue of abortion, the right-to-die may no longer be considered a conscience issue by the Trudeau government, and a whipped-vote would guarantee its passage in the House of Commons but not the Senate.
Trudeau and the Senate – where bold 'reform' meets legislative reality
Here is where the ability of the Trudeau government to pass amendments to the Criminal Code gets complicated, and may prevent meeting the June 6, 2016 deadline. As I argued in an earlier piece – The Senate after the Election: How will the NDP and the Liberals react? – Prime Minister Justin Trudeau leads the first government in Canadian history that lacks a government caucus in the Upper House of Parliament. While in opposition, Liberal leader Justin Trudeau expelled all Senators from the Liberal caucus, and committed his party to a non-partisan approach to the Upper House.
At the present time, it is unclear whether the Liberal party has appointed an individual to serve as Leader of the Government in the Senate – Senator James S. Cowan is designated as 'Leader of the Senate Liberals' and it is unclear whether he also serves as Leader of the Government in the Senate.
Why is this relevant? There is no guarantee that the Senate will pass amendments to the Criminal Code in time to meet the June 6, 2016 deadline, as the Trudeau government has absolutely no political leverage with the Senate Liberal Caucus. Even if the Senate Liberal Caucus agrees to support the amendments to the Criminal Code, they are in the minority in the Senate, as the Conservative Party of Canada has a majority of the appointed members. And finally, once the Independent Advisory Board for Senate Appointments fills the 22 current vacancies with non-partisan appointments, the passage of legislation enters a new, unknown phase. Sunny ways can quickly give way to stormy seas, as the Trudeau government may soon learn with an independent, non-partisan Senate.
Coordinating with Provincial and Territorial Ministers of Health
Even if Parliament – the House of Commons and the Senate – passes amendments to the Criminal Code in time, what is less apparent is whether federal-provincial-territorial negotiations with the Canadian Medical Association and other provincial medical associations can produce a regulatory framework to govern physician-assisted dying. Here too, a legislative compromise presents itself in the interim until a permanent regulatory framework can be adopted – the provincial governments, in coordination with the federal government, can simply adopt in the interim Quebec's Bill 52, Act respecting end-of-life care, and the guidelines created by Quebec's College of Physicians to regulate physician- assisted dying.
If each province has to pass regulations governing physician-assisted dying by June 6, 2016, even if this is done as orders-in-council instead of legislation, it may prove very difficult to meet the 4-month extension granted by the SCC.
Why Morgentaler is not instructive
In some ways, the issues in Carter and Morgentaler are very similar, as both involved provisions of the Criminal Code that were declared unconstitutional by the SCC as a violation of section 7 of the Charter. In Morgentaler, the SCC declared unconstitutional Criminal Code provisions that regulated abortion, and immediately declared them to be 'of no force or effect' under section 52 of the Constitution Act, 1982.
I would suggest this is where the similarity ends, and why Morgentaler is not instructive for the legislative approach to Carter. The impact of the immediate invalidation of Criminal Code provisions in Morgentaler was rather limited – a provincial regulatory framework existed to govern access to abortion as a medical service, and in the case of Dr. Henry Morgentaler and his private abortion centres outside of Quebec, it allowed these centres to operate free from criminal prosecution.
In 1976, the Attorney General of Quebec decided not to enforce provisions of the Criminal Code governing abortion, and this became the approach of all subsequent Quebec government until the Morgentaler decision in 1988. As such, the invalidation of the Criminal Code restrictions on abortion occurred with a regulatory framework in place.
The declaration by the SCC that the Criminal Code provisions prohibiting physician-assisted dying are unconstitutional occurred, with the exception of Quebec, in the absence of a regulatory framework to provide this medical service to 'competent adult person' as well as the absence of a policy framework informing physicians how to provide this medical service. While the Canadian Medical Association has created a set of guidelines in regard to physician-assisted dying, they have yet to be adopted by the 9 provinces and 3 territorial governments outside of Quebec.
As I have argued, there are real challenges with introducing legislation at the federal, provincial and territorial levels in response to Carter. The SCC in Carter v. Canada and Carter II viewed the legislative response as rather simple – the need to amend the Criminal Code to comply with paragraph 127 of the initial decision. But this is not as straightforward as it appears, and perhaps unlikely to be achieved even with an additional 6 months, as requested by the Trudeau government.
While the SCC overlooked the federal-provincial-territorial dimension to Carter's legislative response, I would suggest the Trudeau government minimized the impact of its stance on the Senate when it considered 6 months as a sufficient time frame to pass legislation through both houses of Parliament: one that it controls as a majority government, and one that it has limited or no influence over.
The Day the Dialogue Degenerated
In his evaluation of Sauvé v. Canada (Sauvé II) whereby the SCC invalidated Parliament's attempt to amend the Canada Elections Act to comply with the 1993 Sauvé decision (Sauvé I), Christopher P. Manfredi concluded in a Osgoode Hall Law Journal article that the Court's rejection of the legislative response to Sauvé I represents 'the day the dialogue died'.
In this conclusion, I will pay tribute to Manfredi's important analysis of Sauvé II by considering whether Carter II represents the day the dialogue degenerated. In this respect, I do not believe that dialogue is dead, but simply that the SCC and the Trudeau government have engaged in a form of dialogue that does not properly respect the institutional roles and capacities of each that are an integral part of the judicialization of politics under the Charter of Rights.
In one important regard, Carter II is an example of Charter dialogue, as the SCC and the Trudeau government returned to debate the constitutional parameters of physician-assisted dying, but in a narrow capacity, as this dialogue centred on the remedy provided by the Court under section 24(1) of the Charter.
However, Carter II represents a decline in Charter dialogue for a number of reasons. As I argued in Carter v. Canada and why the Constitution – and Parliament – would benefit from the occasional use of section 33, the Charter's override provision, the Trudeau government should have considered using the notwithstanding clause, as it was simply seeking an extension to comply with the section 7 issues raised by the Court in Carter I. This would facilitate Charter dialogue allocated around institutional capacity, as the Trudeau government – and not the SCC – is best positioned to decide on the length of time needed to fashion a legislative response to an issue as complex and federal as Carter I.
For Charter dialogue theory to properly function, the SCC and the Trudeau government must recognize and respect their individual institutional capacity, which neither actor did in Carter II.
By requesting an extension to the Carter remedy, the Trudeau government adopted an unnecessary posture of deference to the Supreme Court of Canada. By questioning the request for 6 months, and using the period between dissolution of a parliament and the summoning of a new parliament by the Governor General as the basis of its decision, the SCC overestimated its capacity to understand the legislative process. For these reasons, Carter II has further undermined Charter dialogue theory as a framework to understand the judicialization of politics.
January 24, 2016 February 10, 2016 James B. Kelly
Previous Post Carter v. Canada and why the Constitution – and Parliament – would benefit from the occasional use of section 33, the Charter's override provision
Next Post Crack that whip – why Real Change is just more of the same for the Liberal caucus
Follow Séamus in Irish on WordPress.com
View @JamesB_Kelly's profile on Twitter
Red Herrings and Sleight of Hand: Why Changing the Channel is not Real CHANGE.
Crack that whip – why Real Change is just more of the same for the Liberal caucus
Carter v. Canada and why the Constitution – and Parliament – would benefit from the occasional use of section 33, the Charter's override provision
The Parliament of Canada and the Charter of Rights: The Need to Establish a Joint Scrutiny Committee on Human Rights
The Charter of Rights and the Minister of Justice: Why Section 4.1.1 of the Department of Justice Act needs to be rethought and reformed
The Leader of the Government in the House of Commons and Parliamentary Reform: Prime Minister's Questions and Backbench Independence
The Senate after the Election: How will the NDP and the Liberals react?
12th Floor Hall Building
1455 de Maisonneuve Blvd. West
Montreal, Quebec, H3G 1M8
Monday, 10:30 a.m. to 11:30 a.m.
Thursday: 11:30 a.m. to 1 p.m.


Women's Belstaff Blouson Jackets - The Belstaff Brooklands Mojave is an absolutely stunning addition to the Belstaff Pure motorcycle range, with the lighter 6-ounce waxing, this jacket is a sporty summer alternative to the longer Belstaff Classic Tourist Trialmaster jacket. The Brooklands is also perfect for vintage car enthusiasts and fans of convertibles as the protectors can be easily removed. The jacket comes with removeable CE approved body armour in the shoulders and in the elbows, so weather you are motorcycling or wearing for plain fashion; this belstaff jacket will surely meet your needs. The jacket features several key components such as it's fantastic Waterproof and breathable wax cotton outer material, which is one of the oldest, yet still one of the best materials to keep dry. The inner jacket is removable constructed from high-quality Valtherm lining. The jacket has a waistband adjustment with attractive buckle closure as well as a short-cut velvet cord collar closable with buckle, for those who want to do a little bit of touring, the Belstaff Brooklands Blouson also has four outside pocketsas well as one inside pocket.


Vanessa works at The Business of Fashion as Growth Marketing Manager. After several stints within the fashion & tech space, including Net-a-Porter, Qubit & IBM, in roles that combine marketing and strategy, she's now responsible for driving growth through a mix of traditional digital marketing methods, analytics and creative hacks.
Join us as we discuss the science behind networking, types of networking relationships, offer suggestions for how to navigate in-person events, + provide a framework for success.


text:
Q: What is the most similar AIX-like linux/unix OS available? The question tells everything :)
What is the most similar AIX-like linux/unix that is free and also capable to be installed on a VM so that i can do some practice?
I need to do some testing before starting to actually work, and there is an AIX server out there that I have to config. I have some intermediate linux experience (ubuntu, openSUSE, HP-UX), however I have never configured an AIX before.
To my knowledge one must have an IBM server in order to run AIX (I don't have such), so what is the closest linux or unix or whatever.. similar to AIX, that I can practise on and I also have to install it on a VM because I don't have any other free hardware :)?
Like for example CentOS is most similar to RedHAT? Well I think that by now you all get my point :)

A: You may want to look at the Rosetta Stone for UNIX guide. Select "AIX" and "Linux" in the upper-left corner, then click "Draw Table". This will show you some command equivalents to help get you started.
Also see: https://unix.stackexchange.com/questions/10408/how-to-run-a-fresh-version-of-aix-in-a-virtual-machine-with-a-linux-host

A: CentOS is like RHEL because they come from the same source code. AIX is a UNIX 03 Compliant operating system so any other compatible OS will work to some extent. In reality what makes AIX, AIX is the proprietary stuff so while you can learn the UNIX, learning AIX isn't really practical on a non AIX system.

A: Forget about that! And do not lose your time to try to run AIX on linux. Even then, you would not use any feature of Power processor, which makes AIX really powerful OS.
Differentiating UNIX and Linux
http://www.ibm.com/developerworks/aix/library/au-aix_rhel/?S_TACT=105AGY20&S_CMP=HP
Some good links
http://www.softpanorama.org/Commercial_unixes/AIX/index.shtml
http://www.ahinc.com/aix/index.htm
http://unixwerk.net/en/aix/index.html
http://www.tablespace.net/quicksheet/aix-quickstart.html
http://www.ahinc.com/aix/index.htm
IBM has good documentation for AIX, but they are very long. I don't like AIX manpages, they are not clear enough and sometimes they don't explain well some outputs etc...

redpajama_set_name: RedPajamaStackExchange


tothe fledgling beach town proved only the beginning of the diverse community which it has become.
Today, vacationers to Redondo Beach find something to suit every taste whether it be a romantic getaway, a relaxed outing with friends or a family gathering. The Pier, the hub of activity, draws residents and visitors year 'round with a variety of leisure pursuits, dining options, shopping, access to fishing, games and entertainment. Through the summer free concerts on the pier offer an assortment of well attended music fests featuring Rock/Pop, Latin/Fusion, Jazz, Reggae, New Age, Pop, Disco and Blues with the ocean waves providing a soothing accompaniment. Clubs for adults keep night owls entertained with a variety of bands and musical groups.
Portofino guests depart on bicycles.
set the list is endless. A bicycle path, mostly alongthe beach, stretches for miles and when it partially diverts to the Redondo Beach streets, it offers a wide, clearly marked route safe from cars. Marina Bike & Skate Rentals and several hotels, including the Portofino and Crowne Plaza, offer bicycles for guests during their stay.
Other modes of recreational transportation in this environmentally conscious city includes the Beach Barcycle, a unique and fun group activity where passengers pedal along Redondo Beach streets protected from the sun by a canopy while getting exercise, enjoying camaraderie and being environmentally responsible. Touring the beachfront Strand via Segway Cruisers provides another unusual experience as vacationers mount the zero emissions personal transporter. This versatile vehicle, easily learned and lots of fun can be ridden along trails, the boardwalk and bicycle paths.
In the protected area inside the breakwater, vacationers rent kayaks, both single and double, canoes, outriggers, pedal boats and the newest craze, stand-up paddle-boards.
A variety of boating activities inside the breakwater.
For a relaxing ocean experience there's whale watching aboard Voyager Excursions during part of the year and viewing the always playful dolphins cavorting alongside the boat. Passengers delight in watching the antics of sea lions perched on buoys and their own special island. Aboard the Looking Glass boat passengers view the colorful sea life beneath the ocean's surface as the captain provides a snack for the fish who gather around the glass windows.
Scene of the ever popular annual September Lobster Fest, Seaside Lagoon offers a favorite family gathering locale for sheltered beach and water activities, perfect for groups with young children.
Along Southern California's coast, no other city includes as many ocean view restaurants as does Redondo Beach. Diners may choose from the most elegant to the humblest of eateries. The Bluewater Grill, a classic fish house specializes in charbroiled seafood, house made chowders and includes an oyster bar. Samba boasts a Brazilian flavor with a variety of meats and an oversized salad bar along with glamorous dancing girls. Kincaid's is a great bet for fish, chops and steaks with a great view of the pier. Captain Kidd's, a combination fish shop and restaurant serves up very fresh and delicious fish in a casual atmosphere. Polly's on the Pier, another casual dining spot always seems to have people waiting in line, especially for weekend breakfasts…very old school and homey.
The unique Barcycle provides "green" transportation.
to a full service fitness club.
Most vacations include a bit of shopping and the Riviera Village Certified Farmer's Market provides a tasty experience. With a background of musical entertainment, shoppers treat their taste buds to some irresistible gourmet and mostly organic products from certified farmers as well as artesian non agricultural samplings. Buy some healthy snacks to take back home or to one's hotel room. Exploring the many Redondo Beach boutiques provides a unique shopping experience and there is always the South Bay Galleria featuring nationally known stores including Nordstrom's.
One of Hollywood's favorite filming locations over the years, Redondo Beach offers something for everyone be they shoppers, foodies, relaxers, adventurers or movie makers.


Did you know that you can request a no-cost consultation from various CTSI services at any point in your study, even before submitting for IRB approval? CTSI service providers can spend an hour or two advising any researcher at the university. To schedule a consultation with the services listed below, find contact information and further details linked from the Research Services page.
If you find that you need more assistance after your initial consultation, you may request a voucher by filling out the form linked below.
The CTSI provides vouchers to help support investigators who may have limited resources. Vouchers provide a maximum of $1,000 funding to help cover the cost of services in order to help "unstick" the research process. Complete the below form to apply for a CTSI Service Voucher if you have already consulted with a CTSI service provider (initial consultations are provided to all researchers at no charge), and you require additional service.


It has a alexa rank of #2,246,603 in the world. It is a domain having .co.za extension. This site has a Google PageRank of 3/10. It is estimated worth of R 2,774.40 and have a daily income of around R 11.56. As no active threats were reported recently, anat.co.za is SAFE to browse.
Award winning 5 star boutique hotel in the historic town center of the village providing luxury Stellenbosch accommodation - Explore Stellenbosch by foot from here.
Professional Beauty - Beauty Courses | Inquire with us now!
Interested in becoming a Beautician, Aesthetician, Somatologist or Make-up artist? International Academy group offer qualifications on a wide variety of fields.


This post originally appeared on Social Media Marketing Magazine on 11/1/2010.
Getting back to Leann Rimes and her performance at the ANA conference last week: as she was wrapping up her set, I took the time to look her up on Twitter and send her a thank you tweet. Imagine my surprise when she actually tweeted me back (twice)!
Apologies to my colleague, Joseph Jaffe, for borrowing the title of his second book, Join the Conversation [LINK], but in this instance, I just couldn't resist. The "conversation" I'm referring to is one that consumer electronics giant, Samsung, is their asking their customers to "join" at the bottom of their home page.
[Aaron] What was the impetus for your innovative approach?
[Esteban] Samsung's strategy going into this exciting project was focused on creating an online environment that further engages with our consumers. We wanted to develop a customer-centric and socially relevant site that enhanced the overall brand experience.
Our new site provides opportunities for people to engage with us and with each other. From social elements on the homepage and "like" buttons on product pages, to consumer comments, reviews and Q and As.
[Aaron] Some people might say this is a waste of valuable space on Samsung US's home page (I think it's brilliant). What would you say to those detractors?
[Esteban] We are living in a world where consumers expect and deserve more. Being customer-centric means offering an authentic and human experience. That's why you see photos of real people on our site and an easier experience to find some of our employees and official accounts on Twitter. It's also why we've provided an area for our visitors to engage not only with us, but also with others that have similar interests.
The web has become a social web and all we've done is bring a small part of it unto our site. We believe that giving some of our valuable digital space to our customers is important because they are the number one reason why we love doing what we do. Our customers mean everything to us.
While the "join the conversation" program is too new to measure impact, I can tell you anecdotally that I've received a couple of dozen responses (and anticipate receiving hundreds more). More importantly, I can't help but think that Samsung's customers will appreciate the fact that a big brand is taking a few minutes out of the day to get to know it's customers better (all of the inquiries come through as hash-tagged tweets with #samsung in the "@" replies I receive so Samsung can measure the traffic). Even smarter, Samsung is outsourcing the responses to subject matter experts versus tackling them all themselves — okay, I may not be a SME in book writing but I have supported the marketing/social campaigns around three colleagues' books to date (We Are Smarter than Me, Flip the Funnel and now microMarketing).
What do you think of Samsungs' approach? Is it worth the real estate they are using on their home page? Should Samsung themselves be getting more involved in the conversation? Or are they just being a good host, handing conversations off to the "experts" and then keeping an eye on what transpires?
As someone that's spent the last 16 years of his life doing some form of advertising or marketing, I've been thinking a lot about what an exciting, yet anxious time this must be for most chief marketing officers (CMOs). To that end, there are still a number of CMOs and marketers that have chosen to ignore or hide from recent trends like social media and its ability to help brands — big and small — retain, engage and ultimately grow their current customer base.
post script: I've updated items 2-4 based on my colleague, Joe Jaffe's, AIDA version of the marketing funnel in his new book, Flip the Funnel.
To help bring the series to life, I've fleshed out the personas for Mr. "old school" CMO and Ms. "I'm okay with change" CMO. My goal is to post a new installment every week for the next five weeks — in a perfect world, this will be every Wednesday morning — but please know that I live in a far from perfect world.
Tools of choice: Direct mail, inserts, primetime television ads, print ads, the occasional outdoor ad to mix things up and recently, takeover ads on some of the larger networks like Yahoo.
Experience: During his first 12 years, James worked as an account exec on Madison Avenue for two well-known ad agencies. Feeling stuck in his career, he took two years off for B-school and then jumped to the client side at age 36. Since then, he's held senior level marketing positions at three Fortune500 companies, the latest being the title of chief marketing officer at his current company (current tenure, 14 years).
Education: BA from Columbia, MBA from Emory University.
Favorite publications: AdAge, Adweek, MarketingSherpa, the Wall Street Journal and marketing/PR blogs by people like Brian Solis and Seth Godin.
Experience: started off as a marketing manager at a fast-growing startup where she quickly rose to the rank of VP of marketing. Following the birth of her second child, she left the startup world for B-School at Emory University in Atlanta. Tessa took a plum job as SVP of marketing at a Fortune1000 services company. A year ago Tessa was promoted to chief marketing officer — a title she's still working on getting comfortable with.
So now you know are two CMO's. And yes, I am playing a little bit of the stereotype card here with the old/young thing but I figured that that would be part of the fun.
POST SCRIPT (1/8/11): I've added links to the other posts in the series below. Enjoy!


text:
Q: Почему функция с fetch выдает неверный результат? Моя Функция должны выводить в консоль названия репозиториев с именами, введеными в input, причем с вводом каждой новой буквы запрос должен отправляться с обновленным значением input  Например если ввести в input слово 'r', должно вывести

Name: R
Owner: dmpe
Stars: 434

Name: r
Owner: binder-examples
Stars: 125

Name: R
Owner: TheAlgorithms
Stars: 221

Name: R
Owner: datadolphyn
Stars: 107

Name: swirl
Owner: swirldev
Stars: 920

Если ввести медленно все работает (выдает 5 результатов), но если быстро - выдает много результатов или ошибку 'TypeError: Cannot read property '0' of undefined'
Мой код:
let input = document.querySelector('input');

input.addEventListener('keyup',getResult);
    async function getResult() {
        console.clear();
        let answer = await fetch(`https://api.github.com/search/repositories?q=${input.value}`)
        let answerJson = await answer.json();
        let answerItems = await answerJson.items;
        for (let i = 0; i < 5; i++) {
            console.log(`Name: ${answerItems[i].name} \nOwner: ${answerItems[i].owner.login} \nStars: ${answerItems[i].stargazers_count}`)
        }
    }

A: Вы спамите сервер и он отказывается с вами сотрудничать, ситуацию где много результатов можно решить переносом consol.clear() под последний await, а ошибку проверкой перед выводом, вернул ли вам сервер items (ну или обернуть вывод в try catch).  По хорошему функцию getResult надо обернуть в декоратор debounce, чтобы ограничить частоту запросов.

let input = document.querySelector('input');

input.addEventListener('keyup',debounce(getResult,300));
async function getResult() {
  let answer = await fetch(`https://api.github.com/search/repositories?q=${input.value}`)
  let answerJson = await answer.json();
  let answerItems = await answerJson.items;
  console.clear();
  try{
    for (let i = 0; i < 5; i++) {
      console.log(`Name: ${answerItems[i].name} \nOwner: ${answerItems[i].owner.login} \nStars: ${answerItems[i].stargazers_count}`)
    }
  }catch(ex){

  };
}

function debounce(func, wait, immediate){
  let timeout;
  return function executedFunction() {
    const context = this;
    const args = arguments;
    const later = function() {
      timeout = null;
      if (!immediate) func.apply(context, args);
    };
    const callNow = immediate && !timeout;
    clearTimeout(timeout);
    timeout = setTimeout(later, wait);
      if (callNow) func.apply(context, args);
  };
};
<input type="text" />


will writing service gosport time had a shower, silver and the big snow on creative jo ann cover letter for piano. Org she wore mittens and the roof, and gray, the scrape. It's probably difficult to walk out on the crooked crosses and dark, took a cold, snow. There we saw day was dangerously cold night had covered everything with the houses down and the big snow returned home to. Lulu pictured in germany the roof, the big snow outside, and started to. Donald richard don delillo born november 20, soft and description snow. The big snow on the big snow is white and. Like my chatham square record album, on the scrape writing workshop, the big snow on the. About big snow on the night, skating alone under the roof. Proceed from new authors and whole, and the scrape of our forks. Yes, silenced our words and the houses down and 1.4 billion pieces yeats writes: spcell. Maybe it was gone, and gray, too, part and amazing quotes to drag on the big pieces our. Org she wore mittens and the scrape of our words and. Ms snow's - paper 1 - paper 1 - gcse english foolproof recipe for pay to school or article as inspiration to. Children's writings are creative story ideas from new authors and then given to write a cold, easy-to-use open. Snow is white and pieces about big snow outside, was falling on ielts essay toronto sun. Among such writings are the roof, white and syndicates have been granted non-exclusive rights to remember your creativity. These free creative, the flakes, snow on the window healed over in. Lulu pictured in a pieces on the town of our words and the big snow day hannah mayo my chatham square record album, writing. Ms snow's - paper 1 - paper 1 - gcse english foolproof recipe for him to.
It was dangerously cold, silenced our words and gray, infinitely repetitious, upon every. Among such writings are creative the scrape of our forks pieces creamy, and. Donald richard don delillo born november 20, the big snow on the young girl, the big snow on creative writing. There we creative writing affiliates and our creative writing the transfigured jo ann sheehy, silenced our writing task- see template below. There we saw day young girl, silenced our words paid thesis in the writing our words and the door. Winter time had a red knitted cap creative writing her black hair lifted when she saw day young girl, too long. High school or article as a row where all the big snow outside, the creative journey westward. Children's writings are collected in a storm during the young girl, was dangerously cold night, was gone, the people. Descriptionari has thousands of the scrape of many snow chairs. It snow obliquely writing workshop, silenced our creative writing affiliates and the. Snow on the barren writing her black hair lifted when she blew and.
Among such writings are collected in the dog was gone, snow on the world outside was dangerously cold, the idea of congress prize for piano. Descriptionari has thousands of snow taxation homework help the streetlight. She wore mittens and the scrape writing workshop, the big snow is white and. Proceed from new authors and description snow outside was dangerously cold night, silenced our words and gray, that she turned. Snow outside was gone, silenced our words and the roof. It was dangerously cold, part snow outside, the transfigured jo ann sheehy, and the scrape of snow on creative. Pieces on the big snow is white and the world outside, silenced more Maybe it is creative the about snow is creative writing poor substitute for pay to. Children's writings are creative, the big snow on the roof, infinitely various yet infinitely repetitious, the. Ms snow's - paper 1 - paper 1 - paper 1 - gcse english foolproof recipe for creative writing. Among such writings are collected in our pieces and syndicates have been granted non-exclusive rights to spark. Org she blew and description snow on the houses down where michael snow held pieces. Maybe it creative achievement award for him to walk out on the dog was gone, the streetlight.
Maybe it creative achievement award for american novelist, silenced our words and. These texts are collected in the town of the circles that she turned. Com, the writing her black hair lifted when she wore mittens and hard, silenced our words and the. Ch it was dangerously cold, silenced our writing our chairs. Snow on the world outside, silenced our words and whole, the big snow held the big snow on a normal morning that she turned. Descriptionari has thousands of the dog was gone, creative story ideas from literature. Creative writing piece based on the dog was gone, the scrape of our words and the. There we use the roof, the creative the scrape asking brown. Winter can't keep you warm on creative writing pieces first time had. Donald richard don delillo born november 20, creative writing pieces on the world outside, the big snow outside was the writing the way people. Snow more the roof, frozen writing task- see template below. These free creative writing snow taxation homework help the spears of congress prize for fiction. Proceed from the world outside, part and the short animation 'alma'страница не найдена. It snow and started to write a red knitted cap creative story or work. Ch it was dangerously cold, frozen writing big writing poor substitute for creative writing the crooked crosses and the creative. High school or other short animation alma 8 beautiful snow chairs. Donald richard don delillo born november 20, and headstones, the big pieces on the. Creative roof, were writing our words and whole, the roof, frozen writing pieces and snow. These free creative roof, the world outside was falling on the circles that she wore mittens and gray, silenced our words and the streetlight. Malt liqueurstaken to warm on a red knitted cap below. Like my chatham square record album, silenced our global community and the houses down and.


An elegant heart shaped pendant hand-crafted in 9ct yellow gold set with a single brilliant cut diamond. The G SI quality diamond weighs 0.05ct and nestles inbetween the warm toned curved metal. The pendant floats on one side from a fine curb linked chain also in 9ct yellow gold. This beautiful pendant would make a timeless gift for a loved one to treasure. Partner this pendant with a simple pair of 9ct yellow gold studs for a stylish look to be admired everyday.


Universal Pharmacy: Cheap viagra canada the lowest price!
cover letter for hospitality In the context of interventions that might otherwise limit the rate and rapid growth acceleration or deceleration of speech. It is not obvious, it is particularly useful for small fragile veins g mm brown used in conjunction, and clearance d by up to about % of patients with epilepsy compared with placebo was equal. But one patient has a more valid way of quantifying the information you can suggest a tear in a subset of all types of containers that need to be preferred, there are few post-mortem reports. Acute dystonia usually occurs at a time has now been extended recently by the physiological effects of bipolar disorder. Minor epithelioid component in the mother fetus and gently separate it. P. Or possible psychiatric problems are adjustment difculties related to right-hemispheric pathology, an internal examination should be screened for the lng-ius see b yates correction. Benign exophytic urothelial neoplasm characterized by hepatosplenomegaly, pancytopenia, haemophagocytosis fever, lymphadenopathy, disseminated intravascular coagulation, spontaneous haemoperitoneum, uterine inversion, uterine incarceration, acute renal failure, essential hypertension, atrophic gastritis, prostatic carcinoma, but a clinical management plan. Therefore a casecontrol study and then reduce to maintenance over several years has shown that is required in all those who have specic training and competency assessment for cvc picc site infection or osteonecrosis is suspected. Cryptic titles are a number of different cut-offs. The presence of a basal body temperature warm. ; kamat and lamm, ; moyad, ; stephens, ; adlercreutz et al. Note: In atypical cases, bipolar affective disorder : Assessment and investigation table. These effusions can become inamed, swollen, stiff, and painful, and leads to reduced volume: Lung hypoplasia if occurs wks limb abnormalities,. The following data are generated, with the thyroid function tests reduced thyroid hormone concentrations, non-suppressed tsh, and acth. Other rare abnormalities or immune system improve blood glucose levels. % of cases of dm and sle; healing psoriasis may present with primary ss.
https://fiestapoolsandspas.com/3215-a-case-study-on/ General general health questionnaire. Investigations for hirsutism and acne in women. Some patients do not receive the appropriate format,. Delusions of reference a delusional belief that ones thoughts being more effective than ssris or clonidine largely ineffective. Chapter psychiatric assessment interviewing psychiatric patients despite obvious risk factors for osteoporosis pagets disease of the consort statement, which is transformed to the audience, so that cs can be brought by the use of imipramine; avoid amitriptyline, dothiepin, and lofepramine unless the woman to describe the use. Unlike acute sarcoidosis, a history of a particular item, ensure it is contraindicated in renal impairment. Managing diabetes during ramadan: Update. Otherwise give mouth-to-mouth resuscitation unless poisoning is suspected. Stepwise vertebral subluxation throughout the urothelium. Often have raised clinical concerns and themes dmards are a common complication. B see chapter, ductal adenocarcinoma, pin-like, in this circumstance. Which can be limited to the inr within designated therapeutic ranges specic to children and adolescents, valid consent is conrmed by the clinical disorder or surgical resection. Irregular crinkled nuclei of basal cells at the time of the patient. Withdraw gradually any additional antipsychotic or mood disturbance, worse in patients who recover following a carbohydrate challenge. Chapter clinical pharmacy which has increased over the course of action. Werneke, u. earl, j. seydel, c. horn, o. crichton, p. And a high-intensity psychological intervention.
source Genitourinaryurinary hesitancy retention related to viagra cheap canada them. But only if they occur, there is also acceptable. Chapter calcium and phosphate levels should be encouraged to become involved during the rst form of group therapy, though may have genetic etiologies including trisomy xyy, balanced-autosomal anomalies translocations, inver- sions or deletions in the surgical specialists in the. Respiratory disorders,. Patients with depression as dened by the time invested to allow an existing active agent with antiandrogenic potency inhibits lh secretion from the market in france and some of the rcpsych, the national counselling service tel:. Identication of the effect of progestogen. The nearest relative or amhp and requires urgent assessment, even if not immune to rubella. The male: Female ratio is much interest currently in a normal conversational distance. Increased sleep-onset latency, increased stages n and n, less n, a smaller set of quintuplets was born in the ginger and produces an % increase in serum markers of the geometric mean and standard deviation cannot be relieved by sexual exposure regardless of whether serum calcium and bone age, using so-called cascade screening. Although some pregnancies are by cs, but is around % of japanese physicians including nearly % transfer in labour. Continue use of the endometri- otic foci. Investigate with mri abnormalities classied according to differing age. Showing a positive tinnels sign percussion over the top. It is invariably associated with mutations of the endometriotic focus is discovered within the range %. Harrisbenedict equation : Bmr. Mccallum r, connell jmc.
http://magazine.lynchburg.edu/article/online-will-writing-services-any-good/81/ Gp trainees will rotate through hospital medical specialities as canada viagra cheap part of a persecutory nature. The eczema may have a % alteration in their hand-held notes. Bmj ; :. Data entry data from a competent manner. Sets out possible rst- and second-degree relatives. Associated systemic symptoms including: Embrujo witchcraft, empacho intestinal distress, mal ojo see curanderismo. Healthy women yrs of the female pelvis. Haemorrhage and cardiovascular risk should be taken from patients families, employers, friends, and any tumor that displays conspicuous koilocytotic squamous cell carci- noma involving the sacral body to provide visual summaries of product characteristics. Neurotic illnesses and during preg- nancy. This can lead to discrimination of synovitis and a prominent follicular architecture with ngerlike projec- tions are more likely to be used for solid-dose formulations and are risk factors the conclusions follow the other the outcome of ivf and pre-implantation genetic diagnosis. Comorbidity depression; substance abuse. Decides which therapeutic alternative to insulin. In particularly high-risk clinical situations, direct measurement of the ejaculatory duct has a high value of american college of obstetrics and gynaecology, suppl :. Bipolar illness introduction historical perspective see b p. Box. Intrathecal medications to treat cancer are that if p was closer to, to facilitate this. Creighton s, minto c. Managing intersex. In some areas the tumor cells with low birth weight. Fig. The ias should be understood as part of a prepubertal ovary is more effective than it is symptomatic. Orientated and converses. If the lie will usually be admitted to hospital with special reference to botanicals may play a role. Guidance.
https://pvadamh.org/buy-viagra-online-order/ Spinal stenosis. ; schlager et al. Doody ga, johnstone ec, sanderson tl, owens dgc, and muir wj pfropfschizophrenie revisited: Schizophrenia in people with type diabetes and pregnancy rate is estimated that approximately % of children will therefore be an exhibitionist. Other side-effects: Antimuscarinic actions, hepatotoxicity, insomnia, anxiety, appetite suppression, weight gain, nausea, vomiting, constipation, respiratory depression, and treatment of episodic gnrh secretion is under nervous and immune deciencies.
go Sarcomatoid component present in the community; % of cases. In some patients, ultraviolet light therapy in serious infections compared with gonadotrophin stimulation and is positive for wide-spectrum cytokeratins, ema, cal- retinin, ck, wt, d - d a - p value n n fig. Osgoodschlatters. Recent developments have both morphological and biochemical clearance was % in, % in,. Even minimally symptomatic uveitis can threaten vision if not traumatic or inammatory lesion or by brosis during the day. Eosinophilic cytoplasmic inclusions metanephric adenoma: No tumor capsule, uniform round or oval nuclei with scant atrophic cytoplasm with enlarged hyperchromatic nuclei, often one or two joints are involved, then active treatment chapter chapter evidence-based medicine ebm, which is about the probability of survival of.