text:
package ua.com.fielden.platform.domaintree.impl;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import ua.com.fielden.platform.domaintree.Function;
import ua.com.fielden.platform.domaintree.ICalculatedProperty.CalculatedPropertyAttribute;
import ua.com.fielden.platform.domaintree.IDomainTreeManager.IDomainTreeManagerAndEnhancer;
import ua.com.fielden.platform.domaintree.testing.DomainTreeManagerAndEnhancer1;
import ua.com.fielden.platform.domaintree.testing.MasterEntity;
import ua.com.fielden.platform.domaintree.testing.MasterEntityForIncludedPropertiesLogic;
import ua.com.fielden.platform.entity.annotation.IsProperty;
import ua.com.fielden.platform.reflection.PropertyTypeDeterminator;

/**
 * A test for base TG domain tree representation.
 *
 * @author TG Team
 *
 */
public class AbstractDomainTreeRepresentationAndEnhancerTest extends AbstractDomainTreeTest {
    ///////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////// Test initialisation ///////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////////////////////////
    private int i, j;

    @Override
    protected IDomainTreeManagerAndEnhancer dtm() {
        return (IDomainTreeManagerAndEnhancer) just_a_dtm();
    }

    @BeforeClass
    public static void initDomainTreeTest() throws Exception {
        initialiseDomainTreeTest(AbstractDomainTreeRepresentationAndEnhancerTest.class);
    }

    protected static Object createDtm_for_AbstractDomainTreeRepresentationAndEnhancerTest() {
        return new DomainTreeManagerAndEnhancer1(factory(), createRootTypes_for_AbstractDomainTreeRepresentationAndEnhancerTest());
    }

    protected static Object createIrrelevantDtm_for_AbstractDomainTreeRepresentationAndEnhancerTest() {
        return null;
    }

    protected static Set<Class<?>> createRootTypes_for_AbstractDomainTreeRepresentationAndEnhancerTest() {
        final Set<Class<?>> rootTypes = new HashSet<>(createRootTypes_for_AbstractDomainTreeTest());
        return rootTypes;
    }

    protected static void manageTestingDTM_for_AbstractDomainTreeRepresentationAndEnhancerTest(final Object obj) {
        final IDomainTreeManagerAndEnhancer dtmae = (IDomainTreeManagerAndEnhancer) obj;

        manageTestingDTM_for_AbstractDomainTreeTest(dtmae.getRepresentation());

        allLevelsWithoutCollections(new IAction() {
            @Override
            public void action(final String name) {
                dtmae.getEnhancer().addCalculatedProperty(MasterEntity.class, name, "1 * integerProp", "Calc integer prop", "Desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
                dtmae.getEnhancer().apply();
            }
        }, "");
        dtmae.getFirstTick().checkedProperties(MasterEntity.class);
        dtmae.getSecondTick().checkedProperties(MasterEntity.class);
    }

    protected static void performAfterDeserialisationProcess_for_AbstractDomainTreeRepresentationAndEnhancerTest(final Object obj) {
    }

    protected static void assertInnerCrossReferences_for_AbstractDomainTreeRepresentationAndEnhancerTest(final Object obj) {
        final AbstractDomainTreeManagerAndEnhancer dtmae = (AbstractDomainTreeManagerAndEnhancer) obj;
        final AbstractDomainTreeManager dtm = (AbstractDomainTreeManager) dtmae.base();
        AbstractDomainTreeManagerTest.assertInnerCrossReferences_for_AbstractDomainTreeManagerTest(dtm);
    }

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////// End of Test initialisation ////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////////////////////////

    ////////////////////////////////////////////////////////////////
    ////////////////////// 1. Excluding logic //////////////////////
    ////////////////////////////////////////////////////////////////
    @Test
    public void test_that_domain_changes_for_First_Level_are_correctly_reflected_in_Included_properties() {
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property").toString(), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class).toString());
        dtm().getEnhancer().addCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "", "2 * integerProp", "Prop1", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property", "prop1").toString(), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class).toString());
        dtm().getEnhancer().removeCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "prop1");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property").toString(), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class).toString());
    }

