text:
package com.blazebit.persistence.testsuite.treat.builder;

import com.blazebit.persistence.testsuite.entity.IntIdEntity;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.List;

@RunWith(Parameterized.class)
public class RootTreatTest extends AbstractTreatVariationsTest {

    public RootTreatTest(String strategy, String objectPrefix) {
        super(strategy, objectPrefix);
    }

    @Parameterized.Parameters
    public static Object[] getParameters() {
        return new Object[] {
            new Object[] { "Joined", "s" },
            new Object[] { "SingleTable", "st" },
            new Object[] { "TablePerClass", "tpc" }
        };
    }

    @Test
    public void selectTreatedRootBasic() {
        assumeTreatInNonPredicateDoesNotFilter();
        List<Integer> bases = list(
                from(Integer.class, "Base", "b")
                        .select("TREAT(b AS " + strategy + "Sub1).sub1Value")
        );

        // From => 4 instances
        Assert.assertEquals(4, bases.size());
        assertRemoved(bases, null);
        assertRemoved(bases, null);
        assertRemoved(bases, 1);
        assertRemoved(bases, 101);
    }

    @Test
    public void selectMultipleTreatedRootBasic() {
        assumeTreatInNonPredicateDoesNotFilter();
        List<Object[]> bases = list(
                from(Object[].class, "Base", "b")
                        .select("TREAT(b AS " + strategy + "Sub1).sub1Value")
                        .select("TREAT(b AS " + strategy + "Sub2).sub2Value")
        );

        // From => 4 instances
        Assert.assertEquals(4, bases.size());
        assertRemoved(bases, new Object[] { 1,    null });
        assertRemoved(bases, new Object[] { 101,  null });
        assertRemoved(bases, new Object[] { null, 2    });
        assertRemoved(bases, new Object[] { null, 102  });
    }

    @Test
    public void selectTreatedParentRootBasic() {
        assumeAccessTreatedOuterQueryVariableWorks();
        List<Integer> bases = list(
                from(Integer.class, "Base", "b")
                        .selectSubquery()
                            .from(IntIdEntity.class, "i")
                            .where("i.name").eqExpression("b.name")
                            .select("i.value")
                            .where("i.value").eqExpression("TREAT(b AS " + strategy + "Sub1).sub1Value")
                        .end()
        );

        // From => 4 instances
        // There are 2 IntIdEntity instances per Base instance
        // For the 2 Sub1 instances, their sub1Value is returned
        // For the 2 Sub2 instances, null is emmitted
        Assert.assertEquals(4, bases.size());
        assertRemoved(bases, null);
        assertRemoved(bases, null);
        assertRemoved(bases, 1);
        assertRemoved(bases, 101);
    }

    @Test
    public void selectMultipleTreatedParentRootBasic() {
        assumeAccessTreatedOuterQueryVariableWorks();
        List<Object[]> bases = list(
                from(Object[].class, "Base", "b")
                        .selectSubquery()
                            .from(IntIdEntity.class, "i")
                            .where("i.name").eqExpression("b.name")
                            .select("i.value")
                            .where("i.value").eqExpression("TREAT(b AS " + strategy + "Sub1).sub1Value")
                        .end()
                        .selectSubquery()
                            .from(IntIdEntity.class, "i")
                            .where("i.name").eqExpression("b.name")
                            .select("i.value")
                            .where("i.value").eqExpression("TREAT(b AS " + strategy + "Sub2).sub2Value")
                        .end()
        );

        // From => 4 instances
        // There are 2 IntIdEntity instances per Base instance
        // For the 2 Sub1 instances, their sub1Value is returned
        // For the 2 Sub2 instances, null is emmitted
        // The second subquery is like the first but for Sub2
        Assert.assertEquals(4, bases.size());
        assertRemoved(bases, new Object[] { 1,    null });
        assertRemoved(bases, new Object[] { 101,  null });
        assertRemoved(bases, new Object[] { null, 2    });
        assertRemoved(bases, new Object[] { null, 102  });
    }

    @Test
    public void selectTreatedRootEmbeddableBasic() {
        assumeTreatInNonPredicateDoesNotFilter();
        List<Integer> bases = list(
                from(Integer.class, "Base", "b")
                        .select("TREAT(b AS " + strategy + "Sub1).sub1Embeddable.someValue")
        );

        // From => 4 instances
        Assert.assertEquals(4, bases.size());
        assertRemoved(bases, null);
        assertRemoved(bases, null);
        assertRemoved(bases, null);
        assertRemoved(bases, 101);
    }

    @Test
    public void selectMultipleTreatedRootEmbeddableBasic() {
        assumeTreatInNonPredicateDoesNotFilter();
        List<Object[]> bases = list(
                from(Object[].class, "Base", "b")
                        .select("TREAT(b AS " + strategy + "Sub1).sub1Embeddable.someValue")
                        .select("TREAT(b AS " + strategy + "Sub2).sub2Embeddable.someValue")
        );

        // From => 4 instances
        Assert.assertEquals(4, bases.size());
        assertRemoved(bases, new Object[] { null, null });
        assertRemoved(bases, new Object[] { null, null });
        assertRemoved(bases, new Object[] { 101,  null });
        assertRemoved(bases, new Object[] { null, 102  });
    }

    @Test
    public void selectTreatedParentRootEmbeddableBasic() {
        assumeAccessTreatedOuterQueryVariableWorks();
        List<Integer> bases = list(
                from(Integer.class, "Base", "b")
                        .selectSubquery()
                            .from(IntIdEntity.class, "i")
                            .where("i.name").eqExpression("b.name")
                            .select("i.value")
                            .where("i.value").eqExpression("TREAT(b AS " + strategy + "Sub1).embeddable1.sub1SomeValue")
                        .end()
        );

        // From => 4 instances
        // There are 2 IntIdEntity instances per Base instance
        // For the 2 Sub1 instances, their sub1SomeValue is returned
        // For the 2 Sub2 instances, null is emmitted
        Assert.assertEquals(4, bases.size());
        assertRemoved(bases, null);
        assertRemoved(bases, null);
        assertRemoved(bases, 1);
        assertRemoved(bases, 101);
    }

    @Test
    public void selectMultipleTreatedParentRootEmbeddableBasic() {
        assumeAccessTreatedOuterQueryVariableWorks();
        List<Object[]> bases = list(
                from(Object[].class, "Base", "b")
                        .selectSubquery()
                            .from(IntIdEntity.class, "i")
                            .where("i.name").eqExpression("b.name")
                            .select("i.value")
                            .where("i.value").eqExpression("TREAT(b AS " + strategy + "Sub1).embeddable1.sub1SomeValue")
                        .end()
                        .selectSubquery()
                            .from(IntIdEntity.class, "i")
                            .where("i.name").eqExpression("b.name")
                            .select("i.value")
                            .where("i.value").eqExpression("TREAT(b AS " + strategy + "Sub2).embeddable2.sub2SomeValue")
                        .end()
        );

        // From => 4 instances
        // There are 2 IntIdEntity instances per Base instance
        // For the 2 Sub1 instances, their sub1SomeValue is returned
        // For the 2 Sub2 instances, null is emmitted
        // The second subquery is like the first but for Sub2
        Assert.assertEquals(4, bases.size());
        assertRemoved(bases, new Object[] { 1,    null });
        assertRemoved(bases, new Object[] { 101,  null });
        assertRemoved(bases, new Object[] { null, 2    });
        assertRemoved(bases, new Object[] { null, 102  });
    }

    // NOTE: EclipseLink is broken in this regard and it's unfortunately not possible to fix or workaround this: https://github.com/eclipse-ee4j/eclipselink/issues/428
    @Test
    public void whereTreatedRootBasic() {
        assumeTreatInNonPredicateDoesNotFilter();
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .where("COALESCE(TREAT(b AS " + strategy + "Sub1).sub1Value, 0)").ltExpression("100")
        );

