text:
<Items>
    <Request>
        <IsValid>True</IsValid>
        <ItemSearchRequest>
            <Keywords>moto g</Keywords>
            <ResponseGroup>Small</ResponseGroup>
            <SearchIndex>All</SearchIndex>
        </ItemSearchRequest>
    </Request>
    <TotalResults>1630787</TotalResults>
    <TotalPages>163079</TotalPages>
    <MoreSearchResultsUrl>http://www.amazon.com/gp/redirect.html?linkCode=xm2&SubscriptionId=MyAccessKeyId&location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fsearch%3Fkeywords%3Dmoto%2Bg%26url%3Dsearch-alias%253Daws-amazon-aps&tag=affiliate-tag&creative=386001&camp=2025</MoreSearchResultsUrl>
    <Item>
        <ASIN>B00ZQVSKSM</ASIN>
        <ParentASIN>B0127MKEAE</ParentASIN>
        <DetailPageURL>http://www.amazon.com/Motorola-Moto-3rd-Generation-Unlocked/dp/B00ZQVSKSM%3Fpsc%3D1%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00ZQVSKSM</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Motorola-Moto-3rd-Generation-Unlocked/dp/tech-data/B00ZQVSKSM%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKSM</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00ZQVSKSM%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKSM</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00ZQVSKSM%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKSM</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00ZQVSKSM%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKSM</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00ZQVSKSM%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKSM</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00ZQVSKSM%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKSM</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00ZQVSKSM%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKSM</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Motorola Moto G (3rd Generation) - Black - 8 GB - Global GSM Unlocked Phone</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00MWI4HW0</ASIN>
        <ParentASIN>B00NOSVK54</ParentASIN>
        <DetailPageURL>http://www.amazon.com/Motorola-Moto-generation-Cellphone-Black/dp/B00MWI4HW0%3Fpsc%3D1%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00MWI4HW0</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Motorola-Moto-generation-Cellphone-Black/dp/tech-data/B00MWI4HW0%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4HW0</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00MWI4HW0%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4HW0</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00MWI4HW0%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4HW0</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00MWI4HW0%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4HW0</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00MWI4HW0%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4HW0</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00MWI4HW0%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4HW0</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00MWI4HW0%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4HW0</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Motorola Moto G (2nd generation) Unlocked Cellphone, 8GB, Black</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00GWR373M</ASIN>
        <ParentASIN>B00GYTNP94</ParentASIN>
        <DetailPageURL>http://www.amazon.com/Motorola-Moto-1st-Generation-Unlocked/dp/B00GWR373M%3Fpsc%3D1%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00GWR373M</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Motorola-Moto-1st-Generation-Unlocked/dp/tech-data/B00GWR373M%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR373M</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00GWR373M%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR373M</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00GWR373M%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR373M</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00GWR373M%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR373M</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00GWR373M%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR373M</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00GWR373M%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR373M</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00GWR373M%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR373M</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Motorola Moto G (1st Generation) - Black - 16GB - Global GSM Unlocked Phone</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00ZQVSKNM</ASIN>
        <ParentASIN>B0127MKEAE</ParentASIN>
        <DetailPageURL>http://www.amazon.com/Motorola-Moto-3rd-Generation-Unlocked/dp/B00ZQVSKNM%3Fpsc%3D1%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00ZQVSKNM</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Motorola-Moto-3rd-Generation-Unlocked/dp/tech-data/B00ZQVSKNM%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKNM</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00ZQVSKNM%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKNM</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00ZQVSKNM%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKNM</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00ZQVSKNM%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKNM</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00ZQVSKNM%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKNM</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00ZQVSKNM%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKNM</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00ZQVSKNM%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKNM</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Motorola Moto G (3rd Generation) - White - 8 GB - Global GSM Unlocked Phone</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00ZQVSKS2</ASIN>
        <ParentASIN>B0127MKEAE</ParentASIN>
        <DetailPageURL>http://www.amazon.com/Motorola-Moto-3rd-Generation-Unlocked/dp/B00ZQVSKS2%3Fpsc%3D1%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00ZQVSKS2</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Motorola-Moto-3rd-Generation-Unlocked/dp/tech-data/B00ZQVSKS2%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKS2</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00ZQVSKS2%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKS2</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00ZQVSKS2%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKS2</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00ZQVSKS2%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKS2</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00ZQVSKS2%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKS2</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00ZQVSKS2%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKS2</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00ZQVSKS2%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00ZQVSKS2</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Motorola Moto G (3rd Generation) - Black - 16 GB - Global GSM Unlocked Phone</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00MWI4IN8</ASIN>
        <ParentASIN>B00NOSVK54</ParentASIN>
        <DetailPageURL>http://www.amazon.com/Motorola-Moto-generation-Cellphone-White/dp/B00MWI4IN8%3Fpsc%3D1%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00MWI4IN8</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Motorola-Moto-generation-Cellphone-White/dp/tech-data/B00MWI4IN8%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4IN8</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00MWI4IN8%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4IN8</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00MWI4IN8%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4IN8</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00MWI4IN8%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4IN8</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00MWI4IN8%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4IN8</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00MWI4IN8%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4IN8</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00MWI4IN8%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00MWI4IN8</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Motorola Moto G (2nd generation) Unlocked Cellphone, 8GB, White</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00GWR36F6</ASIN>
        <ParentASIN>B00GYTNP94</ParentASIN>
        <DetailPageURL>http://www.amazon.com/Motorola-Moto-1st-Generation-Unlocked/dp/B00GWR36F6%3Fpsc%3D1%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00GWR36F6</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Motorola-Moto-1st-Generation-Unlocked/dp/tech-data/B00GWR36F6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR36F6</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00GWR36F6%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR36F6</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00GWR36F6%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR36F6</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00GWR36F6%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR36F6</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00GWR36F6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR36F6</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00GWR36F6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR36F6</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00GWR36F6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00GWR36F6</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Motorola Moto G (1st Generation) - Black - 8 GB - Global GSM  Unlocked Phone</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00HPP3QD6</ASIN>
        <DetailPageURL>http://www.amazon.com/Moto-Verizon-Prepaid-Phone-Only/dp/B00HPP3QD6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00HPP3QD6</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Moto-Verizon-Prepaid-Phone-Only/dp/tech-data/B00HPP3QD6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00HPP3QD6</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00HPP3QD6%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00HPP3QD6</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00HPP3QD6%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00HPP3QD6</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00HPP3QD6%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00HPP3QD6</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00HPP3QD6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00HPP3QD6</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00HPP3QD6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00HPP3QD6</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00HPP3QD6%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00HPP3QD6</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Moto G - Verizon Prepaid Phone (Verizon Prepaid Only)</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00K0NRZSW</ASIN>
        <ParentASIN>B00UWIGEQ4</ParentASIN>
        <DetailPageURL>http://www.amazon.com/Motorola-Moto-Generation-Cellphone-Black/dp/B00K0NRZSW%3Fpsc%3D1%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00K0NRZSW</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/Motorola-Moto-Generation-Cellphone-Black/dp/tech-data/B00K0NRZSW%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00K0NRZSW</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00K0NRZSW%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00K0NRZSW</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00K0NRZSW%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00K0NRZSW</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00K0NRZSW%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00K0NRZSW</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00K0NRZSW%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00K0NRZSW</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00K0NRZSW%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00K0NRZSW</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00K0NRZSW%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00K0NRZSW</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Motorola</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>Motorola Moto G (1st Generation) Unlocked Cellphone, 8GB, Black</Title>
        </ItemAttributes>
    </Item>
    <Item>
        <ASIN>B00W3VHE9O</ASIN>
        <DetailPageURL>http://www.amazon.com/generation-Joy-Chen-Protector-Radiation/dp/B00W3VHE9O%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00W3VHE9O</DetailPageURL>
        <ItemLinks>
            <ItemLink>
                <Description>Technical Details</Description>
                <URL>http://www.amazon.com/generation-Joy-Chen-Protector-Radiation/dp/tech-data/B00W3VHE9O%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00W3VHE9O</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Baby Registry</Description>
                <URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3DB00W3VHE9O%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00W3VHE9O</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wedding Registry</Description>
                <URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3DB00W3VHE9O%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00W3VHE9O</URL>
            </ItemLink>
            <ItemLink>
                <Description>Add To Wishlist</Description>
                <URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3DB00W3VHE9O%26SubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00W3VHE9O</URL>
            </ItemLink>
            <ItemLink>
                <Description>Tell A Friend</Description>
                <URL>http://www.amazon.com/gp/pdp/taf/B00W3VHE9O%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00W3VHE9O</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Customer Reviews</Description>
                <URL>http://www.amazon.com/review/product/B00W3VHE9O%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00W3VHE9O</URL>
            </ItemLink>
            <ItemLink>
                <Description>All Offers</Description>
                <URL>http://www.amazon.com/gp/offer-listing/B00W3VHE9O%3FSubscriptionId%3DMyAccessKeyId%26tag%3Daffiliate-tag%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB00W3VHE9O</URL>
            </ItemLink>
        </ItemLinks>
        <ItemAttributes>
            <Manufacturer>Joy Chen</Manufacturer>
            <ProductGroup>Wireless</ProductGroup>
            <Title>For Moto G (2nd generation) , Joy Chen Painting The Colorful Tree Leaves PU Leather and TPU [Wallet Magnet] Flip [Closure] Stand Case Cover for Moto G (2nd generation) With Card Holder F84+ Screen Protector + 24K Radiation Paste</Title>
        </ItemAttributes>
    </Item>