    @Ignore
    @Test
    public void test_that_domain_changes_for_First_Level_COLLECTIONS_are_correctly_reflected_in_Included_properties() {
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        dtm().getEnhancer().addCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "entityPropCollection", "2 * integerProp", "Prop1", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.integerProp", "entityPropCollection.moneyProp", "entityPropCollection.prop1"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));

        PropertyTypeDeterminator.determinePropertyType(dtm().getEnhancer().getManagedType(MasterEntityForIncludedPropertiesLogic.class), "entityPropCollection.prop1");

        dtm().getEnhancer().getCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "entityPropCollection.prop1").setAttribute(CalculatedPropertyAttribute.ALL);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.integerProp", "entityPropCollection.moneyProp", "entityPropCollection.prop1").toString(), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class).toString());
    }

    @Ignore
    @Test
    public void test_that_domain_changes_for_Second_Level_are_correctly_reflected_in_Included_properties() {
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        dtm().getEnhancer().addCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "entityProp", "2 * integerProp", "Prop1", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.integerProp", "entityProp.moneyProp", "entityProp.prop1", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));

        dtm().getEnhancer().addCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "entityProp", "2 * integerProp", "Prop2", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.integerProp", "entityProp.moneyProp", "entityProp.prop1", "entityProp.prop2", "entityPropCollection", "entityPropCollection.dummy-property").toString(), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class).toString());
        dtm().getEnhancer().removeCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "entityProp.prop1");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.integerProp", "entityProp.moneyProp", "entityProp.prop2", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        dtm().getEnhancer().removeCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "entityProp.prop2");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.integerProp", "entityProp.moneyProp", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
    }

    @Ignore
    @Test
    public void test_that_domain_changes_for_Second_Level_circular_properties_are_correctly_reflected_in_Included_properties() {
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));

        dtm().getEnhancer().addCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "entityPropOfSelfType", "2 * integerProp", "Prop1", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();

        assertTrue("Should be excluded.", dtm().getRepresentation().isExcludedImmutably(MasterEntityForIncludedPropertiesLogic.class, "entityPropOfSelfType.entityProp.keyPartProp"));

        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.desc", "entityPropOfSelfType.integerProp", "entityPropOfSelfType.entityPropOfSelfType", "entityPropOfSelfType.entityPropOfSelfType.dummy-property", "entityPropOfSelfType.entityProp", "entityPropOfSelfType.entityProp.dummy-property", "entityPropOfSelfType.entityPropCollection", "entityPropOfSelfType.entityPropCollection.dummy-property", "entityPropOfSelfType.prop1", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property").toString(), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class).toString());
    }

    @Test
    public void test_that_domain_changes_for_property_removal_are_correctly_reflected_in_Included_properties_with_resetting_of_the_meta_state() {
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        dtm().getEnhancer().addCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "", "2 * integerProp", "Prop1", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property", "prop1"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        dtm().getFirstTick().check(MasterEntityForIncludedPropertiesLogic.class, "prop1", true);

        dtm().getEnhancer().removeCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "prop1");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
    }

    @Test
    @Ignore("Ignored due to the removal of support for listeners. Need to revisit.")
    public void test_that_domain_changes_for_calc_property_modifications_are_correctly_reflected_in_Included_properties() {
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        dtm().getEnhancer().addCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "", "2 * integerProp", "Prop1", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property", "prop1"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        dtm().getFirstTick().check(MasterEntityForIncludedPropertiesLogic.class, "prop1", true);
        dtm().getSecondTick().check(MasterEntityForIncludedPropertiesLogic.class, "prop1", true);

        // minor change which should do nothing with meta-state
        dtm().getEnhancer().getCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "prop1").setDesc("Changed desc");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property", "prop1"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        assertTrue("Should be unchanged.", dtm().getFirstTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop1"));
        assertTrue("Should be unchanged.", dtm().getSecondTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop1"));

        // minor change which should do nothing with meta-state
        dtm().getEnhancer().getCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "prop1").setOriginationProperty("moneyProp");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property", "prop1"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        assertTrue("Should be unchanged.", dtm().getFirstTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop1"));
        assertTrue("Should be unchanged.", dtm().getSecondTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop1"));

        // minor change which should do nothing with meta-state
        dtm().getEnhancer().getCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "prop1").setContextualExpression("3 * moneyProp");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property", "prop1"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        assertTrue("Should be unchanged.", dtm().getFirstTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop1"));
        assertTrue("Should be unchanged.", dtm().getSecondTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop1"));

        // at this stage -- title change is treated as "significant"
        dtm().getEnhancer().getCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "prop1").setTitle("Prop 2");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property", "prop2"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        assertFalse("Should be unchanged.", dtm().getFirstTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop2"));
        assertFalse("Should be unchanged.", dtm().getSecondTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop2"));

        dtm().getEnhancer().getCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "prop2").setTitle("Prop 1");
        dtm().getEnhancer().apply();
        dtm().getFirstTick().check(MasterEntityForIncludedPropertiesLogic.class, "prop1", true);
        dtm().getSecondTick().check(MasterEntityForIncludedPropertiesLogic.class, "prop1", true);

        // significant change which should reset+update meta-state
        dtm().getEnhancer().getCalculatedProperty(MasterEntityForIncludedPropertiesLogic.class, "prop1").setContextualExpression("MAX(2 * integerProp)");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property", "prop1"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
        assertFalse("Should be resetted.", dtm().getFirstTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop1"));
        assertFalse("Should be resetted.", dtm().getSecondTick().isChecked(MasterEntityForIncludedPropertiesLogic.class, "prop1"));
    }

    @Test
    public void test_that_Included_Properties_are_correct() throws Exception {
        assertEquals("Incorrect included properties.", Arrays.asList("", "desc", "integerProp", "entityPropOfSelfType", "entityPropOfSelfType.dummy-property", "entityProp", "entityProp.dummy-property", "entityPropCollection", "entityPropCollection.dummy-property"), dtm().getRepresentation().includedProperties(MasterEntityForIncludedPropertiesLogic.class));
    }

    ////////////////////////////////////////////////////////////////////
    ////////////////////// 6. Available functions.//////////////////////
    ////////////////////////////////////////////////////////////////////
    protected List<Function> enhanceFunctionsWithCollectionalAttributes(final List<Function> functions) {
        final List<Function> newFunctions = new ArrayList<>(functions);
        newFunctions.add(Function.ALL);
        newFunctions.add(Function.ANY);
        return newFunctions;
    }

    @Test
    public void test_that_integer_calculated_property_has_functions_with_Count_Distinct() {
        // Check whether count distinct function can be applied to calculated property of CalculatedPropertyCategory.EXPRESSION based on date property.
        final String m = "Available functions are incorrect.";
        allLevelsWithoutCollections(new IAction() {
            @Override
            public void action(final String name) {
                dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, name, "YEAR(dateProp)", "Integer Prop Originated From Date", "desc", CalculatedPropertyAttribute.NO_ATTR, "dateProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
                dtm().getEnhancer().apply();
                assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, AbstractDomainTreeTest.name(name, "integerPropOriginatedFromDate"))));
            }
        }, ""); // integerPropOriginatedFromDate

        // Check whether count distinct function can be applied to calculated property of CalculatedPropertyCategory.COLLECTIONAL_EXPRESSION based on date property.
        allLevelsWithCollections(new IAction() {
            @Override
            public void action(final String name) {
                dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, name, "YEAR(dateProp)", "Integer Prop Originated From Date", "desc", CalculatedPropertyAttribute.NO_ATTR, "dateProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
                dtm().getEnhancer().apply();
                assertEquals(m, enhanceFunctionsWithCollectionalAttributes(Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX)), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, AbstractDomainTreeTest.name(name, "integerPropOriginatedFromDate"))));
            }
        }, ""); // integerPropOriginatedFromDate

        // TODO // Check whether count distinct function can be applied to calculated property of CalculatedPropertyCategory.AGGREGATED_COLLECTIONAL_EXPRESSION type based on entity property.
        // TODO dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "collection", "COUNT(entityProp)", "Calc From Entity Prop 1", "desc", CalculatedPropertyAttribute.NO_ATTR, "entityProp");
        // TODO dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.collection", "COUNT(entityProp)", "Calc From Entity Prop 2", "desc", CalculatedPropertyAttribute.NO_ATTR, "entityProp");
        // TODO dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.collection.slaveEntityProp", "COUNT(entityProp)", "Calc From Entity Prop 3", "desc", CalculatedPropertyAttribute.NO_ATTR, "entityProp");
        // TODO dtm().getEnhancer().apply();
        // TODO assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<Function>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "calcFromEntityProp1")));
        // TODO assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<Function>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.calcFromEntityProp2")));
        // TODO assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<Function>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.calcFromEntityProp3")));
        //
        // TODO // Check whether count distinct function can be applied to calculated property of CalculatedPropertyCategory.AGGREGATED_COLLECTIONAL_EXPRESSION type based on boolean property.
        // TODO dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "collection", "COUNT(booleanProp)", "Calc From Boolean Prop 1", "desc", CalculatedPropertyAttribute.NO_ATTR, "booleanProp");
        // TODO dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.collection", "COUNT(booleanProp)", "Calc From Boolean Prop 2", "desc", CalculatedPropertyAttribute.NO_ATTR, "booleanProp");
        // TODO dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.collection.slaveEntityProp", "COUNT(booleanProp)", "Calc From Boolean Prop 3", "desc", CalculatedPropertyAttribute.NO_ATTR, "booleanProp");
        // TODO dtm().getEnhancer().apply();
        // TODO assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<Function>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "calcFromBooleanProp1")));
        // TODO assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<Function>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.calcFromBooleanProp2")));
        // TODO assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<Function>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.calcFromBooleanProp3")));

        /////////////////////////////////////////////////// There are no count distinct //////////////////////////////////////////////
        allLevelsWithoutCollections(new IAction() {
            @Override
            public void action(final String name) {
                dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, name, "2 * integerProp", "Calculated Integer Prop", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
                dtm().getEnhancer().apply();
                assertEquals(m, Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, AbstractDomainTreeTest.name(name, "calculatedIntegerProp"))));
            }
        }, ""); // calculatedIntegerProp

        allLevelsWithCollections(new IAction() {
            @Override
            public void action(final String name) {
                dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, name, "2 * integerProp", "Calculated Integer Prop", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
                dtm().getEnhancer().apply();
                assertEquals(m, enhanceFunctionsWithCollectionalAttributes(Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX)), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, AbstractDomainTreeTest.name(name, "calculatedIntegerProp"))));
            }
        }, ""); // calculatedIntegerProp

        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "", "COUNT(integerProp)", "Calc From Integer Prop 1", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp", "COUNT(integerProp)", "Calc From Integer Prop 2", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.entityProp", "COUNT(integerProp)", "Calc From Integer Prop 3", "desc", CalculatedPropertyAttribute.NO_ATTR, "integerProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals(m, Arrays.asList(Function.SELF), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "calcFromIntegerProp1")));
        assertEquals(m, Arrays.asList(Function.SELF), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "calcFromIntegerProp2")));
        assertEquals(m, Arrays.asList(Function.SELF), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "calcFromIntegerProp3")));
    }

    @Test
    @Ignore
    public void test_that_integer_calculated_of_AGGREGATED_COLLECTIONAL_EXPRESSION_type_property_has_functions_with_Count_Distinct() {
        // Check whether count distinct function can be applied to calculated property of CalculatedPropertyCategory.EXPRESSION based on date property.
        final String m = "Available functions are incorrect.";

        // Check whether count distinct function can be applied to calculated property of CalculatedPropertyCategory.AGGREGATED_COLLECTIONAL_EXPRESSION type based on entity property.
        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "collection", "COUNT(entityProp)", "Calc From Entity Prop 1", "desc", CalculatedPropertyAttribute.NO_ATTR, "entityProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.collection", "COUNT(entityProp)", "Calc From Entity Prop 2", "desc", CalculatedPropertyAttribute.NO_ATTR, "entityProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.collection.slaveEntityProp", "COUNT(entityProp)", "Calc From Entity Prop 3", "desc", CalculatedPropertyAttribute.NO_ATTR, "entityProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "calcFromEntityProp1")));
        assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.calcFromEntityProp2")));
        assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.calcFromEntityProp3")));

        // Check whether count distinct function can be applied to calculated property of CalculatedPropertyCategory.AGGREGATED_COLLECTIONAL_EXPRESSION type based on boolean property.
        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "collection", "COUNT(booleanProp)", "Calc From Boolean Prop 1", "desc", CalculatedPropertyAttribute.NO_ATTR, "booleanProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.collection", "COUNT(booleanProp)", "Calc From Boolean Prop 2", "desc", CalculatedPropertyAttribute.NO_ATTR, "booleanProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "entityProp.collection.slaveEntityProp", "COUNT(booleanProp)", "Calc From Boolean Prop 3", "desc", CalculatedPropertyAttribute.NO_ATTR, "booleanProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "calcFromBooleanProp1")));
        assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.calcFromBooleanProp2")));
        assertEquals(m, Arrays.asList(Function.SELF, Function.COUNT_DISTINCT, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.calcFromBooleanProp3")));
    }

    @Test
    public void test_which_calculated_property_categories_have_which_functions() {
        enhanceDomainWithCalculatedPropertiesOfDifferentTypes(dtm());
        final String m = "Available functions are incorrect.";

        // EXPRESSION
        assertEquals(m, Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "exprProp")));
        assertEquals(m, Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.exprProp")));
        // AGGREGATED_EXPRESSION
        assertEquals(m, Arrays.asList(Function.SELF), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "aggrExprProp1")));
        assertEquals(m, Arrays.asList(Function.SELF), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "aggrExprProp2")));
        // COLLECTIONAL_EXPRESSION
        assertEquals(m, enhanceFunctionsWithCollectionalAttributes(Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX)), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.collection.collExprProp")));
        assertEquals(m, enhanceFunctionsWithCollectionalAttributes(Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX)), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.collection.simpleEntityProp.collExprProp")));
        // TODO AGGREGATED_COLLECTIONAL_EXPRESSION
        // TODO assertEquals(m, Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<Function>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.aggrCollExprProp1")));
        // TODO assertEquals(m, Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<Function>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.aggrCollExprProp2")));
        // ATTRIBUTED_COLLECTIONAL_EXPRESSION
        assertEquals(m, Arrays.asList(Function.SELF), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.collection.attrCollExprProp1")));
        assertEquals(m, Arrays.asList(Function.SELF), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.collection.simpleEntityProp.attrCollExprProp2")));
    }

    @Test
    @Ignore
    public void test_AGGREGATED_COLLECTIONAL_EXPRESSION_calculated_property_category_have_which_functions() {
        enhanceDomainWithCalculatedPropertiesOfDifferentTypes(dtm());
        final String m = "Available functions are incorrect.";

        // AGGREGATED_COLLECTIONAL_EXPRESSION
        assertEquals(m, Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.aggrCollExprProp1")));
        assertEquals(m, Arrays.asList(Function.SELF, Function.SUM, Function.AVG, Function.MIN, Function.MAX), new ArrayList<>(dtm().getRepresentation().availableFunctions(MasterEntity.class, "entityProp.aggrCollExprProp2")));
    }

    @Test
    @Ignore("Ignored due to the removal of support for listeners. Need to revisit.")
    public void test_that_PropertyListeners_work() {
        i = 0;
        j = 0;
        assertEquals("Incorrect value 'i'.", 0, i);
        assertEquals("Incorrect value 'j'.", 0, j);

        dtm().getRepresentation().excludeImmutably(MasterEntity.class, "integerProp");
        assertEquals("Incorrect value 'i'.", 0, i);
        assertEquals("Incorrect value 'j'.", 1, j);

        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "", "1 * 2 * integerProp", "Calc prop1", "Desc", CalculatedPropertyAttribute.NO_ATTR, "bigDecimalProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect value 'i'.", 1, i);
        assertEquals("Incorrect value 'j'.", 1, j);

        dtm().getEnhancer().removeCalculatedProperty(MasterEntity.class, "calcProp1");
        dtm().getEnhancer().apply();
        assertEquals("Incorrect value 'i'.", 1, i);
        assertEquals("Incorrect value 'j'.", 2, j);

        dtm().getRepresentation().warmUp(MasterEntity.class, "entityProp.entityProp.slaveEntityProp");
        assertEquals("Incorrect value 'i'.", 138, i);
        assertEquals("Incorrect value 'j'.", 5, j);
    }

    @Test
    @Ignore("Ignored due to the removal of support for listeners. Need to revisit.")
    public void test_that_WeakPropertyListeners_work() {
        i = 0;
        j = 0;

        assertEquals("Incorrect value 'i'.", 0, i);
        assertEquals("Incorrect value 'j'.", 0, j);

        dtm().getRepresentation().excludeImmutably(MasterEntity.class, "integerProp");
        assertEquals("Incorrect value 'i'.", 0, i);
        assertEquals("Incorrect value 'j'.", 1, j);

        dtm().getEnhancer().addCalculatedProperty(MasterEntity.class, "", "1 * 2 * integerProp", "Calc prop1", "Desc", CalculatedPropertyAttribute.NO_ATTR, "bigDecimalProp", IsProperty.DEFAULT_PRECISION, IsProperty.DEFAULT_SCALE);
        dtm().getEnhancer().apply();
        assertEquals("Incorrect value 'i'.", 0, i);
        assertEquals("Incorrect value 'j'.", 1, j);
    }

    @Test
    @Ignore("Ignored due to the removal of support for listeners. Need to revisit.")
    public void test_that_PropertyDisablementListeners_work() {
        i = 0;
        j = 0;

        assertEquals("Incorrect value 'i'.", 0, i);
        assertEquals("Incorrect value 'j'.", 0, j);

        dtm().getRepresentation().getFirstTick().disableImmutably(MasterEntity.class, "integerProp");
        assertEquals("Incorrect value 'i'.", 1, i);
        assertEquals("Incorrect value 'j'.", 0, j);

        dtm().getFirstTick().check(MasterEntity.class, "bigDecimalProp", true);
        dtm().getRepresentation().getFirstTick().disableImmutably(MasterEntity.class, "bigDecimalProp");
        assertEquals("Incorrect value 'i'.", 2, i);
        assertEquals("Incorrect value 'j'.", 0, j);

        dtm().getRepresentation().warmUp(MasterEntity.class, "entityProp.entityProp.slaveEntityProp");
        assertEquals("Incorrect value 'i'.", 2, i);
        assertEquals("Incorrect value 'j'.", 0, j);
    }

    @Test
    @Ignore("Ignored due to the removal of support for listeners. Need to revisit.")
    public void test_that_WeakPropertyDisablementListeners_work() {
        i = 0;
        j = 0;

        assertEquals("Incorrect value 'i'.", 0, i);
        assertEquals("Incorrect value 'j'.", 0, j);

        dtm().getRepresentation().getFirstTick().disableImmutably(MasterEntity.class, "integerProp");
        assertEquals("Incorrect value 'i'.", 1, i);
        assertEquals("Incorrect value 'j'.", 0, j);

        dtm().getFirstTick().check(MasterEntity.class, "bigDecimalProp", true);
        dtm().getRepresentation().getFirstTick().disableImmutably(MasterEntity.class, "bigDecimalProp");
        assertEquals("Incorrect value 'i'.", 1, i);
        assertEquals("Incorrect value 'j'.", 0, j);
    }
}