        // From => 4 instances
        // Where => 3 instance because 1 Sub1 has sub1Value 101, the others are Sub2s
        Assert.assertEquals(3, bases.size());
        assertRemoved(bases, objectPrefix + "2.parent");
        assertRemoved(bases, objectPrefix + "1");
        assertRemoved(bases, objectPrefix + "2");
    }

    @Test
    public void whereTreatedRootBasicOr() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .whereOr()
                            .where("TYPE(b)").notEqExpression(strategy + "Sub1")
                            .where("COALESCE(TREAT(b AS " + strategy + "Sub1).sub1Value, 0)").ltExpression("100")
                        .endOr()
        );

        // From => 4 instances
        // Where => 3 instance because 1 Sub1 has sub1Value 101, the others are Sub2s
        Assert.assertEquals(3, bases.size());
        assertRemoved(bases, objectPrefix + "2.parent");
        assertRemoved(bases, objectPrefix + "1");
        assertRemoved(bases, objectPrefix + "2");
    }

    // NOTE: EclipseLink is broken in this regard and it's unfortunately not possible to fix or workaround this: https://github.com/eclipse-ee4j/eclipselink/issues/428
    @Test
    public void whereMultipleTreatedRootBasic() {
        assumeTreatInNonPredicateDoesNotFilter();
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .where("COALESCE(TREAT(b AS " + strategy + "Sub1).sub1Value, 0)").ltExpression("100")
                        .where("COALESCE(TREAT(b AS " + strategy + "Sub2).sub2Value, 0)").ltExpression("100")
        );

        // From => 4 instances
        // Where => 2 instances because one Sub1 has sub1Value 1 and one Sub2 has sub2Value 1
        Assert.assertEquals(2, bases.size());
        assertRemoved(bases, objectPrefix + "1");
        assertRemoved(bases, objectPrefix + "2");
    }

    @Test
    public void whereMultipleTreatedRootBasicOr() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .whereOr()
                            .where("TYPE(b)").notEqExpression(strategy + "Sub1")
                            .where("COALESCE(TREAT(b AS " + strategy + "Sub1).sub1Value, 0)").ltExpression("100")
                        .endOr()
                        .whereOr()
                            .where("TYPE(b)").notEqExpression(strategy + "Sub2")
                            .where("COALESCE(TREAT(b AS " + strategy + "Sub2).sub2Value, 0)").ltExpression("100")
                        .endOr()
        );

        // From => 4 instances
        // Where => 2 instances because 1 Sub1 has sub1Value 101, the other has 1
        // 1 Sub2 has sub2Value 102, the other has 2
        Assert.assertEquals(2, bases.size());
        assertRemoved(bases, objectPrefix + "1");
        assertRemoved(bases, objectPrefix + "2");
    }

    // NOTE: EclipseLink is broken in this regard and it's unfortunately not possible to fix or workaround this: https://github.com/eclipse-ee4j/eclipselink/issues/428
    @Test
    public void whereTreatedRootEmbeddableBasic() {
        assumeTreatInNonPredicateDoesNotFilter();
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .where("COALESCE(TREAT(b AS " + strategy + "Sub1).embeddable1.sub1SomeValue, 0)").ltExpression("100")
        );

        // From => 4 instances
        // Where => 1 instance because 1 Sub1 has sub1Value 101, the others are Sub2s
        Assert.assertEquals(3, bases.size());
        assertRemoved(bases, objectPrefix + "2.parent");
        assertRemoved(bases, objectPrefix + "1");
        assertRemoved(bases, objectPrefix + "2");
    }

    @Test
    public void whereTreatedRootEmbeddableBasicOr() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .whereOr()
                            .where("TYPE(b)").notEqExpression(strategy + "Sub1")
                            .where("COALESCE(TREAT(b AS " + strategy + "Sub1).embeddable1.sub1SomeValue, 0)").ltExpression("100")
                        .endOr()
        );

        // From => 4 instances
        // Where => 3 instances because 1 Sub1 has sub1Value 101, the other has 1 and Sub2s use 0 because of coalesce
        Assert.assertEquals(3, bases.size());
        assertRemoved(bases, objectPrefix + "2.parent");
        assertRemoved(bases, objectPrefix + "1");
        assertRemoved(bases, objectPrefix + "2");
    }

    // NOTE: EclipseLink is broken in this regard and it's unfortunately not possible to fix or workaround this: https://github.com/eclipse-ee4j/eclipselink/issues/428
    @Test
    public void whereMultipleTreatedRootEmbeddableBasic() {
        assumeTreatInNonPredicateDoesNotFilter();
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .where("COALESCE(TREAT(b AS " + strategy + "Sub1).embeddable1.sub1SomeValue, 0)").ltExpression("100")
                        .where("COALESCE(TREAT(b AS " + strategy + "Sub2).embeddable2.sub2SomeValue, 0)").ltExpression("100")
        );

        // From => 4 instances
        // Where => 2 instances because one Sub1 has sub1Value 1 and one Sub2 has sub2Value 1
        Assert.assertEquals(2, bases.size());
        assertRemoved(bases, objectPrefix + "1");
        assertRemoved(bases, objectPrefix + "2");
    }

    @Test
    public void whereMultipleTreatedRootEmbeddableBasicOr() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .whereOr()
                            .where("TYPE(b)").notEqExpression(strategy + "Sub1")
                            .where("COALESCE(TREAT(b AS " + strategy + "Sub1).embeddable1.sub1SomeValue, 0)").ltExpression("100")
                        .endOr()
                        .whereOr()
                            .where("TYPE(b)").notEqExpression(strategy + "Sub2")
                            .where("COALESCE(TREAT(b AS " + strategy + "Sub2).embeddable2.sub2SomeValue, 0)").ltExpression("100")
                        .endOr()
        );

        // From => 4 instances
        // Where => 2 instances because 1 Sub1 has sub1SomeValue 101, the other has 1
        // 1 Sub2 has sub2SomeValue 102, the other has 2
        Assert.assertEquals(2, bases.size());
        assertRemoved(bases, objectPrefix + "1");
        assertRemoved(bases, objectPrefix + "2");
    }

    @Test
    public void whereTreatedRootConditionBasic() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .where("TREAT(b AS " + strategy + "Sub1).sub1Value").eqExpression("101")
        );

        // From => 4 instances
        // Where => 1 instance because 1 Sub1 has sub1Value 101
        Assert.assertEquals(1, bases.size());
        assertRemoved(bases, objectPrefix + "1.parent");
    }

    @Test
    public void whereMultipleTreatedRootConditionBasic() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .whereOr()
                            .where("TREAT(b AS " + strategy + "Sub1).sub1Value").eqExpression("101")
                            .where("TREAT(b AS " + strategy + "Sub2).sub2Value").eqExpression("102")
                        .endOr()

        );

        // From => 4 instances
        // Where => 2 instances because 1 Sub1 has sub1Value 101 and 1 Sub2 has sub2Value 102
        Assert.assertEquals(2, bases.size());
        assertRemoved(bases, objectPrefix + "1.parent");
        assertRemoved(bases, objectPrefix + "2.parent");
    }

    @Test
    public void whereTreatedRootConditionEmbeddableBasic() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .where("TREAT(b AS " + strategy + "Sub1).embeddable1.sub1SomeValue").eqExpression("101")
        );

        // From => 4 instances
        // Where => 1 instance because 1 Sub1 has sub1SomeValue 101
        Assert.assertEquals(1, bases.size());
        assertRemoved(bases, objectPrefix + "1.parent");
    }

    @Test
    public void whereMultipleTreatedRootConditionEmbeddableBasic() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .whereOr()
                            .where("TREAT(b AS " + strategy + "Sub1).embeddable1.sub1SomeValue").eqExpression("101")
                            .where("TREAT(b AS " + strategy + "Sub2).embeddable2.sub2SomeValue").eqExpression("102")
                        .endOr()

        );

        // From => 4 instances
        // Where => 2 instances because 1 Sub1 has sub1SomeValue 101 and 1 Sub2 has sub2SomeValue 102
        Assert.assertEquals(2, bases.size());
        assertRemoved(bases, objectPrefix + "1.parent");
        assertRemoved(bases, objectPrefix + "2.parent");
    }

    @Test
    public void whereTreatedRootConditionNegated() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .setWhereExpression("NOT(TREAT(b AS " + strategy + "Sub1).sub1Value = 101)")
        );

        // From => 4 instances
        // Where => 1 instance because 1 Sub1 has sub1Value 1, for the other objects the treat comparison result in NULL, leading to FALSE overall
        Assert.assertEquals(1, bases.size());
        assertRemoved(bases, objectPrefix + "1");
    }

    @Test
    public void whereMultipleTreatedRootConditionNegated() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .setWhereExpression("NOT(TREAT(b AS " + strategy + "Sub1).sub1Value = 101) AND NOT(TREAT(b AS " + strategy + "Sub2).sub2Value = 102)")
        );

        // From => 4 instances
        // Where => 0 instances because one of the treat comparisons result in NULL, leading to FALSE overall
        Assert.assertEquals(0, bases.size());
    }

    @Test
    public void whereTreatedRootConditionSuperTypeAccess() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .where("TREAT(b AS " + strategy + "Sub1).value").gtExpression("100")
        );

        // From => 4 instances
        // Where => 1 instance because 1 Sub1 has value 101, the other has 1 and Sub2s are excluded because of type constraint
        Assert.assertEquals(1, bases.size());
        assertRemoved(bases, objectPrefix + "1.parent");
    }

    @Test
    public void whereMultipleTreatedRootConditionSuperTypeAccess() {
        List<String> bases = list(
                from(String.class, "Base", "b")
                        .select("b.name")
                        .whereOr()
                            .where("TREAT(b AS " + strategy + "Sub1).value").gtExpression("100")
                            .where("TREAT(b AS " + strategy + "Sub2).value").ltExpression("100")
                        .endOr()
        );

        // From => 4 instances
        // Where => 2 instances because 1 Sub1 has value 101 and 1 Sub2 has value 102 the has value 1
        Assert.assertEquals(2, bases.size());
        assertRemoved(bases, objectPrefix + "1.parent");
        assertRemoved(bases, objectPrefix + "2");
    }

}


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;