</Items>


text:
import 'rump-scripts'
import rump from 'rump'
import {rebuild} from './configs'

rump.on('update:scripts', () => {
  rebuild()
  rump.emit('update:scripts:test')
})

rump.on('gulp:scripts', (...args) => {
  require('./gulp')
  rump.emit('gulp:scripts:test', ...args)
})

Object.defineProperty(rump.configs, 'karma', {
  get: () => rump.configs.main.scripts.karma,
})

redpajama_set_name: RedPajamaGithub


text:
<!--
id: 3235286
link: http://tumblr.atmos.org/post/3235286/did-jeff-tell-you
slug: did-jeff-tell-you
date: Sat Jun 09 2007 19:55:18 GMT-0700 (PDT)
publish: 2007-06-09
tags:
title: did jeff tell you
-->

did jeff tell you
=================

Andy: did jeff tell you about the girl who pissed herself Ethan: that is
sawweet


text:
const PLAYER_TEMPLATE = `
		<div class="Player">
            <!-- ko foreach: player.cardsInHand -->
            	<card params="card: $data"></card>
            <!-- /ko -->
			<button data-bind="click: playCard, enable: isActivePlayer()">Play card</button>
		</div>`;

class PlayerComponent {
	player: Player;

	constructor(params: PlayerComponent) {
		this.player = params.player;
	}

	playCard() {
		this.player.playCard();
	}

	isActivePlayer() {
		return this.player.isActivePlayer();
	}
}

Component.registerComponent({
	name: "player",
	viewModel: PlayerComponent,
	template: PLAYER_TEMPLATE
});


text:
@implementation NSString(JM)