text:
<?php

namespace Cake\ORM;

use Cake\Collection\Collection;
use Cake\Database\Expression\TupleComparison;
use Cake\Datasource\EntityInterface;

/**
 * Contains methods that are capable of injecting eagerly loaded associations into
 * entities or lists of entities by using the same syntax as the EagerLoader.
 *
 * @internal
 */
class LazyEagerLoader
{

    /**
     * Loads the specified associations in the passed entity or list of entities
     * by executing extra queries in the database and merging the results in the
     * appropriate properties.
     *
     * The properties for the associations to be loaded will be overwritten on each entity.
     *
     * @param \Cake\Datasource\EntityInterface|array $entities a single entity or list of entities
     * @param array $contain A `contain()` compatible array.
     * @see \Cake\ORM\Query\contain()
     * @param \Cake\ORM\Table $source The table to use for fetching the top level entities
     * @return \Cake\Datasource\EntityInterface|array
     */
    public function loadInto($entities, array $contain, Table $source)
    {
        $returnSingle = false;

        if ($entities instanceof EntityInterface) {
            $entities = [$entities];
            $returnSingle = true;
        }

        $entities = new Collection($entities);
        $query = $this->_getQuery($entities, $contain, $source);
        $associations = array_keys($query->contain());

        $entities = $this->_injectResults($entities, $query, $associations, $source);

        return $returnSingle ? array_shift($entities) : $entities;
    }

    /**
     * Builds a query for loading the passed list of entity objects along with the
     * associations specified in $contain.
     *
     * @param \Cake\Collection\CollectionInterface $objects The original entities
     * @param array $contain The associations to be loaded
     * @param \Cake\ORM\Table $source The table to use for fetching the top level entities
     * @return \Cake\ORM\Query
     */
    protected function _getQuery($objects, $contain, $source)
    {
        $primaryKey = $source->getPrimaryKey();
        $method = is_string($primaryKey) ? 'get' : 'extract';

        $keys = $objects->map(function ($entity) use ($primaryKey, $method) {
            return $entity->{$method}($primaryKey);
        });

        $query = $source
            ->find()
            ->select((array)$primaryKey)
            ->where(function ($exp, $q) use ($primaryKey, $keys, $source) {
                if (is_array($primaryKey) && count($primaryKey) === 1) {
                    $primaryKey = current($primaryKey);
                }

                if (is_string($primaryKey)) {
                    return $exp->in($source->aliasField($primaryKey), $keys->toList());
                }

                $types = array_intersect_key($q->defaultTypes(), array_flip($primaryKey));
                $primaryKey = array_map([$source, 'aliasField'], $primaryKey);

                return new TupleComparison($primaryKey, $keys->toList(), $types, 'IN');
            })
            ->contain($contain);

        foreach ($query->getEagerLoader()->attachableAssociations($source) as $loadable) {
            $config = $loadable->getConfig();
            $config['includeFields'] = true;
            $loadable->setConfig($config);
        }

        return $query;
    }

    /**
     * Returns a map of property names where the association results should be injected
     * in the top level entities.
     *
     * @param \Cake\ORM\Table $source The table having the top level associations
     * @param array $associations The name of the top level associations
     * @return array
     */
    protected function _getPropertyMap($source, $associations)
    {
        $map = [];
        $container = $source->associations();
        foreach ($associations as $assoc) {
            $map[$assoc] = $container->get($assoc)->getProperty();
        }

        return $map;
    }