namespace RDFSharp.Test.Model
{
    [TestClass]
    public class RDFTargetClassTest
    {
        #region Test
        [TestMethod]
        public void ShouldCreateTargetClass()
        {
            RDFTargetClass targetClass = new RDFTargetClass(new RDFResource("ex:targetClass"));

            Assert.IsNotNull(targetClass);
            Assert.IsTrue(targetClass.TargetValue.Equals(new RDFResource("ex:targetClass")));
        }

        [TestMethod]
        public void ShouldThrowExceptionOnCreatingTargetClassBecauseNullValue()
            => Assert.ThrowsException<RDFModelException>(() => new RDFTargetClass(null));

        [TestMethod]
        public void ShouldExportTargetClass()
        {
            RDFTargetClass targetClass = new RDFTargetClass(new RDFResource("ex:targetClass"));
            RDFGraph graph = targetClass.ToRDFGraph(new RDFNodeShape(new RDFResource("ex:nodeShape")));

            Assert.IsNotNull(graph);
            Assert.IsTrue(graph.TriplesCount == 1);
            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("ex:nodeShape"), RDFVocabulary.SHACL.TARGET_CLASS, targetClass.TargetValue)));
        }
        #endregion
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.edx.mobile.player;

import android.graphics.Point;

public interface IPlayerListener {