-(BOOL)isWhiteCharacterOnly {
    NSString *content = [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
    content = [self stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];

    return (content.length == 0);
}

-(NSString *)trimWhiteSpace {
    NSString *content = [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
    content = [self stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];

    return content;
}

@end


text:
namespace Moonlit.Mvc
{
    public class DashboardIcon
    {
        public string Icon { get; set; }
        public string Text { get; set; }
        public string Url { get; set; }
        public int Order { get; set; }

        public string Description { get; set; }
    }
}


text:
<?php
/**
 * @package My AKV Soesterkwartier
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

	    <?php
	    // Display a thumb tack in the top right hand corner if this post is sticky
	    if (is_sticky()) {
		echo '';
	    }
	    ?>

	    <?php the_content(); ?>

	    <?php if ( 'post' == get_post_type() ) : ?>

		<?php my_akvs_posted_on(); ?>
		<?php
		if (!post_password_required() && ( comments_open() || '0' != get_comments_number() )) {
		    echo '';
		    comments_popup_link(__('Leave a comment', 'my-akvs'), __('1 Comment', 'my-akvs'), __('% Comments', 'my-akvs'));
		    echo '';
		}
		?>
		<?php edit_post_link( __( 'Edit', 'my-akvs' ), '', '' ); ?>

	    <?php endif; ?>


text:
package org.drools.core.util;

import java.io.IOException;
import java.net.URL;
import java.security.InvalidKeyException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.Signature;
import java.security.SignatureException;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.Properties;

import org.drools.RuleBaseConfiguration;
import org.drools.RuntimeDroolsException;

/**
 * A helper class to deal with the key store and signing process during
 * Serialisation
 *
 * This class will read and use the following system properties:
 *
 * drools.serialization.sign = <false|true>
 * drools.serialization.private.keyStoreURL = <URL>
 * drools.serialization.private.keyStorePwd = <password>
 * drools.serialization.private.keyAlias = <key>
 * drools.serialization.private.keyPwd = <password>
 * drools.serialization.public.keyStoreURL = <URL>
 * drools.serialization.public.keyStorePwd = <password>
 */
public class KeyStoreHelper {

    // true if packages should be signed during serialization
    public static final String PROP_SIGN       = "drools.serialization.sign";
    // the URL to the key store where the private key is stored
    public static final String PROP_PVT_KS_URL = "drools.serialization.private.keyStoreURL";
    // the key store password
    public static final String PROP_PVT_KS_PWD = "drools.serialization.private.keyStorePwd";
    // the private key identifier
    public static final String PROP_PVT_ALIAS  = "drools.serialization.private.keyAlias";
    // the private key password
    public static final String PROP_PVT_PWD    = "drools.serialization.private.keyPwd";
    // the URL to the key store where the public key is stored
    public static final String PROP_PUB_KS_URL = "drools.serialization.public.keyStoreURL";
    // the key store password
    public static final String PROP_PUB_KS_PWD = "drools.serialization.public.keyStorePwd";

    private boolean            signed;
    private URL                pvtKeyStoreURL;
    private char[]             pvtKeyStorePwd;
    private String             pvtKeyAlias;
    private char[]             pvtKeyPassword;
    private URL                pubKeyStoreURL;
    private char[]             pubKeyStorePwd;

    private KeyStore           pvtKeyStore;
    private KeyStore           pubKeyStore;

    /**
     * Creates a KeyStoreHelper and initialises the KeyStore, by loading its entries.
     *
     * @throws RuntimeDroolsException in case any error happens when initialising and loading the keystore.
     */
    public KeyStoreHelper() {
        try {
            Properties prop = System.getProperties();
            this.signed = Boolean.valueOf( prop.getProperty( PROP_SIGN,
                                                             RuleBaseConfiguration.DEFAULT_SIGN_ON_SERIALIZATION ) ).booleanValue();
            String url = prop.getProperty( PROP_PVT_KS_URL,
                                           "" );
            if ( url.length() > 0 ) {
                this.pvtKeyStoreURL = new URL( url );
            }
            this.pvtKeyStorePwd = prop.getProperty( PROP_PVT_KS_PWD,
                                                    "" ).toCharArray();
            this.pvtKeyAlias = prop.getProperty( PROP_PVT_ALIAS,
                                                 "" );
            this.pvtKeyPassword = prop.getProperty( PROP_PVT_PWD,
                                                    "" ).toCharArray();

            url = prop.getProperty( PROP_PUB_KS_URL,
                                    "" );
            if ( url.length() > 0 ) {
                this.pubKeyStoreURL = new URL( url );
            }
            this.pubKeyStorePwd = prop.getProperty( PROP_PUB_KS_PWD,
                                                    "" ).toCharArray();
            initKeyStore();
        } catch ( Exception e ) {
            throw new RuntimeDroolsException( "Error initialising KeyStore: " + e.getMessage(),
                                              e );
        }
    }

    private void initKeyStore() throws NoSuchAlgorithmException,
                               CertificateException,
                               IOException,
                               KeyStoreException {
        if ( pvtKeyStoreURL != null ) {
            this.pvtKeyStore = KeyStore.getInstance( "JKS" );
            this.pvtKeyStore.load( pvtKeyStoreURL.openStream(),
                                   pvtKeyStorePwd );
        }
        if ( pubKeyStoreURL != null ) {
            this.pubKeyStore = KeyStore.getInstance( "JKS" );
            this.pubKeyStore.load( pubKeyStoreURL.openStream(),
                                   pubKeyStorePwd );
        }
    }

    /**
     * Generates the signature for the given byte[] using MD5 with RSA algorithm and the
     * private key with which this helper was initialised.
     *
     * @param data the byte[] of data to be signed
     *
     * @return the signature, encrypted with the private key
     *
     * @throws UnrecoverableKeyException
     * @throws KeyStoreException
     * @throws NoSuchAlgorithmException
     * @throws InvalidKeyException
     * @throws SignatureException
     */
    public byte[] signDataWithPrivateKey(byte[] data) throws UnrecoverableKeyException,
                                                     KeyStoreException,
                                                     NoSuchAlgorithmException,
                                                     InvalidKeyException,
                                                     SignatureException {
        if( pvtKeyStore == null ) {
            throw new RuntimeDroolsException( "Key store with private key not configured. Please configure it properly before using signed serialization." );
        }
        PrivateKey pvtkey = (PrivateKey) pvtKeyStore.getKey( pvtKeyAlias,
                                                             pvtKeyPassword );
        Signature sig = Signature.getInstance( "MD5withRSA" );
        sig.initSign( pvtkey );
        sig.update( data );
        return sig.sign();
    }

    /**
     * Checks the given byte[] data against the signature, using the
     * public key with which this helper was initialised and the algorithm
     * MD5 with RSA.
     *
     * @param data the original data that was signed
     * @param signature the provided signature
     *
     * @return true in case the signature matches, false otherwise.
     *
     * @throws KeyStoreException
     * @throws NoSuchAlgorithmException
     * @throws InvalidKeyException
     * @throws SignatureException
     */
    public boolean checkDataWithPublicKey(final String publicKeyAlias,
                                          final byte[] data,
                                          final byte[] signature) throws KeyStoreException,
                                                                 NoSuchAlgorithmException,
                                                                 InvalidKeyException,
                                                                 SignatureException {
        if( pubKeyStore == null ) {
            throw new RuntimeDroolsException( "Key store with public key not configured. Please configure it properly before using signed serialization." );
        }
        Certificate cert = pubKeyStore.getCertificate( publicKeyAlias );
        if( cert == null ) {
            throw new RuntimeDroolsException( "Public certificate for key '"+publicKeyAlias+"' not found in the configured key store. Impossible to deserialize the object." );
        }
        Signature sig = Signature.getInstance( "MD5withRSA" );
        sig.initVerify( cert.getPublicKey() );
        sig.update( data );
        return sig.verify( signature );
    }

    public boolean isSigned() {
        return signed;
    }

    public URL getPvtKeyStoreURL() {
        return pvtKeyStoreURL;
    }

    public char[] getPvtKeyStorePwd() {
        return pvtKeyStorePwd;
    }

    public String getPvtKeyAlias() {
        return pvtKeyAlias;
    }

    public char[] getPvtKeyPassword() {
        return pvtKeyPassword;
    }

    public URL getPubKeyStoreURL() {
        return pubKeyStoreURL;
    }

    public char[] getPubKeyStorePwd() {
        return pubKeyStorePwd;
    }

    public KeyStore getPvtKeyStore() {
        return pvtKeyStore;
    }

    public KeyStore getPubKeyStore() {
        return pubKeyStore;
    }

}


text:
/**********************************************************************************************************************
 *  AUTHOR IDENTITY
 *  -------------------------------------------------------------------------------------------------------------------
 *  Name                          Initials      Company
 *  -------------------------------------------------------------------------------------------------------------------
 *  Torsten Kercher               vistkr        Vector Informatik GmbH
 *  -------------------------------------------------------------------------------------------------------------------
 *
 *  REVISION HISTORY
 *  -------------------------------------------------------------------------------------------------------------------
 *  Version   Date        Author  Change Id     Description
 *  -------------------------------------------------------------------------------------------------------------------
 *  01.00.00  2012-09-17  vistkr                Initial for Rh850 platform and GreenHills compiler
 *  01.00.01  2013-11-05  vistkr                Update to template 1.04.02
 *  01.00.02  2013-12-05  vistkr                Add MISRA justifications
 *  01.01.00  2014-01-15  vistkr                AR4-569: Add CONSTP2FUNC macro (update to template 1.05.00)
 *  01.01.01  2014-10-20  vistkr                Improve comments
 *********************************************************************************************************************/

#ifndef COMPILER_H
# define COMPILER_H

/* PRQA S 3453 COMPILER_3453_TAG */ /* MD_MSR_19.7 */

/**********************************************************************************************************************
 * INCLUDES
 *********************************************************************************************************************/

# include "Compiler_Cfg.h"

/**********************************************************************************************************************
 *  GLOBAL CONSTANT MACROS
 *********************************************************************************************************************/

/* ##V_CFG_MANAGEMENT ##CQProject : CommonAsr_Rh850 CQComponent : Impl_CompAbstract_GreenHills */
# define COMMONASR_RH850_IMPL_COMPABSTRACT_VERSION 0x0101
# define COMMONASR_RH850_IMPL_COMPABSTRACT_RELEASE_VERSION 0x01

# define COMPILER_VENDOR_ID    30u  /* SREQ00015523 */
# define COMPILER_MODULE_ID    198u /* SREQ00015523 */

/* AUTOSAR Software Specification Document Version Information */
#   define COMPILER_AR_RELEASE_MAJOR_VERSION       (4u)
#   define COMPILER_AR_RELEASE_MINOR_VERSION       (0u)
#   define COMPILER_AR_RELEASE_REVISION_VERSION    (3u)

/* Component Version Information */
# define COMPILER_SW_MAJOR_VERSION       (1u)
# define COMPILER_SW_MINOR_VERSION       (1u)
# define COMPILER_SW_PATCH_VERSION       (1u)

# define _GREENHILLS_C_RH850_

/* AUTOMATIC used for the declaration of local pointers */
# define AUTOMATIC

/* TYPEDEF shall be used within type definitions, where no memory qualifier can be specified */
# define TYPEDEF

/* NULL_PTR define with a void pointer to zero (the usage does not lead to compile warnings about implicit casts) */
# ifndef NULL_PTR
#  define NULL_PTR ((void *)0)
# endif

/* INLINE define for abstraction of the keyword inline */
# define INLINE __inline

/* LOCAL_INLINE define for abstraction of the keyword inline for functions with static scope */
# define LOCAL_INLINE static inline

/* FUNC macro for the declaration and definition of functions
   rettype     return type of the function
   memclass    classification of the function itself
 */
# define FUNC(rettype, memclass) rettype /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* FUNC_P2CONST macro for declaration and definition of functions returning a pointer to a constant
   rettype     return type of the function
   ptrclass    defines the classification of the pointer's distance
   memclass    classification of the function itself
 */
# define FUNC_P2CONST(rettype, ptrclass, memclass) const rettype* /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* FUNC_P2VAR macro for the declaration and definition of functions returning a pointer to a variable
   rettype     return type of the function
   ptrclass    defines the classification of the pointer's distance
   memclass    classification of the function itself
 */
# define FUNC_P2VAR(rettype, ptrclass, memclass) rettype* /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* P2VAR macro for the declaration and definition of pointers in RAM, pointing to variables
   ptrtype     type of the referenced variable memory class
   memclass    classification of the pointer's variable itself
   ptrclass    defines the classification of the pointer's distance
 */
# define P2VAR(ptrtype, memclass, ptrclass) ptrtype* /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* P2CONST macro for the declaration and definition of pointers in RAM, pointing to constants
   ptrtype     type of the referenced data
   memclass    classification of the pointer's variable itself
   ptrclass    defines the classification of the pointer's distance
 */
# define P2CONST(ptrtype, memclass, ptrclass) const ptrtype* /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* CONSTP2VAR macro for the declaration and definition of constant pointers accessing variables
   ptrtype     type of the referenced data
   memclass    classification of the pointer's variable itself
   ptrclass    defines the classification of the pointer's distance
 */
# define CONSTP2VAR(ptrtype, memclass, ptrclass) ptrtype *const /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* CONSTP2CONST macro for the declaration and definition of constant pointers accessing constants
   ptrtype     type of the referenced data
   memclass    classification of the pointer's variable itself
   ptrclass    defines the classification of the pointer's distance
 */
# define CONSTP2CONST(ptrtype, memclass, ptrclass) const ptrtype *const /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* P2FUNC macro for the type definition of pointers to functions
   rettype     return type of the function
   ptrclass    defines the classification of the pointer's distance
   fctname     function name respectively name of the defined type
 */
# define P2FUNC(rettype, ptrclass, fctname) rettype (* fctname) /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* CONSTP2FUNC macro for the type definition of constant pointers to functions
   rettype     return type of the function
   ptrclass    defines the classification of the pointer's distance
   fctname     function name respectively name of the defined type
 */
# define CONSTP2FUNC(rettype, ptrclass, fctname) rettype (*const fctname) /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* CONST macro for the declaration and definition of constants
   type        type of the constant
   memclass    classification of the constant itself
 */
# define CONST(type, memclass) const type /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/* VAR macro for the declaration and definition of variables
   vartype     type of the variable
   memclass    classification of the variable itself
 */
# define VAR(vartype, memclass) vartype /* PRQA S 3410 */ /* MD_Compiler_19.10 */

/**********************************************************************************************************************
 *  GLOBAL FUNCTION MACROS
 *********************************************************************************************************************/

/**********************************************************************************************************************
 *  GLOBAL DATA TYPES AND STRUCTURES
 *********************************************************************************************************************/

/**********************************************************************************************************************
 *  GLOBAL DATA PROTOTYPES
 *********************************************************************************************************************/

/**********************************************************************************************************************
 *  GLOBAL FUNCTION PROTOTYPES
 *********************************************************************************************************************/

/* PRQA L:COMPILER_3453_TAG */

/**********************************************************************************************************************
 *  MISRA deviations
 *********************************************************************************************************************/
/* Justification for module-specific MISRA deviations:

MD_Compiler_19.10:
  Reason: The macro is used in a scope that does not allow brackets, e.g. declaration of functions and variables.
  Risk: Non-atomic parameters lead to compile errors.
  Prevention: Used parameters are always atomic.

*/

#endif  /* COMPILER_H */

/**********************************************************************************************************************
 *  END OF FILE: Compiler.h
 *********************************************************************************************************************/


text:
* Python 3.6
* Tensorflow 1.0
* Numpy 1.11.3
* Matplotlib 2.0.0
* Seaborn 0.71

#### Description

Create adversarial images to fool a MNIST classifier in TensorFlow.

There are two ways to fool a CNN model. The first one is raised by Ian Goodfellow (also known
as the fast gradient sign method), the other one is adopted by Papernot et al (also know as Jacobian-based saliency map). Here we first implement the easier one: fast gradient method.

This method can be simplified as

To conclude, the process is pretty straight-forward, we calculate the gradient w.r.t. target class and update input image based on the gradient. Repeat this process until we achieve a wanted confidence.

![](/img/process_1.png)

We tested two update strategies, one is to simply take the sign of gradient and perform uniformly updates for all pixels and the other is to use gradient value as parts of step size. It is easy to know that if the gradient of a pixel is large, we only need to add a little wiggle, which will bring enough influence on the prediction. Therefore, it will give us a less noisy adversarial image. We add a L2-norm -like loss to evaluate the Delta, a small loss means we add a very little perturbation to original image, making the adversarial image unnoticeable for humans.

The experiment results support that -- updating by gradient value gives us a less L2-norm-like loss.

Here is the result for using the sign of gradient, the final L2-norm-like loss is 3.12143

![](/img/fg_sign_versus.png)

![](/img/fg_sign_iter.png)

Here is the result for using the value of gradient, the final L2-norm-like loss is 2.18394

![](/img/fg_grad_versus.png)

![](/img/fg_grad_iter.png)

As we want an adversarial image with unnoticeable perturbation, we perform gradient value updating.

You can find experiments result in the `notebook` folder

In `AdversarialMNIST` folder, `generate_model_old.py` is used for training CNN model and dump model to target path

Update:

As all functions have been packed into a class `AdversarialMNIST` as a package, you can use them easier

```python
import sys
# suppose current path is 'notebook/'
# set the package_path to the folder 'AdversarialMNIST'
package_path = '../'
sys.path.append(package_path)
from AdversarialMNIST.AdversarialMNIST import AdversarialMNIST

# create a object, the graph will be initialized
model = AdversarialMNIST()
# show the graph structure
model.show_trainable_variables()
"""
  layer_conv1_5x5_32/Weights:0
  layer_conv1/Bias:0
  layer_conv2_5x5x64/Weights:0
  layer_conv2/Bias:0
  layer_fc1_1024/Weights:0
  layer_fc1/Bias:0
  layer_fc2_10/Weights:0
  layer_fc2/Bias:0
"""
# Option 1: train a new model by MNIST and dump the model to target place *use default dataset
model.fit(learning_rate=1e-4, max_steps=20000, dropout=0.5, model_path='../model/MNIST.ckpt')

# Option 2: load previous model
model.load_model(model_path='../model/MNIST.ckpt')

# Option 3: train a new model by given dataset *use customized dataset
model.fit(x=new_train_images, y=new_train_labels, learning_rate=1e-4,
          max_steps=5000, dropout=0.5, model_path='../model/MNIST_NEW.ckpt')

# make a prediction for images
# return predictions and probabilities for input images. Here shows the results for ordinary prediction
normal_pred,normal_prob = model.predict(images, prob=True)

# generate adversarial images
# you can assign any target_class that you want to fool network with desired confidence
# if verbose is 1, it will generate all figures for report
ad_images = model.generate_adversarial(img_list=img_list,
                                       target_class=7, eta=0.1, threshold=0.99,
                              		save_path='../img/', file_name='adversarial', verbose=0)
#Predictions and probabilites of adv images
adv_pred,adv_prob = model.predict(ad_images, prob=True)
```

Previous Usage:

```
python generate_model_old.py [--max_steps] [--learning_rate] [--dropout] [--data_dir]
                             [--log_dir] [--model_path]
```

`generate_adversarial_old.py` contains function that consumes a image list(img_list) and a desired class(target_class) , therefore produces the adversarial images that can fool the model.

This following image is the result generated by `generate_adversarial_old.py`

You can find iteration processes in the `img` folder

#### To Do

- [x] Read [Karpathy's blog](http://karpathy.github.io/2015/03/30/breaking-convnets/)
- [x] Read paper [Deep Neural Networks are Easily Fooled](https://arxiv.org/abs/1412.1897) and [Explaining and Harnessing Adversarial Examples](https://arxiv.org/abs/1412.6572)
- [x] Go through all details in [Deep MNIST for Experts](https://www.tensorflow.org/get_started/mnist/pros)
- [x] Here is a [torch implement](https://github.com/e-lab/torch-toolbox/tree/master/Adversarial) for OVERFEAT network (Not so useful)
- [x] Time to code ~
      * [x] Train a common CNN for MNIST
      * [x] generate adversarial images to misclassify any examples of '2' as '6'
      * [x] generate adversarial images for any number as any number

- [ ] There seems to be much of fun to explore~ !

      - [x] Can these images fool other classifier? such as SVM, RandomForest, GradientBoost Tree, or a deeper network

            Actually, no.

      - [x] what if we add adversarial images in the training set?

            Not so helpful as for defence result

      - [ ] How about one adversarial image for all images in the same class? i.e. a delta image that can apply to all images so that the CNN will still be fooled.

      - [ ] implement Jacobian-based saliency map described in [This paper](https://arxiv.org/abs/1511.07528)

      - [ ] All methods mentioned above need the architecture of network, however, recently, there is a black-box attack method, described in [this paper](https://arxiv.org/abs/1602.02697)


text:
// This file is automatically generated.

package adila.db;

/*
 * Samsung Galaxy S7
 *
 * DEVICE: heroqltetmo
 * MODEL: SM-G930T
 */
final class heroqltetmo {
    public static final String DATA = "Samsung|Galaxy S7|Galaxy S";
}


text:
<list model="account.transfer">
    <field name="number"/>
    <field name="date"/>
    <field name="account_from_id"/>
    <field name="account_to_id"/>
    <field name="amount"/>
    <field name="ref"/>
    <field name="state"/>
</list>


text:
	time:2016-01-26 16:50:30 by freddon
##Before Started##
###Pr BackGround###
> For someone who wanna look for something but had no much time and oppotunity on it.

> It's not so easy to rebuild her/his feeling or memory,but,those who could just did a flash thinking merely and rided the time.

> Even the man have dept within confusing questions which were so rarely.

> For the items show before,there are someone also can give a hand or some routes.

> Kind-Hearted People think his words can help someone,like ideas、advices、 infomations、experience and so on.

###Pr Ability###
> Consumer can Publish requirement like Missing、Finding、Catching、Confusing、Buyment、Useful Resources etc.

> Producer can give respond to Consumer,after that,Consumer also can give a grateful real or virtual.
###Who use###
> Information Producer and Consumer.

> The Guide between Information Producer and Consumer.

> People love Enjoyment.

> The People who just be an onlooker sometimes.

###Env Of Pr###

> RunTime Env
> >SERVER - `Apache2.22` `PHP5.45` `MYSQL5.6`
>
> >IDE - `Webstorm` `Navicat Data Modeler` `Navicat For Mysql` `VS2015` `XCode7.2` `Android Studio` `NotePad++`

> Available Platforms
> >WEB、Windows10(Mobile&Surface Application)、IOS、Android

###Oper Mode###

> Pr is not just play a role in constructing a platform.

> The Cost of Operate Pr like time and money is surrported by creater for now a while.After that,if Pr is Preciated by most of people,Pr will need theirs' help or add a non-affective mode.

##Design For Pr##

###Pr-info###

> The information has some types like req、share、query、p2p-resp etc.

> The Pr-info can be private or public to someone or anybody beyond the setting of some types.

> The states of Pr information contains several tags to mark this info for searching conveniently.And sometimes the Pr would be like mission.

> The publisher or can put a port in Pr-item for surrport payback.

> The content of Pr-info will contains single-text、md-text、media links and other Pr-info quote.

###Pr-User###
> For it's difficult to keep on record rencently.Pr-Sys won't link other social port for sign up besides orign methods.

> For a period of Beta Version,Pr-sys will allow invite-code to sign up.

> For someone disgust,Pr-sys will add a firewall to decrease these awful things.

> Rank or Level will be neccessary.

> User diy-system will be added probably.

###Pr-Com###

##Coming Soon##


text:
<?php
class Salary_model extends CI_Model {

    public function __construct()
    {
        $this->load->database();
    }

    public function get_salary($data)
    {
        $this->db->order_by('timestamp', 'DESC');
        $this->db->limit(1);
        $query = $this->db->get_where('swan_salary', array('bh' => $data['bh']));
        return $query->row_array();
    }

    public function get_lists($data)
    {
        $this->db->order_by('timestamp', 'DESC');
        $query = $this->db->get_where('swan_salary', array('bh' => $data['bh']));
        return $query->result_array();
    }

}


text:
/*.fade.ng-enter {
  transition:0.5s linear all;
  opacity:0;
}*/

/* The finishing CSS styles for the enter animation */
/*.fade.ng-enter.ng-enter-active {
  opacity:1;
}

.fade.ng-leave {
  transition:0.5s linear all;
  opacity:1;
}
.fade.ng-leave.ng-leave-active {
  opacity:0;
}

.fade.ng-leave {
  animation: my_fade_animation 0.5s linear;
  -webkit-animation: my_fade_animation 0.5s linear;
}

@keyframes my_fade_animation {
  from { opacity:1; }
  to { opacity:0; }
}

@-webkit-keyframes my_fade_animation {
  from { opacity:1; }
  to { opacity:0; }
}*/

.highlight {
  transition:0.5s linear all;
}
.highlight.on-add {
  background:white;
}
.highlight.on {
  background:yellow;
}
.highlight.on-remove {
  background:black;
}

.fade.ng-hide {
  transition:0.5s linear all;
  opacity:0;
}

.my-animation.ng-enter {
  /* standard transition code */
  transition: 1s linear all;
  opacity:0;
}
.my-animation.ng-enter-stagger {
  /* this will have a 100ms delay between each successive leave animation */
  transition-delay: 0.1s;

  /* As of 1.4.4, this must always be set: it signals ngAnimate
    to not accidentally inherit a delay property from another CSS class */
  transition-duration: 0s;
}
.my-animation.ng-enter.ng-enter-active {
  /* standard transition styles */
  opacity:1;
}

.zipper.ng-animate {
  transition:0.5s linear all;
}
.zipper.ng-enter {
  opacity:0;
}
.zipper.ng-enter.ng-enter-active {
  opacity:1;
}
.zipper.ng-leave {
  opacity:1;
}
.zipper.ng-leave.ng-leave-active {
  opacity:0;
}

/*
.box {
  margin: 50px auto;
  background: #5FCF80;
  width: 150px;
  height: 150px;
}
.box:hover {
  transform: rotate(360deg);
  background: #9351A6;
  border-radius: 50%;
}
.rotate {
  transition: all 0.5s ease-in-out;
}
.rotate:hover {
  transition: all 1s ease-in-out;
}
*/

input[type='checkbox'] {
  -ms-transform: scale(2); /* IE */
  -moz-transform: scale(2); /* FF */
  /* -webkit-transform: scale(2); */ /* Safari and Chrome */
  -o-transform: scale(2); /* Opera */
  margin: 6px;
}

.box {
  margin: 20px auto;
  background: #5FCF80;
  width: 150px;
  height: 150px;
}

.circle {
  -webkit-transform: rotate(360deg);
  background: #9351A6;
  border-radius: 50%;
  margin: 20px auto;
  width: 150px;
  height: 150px;
}

.rotate {
  -webkit-transition: all 1s ease-in-out;
	-moz-transition: all 1s ease-in-out;
	-o-transition: all 1s ease-in-out;
	transition: all 1s ease-in-out;
}

@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes disappear {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.fade.ng-enter {
  animation: 2s appear;
}

.fade.ng-leave {
  animation: 1s disappear;
}

.animate-enter,
.animate-leave
{
    -webkit-transition: 1550ms cubic-bezier(0.420, 0.000, 1.000, 1.000) all;
    -moz-transition: 1550ms cubic-bezier(0.420, 0.000, 1.000, 1.000) all;
    -ms-transition: 1550ms cubic-bezier(0.420, 0.000, 1.000, 1.000) all;
    -o-transition: 1550ms cubic-bezier(0.420, 0.000, 1.000, 1.000) all;
    transition: 1550ms cubic-bezier(0.420, 0.000, 1.000, 1.000) all;
}

.animate-enter {
    left: -100%;
}
.animate-enter.animate-enter-active {
    left: 0;
}

.animate-leave {
    left: 0;
}
.animate-leave.animate-leave-active{
    left: 100%;
}

.slide-pop {
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}
.slide-pop.ng-enter,
.slide-pop.ng-leave {
	-webkit-transition: all 1s linear;
	transition: all 1s linear;
}
.slide-pop.ng-enter {
	opacity: 0;
	-webkit-transform: scale(.5);
	transform: scale(.5);
}
.slide-pop.ng-enter-active {
	opacity: 1;
	-webkit-transform: scale(1);
	transform: scale(1);
}
.slide-pop.ng-leave {
	left: 0;
	opacity: .5;
}
.slide-pop.ng-leave-active {
	left: -100%;
	opacity: 0;
}

.reverse .page.slide-pop.ng-enter {
	opacity: .5;
	left: -100%;
	-webkit-transform: scale(1);
	transform: scale(1);
}
.reverse .page.slide-pop.ng-enter-active {
	opacity: 1;
	left: 0;
}
.reverse .page.slide-pop.ng-leave {
	opacity: .5;
	-webkit-transform: scale(1);
	transform: scale(1);
	left: 0;
	right: 0;
}
.reverse .page.slide-pop.ng-leave-active {
	opacity: 0;
	-webkit-transform: scale(.5);
	transform: scale(.5);
}

/* Pop in/out animation */
.content .page.pop {
    position: absolute;
    left: 0; right: 0;
    top: 0; bottom: 0;
}
.content .page.pop.ng-enter,
.content .page.pop.ng-leave {
    -webkit-transition: all 1s ease;
    transition: all 1s ease;
}
.content .page.pop.ng-enter {
    -webkit-transform: scale(0);
    transform: scale(0);
}
.content .page.pop.ng-enter-active,
.content .page.pop.ng-leave,
.content .page.pop.ng-leave-active {
    -webkit-transform: scale(1);
    transform: scale(1);
}
.content .page.pop.ng-leave-active {}

/* Fade in/out */
.content .page.fade {
    left: 0;
    right: 0;
    height: 100%;
    opacity: 1;
}
.content .page.fade.ng-enter,
.content .page.fade.ng-leave {
    -webkit-transition: all 1s ease;
    transition: all 1s ease;
}
.content .page.fade.ng-enter {
    opacity: 0;
}
.content .page.fade.ng-enter-active {
    opacity: 1;
}
.content .page.fade.ng-leave {
    opacity: 1;
}
.content .page.fade.ng-leave-active {
    opacity: 0;
}

/* Flip animation */
.content {
	-webkit-perspective: 600px;
	perspective: 600px;
}
.content .page.flip {
	-webkit-transform-style: preserve-3d;
	transform-style: preserve-3d;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	-webkit-transition: all 1s ease-in-out;
	transition: all 1s ease-in-out;
}
.content .page.flip.ng-enter {
    -webkit-transform: rotateY(-180deg);
    transform: rotateY(-180deg);
	z-index: 800;
}
.content .page.flip.ng-enter-active {
	-webkit-transform: rotateY(0deg);
	transform: rotateY(0deg);
	z-index: 900;
}
.content .page.flip.ng-leave {
	-webkit-transform: rotateY(0deg);
	transform: rotateY(0deg);
	z-index: 900;
}
.content .page.flip.ng-leave-active {
	-webkit-transform: rotateY(180deg);
	transform: rotateY(180deg);
	z-index: 800;
}

/* Rotate animation */
.content .page.rotate {
	-webkit-animation-duration: 1s;
	animation-duration: 1s;
}
.content .page.ng-leave.rotate {
	-webkit-animation-name: rotate-leave;
	animation-name: rotate-leave;
}
.content .page.ng-enter.rotate {
	-webkit-animation-name: rotate-enter;
	animation-name: rotate-enter;
}
@-webkit-keyframes rotate-leave {
	0% {
		-webkit-transform-origin: center center;
		transform-origin: center center;
		-webkit-transform: rotate(0);
		transform: rotate(0);
		opacity: 1;
	}
	100% {
		-webkit-transform-origin: center center;
		transform-origin: center center;
		-webkit-transform: rotate(-180deg);
		transform: rotate(-180deg);
		opacity: 0;
	}
}
@-webkit-keyframes rotate-enter {
	0% {
		-webkit-transform-origin: center center;
		transform-origin: center center;
		-webkit-transform: rotate(-180deg);
		transform: rotate(-180deg);
		opacity: 0;
	}
	100% {
		-webkit-transform-origin: center center;
		transform-origin: center center;
		-webkit-transform: rotate(-360deg);
		transform: rotate(-360deg);
		opacity: 1;
	}
}

@keyframes rotate-leave {
	0% {
		transform-origin: center center;
		transform: rotate(0);
		opacity: 1;
	}
	100% {
		transform-origin: center center;
		transform: rotate(-180deg);
		opacity: 0;
	}
}
@keyframes rotate-enter {
	0% {
		transform-origin: center center;
		transform: rotate(-180deg);
		opacity: 0;
	}
	100% {
		transform-origin: center center;
		transform: rotate(-360deg);
		opacity: 1;
	}
}

/* slide-pop screen animation */
.content .page.slide-pop {
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}
.content .page.slide-pop.ng-enter,
.content .page.slide-pop.ng-leave {
	-webkit-transition: all 1s linear;
	transition: all 1s linear;
}
.content .page.slide-pop.ng-enter {
	opacity: 0;
	-webkit-transform: scale(.5);
	transform: scale(.5);
}
.content .page.slide-pop.ng-enter-active {
	opacity: 1;
	-webkit-transform: scale(1);
	transform: scale(1);
}
.content .page.slide-pop.ng-leave {
	left: 0;
	opacity: .5;
}
.content .page.slide-pop.ng-leave-active {
	left: -100%;
	opacity: 0;
}

.reverse .page.slide-pop.ng-enter {
	opacity: .5;
	left: -100%;
	-webkit-transform: scale(1);
	transform: scale(1);
}
.reverse .page.slide-pop.ng-enter-active {
	opacity: 1;
	left: 0;
}
.reverse .page.slide-pop.ng-leave {
	opacity: .5;
	-webkit-transform: scale(1);
	transform: scale(1);
	left: 0;
	right: 0;
}
.reverse .page.slide-pop.ng-leave-active {
	opacity: 0;
	-webkit-transform: scale(.5);
	transform: scale(.5);
}


text:
/*
 * @summary JSON list of countries, continents, regions for each locale
 */
var i18nCountries = {

  /*
   * @summary English
   */
  en:     {
    countries:  require('./en/countries'),
    continents: require('./en/continents'),
    regions:    require('./en/regions')
  },

  /*
   * @summary French (Français)
   */
  fr:     {
    countries:  require('./fr/countries'),
    continents: require('./fr/continents'),
    regions:    require('./fr/regions')
  },

  /*
   * @summary Dutch (Nederlands)
   */
  nl:     {
    countries:  require('./nl/countries'),
    continents: require('./nl/continents'),
    regions:    require('./nl/regions')
  },

  /*
   * @summary Shared attributes
   */
  shared:     {
    countries:  require('./shared/countries')
  }

};

module.exports = i18nCountries;


text:
constexpr auto Builtin_GLSL_LineBatch_VS = R"(
#version 330
layout(location=0)in vec3 Position;
layout(location=1)in vec4 Color;
out VertexData{
vec4 DestinationColor;}Out;
uniform TransformMatrix{
mat4 ViewProjection;};
void main(){
gl_Position=vec4(Position.xyz,1.0)*ViewProjection;
Out.DestinationColor=Color;}
)";


text:
<script src="../../resources/testharness.js"></script>
<script src="test-helpers.js"></script>
<script>

function xhr_send(method, data) {
  return new Promise(function(resolve, reject) {
      var xhr = new XMLHttpRequest();
      xhr.onload = function() {
        if (xhr.getResponseHeader('Content-Type') !== null) {
          reject('Content-Type must be null.');
        }
        resolve();
      };
      xhr.onerror = function() {
        reject('XHR must succeed.');
      };
      xhr.responseType = 'text';
      xhr.open(method, './dummy?test', true);
      xhr.send(data);
    });
}

window.addEventListener('message', function(evt) {
    var port = evt.ports[0];
    xhr_send('POST', 'test string')
      .then(function() { port.postMessage({results: 'finish'}); })
      .catch(function(e) { port.postMessage({results: 'failure:' + e}); });
  });
</script>


text:
/**
 * This widget displays user's information
 */

var args = arguments[0] || {};

var type = args.type || 'regular';

var userInfo = _.isUndefined(Ti.App.Properties.getObject("userInfo", null)) ?
    'Not Logged In' : Alloy.CFG.drupalConfig.userInfo;

init();
addEventListeners();

/**
 * Start it off
 */
function init() {
    log.info("[WIDGET User Display] : Initializing");
    log.debug("[WIDGET User Display] : User Info", userInfo);

    var imagePath = ''
    //if (!userInfo.picture === null && !userInfo.picture.url === null) {
        //imagePath = userInfo.picture.url;
    //}

    var realName = _.isUndefined(userInfo) ? 'Not Logged In' : userInfo.realname;
    var imageProfilePic = imagePath;
    $.labelUserRealName.text = realName;
    //$.imageProfilePic.image = imageProfilePic;

    if (type === 'regular') {
        displayRegular();
    } else {
        displaySmall();
    }
}

/**
 * Add Event Listeners
 */
function addEventListeners() {
    $.viewProfileSummary.addEventListener('click', function() {
        Alloy.Globals.Menu.setMainContent('UserProfile');
    });
}

/**
 *
 */
function displayRegular() {

}

/**
 *
 */
function displaySmall() {
    $.imageProfilePic.left = 10;
    $.imageProfilePic.top = 10;
    $.imageProfilePic.height = 44;
    $.imageProfilePic.width = 44;
    $.viewProfileSummary.height = 50;
}

$.setSize = function(type) {
    if (type === 'regular') {
        displayRegular();
    } else {
        displaySmall();
    }
};

$.setType = function(type) {
    if (type === 'regular') {
        displayRegular();
    } else if (type == 'medium') {
        $.imageProfilePic.left = 20;
        $.imageProfilePic.height = 75;
        $.imageProfilePic.width = 75;
        $.viewProfileSummary.height = 100;
    } else {
        displaySmall();
    }
};

$.setStyle = function(style) {
    if (style == 'light') {

    } else if (style == 'dark') {
        $.viewUserInfo.color = 'white';
        $.labelUserRealName.color = 'white';
        $.labelUserLocation.color = 'white';
    }
}