    /**
     * Injects the results of the eager loader query into the original list of
     * entities.
     *
     * @param array|\Traversable $objects The original list of entities
     * @param \Cake\Collection\CollectionInterface|\Cake\Database\Query $results The loaded results
     * @param array $associations The top level associations that were loaded
     * @param \Cake\ORM\Table $source The table where the entities came from
     * @return array
     */
    protected function _injectResults($objects, $results, $associations, $source)
    {
        $injected = [];
        $properties = $this->_getPropertyMap($source, $associations);
        $primaryKey = (array)$source->getPrimaryKey();
        $results = $results
            ->indexBy(function ($e) use ($primaryKey) {
                return implode(';', $e->extract($primaryKey));
            })
            ->toArray();

        foreach ($objects as $k => $object) {
            $key = implode(';', $object->extract($primaryKey));
            if (!isset($results[$key])) {
                $injected[$k] = $object;
                continue;
            }

            $loaded = $results[$key];
            foreach ($associations as $assoc) {
                $property = $properties[$assoc];
                $object->set($property, $loaded->get($property), ['useSetters' => false]);
                $object->setDirty($property, false);
            }
            $injected[$k] = $object;
        }

        return $injected;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;

using System.Xml;
using System.Xml.XPath;
using System.Collections.Generic;

namespace umbraco.cms.businesslogic.packager
{
    public class PackageInstance
    {
        public int Id { get; set; }

        public string RepositoryGuid { get; set; }

        public string PackageGuid { get; set; }

        public bool HasUpdate { get; set; }

        public bool EnableSkins { get; set; }

        public Guid SkinRepoGuid { get; set; }

        public string Name { get; set; }

        public string Url { get; set; }

        public string Folder { get; set; }

        public string PackagePath { get; set; }

        public string Version { get; set; }

        /// <summary>
        /// The minimum umbraco version that this package requires
        /// </summary>
        public Version UmbracoVersion { get; set; }

        public string Author { get; set; }

        public string AuthorUrl { get; set; }

        public string License { get; set; }

        public string LicenseUrl { get; set; }

        public string Readme { get; set; }

        public bool ContentLoadChildNodes { get; set; }

        public string ContentNodeId { get; set; }

        public List<string> Macros { get; set; }

        public List<string> Languages { get; set; }

        public List<string> DictionaryItems { get; set; }

        public List<string> Templates { get; set; }

        public List<string> Documenttypes { get; set; }

        public List<string> Stylesheets { get; set; }

        public List<string> Files { get; set; }

        public string LoadControl { get; set; }

        public string Actions { get; set; }

        public List<string> DataTypes { get; set; }

        public string IconUrl { get; set; }

        public PackageInstance()
        {
            SkinRepoGuid = Guid.Empty;
            Name = string.Empty;
            Url = string.Empty;
            Folder = string.Empty;
            PackagePath = string.Empty;
            Version = string.Empty;
            UmbracoVersion = null;
            Author = string.Empty;
            AuthorUrl = string.Empty;
            License = string.Empty;
            LicenseUrl = string.Empty;
            Readme = string.Empty;
            ContentNodeId = string.Empty;
            IconUrl = string.Empty;
            Macros = new List<string>();
            Languages = new List<string>();
            DictionaryItems = new List<string>();
            Templates = new List<string>();
            Documenttypes = new List<string>();
            Stylesheets = new List<string>();
            Files = new List<string>();
            LoadControl = string.Empty;
            DataTypes = new List<string>();
            EnableSkins = false;
            ContentLoadChildNodes = false;
        }
    }
}


text:
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2013 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

#ifndef LCB_HOSTLIST_H
#define LCB_HOSTLIST_H

#include "config.h"
#include <libcouchbase/couchbase.h>

/**
 * Structure representing a host. This contains the string representation
 * of a host and a port.
 */
typedef struct lcb_host_st {
    char host[NI_MAXHOST + 1];
    char port[NI_MAXSERV + 1];
} lcb_host_t;

/**
 * Structure representing a list of hosts. This has an internal iteration
 * index which is used to cycle between 'good' and 'bad' hosts.
 */
#ifndef __cplusplus
struct hostlist_st;
typedef struct hostlist_st *hostlist_t;
#else
#include <vector>

namespace lcb {
struct Hostlist {
    Hostlist() : ix(0) {}
    ~Hostlist();

    /**
     * Adds a string to the hostlist. See lcb_host_parse for details.
     * Note that if the host already exists (see 'lcb_host_equals') it will
     * not be added
     * @param s the string to parse
     * @param len the length of the string
     * @param deflport If `s` does not contain an explicit port, use this
     *        port instead.
     * @return LCB_EINVAL if the host string is not valid
     */
    lcb_error_t add(const char *s, long len, int deflport);
    lcb_error_t add(const char *s, int deflport) { return add(s, -1, deflport); }
    void add(const lcb_host_t&);

    bool exists(const lcb_host_t&) const;
    bool exists(const char *hostport) const;

    /**
     * Return the next host in the list.
     * @param wrap If the internal iterator has reached its limit, this
     * indicates whether it should be reset, or if it should return NULL
     * @return a new host if available, or NULL if the list is empty or the
     * iterator is finished.
     */
    lcb_host_t *next(bool wrap);
    bool finished() const;

    size_t size() const { return hosts.size(); }
    bool empty() const { return hosts.empty(); }
    Hostlist& assign(const Hostlist& other);

    /** Clears the hostlist */
    void clear() { hosts.clear(); reset_strlist(); ix = 0; }

    /** Randomize the hostlist by shuffling the order. */
    void randomize();

    /**
     * String list handling functions. These are used to return the hostlist via
     * the API where we return a char*[] terminated by a NULL pointer.
     */

    /** Ensure that the string list contains at least one entry */
    void ensure_strlist();

    /** Frees the current list of strings */
    void reset_strlist();

    const char * const *get_strlist() {
        ensure_strlist();
        return &hoststrs[0];
    }

    unsigned int ix;
    const lcb_host_t& operator[](size_t ix_) const { return hosts[ix_]; }

    std::vector<lcb_host_t> hosts;
    std::vector<const char *> hoststrs;
};
}
typedef lcb::Hostlist* hostlist_t;

struct hostlist_st : lcb::Hostlist {
    hostlist_st() : Hostlist() {
    }
};
#endif

#ifdef __cplusplus
extern "C" {
#endif
/**
 * Parses a string into a hostlist
 * @param host the target host to populate
 * @param spec a string to parse. This may either be an IP/host or an
 * IP:Port pair.
 * @param speclen the length of the string. If this is -1 then it is assumed
 * to be NUL-terminated and strlen will be used
 * @param deflport If a port is not found in the spec, then this port will
 * be used
 *
 * @return LCB_EINVAL if the host format is invalid
 */
lcb_error_t
lcb_host_parse(lcb_host_t *host, const char *spec, int speclen, int deflport);

/** Wrapper around lcb_host_parse() which accepts a NUL-terminated string
 * @param host the host to populate
 * @param spec a NUL-terminated string to parse
 * @param deflport the default port to use if the `spec` does not contain a port
 * @see lcb_host_parse()
 */
#define lcb_host_parsez(host, spec, deflport) lcb_host_parse(host, spec, -1, deflport)

/**
 * Compares two hosts for equality.
 * @param a host to compare
 * @param b other host to compare
 * @return true if equal, false if different.
 */
int lcb_host_equals(const lcb_host_t *a, const lcb_host_t *b);

#ifdef __cplusplus
}
#endif
#endif


text:
package com.limemobile.app.utils;

import java.io.File;
import java.util.List;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.net.Uri;

public class APKUtil {

	public static void runPackage(Context context, String packageName) {
		PackageManager pm = context.getPackageManager();
		try {
			PackageInfo pi = pm.getPackageInfo(packageName, 0);
			Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);
			resolveIntent.setPackage(pi.packageName);

			List<ResolveInfo> apps = pm.queryIntentActivities(
					resolveIntent, 0);

			ResolveInfo ri = apps.iterator().next();
			if (ri != null) {
				packageName = ri.activityInfo.packageName;
				String className = ri.activityInfo.name;

				Intent intent = new Intent(Intent.ACTION_MAIN);

				ComponentName cn = new ComponentName(packageName, className);

				intent.setComponent(cn);
				context.startActivity(intent);
			}
		} catch (NameNotFoundException e) {
		}
	}

	public static void removePackage(Context context, String packageName) {
		try {
			Uri packageURI = Uri.parse("package:" + packageName);
			Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
			context.startActivity(uninstallIntent);
		} catch (Exception e) {
		}
	}

	public static boolean isPackageInstalled(Context context, String packageName) {
		PackageManager pm = context.getPackageManager();
		try {
			PackageInfo pi = pm.getPackageInfo(packageName, 0);
			if (pi == null) {
				return false;
			}
		} catch (Exception e) {
			return false;
		}
		return true;

	}

	public static void installPackage(Context context, String packageName) {
		Intent intent = new Intent(Intent.ACTION_VIEW);

		intent.setDataAndType(Uri.fromFile(new File(packageName)),
				"application/vnd.android.package-archive");
		context.startActivity(intent);

	}

	public static String isPackageArchive(Context context, String filePath) {
		PackageManager pm = context.getPackageManager();

		String packageName = null;
		PackageInfo pi = pm.getPackageArchiveInfo(filePath, PackageManager.GET_ACTIVITIES);

		if (pi != null) {
			ApplicationInfo appInfo = pi.applicationInfo;
			packageName = appInfo.packageName;
			return packageName;
		}
		return packageName;

	}
}


text:
package com.rockwellcollins.atc.agree.analysis;

public class AgreeException extends RuntimeException {
    private static final long serialVersionUID = -2404922400955586291L;