    public void onError();
    public void onVideoLagging();
    public void onVideoNotSeekable();
    public void onPreparing();
    public void onPrepared();
    public void onPlaybackPaused();
    public void onPlaybackStarted();
    public void onPlaybackComplete();
    public void onFullScreen(boolean isFullScreen);
    public void callSettings(Point p);
    public void callPlayerSeeked(long lastPostion, long newPosition, boolean isRewindClicked);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="62">
  <logicalFolder name="root" displayName="root" projectFiles="true">
    <logicalFolder name="HeaderFiles"
                   displayName="Header Files"
                   projectFiles="true">
      <itemPath>NU32.h</itemPath>
      <itemPath>PWM.h</itemPath>
      <itemPath>Ultrasonic.h</itemPath>
      <itemPath>main.h</itemPath>
    </logicalFolder>
    <logicalFolder name="LinkerScript"
                   displayName="Linker Files"
                   projectFiles="true">
      <itemPath>NU32bootloaded.ld</itemPath>
    </logicalFolder>
    <logicalFolder name="f1" displayName="Sample Code" projectFiles="true">
    </logicalFolder>
    <logicalFolder name="SourceFiles"
                   displayName="Source Files"
                   projectFiles="true">
      <itemPath>NU32.c</itemPath>
      <itemPath>Servo.c</itemPath>
      <itemPath>PWM.c</itemPath>
      <itemPath>main.c</itemPath>
      <itemPath>Ultrasonic.c</itemPath>
    </logicalFolder>
    <logicalFolder name="ExternalFiles"
                   displayName="Important Files"
                   projectFiles="false">
      <itemPath>Makefile</itemPath>
    </logicalFolder>
  </logicalFolder>
  <sourceRootList>
    <Elem>.</Elem>
  </sourceRootList>
  <projectmakefile>Makefile</projectmakefile>
  <confs>
    <conf name="default" type="2">
      <toolsSet>
        <developmentServer>localhost</developmentServer>
        <targetDevice>PIC32MX795F512L</targetDevice>
        <targetHeader></targetHeader>
        <targetPluginBoard></targetPluginBoard>
        <platformTool>ICD3PlatformTool</platformTool>
        <languageToolchain>XC32</languageToolchain>
        <languageToolchainVersion>1.31</languageToolchainVersion>
        <platform>2</platform>
      </toolsSet>
      <compileType>
        <linkerTool>
          <linkerLibItems>
          </linkerLibItems>
        </linkerTool>
        <loading>
          <useAlternateLoadableFile>false</useAlternateLoadableFile>
          <parseOnProdLoad>false</parseOnProdLoad>
          <alternateLoadableFile></alternateLoadableFile>
        </loading>
      </compileType>
      <makeCustomizationType>
        <makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
        <makeCustomizationPreStep></makeCustomizationPreStep>
        <makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
        <makeCustomizationPostStep></makeCustomizationPostStep>
        <makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
        <makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
        <makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
      </makeCustomizationType>
      <C32>
        <property key="additional-warnings" value="false"/>
        <property key="enable-app-io" value="false"/>
        <property key="enable-omit-frame-pointer" value="false"/>
        <property key="enable-symbols" value="true"/>
        <property key="enable-unroll-loops" value="false"/>
        <property key="exclude-floating-point" value="false"/>
        <property key="extra-include-directories" value=""/>
        <property key="generate-16-bit-code" value="false"/>
        <property key="generate-micro-compressed-code" value="false"/>
        <property key="isolate-each-function" value="false"/>
        <property key="make-warnings-into-errors" value="false"/>
        <property key="optimization-level" value=""/>
        <property key="place-data-into-section" value="false"/>
        <property key="post-instruction-scheduling" value="default"/>
        <property key="pre-instruction-scheduling" value="default"/>
        <property key="preprocessor-macros" value=""/>
        <property key="strict-ansi" value="false"/>
        <property key="support-ansi" value="false"/>
        <property key="use-cci" value="false"/>
        <property key="use-iar" value="false"/>
        <property key="use-indirect-calls" value="false"/>
      </C32>
      <C32-AR>
      </C32-AR>
      <C32-AS>
      </C32-AS>
      <C32-LD>
        <property key="additional-options-use-response-files" value="false"/>
        <property key="enable-check-sections" value="false"/>
        <property key="exclude-floating-point-library" value="false"/>
        <property key="exclude-standard-libraries" value="false"/>
        <property key="extra-lib-directories" value=""/>
        <property key="fill-flash-options-addr" value=""/>
        <property key="fill-flash-options-const" value=""/>
        <property key="fill-flash-options-how" value="0"/>
        <property key="fill-flash-options-inc-const" value="1"/>
        <property key="fill-flash-options-increment" value=""/>
        <property key="fill-flash-options-seq" value=""/>
        <property key="fill-flash-options-what" value="0"/>
        <property key="generate-16-bit-code" value="false"/>
        <property key="generate-cross-reference-file" value="false"/>
        <property key="generate-micro-compressed-code" value="false"/>
        <property key="heap-size" value=""/>
        <property key="input-libraries" value=""/>
        <property key="linker-symbols" value=""/>
        <property key="map-file" value="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map"/>
        <property key="no-startup-files" value="false"/>
        <property key="oXC32ld-extra-opts" value=""/>
        <property key="optimization-level" value=""/>
        <property key="preprocessor-macros" value=""/>
        <property key="remove-unused-sections" value="false"/>
        <property key="report-memory-usage" value="false"/>
        <property key="stack-size" value=""/>
        <property key="symbol-stripping" value=""/>
        <property key="trace-symbols" value=""/>
        <property key="warn-section-align" value="false"/>
      </C32-LD>
      <C32CPP>
        <property key="additional-warnings" value="false"/>
        <property key="check-new" value="false"/>
        <property key="eh-specs" value="true"/>
        <property key="enable-app-io" value="false"/>
        <property key="enable-omit-frame-pointer" value="false"/>
        <property key="enable-symbols" value="true"/>
        <property key="enable-unroll-loops" value="false"/>
        <property key="exceptions" value="true"/>
        <property key="exclude-floating-point" value="false"/>
        <property key="extra-include-directories" value=""/>
        <property key="generate-16-bit-code" value="false"/>
        <property key="generate-micro-compressed-code" value="false"/>
        <property key="isolate-each-function" value="false"/>
        <property key="make-warnings-into-errors" value="false"/>
        <property key="optimization-level" value=""/>
        <property key="place-data-into-section" value="false"/>
        <property key="post-instruction-scheduling" value="default"/>
        <property key="pre-instruction-scheduling" value="default"/>
        <property key="preprocessor-macros" value=""/>
        <property key="rtti" value="true"/>
        <property key="strict-ansi" value="false"/>
        <property key="use-cci" value="false"/>
        <property key="use-iar" value="false"/>
        <property key="use-indirect-calls" value="false"/>
      </C32CPP>
      <C32Global>
        <property key="legacy-libc" value="false"/>
        <property key="save-temps" value="false"/>
        <property key="wpo-lto" value="false"/>
      </C32Global>
      <ICD3PlatformTool>
        <property key="ADC 1" value="true"/>
        <property key="AutoSelectMemRanges" value="auto"/>
        <property key="CAN1" value="true"/>
        <property key="CAN2" value="true"/>
        <property key="CHANGE NOTICE" value="true"/>
        <property key="COMPARATOR" value="true"/>
        <property key="DMA" value="true"/>
        <property key="ETHERNET CONTROLLER" value="true"/>
        <property key="Freeze All Other Peripherals" value="true"/>
        <property key="I2C1" value="true"/>
        <property key="I2C2" value="true"/>
        <property key="I2C3" value="true"/>
        <property key="I2C4" value="true"/>
        <property key="I2C5" value="true"/>
        <property key="INPUT CAPTURE 1" value="true"/>
        <property key="INPUT CAPTURE 2" value="true"/>
        <property key="INPUT CAPTURE 3" value="true"/>
        <property key="INPUT CAPTURE 4" value="true"/>
        <property key="INPUT CAPTURE 5" value="true"/>
        <property key="INTERRUPT CONTROL" value="true"/>
        <property key="OUTPUT COMPARE 1" value="true"/>
        <property key="OUTPUT COMPARE 2" value="true"/>
        <property key="OUTPUT COMPARE 3" value="true"/>
        <property key="OUTPUT COMPARE 4" value="true"/>
        <property key="OUTPUT COMPARE 5" value="true"/>
        <property key="PARALLEL MASTER/SLAVE PORT" value="true"/>
        <property key="REAL TIME CLOCK" value="true"/>
        <property key="SecureSegment.SegmentProgramming" value="FullChipProgramming"/>
        <property key="TIMER1" value="true"/>
        <property key="TIMER2" value="true"/>
        <property key="TIMER3" value="true"/>
        <property key="TIMER4" value="true"/>
        <property key="TIMER5" value="true"/>
        <property key="ToolFirmwareFilePath"
                  value="Press to browse for a specific firmware version"/>
        <property key="ToolFirmwareOption.UseLatestFirmware" value="true"/>
        <property key="UART1" value="true"/>
        <property key="UART2" value="true"/>
        <property key="UART3" value="true"/>
        <property key="UART4" value="true"/>
        <property key="UART5" value="true"/>
        <property key="UART6" value="true"/>
        <property key="debugoptions.useswbreakpoints" value="false"/>
        <property key="hwtoolclock.frcindebug" value="false"/>
        <property key="memories.aux" value="false"/>
        <property key="memories.bootflash" value="false"/>
        <property key="memories.configurationmemory" value="false"/>
        <property key="memories.eeprom" value="true"/>
        <property key="memories.flashdata" value="true"/>
        <property key="memories.id" value="true"/>
        <property key="memories.programmemory" value="true"/>
        <property key="memories.programmemory.end" value="0x1d07ffff"/>
        <property key="memories.programmemory.start" value="0x1d000000"/>
        <property key="poweroptions.powerenable" value="false"/>
        <property key="programoptions.eraseb4program" value="true"/>
        <property key="programoptions.preserveeeprom" value="false"/>
        <property key="programoptions.preserveprogramrange" value="false"/>
        <property key="programoptions.preserveprogramrange.end" value="0x1d07ffff"/>
        <property key="programoptions.preserveprogramrange.start" value="0x1d000000"/>
        <property key="programoptions.preserveuserid" value="false"/>
        <property key="programoptions.testmodeentrymethod" value="VPPFirst"/>
        <property key="programoptions.usehighvoltageonmclr" value="false"/>
        <property key="programoptions.uselvpprogramming" value="false"/>
        <property key="voltagevalue" value="3.25"/>
      </ICD3PlatformTool>
      <item path="Servo.c" ex="true" overriding="false">
        <C32>
        </C32>
        <C32-AR>
        </C32-AR>
        <C32-AS>
        </C32-AS>
        <C32-LD>
        </C32-LD>
        <C32CPP>
        </C32CPP>
        <C32Global>
        </C32Global>
      </item>
    </conf>
  </confs>
</configurationDescriptor>


text:
/**
 * A project is a collection of handlers
**/
var Project = exports.Project = function(name, author) {
    this.name = name;
    this.author = author;
    this.handlers = {};
    this.handlersLength = 0;
};

Project.prototype.addHandler = function(handler) {
    this.handlers[handler.id] = handler;
    this.handlersLength++;
    this.lastHandler = handler;
};

Project.prototype.removeHandler = function(handler) {
    delete this.handlers[handler.id];
    this.handlersLength--;
	self = this;
	Object.keys(this.handlers).forEach(function (h) {
		self.lastHandler = self.handlers[h];
	});
};

Project.prototype.toString = function() {
    return this.name;
};

Object.defineProperty(Project.prototype, "id", {
    get: function() {
        return this.toString();
    }
});


text:
package org.demo.data.converter;

import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.GenericConverter;

import java.util.Set;

public class MultipleConverter implements GenericConverter {

    @Override
    public Set<ConvertiblePair> getConvertibleTypes() {
        return null;
    }

    @Override
    public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
        return null;
    }

}


text:
/**
 * Created by Zura on 4/5/2016.
 */
$(function () {
    Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, {
        size: 'mini',
        // delay: false,
        position: 'right top'
    });

    //Basic example
    $('#todo-lists-basic-demo').lobiList({
        lists: [
            {
                id: 'todo',
                title: 'TODO',
                defaultStyle: 'lobilist-info',
                items: [
                    {
                        title: 'Floor cool cinders',
                        description: 'Thunder fulfilled travellers folly, wading, lake.',
                        dueDate: '2015-01-31'
                    },
                    {
                        title: 'Periods pride',
                        description: 'Accepted was mollis',
                        done: true
                    },
                    {
                        title: 'Flags better burns pigeon',
                        description: 'Rowed cloven frolic thereby, vivamus pining gown intruding strangers prank treacherously darkling.'
                    },
                    {
                        title: 'Accepted was mollis',
                        description: 'Rowed cloven frolic thereby, vivamus pining gown intruding strangers prank treacherously darkling.',
                        dueDate: '2015-02-02'
                    }
                ]
            },
            {
                title: 'DOING',
                items: [
                    {
                        title: 'Composed trays',
                        description: 'Hoary rattle exulting suspendisse elit paradises craft wistful. Bayonets allures prefer traits wrongs flushed. Tent wily matched bold polite slab coinage celerities gales beams.'
                    },
                    {
                        title: 'Chic leafy'
                    },
                    {
                        title: 'Guessed interdum armies chirp writhes most',
                        description: 'Came champlain live leopards twilight whenever warm read wish squirrel rock.',
                        dueDate: '2015-02-04',
                        done: true
                    }
                ]
            }
        ]
    });
    //Custom datepicker
    $('#todo-lists-demo-datepicker').lobiList({
        lists: [
            {
                title: 'TODO',
                defaultStyle: 'lobilist-info',
                items: [
                    {
                        title: 'Floor cool cinders',
                        description: 'Thunder fulfilled travellers folly, wading, lake.',
                        dueDate: '2015-01-31'
                    }
                ]
            }
        ],
        afterListAdd: function(lobilist, list){
            var $dueDateInput = list.$el.find('form [name=dueDate]');
            $dueDateInput.datepicker();
        }
    });
    // Event handling
    (function () {
        var list;

        $('#todo-lists-initialize-btn').click(function () {
            list = $('#todo-lists-demo-events')
                .lobiList({
                    init: function () {
                        Lobibox.notify('default', {
                            msg: 'init'
                        });
                    },
                    beforeDestroy: function () {
                        Lobibox.notify('default', {
                            msg: 'beforeDestroy'
                        });
                    },
                    afterDestroy: function () {
                        Lobibox.notify('default', {
                            msg: 'afterDestroy'
                        });
                    },
                    beforeListAdd: function () {
                        Lobibox.notify('default', {
                            msg: 'beforeListAdd'
                        });
                    },
                    afterListAdd: function () {
                        Lobibox.notify('default', {
                            msg: 'afterListAdd'
                        });
                    },
                    beforeListRemove: function () {
                        Lobibox.notify('default', {
                            msg: 'beforeListRemove'
                        });
                    },
                    afterListRemove: function () {
                        Lobibox.notify('default', {
                            msg: 'afterListRemove'
                        });
                    },
                    beforeItemAdd: function () {
                        Lobibox.notify('default', {
                            msg: 'beforeItemAdd'
                        });
                    },
                    afterItemAdd: function () {
                        console.log(arguments);
                        Lobibox.notify('default', {
                            msg: 'afterItemAdd'
                        });
                    },
                    beforeItemUpdate: function () {
                        Lobibox.notify('default', {
                            msg: 'beforeItemUpdate'
                        });
                    },
                    afterItemUpdate: function () {
                        console.log(arguments);
                        Lobibox.notify('default', {
                            msg: 'afterItemUpdate'
                        });
                    },
                    beforeItemDelete: function () {
                        Lobibox.notify('default', {
                            msg: 'beforeItemDelete'
                        });
                    },
                    afterItemDelete: function () {
                        Lobibox.notify('default', {
                            msg: 'afterItemDelete'
                        });
                    },
                    beforeListDrop: function () {
                        Lobibox.notify('default', {
                            msg: 'beforeListDrop'
                        });
                    },
                    afterListReorder: function () {
                        Lobibox.notify('default', {
                            msg: 'afterListReorder'
                        });
                    },
                    beforeItemDrop: function () {
                        Lobibox.notify('default', {
                            msg: 'beforeItemDrop'
                        });
                    },
                    afterItemReorder: function () {
                        Lobibox.notify('default', {
                            msg: 'afterItemReorder'
                        });
                    },
                    afterMarkAsDone: function () {
                        Lobibox.notify('default', {
                            msg: 'afterMarkAsDone'
                        });
                    },
                    afterMarkAsUndone: function () {
                        Lobibox.notify('default', {
                            msg: 'afterMarkAsUndone'
                        });
                    },
                    styleChange: function(list, oldStyle, newStyle){
                        console.log(arguments);
                        Lobibox.notify('default', {
                            msg: 'styleChange: Old style - "'+oldStyle+'". New style - "'+ newStyle +'"'
                        });
                    },
                    titleChange: function(list, oldTitle, newTitle){
                        console.log(arguments);
                        Lobibox.notify('default', {
                            msg: 'titleChange: Old title - "'+oldTitle+'". New title - "'+ newTitle + '"'
                        });
                    },
                    lists: [
                        {
                            title: 'TODO',
                            defaultStyle: 'lobilist-info',
                            items: [
                                {
                                    title: 'Floor cool cinders',
                                    description: 'Thunder fulfilled travellers folly, wading, lake.',
                                    dueDate: '2015-01-31'
                                },
                                {
                                    title: 'Periods pride',
                                    description: 'Accepted was mollis',
                                    done: true
                                },
                                {
                                    title: 'Flags better burns pigeon',
                                    description: 'Rowed cloven frolic thereby, vivamus pining gown intruding strangers prank ' +
                                    'treacherously darkling.'
                                },
                                {
                                    title: 'Accepted was mollis',
                                    description: 'Rowed cloven frolic thereby, vivamus pining gown intruding strangers prank ' +
                                    'treacherously darkling.',
                                    dueDate: '2015-02-02'
                                }
                            ]
                        }
                    ]
                })
                .data('lobiList');
        });

        $('#todo-lists-destroy-btn').click(function () {
            list.destroy();
        });
    })();
    // Custom controls
    $('#todo-lists-demo-controls').lobiList({
        lists: [
            {
                title: 'TODO',
                defaultStyle: 'lobilist-info',
                controls: ['edit', 'styleChange'],
                items: [
                    {
                        title: 'Floor cool cinders',
                        description: 'Thunder fulfilled travellers folly, wading, lake.',
                        dueDate: '2015-01-31'
                    }
                ]
            },
            {
                title: 'Disabled custom checkboxes',
                defaultStyle: 'lobilist-danger',
                controls: ['edit', 'add', 'remove'],
                useLobicheck: false,
                items: [
                    {
                        title: 'Periods pride',
                        description: 'Accepted was mollis',
                        done: true
                    }
                ]
            },
            {
                title: 'Controls disabled',
                controls: false,
                items: [
                    {
                        title: 'Composed trays',
                        description: 'Hoary rattle exulting suspendisse elit paradises craft wistful. ' +
                        'Bayonets allures prefer traits wrongs flushed. Tent wily matched bold polite slab coinage ' +
                        'celerities gales beams.'
                    }
                ]
            },
            {
                title: 'Disabled todo edit/remove',
                enableTodoRemove: false,
                enableTodoEdit: false,
                items: [
                    {
                        title: 'Composed trays',
                        description: 'Hoary rattle exulting suspendisse elit paradises craft wistful. ' +
                        'Bayonets allures prefer traits wrongs flushed. Tent wily matched bold polite slab coinage ' +
                        'celerities gales beams.'
                    }
                ]
            }
        ]
    });
    // Disabled drag & drop
    $('#todo-lists-demo-sorting').lobiList({
        sortable: false,
        lists: [
            {
                title: 'TODO',
                defaultStyle: 'lobilist-info',
                controls: ['edit', 'styleChange'],
                items: [
                    {
                        title: 'Floor cool cinders',
                        description: 'Thunder fulfilled travellers folly, wading, lake.',
                        dueDate: '2015-01-31'
                    }
                ]
            },
            {
                title: 'Controls disabled',
                controls: false,
                items: [
                    {
                        title: 'Composed trays',
                        description: 'Hoary rattle exulting suspendisse elit paradises craft wistful. Bayonets allures prefer traits wrongs flushed. Tent wily matched bold polite slab coinage celerities gales beams.'
                    }
                ]
            }
        ]
    });

    $('#actions-by-ajax').lobiList({
        actions: {
            load: 'demo/example1/load.json',
            insert: 'demo/example1/insert.php',
            delete: 'demo/example1/delete.php',
            update: 'demo/example1/update.php'
        },
        afterItemAdd: function(){
            console.log(arguments);
        }
    });
});