    public AgreeException(String message) {
        super(message);
    }
}


text:
FROM marvambass/nginx-ssl-php
MAINTAINER MarvAmBass

ENV DH_SIZE 1024

RUN apt-get update; apt-get install -y \
    wget \
    php5-intl \
    php5-mcrypt \
    php5-mysql \
    mysql-client

# enable php5 mcrypt
RUN php5enmod mcrypt

# install roundcube
RUN wget "http://sourceforge.net/projects/roundcubemail/files/latest/download" -O roundcubemail.tar.gz && \
    tar xvf roundcubemail.tar.gz -C / && \
    rm roundcubemail.tar.gz; \
    mv /roundcube* /roundcube

# fix rights
RUN chmod a+rw /roundcube/temp/; \
    chmod a+rw /roundcube/logs/

# add config
ADD config.inc.php /roundcube/config/config.inc.php

# install nginx roundcube config
ADD nginx-roundcube.conf /etc/nginx/conf.d/nginx-roundcube.conf

# add startup.sh
ADD startup-roundcube.sh /opt/startup-roundcube.sh
RUN chmod a+x /opt/startup-roundcube.sh

# add '/opt/startup-roundcube.sh' to entrypoint.sh
RUN sed -i 's/# exec CMD/# exec CMD\n\/opt\/startup-roundcube.sh/g' /opt/entrypoint.sh


text:
function noLog() {}
function checkLog(test, func) {
  if (test)
    return func;
  return noLog;
}

function clientRequest(request) {
  console.log('  <<<<<<<<<<<<<<<<<<<<<<<<<< Client Request: %s', request);
}

function serverResponse(response) {
  console.log('  >>>>>>>>>>>>>>>>>>>>>>>>>> ServerResponse: %s\n', response);
}

function clientData(name, data) {
  console.log('-- %s ---------------------------', name);
  var clientData = data.actions;
  if (clientData === undefined)
    console.log('NO DATA');
  else
    clientData.forEach(function(action) {
      console.log('%s.%s ->', action.component, action.action, action.data);
    });
  console.log('+++ pending action: ', data.pendingAction);
}

function addToSelection(name, id) {
  console.log('  <<+ [Saving selection: %s, %s]', name, id);
}

function removeFromSelection(name) {
  console.log('  <<x [Removing selection: %s]', name);
}

function selection(selection) {
  console.log(selection);
}

function stack(method, data) {
  console.log('= ' + method + ' ==========================================');
  if (method === 'pop')
    return;

  data.forEach(function(item, index) {
    var actions = '  actions: ';
    item.actions.forEach(function(action, index) {
      var text = action.action;
      if (item.current == index)
        text = '[' + text + ']';
      actions += text + ' ';
    });
    console.log(actions);

    var controls = '  control: ';
    for (var name in item.control)
      controls += name + ' ';
    if (controls !== '  control: ')
      console.log(controls);

    if (item.after)
      console.log('  after: true');
    if (item.count)
      console.log('  count: %d', item.count);
    if (index < data.length - 1)
      console.log('----------------------------------------------');
   });
  console.log('');
}

function pendingAction(action) {
  console.log('### set pending action: %s', action);
}

var logClientData = false;
var logSelection = false;
exports.clientRequest = checkLog(logClientData, clientRequest);
exports.serverResponse = checkLog(logClientData, serverResponse);
exports.clientData = checkLog(logClientData, clientData);
exports.addToSelection = checkLog(logSelection || logClientData, addToSelection);
exports.removeFromSelection = checkLog(logSelection || logClientData, removeFromSelection);

exports.selection = checkLog(logSelection, selection);

var logStack = false;
exports.stack = checkLog(logStack, stack);
exports.pendingAction = checkLog(logStack, pendingAction);


text: java -cp lib/gnat.jar gnat.tests.RemoteNerGeneRepTest


text:
package com.querydsl.spatial.locationtech.jts;

import com.querydsl.core.types.Expression;
import org.locationtech.jts.geom.MultiPolygon;

/**
 * A MultiPolygon is a MultiSurface whose elements are Polygons.
 *
 * @author tiwe
 *
 * @param <T>
 */
public abstract class JTSMultiPolygonExpression<T extends MultiPolygon> extends JTSMultiSurfaceExpression<T> {

    private static final long serialVersionUID = -2285946852207189655L;

    public JTSMultiPolygonExpression(Expression<T> mixin) {
        super(mixin);
    }

}


text:
package net.joelinn.stripe.response.charges;

import net.joelinn.stripe.response.cards.CardResponse;
import net.joelinn.stripe.response.disputes.DisputeResponse;
import net.joelinn.stripe.response.refunds.ListRefundsResponse;

import java.util.Date;
import java.util.Map;

/**
 * User: Joe Linn
 * Date: 5/23/2014
 * Time: 12:00 PM
 */
public class ChargeResponse {
    protected String id;

    protected String object;

    protected boolean livemode;

    protected int amount;

    protected boolean captured;

    protected CardResponse card;

    protected Date created;

    protected String currency;

    protected boolean paid;

    protected boolean refunded;

    protected ListRefundsResponse refunds;

    protected int amountRefunded;

    protected String balanceTransaction;

    protected String customer;

    protected String description;

    protected DisputeResponse dispute;

    protected String failureCode;

    protected String failureMessage;

    protected String invoice;

    protected Map<String, Object> metadata;

    protected String statementDescription;

    protected String receiptEmail;

    public String getId() {
        return id;
    }

    public String getObject() {
        return object;
    }

    public boolean isLivemode() {
        return livemode;
    }

    public int getAmount() {
        return amount;
    }

    public boolean isCaptured() {
        return captured;
    }

    public CardResponse getCard() {
        return card;
    }

    public Date getCreated() {
        return created;
    }

    public String getCurrency() {
        return currency;
    }

    public boolean isPaid() {
        return paid;
    }

    public boolean isRefunded() {
        return refunded;
    }

    public ListRefundsResponse getRefunds() {
        return refunds;
    }

    public int getAmountRefunded() {
        return amountRefunded;
    }

    public String getBalanceTransaction() {
        return balanceTransaction;
    }

    public String getCustomer() {
        return customer;
    }

    public String getDescription() {
        return description;
    }

    public String getFailureCode() {
        return failureCode;
    }

    public String getFailureMessage() {
        return failureMessage;
    }

    public String getInvoice() {
        return invoice;
    }

    public Map<String, Object> getMetadata() {
        return metadata;
    }

    public String getStatementDescription() {
        return statementDescription;
    }

    public DisputeResponse getDispute() {
        return dispute;
    }