text:
namespace Graphics
{

bool Model::LoadAssimp(const char *filename)
{
	Assimp::Importer importer;

	// remove unused data
	importer.SetPropertyInteger(AI_CONFIG_PP_RVC_FLAGS,
		aiComponent_COLORS | aiComponent_LIGHTS | aiComponent_CAMERAS);

	// max triangles and vertices per mesh, splits above this threshold
	importer.SetPropertyInteger(AI_CONFIG_PP_SLM_TRIANGLE_LIMIT, INT_MAX);
	importer.SetPropertyInteger(AI_CONFIG_PP_SLM_VERTEX_LIMIT, 0xfffe); // avoid the primitive restart index

	// remove points and lines
	importer.SetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE, aiPrimitiveType_POINT | aiPrimitiveType_LINE);

	const aiScene *scene = importer.ReadFile(filename,
		aiProcess_CalcTangentSpace |
		aiProcess_JoinIdenticalVertices |
		aiProcess_Triangulate |
		aiProcess_RemoveComponent |
		aiProcess_GenSmoothNormals |
		aiProcess_SplitLargeMeshes |
		aiProcess_ValidateDataStructure |
		//aiProcess_ImproveCacheLocality | // handled by optimizePostTransform()
		aiProcess_RemoveRedundantMaterials |
		aiProcess_SortByPType |
		aiProcess_FindInvalidData |
		aiProcess_GenUVCoords |
		aiProcess_TransformUVCoords |
		aiProcess_OptimizeMeshes |
		aiProcess_OptimizeGraph);

	if (scene == nullptr)
		return false;

	if (scene->HasTextures())
	{
		// embedded textures...
	}

	if (scene->HasAnimations())
	{
		// todo
	}

	m_Header.materialCount = scene->mNumMaterials;
	m_pMaterial = new Material [m_Header.materialCount];
	memset(m_pMaterial, 0, sizeof(Material) * m_Header.materialCount);
	for (unsigned int materialIndex = 0; materialIndex < scene->mNumMaterials; materialIndex++)
	{
		const aiMaterial *srcMat = scene->mMaterials[materialIndex];
		Material *dstMat = m_pMaterial + materialIndex;

		aiColor3D diffuse(1.0f, 1.0f, 1.0f);
		aiColor3D specular(1.0f, 1.0f, 1.0f);
		aiColor3D ambient(1.0f, 1.0f, 1.0f);
		aiColor3D emissive(0.0f, 0.0f, 0.0f);
		aiColor3D transparent(1.0f, 1.0f, 1.0f);
		float opacity = 1.0f;
		float shininess = 0.0f;
		float specularStrength = 1.0f;
		aiString texDiffusePath;
		aiString texSpecularPath;
		aiString texEmissivePath;
		aiString texNormalPath;
		aiString texLightmapPath;
		aiString texReflectionPath;
		srcMat->Get(AI_MATKEY_COLOR_DIFFUSE, diffuse);
		srcMat->Get(AI_MATKEY_COLOR_SPECULAR, specular);
		srcMat->Get(AI_MATKEY_COLOR_AMBIENT, ambient);
		srcMat->Get(AI_MATKEY_COLOR_EMISSIVE, emissive);
		srcMat->Get(AI_MATKEY_COLOR_TRANSPARENT, transparent);
		srcMat->Get(AI_MATKEY_OPACITY, opacity);
		srcMat->Get(AI_MATKEY_SHININESS, shininess);
		srcMat->Get(AI_MATKEY_SHININESS_STRENGTH, specularStrength);
		srcMat->Get(AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE, 0), texDiffusePath);
		srcMat->Get(AI_MATKEY_TEXTURE(aiTextureType_SPECULAR, 0), texSpecularPath);
		srcMat->Get(AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE, 0), texEmissivePath);
		srcMat->Get(AI_MATKEY_TEXTURE(aiTextureType_NORMALS, 0), texNormalPath);
		srcMat->Get(AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP, 0), texLightmapPath);
		srcMat->Get(AI_MATKEY_TEXTURE(aiTextureType_REFLECTION, 0), texReflectionPath);

		dstMat->diffuse = Vector3(diffuse.r, diffuse.g, diffuse.b);
		dstMat->specular = Vector3(specular.r, specular.g, specular.b);
		dstMat->ambient = Vector3(ambient.r, ambient.g, ambient.b);
		dstMat->emissive = Vector3(emissive.r, emissive.g, emissive.b);
		dstMat->transparent = Vector3(transparent.r, transparent.g, transparent.b);
		dstMat->opacity = opacity;
		dstMat->shininess = shininess;
		dstMat->specularStrength = specularStrength;

		char *pRem = nullptr;

		strncpy_s(dstMat->texDiffusePath, "models/", Material::maxTexPath - 1);
		strncat_s(dstMat->texDiffusePath, texDiffusePath.C_Str(), Material::maxTexPath - 1);
		pRem = strrchr(dstMat->texDiffusePath, '.');
		while (pRem != nullptr && *pRem != 0) *(pRem++) = 0; // remove extension

		strncpy_s(dstMat->texSpecularPath, "models/", Material::maxTexPath - 1);
		strncat_s(dstMat->texSpecularPath, texSpecularPath.C_Str(), Material::maxTexPath - 1);
		pRem = strrchr(dstMat->texSpecularPath, '.');
		while (pRem != nullptr && *pRem != 0) *(pRem++) = 0; // remove extension

		strncpy_s(dstMat->texEmissivePath, "models/", Material::maxTexPath - 1);
		strncat_s(dstMat->texEmissivePath, texEmissivePath.C_Str(), Material::maxTexPath - 1);
		pRem = strrchr(dstMat->texEmissivePath, '.');
		while (pRem != nullptr && *pRem != 0) *(pRem++) = 0; // remove extension

		strncpy_s(dstMat->texNormalPath, "models/", Material::maxTexPath - 1);
		strncat_s(dstMat->texNormalPath, texNormalPath.C_Str(), Material::maxTexPath - 1);
		pRem = strrchr(dstMat->texNormalPath, '.');
		while (pRem != nullptr && *pRem != 0) *(pRem++) = 0; // remove extension

		strncpy_s(dstMat->texLightmapPath, "models/", Material::maxTexPath - 1);
		strncat_s(dstMat->texLightmapPath, texLightmapPath.C_Str(), Material::maxTexPath - 1);
		pRem = strrchr(dstMat->texLightmapPath, '.');
		while (pRem != nullptr && *pRem != 0) *(pRem++) = 0; // remove extension

		strncpy_s(dstMat->texReflectionPath, "models/", Material::maxTexPath - 1);
		strncat_s(dstMat->texReflectionPath, texReflectionPath.C_Str(), Material::maxTexPath - 1);
		pRem = strrchr(dstMat->texReflectionPath, '.');
		while (pRem != nullptr && *pRem != 0) *(pRem++) = 0; // remove extension

		aiString matName;
		srcMat->Get(AI_MATKEY_NAME, matName);
		strncpy_s(dstMat->name, matName.C_Str(), Material::maxMaterialName - 1);
	}

	m_Header.meshCount = scene->mNumMeshes;
	m_pMesh = new Mesh [m_Header.meshCount];
	memset(m_pMesh, 0, sizeof(Mesh) * m_Header.meshCount);
	// first pass, count everything
	for (unsigned int meshIndex = 0; meshIndex < scene->mNumMeshes; meshIndex++)
	{
		const aiMesh *srcMesh = scene->mMeshes[meshIndex];
		Mesh *dstMesh = m_pMesh + meshIndex;

		assert(srcMesh->mPrimitiveTypes == aiPrimitiveType_TRIANGLE);

		dstMesh->materialIndex = srcMesh->mMaterialIndex;

		// just store everything as float. Can quantize in Model::optimize()
		dstMesh->attribsEnabled |= attrib_mask_position;
		dstMesh->attrib[attrib_position].offset = dstMesh->vertexStride;
		dstMesh->attrib[attrib_position].normalized = 0;
		dstMesh->attrib[attrib_position].components = 3;
		dstMesh->attrib[attrib_position].format = attrib_format_float;
		dstMesh->vertexStride += sizeof(float) * 3;

		dstMesh->attribsEnabled |= attrib_mask_texcoord0;
		dstMesh->attrib[attrib_texcoord0].offset = dstMesh->vertexStride;
		dstMesh->attrib[attrib_texcoord0].normalized = 0;
		dstMesh->attrib[attrib_texcoord0].components = 2;
		dstMesh->attrib[attrib_texcoord0].format = attrib_format_float;
		dstMesh->vertexStride += sizeof(float) * 2;

		dstMesh->attribsEnabled |= attrib_mask_normal;
		dstMesh->attrib[attrib_normal].offset = dstMesh->vertexStride;
		dstMesh->attrib[attrib_normal].normalized = 0;
		dstMesh->attrib[attrib_normal].components = 3;
		dstMesh->attrib[attrib_normal].format = attrib_format_float;
		dstMesh->vertexStride += sizeof(float) * 3;

		dstMesh->attribsEnabled |= attrib_mask_tangent;
		dstMesh->attrib[attrib_tangent].offset = dstMesh->vertexStride;
		dstMesh->attrib[attrib_tangent].normalized = 0;
		dstMesh->attrib[attrib_tangent].components = 3;
		dstMesh->attrib[attrib_tangent].format = attrib_format_float;
		dstMesh->vertexStride += sizeof(float) * 3;

		dstMesh->attribsEnabled |= attrib_mask_bitangent;
		dstMesh->attrib[attrib_bitangent].offset = dstMesh->vertexStride;
		dstMesh->attrib[attrib_bitangent].normalized = 0;
		dstMesh->attrib[attrib_bitangent].components = 3;
		dstMesh->attrib[attrib_bitangent].format = attrib_format_float;
		dstMesh->vertexStride += sizeof(float) * 3;

		// depth-only
		dstMesh->attribsEnabledDepth |= attrib_mask_position;
		dstMesh->attribDepth[attrib_position].offset = dstMesh->vertexStrideDepth;
		dstMesh->attribDepth[attrib_position].normalized = 0;
		dstMesh->attribDepth[attrib_position].components = 3;
		dstMesh->attribDepth[attrib_position].format = attrib_format_float;
		dstMesh->vertexStrideDepth += sizeof(float) * 3;

		// color rendering
		dstMesh->vertexDataByteOffset = m_Header.vertexDataByteSize;
		dstMesh->vertexCount = srcMesh->mNumVertices;

		dstMesh->indexDataByteOffset = m_Header.indexDataByteSize;
		dstMesh->indexCount = srcMesh->mNumFaces * 3;

		m_Header.vertexDataByteSize += dstMesh->vertexStride * dstMesh->vertexCount;
		m_Header.indexDataByteSize += sizeof(uint16_t) * dstMesh->indexCount;

		// depth-only rendering
		dstMesh->vertexDataByteOffsetDepth = m_Header.vertexDataByteSizeDepth;
		dstMesh->vertexCountDepth = srcMesh->mNumVertices;

		m_Header.vertexDataByteSizeDepth += dstMesh->vertexStrideDepth * dstMesh->vertexCountDepth;
	}
	// allocate storage
	m_pVertexData = new unsigned char [m_Header.vertexDataByteSize];
	m_pIndexData = new unsigned char [m_Header.indexDataByteSize];
	m_pVertexDataDepth = new unsigned char [m_Header.vertexDataByteSizeDepth];
	m_pIndexDataDepth = new unsigned char [m_Header.indexDataByteSize];
	// second pass, fill in vertex and index data
	for (unsigned int meshIndex = 0; meshIndex < scene->mNumMeshes; meshIndex++)
	{
		const aiMesh *srcMesh = scene->mMeshes[meshIndex];
		Mesh *dstMesh = m_pMesh + meshIndex;

		float *dstPos = (float*)(m_pVertexData + dstMesh->vertexDataByteOffset + dstMesh->attrib[attrib_position].offset);
		float *dstTexcoord0 = (float*)(m_pVertexData + dstMesh->vertexDataByteOffset + dstMesh->attrib[attrib_texcoord0].offset);
		float *dstNormal = (float*)(m_pVertexData + dstMesh->vertexDataByteOffset + dstMesh->attrib[attrib_normal].offset);
		float *dstTangent = (float*)(m_pVertexData + dstMesh->vertexDataByteOffset + dstMesh->attrib[attrib_tangent].offset);
		float *dstBitangent = (float*)(m_pVertexData + dstMesh->vertexDataByteOffset + dstMesh->attrib[attrib_bitangent].offset);

		float *dstPosDepth = (float*)(m_pVertexDataDepth + dstMesh->vertexDataByteOffsetDepth + dstMesh->attribDepth[attrib_position].offset);

		for (unsigned int v = 0; v < dstMesh->vertexCount; v++)
		{
			if (srcMesh->mVertices)
			{
				dstPos[0] = srcMesh->mVertices[v].x;
				dstPos[1] = srcMesh->mVertices[v].y;
				dstPos[2] = srcMesh->mVertices[v].z;

				dstPosDepth[0] = srcMesh->mVertices[v].x;
				dstPosDepth[1] = srcMesh->mVertices[v].y;
				dstPosDepth[2] = srcMesh->mVertices[v].z;
			}
			else
			{
				// no position? That's kind of bad.
				assert(0);
			}
			dstPos = (float*)((unsigned char*)dstPos + dstMesh->vertexStride);
			dstPosDepth = (float*)((unsigned char*)dstPosDepth + dstMesh->vertexStrideDepth);

			if (srcMesh->mTextureCoords[0])
			{
				dstTexcoord0[0] = srcMesh->mTextureCoords[0][v].x;
				dstTexcoord0[1] = srcMesh->mTextureCoords[0][v].y;
			}
			else
			{
				dstTexcoord0[0] = 0.0f;
				dstTexcoord0[1] = 0.0f;
			}
			dstTexcoord0 = (float*)((unsigned char*)dstTexcoord0 + dstMesh->vertexStride);

			if (srcMesh->mNormals)
			{
				dstNormal[0] = srcMesh->mNormals[v].x;
				dstNormal[1] = srcMesh->mNormals[v].y;
				dstNormal[2] = srcMesh->mNormals[v].z;
			}
			else
			{
				// Assimp should generate normals if they are missing, according to the postprocessing flag specified on load,
				// so we should never get here.
				assert(0);
			}
			dstNormal = (float*)((unsigned char*)dstNormal + dstMesh->vertexStride);

			if (srcMesh->mTangents)
			{
				dstTangent[0] = srcMesh->mTangents[v].x;
				dstTangent[1] = srcMesh->mTangents[v].y;
				dstTangent[2] = srcMesh->mTangents[v].z;
			}
			else
			{
				// TODO: generate tangents/bitangents if missing
				dstTangent[0] = 1.0f;
				dstTangent[1] = 0.0f;
				dstTangent[2] = 0.0f;
			}
			dstTangent = (float*)((unsigned char*)dstTangent + dstMesh->vertexStride);

			if (srcMesh->mBitangents)
			{
				dstBitangent[0] = srcMesh->mBitangents[v].x;
				dstBitangent[1] = srcMesh->mBitangents[v].y;
				dstBitangent[2] = srcMesh->mBitangents[v].z;
			}
			else
			{
				// TODO: generate tangents/bitangents if missing
				dstBitangent[0] = 0.0f;
				dstBitangent[1] = 1.0f;
				dstBitangent[2] = 0.0f;
			}
			dstBitangent = (float*)((unsigned char*)dstBitangent + dstMesh->vertexStride);
		}

		uint16_t *dstIndex = (uint16_t*)(m_pIndexData + dstMesh->indexDataByteOffset);
		uint16_t *dstIndexDepth = (uint16_t*)(m_pIndexDataDepth + dstMesh->indexDataByteOffset);
		for (unsigned int f = 0; f < srcMesh->mNumFaces; f++)
		{
			assert(srcMesh->mFaces[f].mNumIndices == 3);

			*dstIndex++ = srcMesh->mFaces[f].mIndices[0];
			*dstIndex++ = srcMesh->mFaces[f].mIndices[1];
			*dstIndex++ = srcMesh->mFaces[f].mIndices[2];

			*dstIndexDepth++ = srcMesh->mFaces[f].mIndices[0];
			*dstIndexDepth++ = srcMesh->mFaces[f].mIndices[1];
			*dstIndexDepth++ = srcMesh->mFaces[f].mIndices[2];
		}
	}

	ComputeAllBoundingBoxes();

	return true;
}

} // namespace Graphics