    public String getReceiptEmail() {
        return receiptEmail;
    }
}


text:
Chrome Platform Status
==================

[chromestatus.com](http://chromestatus.com/)

### Get the code

    git clone --recursive https://github.com/GoogleChrome/chromium-dashboard

### Installation

First, install the [Google App Engine SDK for Python](https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python).

You'll also need node/npm. Next, install `bower` and the npm deps:

    npm install -g bower
    npm install

This will also pull down bower_components and run `gulp` to build the site.

### Developing

Note: I've had issues with Django errors just running `grunt serve` or using the `dev_appserver.py` but others haven't.

Download the [Google App Engine Python SDK launcher](https://cloud.google.com/appengine/downloads) (Mac) and use that. Open the launcher and run the app in the main repo directory.

Locally, the `/feature` list pulls from prod (https://www.chromestatus.com/features.json). Opening one of the features will 404 because the entry is not actually in the local db. If you want to test local entries, modify [`templates/features.html`](https://github.com/GoogleChrome/chromium-dashboard/blob/0b3e3eb444f1e6b6751140f9524a2f60cdc2ca5d/templates/features.html#L181-L182) to pull locally and add some db entries by signing in to the app (bottom link). Make sure to check the "sign in as admin" box when doing so. Note that you can also simply go to `http://127.0.0.1:8080/` instead of `localhost` to pull locally.

#### Debugging / settings

[`settings.py`](https://github.com/GoogleChrome/chromium-dashboard/blob/master/settings.py) contains a list
of globals for debugging and running the site locally.

`VULCANIZE`

`False` will run the site without vulcanizing the Polymer elements.

### Deploying

**Note** you need to have admin privileges on the `cr-status` cloud project to be
able to deploy the site.

First, update the version field in `app.yaml`. That will ensure the app deploys
to a versioned URL and helps for rolling back later. Then, run the helper script:

    ./scripts/deploy_site.sh

This will build the site and deploy it to GAE.

Lastly, open the [Google Developer Console](https://console.cloud.google.com/appengine/versions?project=cr-status&organizationId=433637338589&moduleId=default) and flip
to the new version.

### LICENSE

Copyright (c) 2013-2016 Google Ince. All rights reserved.

Apache2 License.

[![Analytics](https://ga-beacon.appspot.com/UA-39048143-2/GoogleChrome/chromium-dashboard/README)](https://github.com/igrigorik/ga-beacon)


text:
package com.netflix.priam.backup;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import mockit.Mock;
import mockit.Mocked;
import mockit.Mockit;

import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.ListObjectsRequest;
import com.amazonaws.services.s3.model.ObjectListing;
import com.amazonaws.services.s3.model.S3ObjectSummary;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.netflix.priam.FakeConfiguration;
import com.netflix.priam.IConfiguration;
import com.netflix.priam.aws.S3FileIterator;
import com.netflix.priam.identity.InstanceIdentity;

/**
 * Unit test for backup file iterator
 *
 * @author Praveen Sadhu
 *
 */
public class TestFileIterator
{
    private static Injector injector;
    private static Date startTime, endTime;
    private static Calendar cal;

    @Mocked
    private static AmazonS3Client s3client;

    private static IConfiguration conf;
    private static InstanceIdentity factory;
    @BeforeClass
    public static void setup() throws InterruptedException, IOException
    {
        injector = Guice.createInjector(new BRTestModule());
        conf = injector.getInstance(IConfiguration.class);
        factory = injector.getInstance(InstanceIdentity.class);

        Mockit.setUpMock(AmazonS3Client.class, MockAmazonS3Client.class);
        Mockit.setUpMock(ObjectListing.class, MockObjectListing.class);
        s3client = new AmazonS3Client();

        cal = Calendar.getInstance();
        cal.set(2011, 7, 11, 0, 30, 0);
        cal.set(Calendar.MILLISECOND, 0);
        startTime = cal.getTime();
        cal.add(Calendar.HOUR, 5);
        endTime = cal.getTime();
    }

    // MockAmazonS3Client class
    @Ignore
    public static class MockAmazonS3Client
    {
        public static String bucketName = "";
        public static String prefix = "";

        @Mock
        public ObjectListing listObjects(ListObjectsRequest listObjectsRequest) throws AmazonClientException, AmazonServiceException
        {
            ObjectListing listing = new ObjectListing();
            listing.setBucketName(listObjectsRequest.getBucketName());
            listing.setPrefix(listObjectsRequest.getPrefix());
            return listing;
        }

        public ObjectListing listNextBatchOfObjects(ObjectListing previousObjectListing) throws AmazonClientException, AmazonServiceException
        {
            ObjectListing listing = new ObjectListing();
            listing.setBucketName(previousObjectListing.getBucketName());
            listing.setPrefix(previousObjectListing.getPrefix());
            return new ObjectListing();
        }
    }

    // MockObjectListing class
    @Ignore
    public static class MockObjectListing
    {
        public static boolean truncated = true;
        public static boolean firstcall = true;
        public static boolean simfilter = false;//Simulate filtering

        @Mock
        public List<S3ObjectSummary> getObjectSummaries()
        {
            if (firstcall)
            {
                firstcall = false;
                if( simfilter )
                    return getObjectSummaryEmpty();
                return getObjectSummary();
            }
            else
            {
                if( simfilter ){
                    simfilter = false;//reset
                    return getObjectSummaryEmpty();
                }
                else
                    truncated = false;
                return getNextObjectSummary();
            }
        }

        @Mock
        public boolean isTruncated()
        {
            return truncated;
        }
    }

    @Test
    public void testIteratorEmptySet()
    {
        cal.set(2011, 7, 11, 6, 1, 0);
        cal.set(Calendar.MILLISECOND, 0);
        Date stime = cal.getTime();
        cal.add(Calendar.HOUR, 5);
        Date etime = cal.getTime();
        MockAmazonS3Client.bucketName = "TESTBUCKET";
        MockAmazonS3Client.prefix = conf.getBackupLocation() + "/" + conf.getDC() + "/" + conf.getAppName() + "/" + factory.getInstance().getToken();
        MockAmazonS3Client.prefix += "/20110811";

        S3FileIterator fileIterator = new S3FileIterator(injector.getProvider(AbstractBackupPath.class), s3client, "TESTBUCKET", stime, etime);
        Set<String> files = new HashSet<String>();
        while (fileIterator.hasNext())
            files.add(fileIterator.next().getRemotePath());
        Assert.assertEquals(0, files.size());
    }

    @Test
    public void testIterator()
    {
        MockObjectListing.truncated = false;
        MockObjectListing.firstcall = true;
        MockObjectListing.simfilter = false;
        MockAmazonS3Client.bucketName = "TESTBUCKET";
        MockAmazonS3Client.prefix = conf.getBackupLocation() + "/" + conf.getDC() + "/" + conf.getAppName() + "/" + factory.getInstance().getToken();
        MockAmazonS3Client.prefix += "/20110811";

        S3FileIterator fileIterator = new S3FileIterator(injector.getProvider(AbstractBackupPath.class), s3client, "TESTBUCKET", startTime, endTime);
        Set<String> files = new HashSet<String>();
        while (fileIterator.hasNext())
            files.add(fileIterator.next().getRemotePath());
        Assert.assertEquals(3, files.size());
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks1/cf1/f1.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks1/cf1/f2.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/META/meta.json"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110600/SST/ks1/cf1/f3.db"));
    }

    @Test
    public void testIteratorTruncated()
    {
        MockObjectListing.truncated = true;
        MockObjectListing.firstcall = true;
        MockObjectListing.simfilter = false;
        MockAmazonS3Client.bucketName = "TESTBUCKET";
        MockAmazonS3Client.prefix = conf.getBackupLocation() + "/" + conf.getDC() + "/" + conf.getAppName() + "/" + factory.getInstance().getToken();
        MockAmazonS3Client.prefix += "/20110811";

        S3FileIterator fileIterator = new S3FileIterator(injector.getProvider(AbstractBackupPath.class), s3client, "TESTBUCKET", startTime, endTime);
        Set<String> files = new HashSet<String>();
        while (fileIterator.hasNext())
            files.add(fileIterator.next().getRemotePath());
        Assert.assertEquals(5, files.size());
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks1/cf1/f1.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks1/cf1/f2.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/META/meta.json"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110600/SST/ks1/cf1/f3.db"));

        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks2/cf1/f1.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks2/cf1/f2.db"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110600/SST/ks2/cf1/f3.db"));

    }

    @Test
    public void testIteratorTruncatedOOR()
    {
        MockObjectListing.truncated = true;
        MockObjectListing.firstcall = true;
        MockObjectListing.simfilter = true;
        MockAmazonS3Client.bucketName = "TESTBUCKET";
        MockAmazonS3Client.prefix = conf.getBackupLocation() + "/" + conf.getDC() + "/" + conf.getAppName() + "/" + factory.getInstance().getToken();
        MockAmazonS3Client.prefix += "/20110811";

        S3FileIterator fileIterator = new S3FileIterator(injector.getProvider(AbstractBackupPath.class), s3client, "TESTBUCKET", startTime, endTime);
        Set<String> files = new HashSet<String>();
        while (fileIterator.hasNext())
            files.add(fileIterator.next().getRemotePath());
        Assert.assertEquals(2, files.size());
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201107110030/SNAP/ks1/cf1/f1.db"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201107110430/SST/ks1/cf1/f2.db"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201107110030/META/meta.json"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201107110600/SST/ks1/cf1/f3.db"));

        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks2/cf1/f1.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks2/cf1/f2.db"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110600/SST/ks2/cf1/f3.db"));

    }

    @Test
    public void testRestorePathIteration()
    {
        MockObjectListing.truncated = true;
        MockObjectListing.firstcall = true;
        MockObjectListing.simfilter = false;
        MockAmazonS3Client.bucketName = "RESTOREBUCKET";
        MockAmazonS3Client.prefix = "test_restore_backup/fake-restore-region/fakerestorecluster" + "/" + factory.getInstance().getToken();
        MockAmazonS3Client.prefix += "/20110811";

        S3FileIterator fileIterator = new S3FileIterator(injector.getProvider(AbstractBackupPath.class), s3client, "RESTOREBUCKET/test_restore_backup/fake-restore-region/fakerestorecluster", startTime, endTime);
        Set<String> files = new HashSet<String>();
        while (fileIterator.hasNext())
            files.add(fileIterator.next().getRemotePath());
        while (fileIterator.hasNext())
            files.add(fileIterator.next().getRemotePath());

        Assert.assertEquals(5, files.size());
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks1/cf1/f1.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks1/cf1/f2.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/META/meta.json"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110600/SST/ks1/cf1/f3.db"));

        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks2/cf1/f1.db"));
        Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks2/cf1/f2.db"));
        Assert.assertFalse(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110600/SST/ks2/cf1/f3.db"));

    }

    public static List<S3ObjectSummary> getObjectSummary()
    {
        List<S3ObjectSummary> list = new ArrayList<S3ObjectSummary>();
        S3ObjectSummary summary = new S3ObjectSummary();
        summary.setKey("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks1/cf1/f1.db");
        list.add(summary);
        summary = new S3ObjectSummary();
        summary.setKey("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks1/cf1/f2.db");
        list.add(summary);
        summary = new S3ObjectSummary();
        summary.setKey("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110600/SST/ks1/cf1/f3.db");
        list.add(summary);
        summary = new S3ObjectSummary();
        summary.setKey("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/META/meta.json");
        list.add(summary);
        return list;
    }

    public static List<S3ObjectSummary> getObjectSummaryEmpty()
    {
        List<S3ObjectSummary> list = new ArrayList<S3ObjectSummary>();
        return list;
    }

    public static List<S3ObjectSummary> getNextObjectSummary()
    {
        List<S3ObjectSummary> list = new ArrayList<S3ObjectSummary>();
        S3ObjectSummary summary = new S3ObjectSummary();
        summary.setKey("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks2/cf1/f1.db");
        list.add(summary);
        summary = new S3ObjectSummary();
        summary.setKey("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks2/cf1/f2.db");
        list.add(summary);
        summary = new S3ObjectSummary();
        summary.setKey("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110600/SST/ks2/cf1/f3.db");
        list.add(summary);
        return list;
    }

}