text:
<?php

class CM_Clockwork_Event_ResultTest extends CMTest_TestCase {

    public function testIsSuccessful() {
        $result = new CM_Clockwork_Event_Result();
        $this->assertSame(false, $result->isSuccessful());

        $result->setSuccess();
        $this->assertSame(true, $result->isSuccessful());

        $result->setFailure();
        $this->assertSame(false, $result->isSuccessful());
    }
}


text:
Date: 2018-01-05

## Definitions

ES refers to elasticsearch

## Context
As a result of [ADR 004](adr-004-transition-mainstream-to-publishing-api-index.md)
we now process data from rabbit MQ and insert them into our search index. While the
process itself works as expected we have had scaling issues when large volumes
of messages arrive from the publishing API and sit in our sidekiq queue waiting to be
processed.

There are two scenarios that result in large queue sizes:

1. Republishing from the publishing API - this is something we want to support moving
forward as ultimately we would like the ability to rebuild the search index from scratch.
2. Changes to reference material (i.e. department name, taxons) which require all associated
documents to be updated.

Currently, both of the above processes sends a message to rabbitMQ which is then sent
to sidekiq before being processed into the ES index. The message currently
consists of a single document to be updated in the search index.

We know that this causes a bottleneck with ES, as it performs balancing work
after each insert, it is for this reason that the [ES documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html) recommends doing bulk
insertion of data rather than individual documents.

We have have already implemented the following items to support batch processing:

* Handling of batches of messages in the Rummager processor. This requeues all messages if
any of them fail during the ES update.
* Batching of messages as they are read off rabbit MQ by the [govuk_message_queue_consumer](https://github.com/alphagov/govuk_message_queue_consumer)

We have done some initial testing using the new batch processor and have the following results:

### Current process

Processing 1 message at a time for approx 10000 documents (employment_tribunal_decision format)

![Queue Size](images/1-queue.png)
![Free CPU](images/1-free-cpu.png)

### New process

Processing 100 messages at a time with a 5 second timeout for approx 10000 documents (employment_tribunal_decision format)

![Queue Size](images/100-queue.png)
![Free CPU](images/100-free-cpu.png)

### New process in bulk

Processing 100 messages at a time with a 5 second timeout for the top 4 formats - approx 125000 documents.

![Queue Size](images/100-bulk-queue.png)
![Free CPU](images/100-bulk-free-cpu.png)
![Sidekiq Errors](images/100-bulk-errors.png)

We don't see an increase in 500 error on dependant apps which means we aren't blocking
consumer applications as a result of increasing our throughput.

We do observed a number of SigTerm exceptions from the worker processes in Sentry
which was unexpected.

## Action plan

The following items need to be completed before this can be rolled out:

* Investigate the cause of the sentry SigTerm errors
* Test that documents are correctly republished - ideally by renaming the index, republishing and then comparing

## Consequences
- Processing in bulk will reduce the processing time to index documents
- This moves us step closer to being able to rebuild the search index on a regular basis, which would insure that it does
  not drift out of sync with the publishing api over time


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>vaadin-gae</display-name>
  <context-param>
  	<description>
  	Vaadin production mode</description>
  	<param-name>productionMode</param-name>
  	<param-value>false</param-value>
  </context-param>
  <servlet>
  	<servlet-name>Vaadin_gae Application</servlet-name>
  	<servlet-class>com.vaadin.server.GAEVaadinServlet</servlet-class>
  	<init-param>
  		<description>
  		Vaadin UI class to use</description>
  		<param-name>UI</param-name>
  		<param-value>com.example.vaadin_gae.Vaadin_gaeUI</param-value>
  	</init-param>
  	<init-param>
  		<description>
  		Legacy mode to return the value of the property as a string from AbstractProperty.toString()</description>
  		<param-name>legacyPropertyToString</param-name>
  		<param-value>false</param-value>
  	</init-param>
  </servlet>
  <servlet-mapping>
  	<servlet-name>Vaadin_gae Application</servlet-name>
  	<url-pattern>/*</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>


text:
set -e # Exit with nonzero exit code if anything fails

# Save some useful information
TRAVIS_AUTHOR="Travis CI"
TRAVIS_EMAIL="travis@shiv.me"

CONTENT_BRANCH="all_md"

BLOG_REPO="https://github.com/shiva/blog.shiv.me.source.git"
BLOG_BRANCH="master"

POSTS_REPO="https://github.com/shiva/blog-posts.git"
POSTS_BRANCH="all_md"

GITHUB_PUBLISH_REPO="https://github.com/shiva/shiva.github.io.git"
GITHUB_PUBLISH_REPO_WITH_TOKEN=${GITHUB_PUBLISH_REPO/https:\/\/github.com\//https://${GH_TOKEN}@github.com/}
GITHUB_PUBLISH_BRANCH="master"

LAST_COMMIT_MSG=`git log -1 --pretty=format:%s`

echo "Starting publish for ${LAST_COMMIT_MSG}."
CHECKOUT_DIR=`pwd`

BLOG_DIR=${CHECKOUT_DIR}/blog

echo "Checkout ${BLOG_REPO} ..."
rm -rf ${BLOG_DIR}
git clone --depth=1 --single-branch -b ${BLOG_BRANCH} ${BLOG_REPO} ${BLOG_DIR}

echo "Create symlinks to content"
mkdir -p ${BLOG_DIR}/content/post
cp -R ${CHECKOUT_DIR}/post/* ${BLOG_DIR}/content/post/
ln -s ${CHECKOUT_DIR}/static ${BLOG_DIR}/static

echo "Checkout ${GITHUB_PUBLISH_REPO} ..."
rm -rf public
git clone --depth=1 --single-branch -b ${GITHUB_PUBLISH_BRANCH} ${GITHUB_PUBLISH_REPO} ${BLOG_DIR}/public

echo "Update themes ..."
cd ${BLOG_DIR}
git submodule update --init --recursive

echo "Re-generate blog ..."
${CHECKOUT_DIR}/binaries/hugo -v

echo "Done."


text:
require "spec_helper"

describe AliasesController do
  describe "routing" do

        it "recognizes and generates #index" do
      { :get => "/aliases" }.should route_to(:controller => "aliases", :action => "index")
    end

        it "recognizes and generates #new" do
      { :get => "/aliases/new" }.should route_to(:controller => "aliases", :action => "new")
    end

    it "recognizes and generates #show" do
      { :get => "/aliases/1" }.should route_to(:controller => "aliases", :action => "show", :id => "1")
    end

    it "recognizes and generates #edit" do
      { :get => "/aliases/1/edit" }.should route_to(:controller => "aliases", :action => "edit", :id => "1")
    end

    it "recognizes and generates #create" do
      { :post => "/aliases" }.should route_to(:controller => "aliases", :action => "create")
    end

    it "recognizes and generates #update" do
      { :put => "/aliases/1" }.should route_to(:controller => "aliases", :action => "update", :id => "1")
    end

    it "recognizes and generates #destroy" do
      { :delete => "/aliases/1" }.should route_to(:controller => "aliases", :action => "destroy", :id => "1")
    end

  end
end