text:
using System;
using System.Numerics;

class SaddyKopper
{
    static void Main()
    {
        string number = Console.ReadLine();
        BigInteger publicNumber = BigInteger.Parse(number);
        BigInteger resultNumber = 1;
        int temporaryNumber;
        int transformations = 0;
        while (true)
        {
            temporaryNumber = 0;
            publicNumber /= 10;
            number = publicNumber.ToString();
            for (int i = 0; i < number.Length; i += 2)
            {
                temporaryNumber += ((int)number[i] - 48);
            }
            if (temporaryNumber != 0)
            {
                resultNumber *= (ulong)temporaryNumber;
            }
            if (publicNumber == 0)
            {
                publicNumber = resultNumber;
                resultNumber = 1;
                transformations++;
                if (publicNumber < 10)
                {
                    Console.WriteLine("{0}", transformations);
                    Console.WriteLine("{0}", publicNumber);
                    return;
                }
                if (transformations == 10)
                {
                    Console.WriteLine("{0}", publicNumber);
                    return;
                }
            }
        }
    }
}


text:
[![DevOps By Rultor.com](http://www.rultor.com/b/myunusov/maxur-ldoc)](http://www.rultor.com/p/myunusov/maxur-ldoc)

[![We recommend IntelliJ IDEA](http://img.teamed.io/intellij-idea-recommend.svg)](https://www.jetbrains.com/idea/)

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/myunusov/maxur-ldoc/blob/master/LICENSE)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.maxur/maxur-ldoc/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.maxur/maxur-ldoc)

[![Build Status](https://travis-ci.org/myunusov/maxur-ldoc.svg?branch=master)](https://travis-ci.org/myunusov/maxur-ldoc)
[![Coverage Status](https://coveralls.io/repos/github/myunusov/maxur-ldoc/badge.svg?branch=master)](https://coveralls.io/github/myunusov/maxur-ldoc?branch=master)

## Overview

Doclet for the JavaDoc tool that generates Living documents from the code.

This doclet uses the analyzed information from the JavaDoc tool. It automatically generates glossary and context map from your code as md and png files.

## Links

* [Living Document (WiKi)](https://en.wikipedia.org/wiki/Living_document)
* [Living Documentation by design, with Domain-Driven Design (eBook)](https://leanpub.com/livingdocumentation)

## Documentation

### Living Glossary

```
Extract the glossary of the Ubiquitous Language from the source code. Consider
the source code as the Single Source of Truth, and take great care of the naming of each class,
interface and public method whenever they represent domain concepts. Add the description of
the domain concept directly into the source code, as structured comments that can be extracted
by a tool. When extracting the glossary, find a way to filter out code that is not expressing the
domain.
```

### Living Context Map

```
Context Mapping is a general purpose technique, part of the Domain Driven Design (DDD) toolkit,
helps the architects and developers manage the many types of complexity they face in software development projects
```

## Highlighted Core

```
In the book Domain-Driven Design, Eric Evans explains that when a domain grows to a large
number of elements, it becomes difficult to understand, even if only a small subset of them are
really important. A simple way to guide developers focus on these particular subset is to highlight
it in the code repository itself.

Flag each element of the CORE DOMAIN within the primary repository of the model, without
particularly trying to elucidate its role. Make it effortless for a developer to know what is in
or out of the CORE.

Using annotations to flag the core concepts directly into the code is a natural approach, one which
evolves well over time. Code elements like classes or interfaces get renamed, move from one module
to another, and sometime end up deleted.
```

### BusinessDomain (Package)

The BusinessDomain annotation represents SubDomain and Bounded Context.

This is a simple example of curation by annotations.

package-info.java

```java
@BusinessDomain(
    name = "Authorization",
    description = "for authorization of users to ensure they have the access control rights (permissions) required to do the actions performed"
)
@Link(related = "core")
@Link(related = "common")
package org.maxur.usrv.smpl.domain.auth;

import org.maxur.ldoc.annotation.BusinessDomain;
import org.maxur.ldoc.annotation.Link;
```

### Concept (Class)

The Concept annotation represents Business Domain Concepts.

This is a simple example of curation by annotations.

```java
@Concept(name = "User", description = "System's User")
public class User {
}
```

## Maven 2

To configure Maven to use Living documentation Doclet, you need to adjust your pom.xml file accordingly:

```xml
...
<dependencies>
    ...
    <dependency>
        <groupId>org.maxur</groupId>
        <artifactId>maxur-ldoc</artifactId>
        <version>0.2</version>
    </dependency>
    ...
</dependencies>
...
<build>
  <plugins>
    ...
    <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
            <execution>
                <id>ldoc</id>
                <phase>post-integration-test</phase>
                <configuration>
                    <doclet>org.maxur.ldoc.LivingDocumentation</doclet>
                    <docletArtifact>
                        <groupId>org.maxur</groupId>
                        <artifactId>maxur-ldoc</artifactId>
                        <version>0.2</version>
                    </docletArtifact>
                    <useStandardDocletOptions>false</useStandardDocletOptions>
                    <additionalparam>
                        -glossary
                        -contextMap
                        -basedir ${project.basedir}/src/site/resources
                    </additionalparam>
                </configuration>
                <goals>
                    <goal>javadoc</goal>
                </goals>
            </execution>

        </executions>
    </plugin>
    ...
  </plugins>
</build>
...
```

Any Living documentation Doclet specific options go into the *additionalparam* argument.

```xml
...
    <additionalparam>
        -glossary
        -contextMap
        -basedir ${project.basedir}/src/site/resources
    </additionalparam>
...
```
The additional parameters for this doclet are described below.

## Gradle

In gradle, the doclet and its dependency need to be declared. From there on, the configuration is the same as your regular JavaDoc configuration.

```groovy
apply plugin: 'java'

configurations {
    livingDocumentationDoclet
}

dependencies {
    livingDocumentationDoclet "org.maxur:maxur-ldoc:0.01"
}

javadoc {
    source = sourceSets.main.allJava
    options.docletPath = configurations.livingDocumentationDoclet.files.asType(List)
    options.doclet = "org.maxur.ldoc.LivingDocumentation"
    options.addStringOption "additionalParamName", "additionalParamValue"
}
```

Replace additionalParamName and additionalParamValue with the name and value of each additional parameter you need.
Note: The initial dash - of additional parameters will automatically be added by the Gradle javadoc task and should therefore be omitted from the configuration.

The additional parameters for this doclet are described below.

##Ant

In ant, the javadoc task needs to be told to use the Living documentation Doclet in a similar way.

```xml
<javadoc destdir="target/javadoc" sourcepath="src">
    <doclet name="org.maxur.ldoc.LivingDocumentation" pathref="livingDocumentationDoclet.classpath">
        <param name="additionalParamName" value="additionalParamValue" />
    </doclet>
</javadoc>
```
Make sure a path reference is defined for livingDocumentationDoclet.classpath pointing to maxur-ldoc-{VERSION}.jar. It may be a good idea to use Ivy in this case.
Replace additionalParamName and additionalParamValue with the name and value of each additional parameter you need.

The additional parameters for this doclet are described below.

##Commandline

Probably not many people run JavaDoc regularly from the commandline, but in case you do, make sure to provide the options -doclet org.maxur.ldoc.LivingDocumentation and -docletpath {PATH_TO_JAR}, where {PATH_TO_JAR} is the location of the maxur-ldoc-{VERSION}.jar.
The latest version of the jar file can be found on [Maven Central](http://repo1.maven.org/maven2/org/maxur/maxur-ldoc/0.2/maxur-ldoc-0.2.jar)

For more details on commandline javadoc, please see the [official documentation from Oracle](http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html).

## Additional parameters

| Parameter      | Type     | Default value | Description |
|----------------|----------|---------------|-------------|
| -all           | Boolean  | `false`       | Specifies whether or not all documents are included to output.|
| -glossary      | Boolean  | `false`       | Specifies whether or not the glossary is included to output.|
| -contextMap    | Boolean  | `false`       | Specifies whether or not the context map is included to output.|
| -basedir       | String   | _none_        | The name of the handlebars templates directory. If this parameter is not specified doclet use default template.|

##Template

###Glossary Template (Example)

glossary.hbs

```text
#Glossary

##Bounded Context "{{title}}" (*{{name}}*)
{{description}}

{{#concepts}}
1. **{{title}}** (*{{name}}*) - {{description}}
{{/concepts}}
```


text:
<?php

abstract class LegalpadConduitAPIMethod extends ConduitAPIMethod {

  final public function getApplication() {
    return PhabricatorApplication::getByClass(
      'PhabricatorLegalpadApplication');
  }

  protected function defineErrorTypes() {
    return array(
      'ERR-INVALID-PARAMETER' => pht('Missing or malformed parameter.'),
    );
  }

}


text:
require 'test_helper'

module Regaliator
  module V30
    class BillTest < Minitest::Test
      def setup
        @config = Configuration.new.tap do |config|
          config.version    = API_VERSION
          config.api_key    = 'api-key'
          config.secret_key = 'secret-key'
          config.host       = 'api.regalii.dev'
          config.use_ssl    = false
        end
      end

      def test_create
        VCR.use_cassette('v30/bill/create') do |cassette|
          response = Regaliator.new(@config).bill.create(biller_id: 2, account_number: '8081969')

          assert response.success?
          assert_equal extract_hsh(cassette), response.data
        end
      end

      def test_update
        VCR.use_cassette('v30/bill/update') do |cassette|
          response = Regaliator.new(@config).bill.update(5, name_on_account: 'Test name')

          assert response.success?
          assert_equal extract_hsh(cassette), response.data
        end
      end

      def test_show
        VCR.use_cassette('v30/bill/show') do |cassette|
          response = Regaliator.new(@config).bill.show(5)

          assert response.success?
          assert_equal extract_hsh(cassette), response.data
        end
      end

      def test_delete
        VCR.use_cassette('v30/bill/delete') do |cassette|
          response = Regaliator.new(@config).bill.delete(731285)

          assert response.success?
          assert_equal extract_hsh(cassette), response.data
        end
      end

      def test_xdata
        VCR.use_cassette('v30/bill/xdata') do |cassette|
          response = Regaliator.new(@config).bill.xdata(674101)

          assert response.success?
          assert_equal extract_hsh(cassette), response.data
        end
      end

      def test_refresh
        VCR.use_cassette('v30/bill/refresh') do |cassette|
          response = Regaliator.new(@config).bill.refresh(5)

          assert response.success?
          assert_equal extract_hsh(cassette), response.data
        end
      end

      def test_bulk_refresh
        VCR.use_cassette('v30/bill/bulk_refresh') do |cassette|
          response = Regaliator.new(@config).bill.bulk_refresh(bill_ids: [720845, 725006, 731285])

          assert response.success?
          assert_equal extract_hsh(cassette), response.data
        end
      end

      def test_pay
        VCR.use_cassette('v30/bill/pay') do |cassette|
          response = Regaliator.new(@config).bill.pay(5, amount: 758.0, currency: 'RD')

          assert response.success?
          assert_equal extract_hsh(cassette), response.data
        end
      end

      def test_list
        VCR.use_cassette('v30/bill/list') do
          response = Regaliator.new(@config).bill.list

          assert response.success?
          assert_equal response.data['bills'].size, 1
        end
      end
    end
  end
end


text:
#include "modules/webaudio/AudioNodeInput.h"
#include "modules/webaudio/AudioNodeOutput.h"
#include "modules/webaudio/DynamicsCompressorNode.h"
#include "modules/webaudio/DynamicsCompressorOptions.h"
#include "platform/audio/DynamicsCompressor.h"
#include "wtf/PtrUtil.h"

// Set output to stereo by default.
static const unsigned defaultNumberOfOutputChannels = 2;

namespace blink {

DynamicsCompressorHandler::DynamicsCompressorHandler(
    AudioNode& node,
    float sampleRate,
    AudioParamHandler& threshold,
    AudioParamHandler& knee,
    AudioParamHandler& ratio,
    AudioParamHandler& attack,
    AudioParamHandler& release)
    : AudioHandler(NodeTypeDynamicsCompressor, node, sampleRate),
      m_threshold(threshold),
      m_knee(knee),
      m_ratio(ratio),
      m_reduction(0),
      m_attack(attack),
      m_release(release) {
  addInput();
  addOutput(defaultNumberOfOutputChannels);
  initialize();
}

PassRefPtr<DynamicsCompressorHandler> DynamicsCompressorHandler::create(
    AudioNode& node,
    float sampleRate,
    AudioParamHandler& threshold,
    AudioParamHandler& knee,
    AudioParamHandler& ratio,
    AudioParamHandler& attack,
    AudioParamHandler& release) {
  return adoptRef(new DynamicsCompressorHandler(node, sampleRate, threshold,
                                                knee, ratio, attack, release));
}

DynamicsCompressorHandler::~DynamicsCompressorHandler() {
  uninitialize();
}

void DynamicsCompressorHandler::process(size_t framesToProcess) {
  AudioBus* outputBus = output(0).bus();
  DCHECK(outputBus);

  float threshold = m_threshold->value();
  float knee = m_knee->value();
  float ratio = m_ratio->value();
  float attack = m_attack->value();
  float release = m_release->value();

  m_dynamicsCompressor->setParameterValue(DynamicsCompressor::ParamThreshold,
                                          threshold);
  m_dynamicsCompressor->setParameterValue(DynamicsCompressor::ParamKnee, knee);
  m_dynamicsCompressor->setParameterValue(DynamicsCompressor::ParamRatio,
                                          ratio);
  m_dynamicsCompressor->setParameterValue(DynamicsCompressor::ParamAttack,
                                          attack);
  m_dynamicsCompressor->setParameterValue(DynamicsCompressor::ParamRelease,
                                          release);

  m_dynamicsCompressor->process(input(0).bus(), outputBus, framesToProcess);

  m_reduction =
      m_dynamicsCompressor->parameterValue(DynamicsCompressor::ParamReduction);
}

void DynamicsCompressorHandler::initialize() {
  if (isInitialized())
    return;

  AudioHandler::initialize();
  m_dynamicsCompressor = wrapUnique(
      new DynamicsCompressor(sampleRate(), defaultNumberOfOutputChannels));
}

void DynamicsCompressorHandler::clearInternalStateWhenDisabled() {
  m_reduction = 0;
}

double DynamicsCompressorHandler::tailTime() const {
  return m_dynamicsCompressor->tailTime();
}

double DynamicsCompressorHandler::latencyTime() const {
  return m_dynamicsCompressor->latencyTime();
}

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

DynamicsCompressorNode::DynamicsCompressorNode(BaseAudioContext& context)
    : AudioNode(context),
      m_threshold(AudioParam::create(context,
                                     ParamTypeDynamicsCompressorThreshold,
                                     -24,
                                     -100,
                                     0)),
      m_knee(AudioParam::create(context,
                                ParamTypeDynamicsCompressorKnee,
                                30,
                                0,
                                40)),
      m_ratio(AudioParam::create(context,
                                 ParamTypeDynamicsCompressorRatio,
                                 12,
                                 1,
                                 20)),
      m_attack(AudioParam::create(context,
                                  ParamTypeDynamicsCompressorAttack,
                                  0.003,
                                  0,
                                  1)),
      m_release(AudioParam::create(context,
                                   ParamTypeDynamicsCompressorRelease,
                                   0.250,
                                   0,
                                   1)) {
  setHandler(DynamicsCompressorHandler::create(
      *this, context.sampleRate(), m_threshold->handler(), m_knee->handler(),
      m_ratio->handler(), m_attack->handler(), m_release->handler()));
}

DynamicsCompressorNode* DynamicsCompressorNode::create(
    BaseAudioContext& context,
    ExceptionState& exceptionState) {
  DCHECK(isMainThread());

  if (context.isContextClosed()) {
    context.throwExceptionForClosedState(exceptionState);
    return nullptr;
  }

  return new DynamicsCompressorNode(context);
}

DynamicsCompressorNode* DynamicsCompressorNode::create(
    BaseAudioContext* context,
    const DynamicsCompressorOptions& options,
    ExceptionState& exceptionState) {
  DynamicsCompressorNode* node = create(*context, exceptionState);

  if (!node)
    return nullptr;

  node->handleChannelOptions(options, exceptionState);

  if (options.hasAttack())
    node->attack()->setValue(options.attack());
  if (options.hasKnee())
    node->knee()->setValue(options.knee());
  if (options.hasRatio())
    node->ratio()->setValue(options.ratio());
  if (options.hasRelease())
    node->release()->setValue(options.release());
  if (options.hasThreshold())
    node->threshold()->setValue(options.threshold());

  return node;
}

DEFINE_TRACE(DynamicsCompressorNode) {
  visitor->trace(m_threshold);
  visitor->trace(m_knee);
  visitor->trace(m_ratio);
  visitor->trace(m_attack);
  visitor->trace(m_release);
  AudioNode::trace(visitor);
}

DynamicsCompressorHandler& DynamicsCompressorNode::dynamicsCompressorHandler()
    const {
  return static_cast<DynamicsCompressorHandler&>(handler());
}

AudioParam* DynamicsCompressorNode::threshold() const {
  return m_threshold;
}

AudioParam* DynamicsCompressorNode::knee() const {
  return m_knee;
}

AudioParam* DynamicsCompressorNode::ratio() const {
  return m_ratio;
}

float DynamicsCompressorNode::reduction() const {
  return dynamicsCompressorHandler().reductionValue();
}

AudioParam* DynamicsCompressorNode::attack() const {
  return m_attack;
}

AudioParam* DynamicsCompressorNode::release() const {
  return m_release;
}

}  // namespace blink


text:
	<title>Lynda La Plante's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Lynda La Plante's panel show appearances

Lynda La Plante (born 1943-03-05[ref]) has appeared in 8 episodes between 2007-2014.  Lynda La Plante on IMDB. Lynda La Plante on Wikipedia.

2007

2008

2009

2010

2011

2012

2013

2014

2014-06-02 / Loose Women

2013-10-08 / Loose Women

2012-06-12 / Loose Women

2010-06-25 / Loose Women

2009-09-14 / Loose Women

2008-10-02 / Loose Women

2008-01-31 / Loose Women

2007-01-19 / Loose Women