text:
package com.ctrip.zeus.auth.impl;

import com.ctrip.zeus.auth.util.AuthUtil;
import com.ctrip.zeus.service.auth.AuthDefaultValues;
import org.jasig.cas.client.util.AbstractCasFilter;
import org.jasig.cas.client.validation.Assertion;
import org.jasig.cas.client.validation.AssertionImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * Created by fanqq on 2016/8/11.
 */
public class SlbServerTokenAuthFilter implements Filter {

    private static final Logger logger = LoggerFactory.getLogger(SlbServerTokenAuthFilter.class);

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException {
        final HttpServletRequest request = (HttpServletRequest) servletRequest;
        final HttpServletResponse response = (HttpServletResponse) servletResponse;

        //1. check whether it is called from other slb servers.
        String slbServerToken = request.getHeader(AuthUtil.SERVER_TOKEN_HEADER);
        if (slbServerToken != null) {
            if (TokenManager.validateToken(slbServerToken)) {
                setAssertion(request, AuthDefaultValues.SLB_SERVER_USER);
                logger.info("Auth by slb server token filter.");
                chain.doFilter(request, response);
                return;
            }
        }
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {

    }

    private void setAssertion(HttpServletRequest request, String userName) {
        Assertion assertion = new AssertionImpl(userName);
        request.setAttribute(AuthUtil.AUTH_USER, userName);
        request.setAttribute(AbstractCasFilter.CONST_CAS_ASSERTION, assertion);
        final HttpSession session = request.getSession(false);
        if (session != null) {
            session.setAttribute(AbstractCasFilter.CONST_CAS_ASSERTION, assertion);
        }
    }
}


text:
namespace pdalboost {} namespace boost = pdalboost; namespace pdalboost {
namespace lambda {

namespace detail {

template<class T> struct generate_error;

}
// -- placeholders --------------------------------------------

template <int I> struct placeholder;

// function_adaptors
template <class Func>
struct function_adaptor;

template <int I, class Act> class action;

template <class Base>
class lambda_functor;

template <class Act, class Args>
class lambda_functor_base;

} // namespace lambda
} // namespace pdalboost

//  #define CALL_TEMPLATE_ARGS class A, class Env
//  #define CALL_FORMAL_ARGS A& a, Env& env
//  #define CALL_ACTUAL_ARGS a, env
//  #define CALL_ACTUAL_ARGS_NO_ENV a
//  #define CALL_REFERENCE_TYPES A&, Env&
//  #define CALL_PLAIN_TYPES A, Env
#define CALL_TEMPLATE_ARGS class A, class B, class C, class Env
#define CALL_FORMAL_ARGS A& a, B& b, C& c, Env& env
#define CALL_ACTUAL_ARGS a, b, c, env
#define CALL_ACTUAL_ARGS_NO_ENV a, b, c
#define CALL_REFERENCE_TYPES A&, B&, C&, Env&
#define CALL_PLAIN_TYPES A, B, C, Env

namespace pdalboost {} namespace boost = pdalboost; namespace pdalboost {
namespace lambda {
namespace detail {

template<class A1, class A2, class A3, class A4>
void do_nothing(A1&, A2&, A3&, A4&) {}

} // detail
} // lambda
} // boost

// prevent the warnings from unused arguments
#define CALL_USE_ARGS \
::pdalboost::lambda::detail::do_nothing(a, b, c, env)

#endif

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <parent>
        <groupId>org.wso2.carbon.identity.inbound.provisioning.scim2</groupId>
        <artifactId>org.wso2.carbon.identity.inbound.provisioning.scim2.test</artifactId>
        <relativePath>../pom.xml</relativePath>
        <version>2.0.12-SNAPSHOT</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>identity-inbound-provisioning-scim2-coverage-report</artifactId>
    <name>WSO2 Identity Inbound Provisioning SCIM2 - Test coverage</name>
    <description>Coverage reports for Carbon Identity Inbound Provisioning SCIM2</description>
    <url>http://wso2.com</url>

    <dependencies>
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.ant</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>with-tests</id>
            <activation>
                <property>
                    <name>!maven.test.skip</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-jacoco-dependencies</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <includeTypes>jar</includeTypes>
                                    <includeArtifactIds>org.jacoco.ant</includeArtifactIds>
                                    <stripVersion>true</stripVersion>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!--Ant plugin - Merge Jacoco Reports-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>

                                    <target xmlns:jacoco="antlib:org.jacoco.ant">
                                        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
                                            <classpath path="${project.build.directory}" />
                                        </taskdef>
                                        <jacoco:report>
                                            <executiondata>
                                                <fileset dir="../../components/org.wso2.carbon.identity.inbound.provisioning.scim2.common/target">
                                                    <include name="jacoco.exec" />
                                                </fileset>
                                                <fileset dir="../../components/org.wso2.carbon.identity.inbound.provisioning.scim2.provider/target">
                                                    <include name="jacoco.exec" />
                                                </fileset>
                                                <fileset dir="../module-tests/target">
                                                    <include name="jacoco.exec" />
                                                </fileset>
                                            </executiondata>
                                            <structure name="Identity Server Tests">
                                                <classfiles>
                                                    <fileset dir="../../components/org.wso2.carbon.identity.inbound.provisioning.scim2.common/target/classes">
                                                        <exclude name="**/*Exception.class" />
                                                        <exclude name="**/*Constants.class" />
                                                    </fileset>
                                                    <fileset dir="../../components/org.wso2.carbon.identity.inbound.provisioning.scim2.provider/target/classes">
                                                        <exclude name="**/*Exception.class" />
                                                        <exclude name="**/*Constants.class" />
                                                    </fileset>

                                                </classfiles>
                                                <sourcefiles encoding="UTF-8">
                                                    <fileset dir="../../components/org.wso2.carbon.identity.inbound.provisioning.scim2.common/src" />
                                                    <fileset dir="../../components/org.wso2.carbon.identity.inbound.provisioning.scim2.provider/src" />
                                                </sourcefiles>
                                            </structure>
                                            <html destdir="${project.build.directory}/site/jacoco" />
                                            <check>
                                                <rule element="PACKAGE">
                                                    <limit counter="LINE" value="COVEREDRATIO" minimum="0.60" />
                                                </rule>
                                            </check>
                                        </jacoco:report>
                                    </target>

                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.jacoco</groupId>
                                <artifactId>org.jacoco.ant</artifactId>
                                <version>${org.jacoco.ant.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>


text:
layout: post
title:  "Using Ionic and Heroku"
date:   "2014-10-05  8:00:00"
categories: angularjs, salesforce, heroku
author: '@maxlynch'
published: true
---

We've noticed a lot of Ionic developers using Heroku side-by-side, either as a backend or to actually host their Ionic app as a mobile website or externally-loaded app.

To help with that, we've built a ready-to-go [Ionic app](https://github.com/driftyco/ionic-heroku-button) with Node.js and Express, to either host your Ionic app as a mobile website,
or to build a Node.js API server.

To get started, all you need to do is click the Heroku Deploy button below, or see the [manual instructions](https://github.com/driftyco/ionic-heroku-button) on the github repo:

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/driftyco/ionic-heroku-button)

We hope this helps you get up and running with Ionic and a great backend like Heroku. Give it a spin, and let us know what you think!


text:
<!DOCTYPE html>

        <meta name="viewport"
              content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <meta charset="UTF-8">
        <title>Pagination</title>
        <link rel="stylesheet" href="../../main.css">


text:
#include <stdint.h>

#include <memory>
#include <vector>

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/kernels/test_util.h"
#include "tensorflow/lite/schema/schema_generated.h"

namespace tflite {
namespace {

using ::testing::ElementsAre;
using ::testing::ElementsAreArray;

template <typename T>
class MatrixSetDiagOpModel : public SingleOpModel {
 public:
  explicit MatrixSetDiagOpModel(const TensorData& input,
                                const TensorData& diag) {
    input_ = AddInput(input);
    diag_ = AddInput(diag);
    output_ = AddOutput({input.type, {}});

    SetBuiltinOp(BuiltinOperator_MATRIX_SET_DIAG,
                 BuiltinOptions_MatrixSetDiagOptions,
                 CreateMatrixSetDiagOptions(builder_).Union());
    BuildInterpreter({GetShape(input_), GetShape(diag_)});
  }

  int input() { return input_; }
  int diag() { return diag_; }

  std::vector<T> GetOutput() { return ExtractVector<T>(output_); }
  std::vector<int> GetOutputShape() { return GetTensorShape(output_); }
  TfLiteType GetOutputType() {
    TfLiteTensor* t = interpreter_->tensor(output_);
    return t->type;
  }

 private:
  int input_;
  int diag_;
  int output_;
};

// Use the machinery of TYPED_TEST_SUITE to test all supported types.
// See
// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#typed-tests
// for details.
template <typename T>
class MatrixSetDiagOpTest : public ::testing::Test {};

using TypesUnderTest =
    ::testing::Types<TypeUnion<int32_t>, TypeUnion<float>, TypeUnion<int16_t>,
                     TypeUnion<int8_t>, TypeUnion<uint8_t>>;

TYPED_TEST_SUITE(MatrixSetDiagOpTest, TypesUnderTest);

TYPED_TEST(MatrixSetDiagOpTest, ThreeByThreeDiagScatter) {
  MatrixSetDiagOpModel<typename TypeParam::ScalarType> model(
      {TypeParam::tensor_type, {3, 3}}, {TypeParam::tensor_type, {3}});
  model.template PopulateTensor<typename TypeParam::ScalarType>(model.input(),
                                                                {7, 1, 2,  //
                                                                 3, 8, 4,  //
                                                                 5, 6, 9});
  model.template PopulateTensor<typename TypeParam::ScalarType>(model.diag(),
                                                                {0, 4, 2});
  model.Invoke();
  EXPECT_THAT(model.GetOutputShape(), ElementsAre(3, 3));
  EXPECT_THAT(model.GetOutput(), ElementsAreArray({0, 1, 2,  //
                                                   3, 4, 4,  //
                                                   5, 6, 2}));
  EXPECT_THAT(model.GetOutputType(), TypeParam::tflite_type);
}

TEST(MatrixSetDiagTest, Int32TestMoreColumnsThanRows) {
  MatrixSetDiagOpModel<int32_t> model({TensorType_INT32, {2, 3}},
                                      {TensorType_INT32, {2}});
  model.PopulateTensor<int32_t>(model.input(), {0, 0, 0,  //
                                                9, 9, 9});
  model.PopulateTensor<int32_t>(model.diag(), {1, 1});
  model.Invoke();
  EXPECT_THAT(model.GetOutputShape(), ElementsAre(2, 3));
  EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 0, 0,  //
                                                   9, 1, 9}));
  EXPECT_THAT(model.GetOutputType(), TfLiteType::kTfLiteInt32);
}

TEST(MatrixSetDiagTest, Int32TestTwoDimDiag) {
  MatrixSetDiagOpModel<int32_t> model({TensorType_INT32, {2, 4, 4}},
                                      {TensorType_INT32, {2, 4}});
  model.PopulateTensor<int32_t>(model.input(), {5, 5, 5, 5,  //
                                                5, 5, 5, 5,  //
                                                5, 5, 5, 5,  //
                                                5, 5, 5, 5,  //
                                                1, 1, 1, 1,  //
                                                1, 1, 1, 1,  //
                                                1, 1, 1, 1,  //
                                                1, 1, 1, 1});
  model.PopulateTensor<int32_t>(model.diag(), {1, 2, 3, 4, 5, 6, 7, 8});
  model.Invoke();
  EXPECT_THAT(model.GetOutputShape(), ElementsAre(2, 4, 4));
  EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 5, 5, 5,  //
                                                   5, 2, 5, 5,  //
                                                   5, 5, 3, 5,  //
                                                   5, 5, 5, 4,  //
                                                   5, 1, 1, 1,  //
                                                   1, 6, 1, 1,  //
                                                   1, 1, 7, 1,  //
                                                   1, 1, 1, 8}));
  EXPECT_THAT(model.GetOutputType(), TfLiteType::kTfLiteInt32);
}

}  // namespace
}  // namespace tflite


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Fl. siles. 1:261, t. 36. 1787

#### Original name
null

### Remarks
null


text:
<?php

namespace Graze\UnicontrollerClient\Parser\Parser;

use Graze\UnicontrollerClient\Parser\Parser\AbstractParser;
use Graze\UnicontrollerClient\Parser\Parser\ParserInterface;
use Graze\UnicontrollerClient\Entity\Entity\EntityBoxItem;

class ParserBoxItem extends AbstractParser implements ParserInterface
{
    /**
     * @return []
     */
    protected function getProperties()
    {
        return [
            'anchorPoint',
            'xPos',
            'yPos',
            'width',
            'height',
            'orion',
            'description',
            'thickness',
            'arc',
            'phantomField'
        ];
    }

    /**
     * @return EntityBoxItem
     */
    protected function getEntity()
    {
        return new EntityBoxItem();
    }
}


text:
> Parse a string into an object with `name`, `email` and `url` properties following npm conventions. Useful for the `authors` property in package.json or for parsing an AUTHORS file into an array of authors objects.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install parse-author --save
```

## Usage

```js
var authors = require('parse-author');

authors('Jon Schlinkert <jon.schlinkert@sellside.com> (https://github.com/jonschlinkert)');
//=> {name: 'Jon Schlinkert', email: 'jon.schlinkert@sellside.com', url: 'https://github.com/jonschlinkert'}
```

Any of the properties can be used or missing:

```js
authors('')
//=> {name: '', email: '', url: ''}

authors('Jon Schlinkert (https://github.com/jonschlinkert)');
//=> {name: 'Jon Schlinkert', email: '', url: 'https://github.com/jonschlinkert'}
```

## Related projects

You might also be interested in these projects:

* [author-regex](https://www.npmjs.com/package/author-regex): Regular expression for parsing an `author` string into an object following npm conventions. | [homepage](https://github.com/jonschlinkert/author-regex)
* [parse-authors](https://www.npmjs.com/package/parse-authors): Parse a string into an array of objects with `name`, `email` and `url` properties following… [more](https://www.npmjs.com/package/parse-authors) | [homepage](https://github.com/jonschlinkert/parse-authors)
* [stringify-author](https://www.npmjs.com/package/stringify-author): Stringify an authors object to `name <email> (url)`. | [homepage](https://github.com/jonschlinkert/stringify-author)
* [stringify-authors](https://www.npmjs.com/package/stringify-authors): Converts an author object or array of author objects into an array of strings. Useful… [more](https://www.npmjs.com/package/stringify-authors) | [homepage](https://github.com/jonschlinkert/stringify-authors)

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-author/issues/new).

## Building docs

Generate readme and API documentation with [verb](https://github.com/verbose/verb):

```sh
$ npm install verb && npm run docs
```

Or, if [verb](https://github.com/verbose/verb) is installed globally:

```sh
$ verb
```

## Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

## Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/parse-author/blob/master/LICENSE).

***

_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 13, 2016._


text:
'use strict';

module.exports = function(app) {
	var users = require('../../app/controllers/users.server.controller');
	var transactionTypes = require('../../app/controllers/transaction-types.server.controller');

	// Transaction types Routes
	app.route('/transaction-types')
		.get(transactionTypes.list)
		.post(users.requiresLogin, transactionTypes.create);

	app.route('/transaction-types/:transactionTypeId')
		.get(transactionTypes.read)
		.put(users.requiresLogin, transactionTypes.hasAuthorization, transactionTypes.update)
		.delete(users.requiresLogin, transactionTypes.hasAuthorization, transactionTypes.delete);

	// Finish by binding the Transaction type middleware
	app.param('transactionTypeId', transactionTypes.transactionTypeByID);
};


text:
game.PlayerEntity = me.ObjectEntity.extend({

    // constructor

    init: function (x, y, settings) {
        settings.spritewidth = 50;
		settings.spriteheight = 92;
        settings.gravity = 0;
        this.parent(x, y, settings);
        this.isCollidable = true;
        // set velocity horziontantl & vertical
        this.setVelocity(5, 8);

        // init variables
        this.gravity = 0;
        this.alwaysUpdate = true;

        //// set the display to follow our position on y axis
        me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH);
    },

    /* -----
    update the player pos
    ------ */

    update: function () {
        if (me.input.isKeyPressed('left')) {

            // flip the sprite on horizontal axis
            //this.flipX(true);
            // update the entity velocity
            this.vel.x -= this.accel.x * me.timer.tick;
        } else if (me.input.isKeyPressed('right')) {
            // unflip the sprite
            //this.flipX(false);
            // update the entity velocity
            this.vel.x += this.accel.x * me.timer.tick;
        } else {
            this.vel.x = 0;
            this.vel.y = -this.accel.y * me.timer.tick;
        }
        this.vel.y = -this.accel.y * me.timer.tick;

        // check & update player movement
        this.updateMovement();

        // check for collision
        var res = me.game.world.collide(this);

        if (res == null) {
            // if we collide with an enemy
			if (res == null) {res = {}; res.obj = {}; res.obj.type = {};}
            if (res.obj.type == me.game.ACTION_OBJECT) {
                // resetear
            }
        }

        // update animation if necessary
        if (this.vel.x != 0 || this.vel.y != 0) {
            // update object animation
            this.parent();
            return true;
        }

        // else inform the engine we did not perform
        // any update (e.g. position, animation)
        return false;
    },

	onCollision: function (res, obj) {

        console.log('res', res, 'obj', obj);
    },

});

/* --------------------------
an enemy Entity
------------------------ */
/*
game.EnemyEntity = me.ObjectEntity.extend({
    init: function (x, y, settings) {
        // define this here instead of tiled
        settings.image = "wheelie_right";
        settings.spritewidth = 64;

        // call the parent constructor
        this.parent(x, y, settings);

        this.startX = x;
        this.endX = x + settings.width - settings.spritewidth;
        // size of sprite

        // make him start from the right
        this.pos.x = x + settings.width - settings.spritewidth;
        this.walkLeft = true;

        // walking & jumping speed
        this.setVelocity(4, 6);

        // make it collidable
        this.collidable = true;
        // make it a enemy object
        this.type = me.game.ENEMY_OBJECT;

    },

    // call by the engine when colliding with another object
    // obj parameter corresponds to the other object (typically the player) touching this one
    onCollision: function (res, obj) {

        // res.y >0 means touched by something on the bottom
        // which mean at top position for this one
        if (this.alive && (res.y > 0) && obj.falling) {
            this.renderable.flicker(45);
        }
    },

    // manage the enemy movement
    update: function () {
        // do nothing if not in viewport
        if (!this.inViewport)
            return false;

        if (this.alive) {
            if (this.walkLeft && this.pos.x <= this.startX) {
                this.walkLeft = false;
            } else if (!this.walkLeft && this.pos.x >= this.endX) {
                this.walkLeft = true;
            }
            // make it walk
            this.flipX(this.walkLeft);
            this.vel.x += (this.walkLeft) ? -this.accel.x * me.timer.tick : this.accel.x * me.timer.tick;

        } else {
            this.vel.x = 0;
        }

        // check and update movement
        this.updateMovement();

        // update animation if necessary
        if (this.vel.x != 0 || this.vel.y != 0) {
            // update object animation
            this.parent();
            return true;
        }
        return false;
    }
});
*/

/*----------------
 a Coin entity
------------------------ */
/*
game.CoinEntity = me.CollectableEntity.extend({
    // extending the init function is not mandatory
    // unless you need to add some extra initialization
    init: function (x, y, settings) {
        // call the parent constructor
        this.parent(x, y, settings);
    },

    // this function is called by the engine, when
    // an object is touched by something (here collected)
    onCollision: function () {
        // do something when collected

        // give some score
        game.data.score += 250;

        // make sure it cannot be collected "again"
        this.collidable = false;
        // remove it
        me.game.remove(this);
    }

});
*/


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Exobasidium vaccinii-uliginosi var. phyllodoces Savile

### Remarks
null


text:
package org.bundler;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @author John Ericksen
 */
public final class Bundles {

    public static final String BUNDLER_NAME = "Bundler";
    public static final String BUNDLER_REPOSITORY_NAME = "Bundler$Repsitory";
    public static final String BUNDLER_PACKAGE = "org.bundler";
    public static final String IMPL_EXT = "BundlerImpl";

    private static final ParcelCodeRepository REPOSITORY = new ParcelCodeRepository();

    private Bundles(){
        // private utility class constructor
    }

    /**
     * Gets the implementation of a `@Silver` annotated class
     *
     * @throws BundlerRuntimeException if there was an error looking up the wrapped Silver$Repository class.
     * @param input Silver interface
     * @return Silver implementation
     */
    @SuppressWarnings("unchecked")
    public static <T> T get(Class<T> input) {
        SilverImplementation<T> parcelableFactory = REPOSITORY.get(input);

        return parcelableFactory.build();
    }

    /**
     * Factory class for building a `Parcelable` from the given input.
     */
    public interface SilverImplementation<T> {

        String BUILD = "build";

        /**
         * Build the corresponding `Parcelable` class.
         *
         * @return Parcelable instance
         */
        T build();
    }

    private static final class SilverImplReflectionProxy<T> implements SilverImplementation<T> {

        private final Constructor<T> constructor;

        public SilverImplReflectionProxy(Class<T> parcelWrapperClass) {
            try {
                this.constructor = parcelWrapperClass.getConstructor();
            } catch (NoSuchMethodException e) {
                throw new BundlerRuntimeException("Unable to create ParcelFactory Type", e);
            }
        }

        @Override
        public T build() {
            try {
                return constructor.newInstance();
            } catch (InstantiationException e) {
                throw new BundlerRuntimeException("Unable to create ParcelFactory Type", e);
            } catch (IllegalAccessException e) {
                throw new BundlerRuntimeException("Unable to create ParcelFactory Type", e);
            } catch (InvocationTargetException e) {
                throw new BundlerRuntimeException("Unable to create ParcelFactory Type", e);
            }
        }
    }

    private static final class ParcelCodeRepository {

        private ConcurrentMap<Class, SilverImplementation> generatedMap = new ConcurrentHashMap<Class, SilverImplementation>();

        public ParcelCodeRepository() {
            loadRepository(getClass().getClassLoader());
        }

        public <T> SilverImplementation<T> get(Class<T> clazz){
            SilverImplementation result = generatedMap.get(clazz);
            if (result == null) {
                SilverImplementation value = findClass(clazz);
                if(value == null){
                    throw new BundlerRuntimeException("Unable to create SilverImplementation for " + clazz.getName());
                }
                result = generatedMap.putIfAbsent(clazz, value);
                if (result == null) {
                    result = value;
                }
            }

            return result;
        }

        @SuppressWarnings("unchecked")
        public SilverImplementation findClass(Class clazz){
            try {
                Class parcelWrapperClass = Class.forName(clazz.getName() + "$$" + IMPL_EXT);
                return new SilverImplReflectionProxy(parcelWrapperClass);
            } catch (ClassNotFoundException e) {
                return null;
            }
        }

        /**
         * Update the repository class from the given classloader.  If the given repository class cannot be instantiated
         * then this method will throw a BundlerRuntimeException.
         *
         * @throws BundlerRuntimeException
         * @param classLoader
         */
        @SuppressWarnings("unchecked")
        public void loadRepository(ClassLoader classLoader){
            try{
                Class repositoryClass = classLoader.loadClass(BUNDLER_PACKAGE + "." + BUNDLER_REPOSITORY_NAME);
                Repository instance = (Repository) repositoryClass.newInstance();
                generatedMap.putAll(instance.get());

            } catch (ClassNotFoundException e) {
                //nothing
            } catch (InstantiationException e) {
                throw new BundlerRuntimeException("Unable to instantiate generated Repository", e);
            } catch (IllegalAccessException e) {
                throw new BundlerRuntimeException("Unable to access generated Repository", e);
            }
        }
    }

    /**
     * @author John Ericksen
     */
    public interface Repository<T> {

        Map<Class, T> get();
    }

}


text:
#pragma once
#include <aws/rds/RDS_EXPORTS.h>
#include <aws/rds/RDSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/rds/model/Filter.h>

namespace Aws
{
namespace RDS
{
namespace Model
{

  /**
   *

   */
  class AWS_RDS_API DescribeSourceRegionsRequest : public RDSRequest
  {
  public:
    DescribeSourceRegionsRequest();
    Aws::String SerializePayload() const override;

    /**
     *
The source region name. For example, us-east-1.

     *
Constraints:

Must specify a valid AWS Region name.

     *

     */
    inline const Aws::String& GetRegionName() const{ return m_regionName; }

    /**
     *
The source region name. For example, us-east-1.

     *
Constraints:

Must specify a valid AWS Region name.

     *

     */
    inline void SetRegionName(const Aws::String& value) { m_regionNameHasBeenSet = true; m_regionName = value; }

    /**
     *
The source region name. For example, us-east-1.

     *
Constraints:

Must specify a valid AWS Region name.

     *

     */
    inline void SetRegionName(Aws::String&& value) { m_regionNameHasBeenSet = true; m_regionName = value; }

    /**
     *
The source region name. For example, us-east-1.

     *
Constraints:

Must specify a valid AWS Region name.

     *

     */
    inline void SetRegionName(const char* value) { m_regionNameHasBeenSet = true; m_regionName.assign(value); }

    /**
     *
The source region name. For example, us-east-1.

     *
Constraints:

Must specify a valid AWS Region name.

     *

     */
    inline DescribeSourceRegionsRequest& WithRegionName(const Aws::String& value) { SetRegionName(value); return *this;}

    /**
     *
The source region name. For example, us-east-1.

     *
Constraints:

Must specify a valid AWS Region name.

     *

     */
    inline DescribeSourceRegionsRequest& WithRegionName(Aws::String&& value) { SetRegionName(value); return *this;}

    /**
     *
The source region name. For example, us-east-1.

     *
Constraints:

Must specify a valid AWS Region name.

     *

     */
    inline DescribeSourceRegionsRequest& WithRegionName(const char* value) { SetRegionName(value); return *this;}

    /**
     *
The maximum number of records to include in the response. If more records
     * exist than the specified MaxRecords value, a pagination token
     * called a marker is included in the response so that the remaining results can be
     * retrieved.

Default: 100

Constraints: Minimum 20, maximum 100.

     */
    inline int GetMaxRecords() const{ return m_maxRecords; }

    /**
     *
The maximum number of records to include in the response. If more records
     * exist than the specified MaxRecords value, a pagination token
     * called a marker is included in the response so that the remaining results can be
     * retrieved.

Default: 100

Constraints: Minimum 20, maximum 100.

     */
    inline void SetMaxRecords(int value) { m_maxRecordsHasBeenSet = true; m_maxRecords = value; }

    /**
     *
The maximum number of records to include in the response. If more records
     * exist than the specified MaxRecords value, a pagination token
     * called a marker is included in the response so that the remaining results can be
     * retrieved.

Default: 100

Constraints: Minimum 20, maximum 100.

     */
    inline DescribeSourceRegionsRequest& WithMaxRecords(int value) { SetMaxRecords(value); return *this;}

    /**
     *
 An optional pagination token provided by a previous
     * DescribeSourceRegions request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline const Aws::String& GetMarker() const{ return m_marker; }

    /**
     *
 An optional pagination token provided by a previous
     * DescribeSourceRegions request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline void SetMarker(const Aws::String& value) { m_markerHasBeenSet = true; m_marker = value; }

    /**
     *
 An optional pagination token provided by a previous
     * DescribeSourceRegions request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline void SetMarker(Aws::String&& value) { m_markerHasBeenSet = true; m_marker = value; }

    /**
     *
 An optional pagination token provided by a previous
     * DescribeSourceRegions request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline void SetMarker(const char* value) { m_markerHasBeenSet = true; m_marker.assign(value); }

    /**
     *
 An optional pagination token provided by a previous
     * DescribeSourceRegions request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline DescribeSourceRegionsRequest& WithMarker(const Aws::String& value) { SetMarker(value); return *this;}

    /**
     *
 An optional pagination token provided by a previous
     * DescribeSourceRegions request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline DescribeSourceRegionsRequest& WithMarker(Aws::String&& value) { SetMarker(value); return *this;}

    /**
     *
 An optional pagination token provided by a previous
     * DescribeSourceRegions request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline DescribeSourceRegionsRequest& WithMarker(const char* value) { SetMarker(value); return *this;}

    /**
     *
This parameter is not currently supported.

     */
    inline const Aws::Vector<Filter>& GetFilters() const{ return m_filters; }

    /**
     *
This parameter is not currently supported.

     */
    inline void SetFilters(const Aws::Vector<Filter>& value) { m_filtersHasBeenSet = true; m_filters = value; }

    /**
     *
This parameter is not currently supported.

     */
    inline void SetFilters(Aws::Vector<Filter>&& value) { m_filtersHasBeenSet = true; m_filters = value; }

    /**
     *
This parameter is not currently supported.

     */
    inline DescribeSourceRegionsRequest& WithFilters(const Aws::Vector<Filter>& value) { SetFilters(value); return *this;}

    /**
     *
This parameter is not currently supported.

     */
    inline DescribeSourceRegionsRequest& WithFilters(Aws::Vector<Filter>&& value) { SetFilters(value); return *this;}

    /**
     *
This parameter is not currently supported.

     */
    inline DescribeSourceRegionsRequest& AddFilters(const Filter& value) { m_filtersHasBeenSet = true; m_filters.push_back(value); return *this; }

    /**
     *
This parameter is not currently supported.

     */
    inline DescribeSourceRegionsRequest& AddFilters(Filter&& value) { m_filtersHasBeenSet = true; m_filters.push_back(value); return *this; }

  private:
    Aws::String m_regionName;
    bool m_regionNameHasBeenSet;
    int m_maxRecords;
    bool m_maxRecordsHasBeenSet;
    Aws::String m_marker;
    bool m_markerHasBeenSet;
    Aws::Vector<Filter> m_filters;
    bool m_filtersHasBeenSet;
  };

} // namespace Model
} // namespace RDS
} // namespace Aws


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <script type="text/javascript">
      window.DLR = {}
      DLR.settings = {background: 'yellow'}
      DLR.path = ".."
    </script>
    <script src="../dlr.js" type="text/javascript"></script>
    <link type="text/css" rel="Stylesheet" href="tests.css" />
    <style type="text/css">
      body { padding: 0; margin: 0; }
    </style>
</head>
<body>
<div width="50" height="50" style="position:fixed;top:0;left:0;">
    <script type="application/xml+xaml" id="canvas1" width="50" height="50">
      <Canvas
        x:Name="canvas1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Background="Red" Width="50" Height="50"
      >
      </Canvas>
    </script>
</div>

<script type="text/python" class="canvas1">
  from System.Windows.Media import SolidColorBrush, Colors
  brush = SolidColorBrush()
  brush.Color = Colors.Green
  me.Background = brush
</script>
</body>
</html>


text:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\setlength\columnsep{20pt}
\usepackage{listings}
\usepackage{geometry}
\usepackage{color}
\usepackage{float}
\setlength{\belowcaptionskip}{-10pt}
\setlength{\abovecaptionskip}{-30pt}
\floatstyle{boxed}
\restylefloat{figure}
\usepackage{hyperref}
\usepackage{graphicx}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{mystyle}{
	backgroundcolor=\color{backcolour},
	commentstyle=\color{codegreen},
	keywordstyle=\color{blue},
	numberstyle=\tiny\color{codegray},
	stringstyle=\color{codepurple},
	basicstyle=\footnotesize,
	breakatwhitespace=false,
	breaklines=true,
	captionpos=b,
	keepspaces=true,
	numbers=left,
	numbersep=5pt,
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	tabsize=2
}

\lstset{style=mystyle}
\title{Data Mining\\ Home Work 03}
\author{aqeel labash}
\date{24 February 2016}
\geometry{
	a4paper,
	total={170mm,257mm},
	left=5mm,
	top=5mm,
	right=5mm
}
\begin{document}
	\maketitle
		{\centering \section*{First Question}}
\begin{flushleft}
To plot the density I used the following code :
\begin{lstlisting}[language=R]
##### Question 1 #####
rm(list=ls())
setwd("/home/aqeel/Study/DM/HW03")
klient1 <- read.csv('klien	t1.txt',header = FALSE)
klient3 <- read.csv('klient3.txt',header=FALSE)
png("densitywithoutwidth.png",width=500,height = 500)
plot(density(klient1$V1),col="RED",type = "l",main="K1 & K3 Density")
lines(density(klient3$V1),col="green")
dev.off()
\end{lstlisting}

The previous code will plot the density of klient1 \& klient3 without specifying the bandwidth. We notice that there is only a small difference between klient1 and klient3.
\begin{figure}[H]
\begin{center}
\includegraphics[scale=0.7]{densitywithoutwidth.png}
\end{center}
\caption{Show the density of K1 \& K3 without specifying width}
\end{figure}
Now to choose the width actually I tried the values to reach a level where I can see the gaps without this periodic behavior in the density. I selected bandwidth to be 11 where we still can see the changes but it won't affect our judgment of the data (high points,small points etc..).Here is the figure with bandwidth:
\begin{figure}[H]

\begin{center}
\includegraphics[scale=1]{densitywithwidth.png}
\end{center}
\caption{Shows K1\&K3 density with specified bandwidth}
\end{figure}
Figure 2 was generated by the following code :
\begin{lstlisting}[language=R]
png("densitywithwidth.png",width = 500,height = 500)
bandwidth =11
plot(density(klient1$V1,bw=bandwidth,kernel = "gaussian"),col="RED",type = "l",main="K1 (Green) & K3(Red) Density")
lines(density(klient3$V1,bw=bandwidth,kernel = "gaussian"),col="green")
dev.off()
\end{lstlisting}
\end{flushleft}
To characterize the data first we should understand the data.
Week hours  : 7*24= 168 , that's how the time is identified. And the holiday is from 120 to 168.So depending on that information here is some characteristics about the data:
\begin{enumerate}
	\item Both groups shows higher activity at the start of week end.
	\item Both groups shows less activity at the week start.
	\item First group (in Green) shows less active during the week than second group (K3,in red)
	\item First group shows more activity at the start of weekend than the second group.
	\item There is a slight shift between both groups.Which made me think that the groups from different time zones
\end{enumerate}
		{\centering \section*{Second Question}}					\begin{flushleft}
		The data contain the following information :
		\begin{enumerate}
			\item Date:the date of purchase in syntax of : "YYYYMMDD"
			\item Time:the time of purchase in syntax of : "HHMM" or "HMM" depending on time.The time is based on 24 not 12.
			\item Product: the name of the product.
			\item Shope\_id: represent the shop identity
		\end{enumerate}
		The following Table shows :
		\begin{enumerate}
			\item How many products bought from specific shop.
			\item The total amount bought of specific product from all the shops.
			\item The total amount bought from specific shop.
			\item The total bought from all shops from all products.
		\end{enumerate}
		\begin{tabular}{|c|c|c|c|c|c|c|}
			\hline
Product\textbackslash Shop&3&4&18&21&32& Total\\ \hline
Banana&6778&8677&4080&1727&3585&24847\\ \hline
Coffee\_Cream&4272&7259&4516&1418&3066&20531\\ \hline
Eggs\_1&1880&3704&1326&1106&2073&10089\\ \hline
Eggs\_2&100&181&0&0&0&281\\ \hline
Grapes&710&1199&495&273&525&3202\\ \hline
Milk\_1&3568&5173&2740&836&2557&14874\\ \hline
Milk\_2&5629&8309&4968&2440&4369&25715\\ \hline
Sour\_Cream\_1&2597&3206&1817&848&1236&9704\\ \hline
Sour\_Cream\_2&2891&5504&3046&1569&2866&15876\\ \hline
Vastlakukkel&939&1784&730&273&383&4109\\ \hline
Whipped\_Cream&2285&3815&1168&600&1396&9264\\ \hline
Total&31649&48811&24886&11090&22056&138492\\ \hline
		\end{tabular}

		The code used to generate the previous table is here:
		\begin{lstlisting}[language=R]
		shopsdata = read.csv("product_time_shop.txt",sep = ';',header = TRUE)
		x<-table(shopsdata$product,shopsdata$shop_id)
		x<-cbind(x,rowSums(x))
		x<-rbind(x,colSums(x))
		x
		\end{lstlisting}
	\end{flushleft}

		{\centering \section*{Third Question}}
To create the boxplots I depended on the 2nd question result.
in Figure 1 we can notice that Tuesday has the highest selling over all products. I guess that's because people misjudged there needs at the start of the week :) (am not alone :D ).Saturday also has a high sell rate over all products. Which could be explained by holiday \& people buying for the week.
\begin{figure}[H]
	\begin{center}
		\includegraphics[scale=0.3]{boxplotdates.png}
	\end{center}
	\caption{Total sales in the specified dates in all stores (Date~Product)}
\end{figure}
In figure 2 we can see that Milk\_2 has a high median which mean it's most sold in most stores.
the opposite for Eggs\_2 \& Grapes which mean they haven't sold much.Banana have a high selling over most of the stores.
\begin{figure}[H]
\begin{center}
	\includegraphics[scale=0.3]{boxplotproducts.png}
\end{center}
\caption{Total sold products in all dates , all stores.(Product ~ Store)}
\end{figure}
Figure 3 shows us the most product where bought from "Store 4". Also "Store 21" didn't sell much of the products compared to other stores.
\begin{figure}[H]
\begin{center}
\includegraphics[scale=0.3]{boxplotStores.png}
\end{center}
\caption{Total sales in specific store in all dates , all products (Store ~ Product)}
\end{figure}

The previous boxplots where generated by this code :
\begin{lstlisting}[language=R]
##### Third Question ##########
library(plyr)
days<-c("Sat","Sun","Sat","Tue","Mon","Tue","Sun","Sat","Fri","Fri","Tue","Wed")
shopsdata$date<- mapvalues(shopsdata$date, from = c(unique(shopsdata$date)), to = days)
png("boxplotStores",width=1600,height = 800)
boxplot(x[,(1:5)],names=paste("Store",colnames(x),sep=" "))
dev.off()
png("boxplotproducts",width = 1600,height = 800)
boxplot(t(x)[,(1:11)],names=colnames(t(x)))
dev.off()
png("boxplotdates.png",width=1600,height=800)
boxplot(table(shopsdata$product,shopsdata$date)[,c(1:6)])
dev.off()
\end{lstlisting}
To represent the data I created a plot compare store vs product.:
\begin{figure}[H]
\begin{center}
	\includegraphics[scale=0.3]{matplotallvsall.png}
\end{center}
\caption{Stores vs products}

\end{figure}
From the previous figure we can see that store 4 was selling the most.Banana and milk\_2 was the most sold thing. I believe this figure satisfy information wanted from stores and products.
The previous plot was generated by the following code :
\begin{lstlisting}[language=R]
png("matplotallvsall.png",width=1600,height=800)
matplot(x, pch = 16,  col = 1:2,xaxt="n",yaxt="n",
ylab = "Stores",type = "l")
axis(1,at=c(1:11),labels = rownames(x))
axis(2,at=x[1,],labels =paste("Store",colnames(x),sep=" "))
dev.off()
\end{lstlisting}
		{\centering \section*{Fourth Question}}
For this task  I looked at the data. We can know if a specific store run out of some or one product if this products stopped selling while the rest still.So I wrote some code to see this fact and here is the code :
\begin{lstlisting}[language=R]
######## Fourth Question #################
shopsdata = read.csv("product_time_shop.txt",sep = ';',header = TRUE)
products <- unique(shopsdata$product)

dd <-subset(shopsdata,date=="20140104" & shop_id==18)[,(2:3)]
dd$product<- factor(dd$product,products,c(1:11))
png("distribution.png",width = 900,height = 1100)
plot(dd,yaxt="n",main="Store 18 at  2014/01/04")
axis(2,at=c(1:11),labels =products)
dev.off()
dd<-subset(dd,product==9)
png("histdensity.png",width = 600,height = 600)
hist(dd$time,prob=TRUE,xlim =c(1000,2400),main = "Density Over Histogram",xlab="Time")
lines(density(dd$time),col="RED")
dd <-subset(shopsdata,date=="20140104" & shop_id==18)[,(2:3)]
dd$product<- factor(dd$product,products,c(1:11))
dd<-subset(dd,product==8)

lines(density(dd$time),col="GREEN")
dev.off()

\end{lstlisting}
The previous code will plot figure 5 which show the distribution of products over time in Store 18 at 2014/01/04. That allow us to see when a product is not sold anymore while other products still being sold.
Same figure show us that product Milk\_2 stopped selling around 16~18 (not accurate due lake of space in the image.)
\begin{figure}[H]
\begin{center}
	\includegraphics[scale=0.6]{distribution.png}
\end{center}
\caption{Show the time of selling all products.}
\end{figure}
\begin{flushleft}

After that to convince you more here is a figure 6 which contain the histogram and the density over it. The red line is Milk\_2 and the green line is Milk\_1 and we can clearly see that after 1700 o'clock there was no more purchases over milk\_2.
\begin{figure}[H]
\begin{center}
\includegraphics[scale=0.8]{histdensity.png}
\end{center}
\caption{Milk\_2 density (in red) vs Milk\_1 density (green)}
\end{figure}
So to formulate it, we can check by fix date,store and then check over all products in one hit to see which one doesn't sell at specific time while other products still selling.
\end{flushleft}
		{\centering \section*{Fifth Question}}
For this question what I've done is firstly organize the data.So I concatenated the columns (Date,Product,Store) after that I updated the time value then draw the heat map.
and here is the code :
\begin{lstlisting}[language=R]
############ Question 5 ##############
rm(list=ls())
shopsdata = read.csv("product_time_shop.txt",sep = ';',header = TRUE)
shopsdata$info=paste(paste(shopsdata$date, shopsdata$product, sep=";"),shopsdata$shop_id,sep = ";")
shopsdata$date=NULL
shopsdata$product=NULL
shopsdata$shop_id=NULL
for (i in c(7:23))
{
shopsdata[shopsdata$time>=(i*100)&shopsdata$time<((i+1)*100),]$time =i
}
colSums(table(shopsdata$info,shopsdata$time))
png("heatmap2.png",width=800,height = 800)
heatmap(table(shopsdata$info,shopsdata$time))
dev.off()
\end{lstlisting}
Here is the heatmap :
\begin{figure}[H]
\begin{center}
	\includegraphics[scale=0.7]{heatmap2.png}
\end{center}
\caption{Heatmap (Red to Yellow)}
\end{figure}
\begin{flushleft}

In figure 7 the heat map shows that at 13 (1 PM) it's the most time that people buy in general.\\
\textbf{Note:} In the heat map the time ordered depending on heat.At 23 the less heat but at 13 the highest heat.
\end{flushleft}
		{\centering \section*{Sixth Question}}
		{\centering \subsection*{(1)}}
		\begin{flushleft}

To see the behavior, I firstly replaced the dates with week days and then calculated the total sales per day using the following code :
\begin{lstlisting}[language=R]
\end{lstlisting}
The previous code create the following table : \\
\begin{tabular}{|c|c|c|c|c|c|c|}
	\hline
Fri&Mon&Sat&Sun&Tue&Wed\\
\hline
23948&9649&32260&20460&38174&14001\\
\hline
\end{tabular}\\
where we can see that people usually by more on Saturday and that's clear and expected. The shock come from Tuesday which has a high selling rate.I think this high value is due to end of what usually people buy on the week end.Here is the code I used for this task:
\begin{lstlisting}[language=R]
############### Question 6 ##############
###1st request###
rm(list=ls())
setwd("/home/aqeel/Study/DM/HW03")
shopsdata = read.csv("product_time_shop.txt",sep = ';',header = TRUE)
library(plyr)
days<-c("Sat","Sun","Sat","Tue","Mon","Tue","Sun","Sat","Fri","Fri","Tue","Wed")
shopsdata$date<- mapvalues(shopsdata$date, from = c(unique(shopsdata$date)), to = days)
\end{lstlisting}
\end{flushleft}
		{\centering \subsection*{(2)}}
To do that I used the table of Days-Products.To normalize we can take the maximum value in the matrix and divide the matrix over that number.Here is the code for this request:
\begin{lstlisting}[language=R]
###2nd request###
products_shops<-table(shopsdata$date,shopsdata$product)
products_shops<- products_shops/norm(products_shops,type ="M")
png("heatmapproductsvsdays.png",width = 500, height = 500)
heatmap(products_shops)
dev.off()
\end{lstlisting}
After that I created a heat map to have a clear view of products bought which day.
\begin{figure}[H]
	\begin{center}
		\includegraphics[scale=1]{heatmapproductsvsdays.png}
	\end{center}
	\caption{Shows heat map of products over week days}
\end{figure}
		{\centering \subsection*{(3)}
\begin{flushleft}
For this task I changed the data:(dates to week days , time to formual hour, merged date with time ) after that created a table (too large 100 row ). Then I normalized the matrix and table it to get the following plot:
\begin{figure}[H]
	\begin{center}
		\includegraphics[scale=0.9]{frequencyoverdays.png}
	\end{center}
	\caption{Product vs day and time.}
\end{figure}
Here is the code for this task :
\begin{lstlisting}[language=R]
###3rd request###
for (i in c(7:23))
{
shopsdata[shopsdata$time>=(i*100)&shopsdata$time<((i+1)*100),]$time =i
}
days<-c("Sat","Sun","Sat","Tue","Mon","Tue","Sun","Sat","Fri","Fri","Tue","Wed")
shopsdata$date<- mapvalues(shopsdata$date, from = c(unique(shopsdata$date)), to = days)
shopsdata$date<-paste(shopsdata$date, shopsdata$time, sep=" ")
shopsdata$time<-NULL
products_overtime <-table(shopsdata$date,shopsdata$product)
products_overtime<- products_overtime/norm(products_overtime)
png("frequencyoverdays.png",width=500,height=500)
matplot(products_overtime,type = "l",xlab = "Day & Time" , ylab = "Product" )
dev.off()
\end{lstlisting}
{\centering\subsection*{(4)}}
From the previous figure which shows the products bought at specific day\& time.\\
I believe if we have it large enough to identify the axis we would be able to identify the products that sold out.
\end{flushleft}
\end{document}


text:
package org.ehcache.xml;

import org.ehcache.spi.service.Service;
import org.ehcache.spi.service.ServiceConfiguration;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import java.net.URI;
import java.util.Map;
import java.util.function.Supplier;

import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;

import static java.util.Collections.singletonMap;

/**
 *
 * @author cdennis
 */
public class FancyParser implements CacheServiceConfigurationParser<Service, ServiceConfiguration<Service, ?>> {

  private static final URI NAMESPACE = URI.create("http://www.example.com/fancy");

  @Override
  public Map<URI, Supplier<Source>> getSchema() {
    return singletonMap(NAMESPACE, () -> new StreamSource(getClass().getResourceAsStream("/configs/fancy.xsd")));
  }

  @Override
  public ServiceConfiguration<Service, ?> parse(Element fragment, ClassLoader classLoader) {
    return new FooConfiguration();
  }

  @Override
  public Class<Service> getServiceType() {
    return null;
  }

  @Override
  public Element unparse(Document target, ServiceConfiguration<Service, ?> serviceConfiguration) {
    return null;
  }

}


text:
package org.traccar.protocol;

import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.Protocol;
import org.traccar.helper.BitUtil;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;

import java.net.SocketAddress;
import java.util.BitSet;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

public class RadarProtocolDecoder extends BaseProtocolDecoder {

    public RadarProtocolDecoder(Protocol protocol) {
        super(protocol);
    }

    public static final int MSG_TRACKING = 0x4C;

    @Override
    protected Object decode(
            Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {

        ByteBuf buf = (ByteBuf) msg;

        buf.readUnsignedByte(); // product id
        buf.readUnsignedByte(); // product version

        String serialNumber = String.valueOf(buf.readUnsignedInt());
        DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, serialNumber);
        if (deviceSession == null) {
            return null;
        }

        buf.readUnsignedByte(); // index
        buf.readUnsignedInt(); // timestamp
        int type = buf.readUnsignedByte();
        buf.readUnsignedShort(); // length

        if (type == MSG_TRACKING) {

            buf.readUnsignedShort(); // memory count
            buf.readUnsignedShort(); // memory index
            int count = buf.readUnsignedShort();
            buf.readUnsignedShort(); // first index

            List<Position> positions = new LinkedList<>();

            for (int index = 0; index < count; index++) {

                Position position = new Position(getProtocolName());

                position.set(Position.KEY_EVENT, buf.readUnsignedShort());

                int maskLength = buf.readUnsignedByte();
                BitSet mask = BitSet.valueOf(buf.nioBuffer(buf.readerIndex(), maskLength));
                buf.skipBytes(maskLength);

                buf.readUnsignedShort(); // length

                if (mask.get(0)) {
                    position.setDeviceTime(new Date(buf.readUnsignedInt() * 1000));
                }
                if (mask.get(1)) {
                    position.setFixTime(new Date(buf.readUnsignedInt() * 1000));
                }
                if (mask.get(2)) {
                    position.setLatitude(buf.readInt() / 360000.0);
                }
                if (mask.get(3)) {
                    position.setLongitude(buf.readInt() / 360000.0);
                }
                if (mask.get(4)) {
                    position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort()));
                }
                if (mask.get(5)) {
                    position.setCourse(buf.readUnsignedShort() * 0.1);
                }
                if (mask.get(6)) {
                    position.setAltitude(buf.readShort());
                }
                if (mask.get(7)) {
                    int flags = buf.readUnsignedByte();
                    position.setValid(BitUtil.check(flags, 0));
                    position.set(Position.KEY_SATELLITES, BitUtil.from(flags, 4));
                }
                if (mask.get(8)) {
                    long flags = buf.readUnsignedInt();
                    position.set(Position.KEY_IGNITION, BitUtil.check(flags, 0));
                    position.set(Position.KEY_CHARGE, BitUtil.check(flags, 1));
                    position.set(Position.KEY_MOTION, BitUtil.check(flags, 2));
                    for (int i = 0; i < 3; i++) {
                        position.set(Position.PREFIX_IN + i, BitUtil.check(flags, 4 + i));
                    }
                }
                if (mask.get(9)) {
                    int flags = buf.readUnsignedShort();
                    position.set(Position.KEY_BLOCKED, BitUtil.check(flags, 0));
                    position.set(Position.PREFIX_IN + 0, BitUtil.check(flags, 4));
                }
                for (int i = 10; i <= 14; i++) {
                    if (mask.get(i)) {
                        buf.readUnsignedShort(); // reserved
                    }
                }
                if (mask.get(15)) {
                    position.set(Position.KEY_ODOMETER, buf.readUnsignedInt() * 100);
                }
                if (mask.get(16)) {
                    buf.readUnsignedInt(); // reserved
                }
                for (int i = 17; i <= 27; i++) {
                    if (mask.get(i)) {
                        buf.readUnsignedByte(); // reserved
                    }
                }
                for (int i = 28; i <= 37; i += 2) {
                    if (mask.get(i)) {
                        buf.skipBytes(12); // reserved
                    }
                    if (mask.get(i + 1)) {
                        buf.readUnsignedByte(); // reserved
                    }
                }
                if (mask.get(38)) {
                    buf.skipBytes(6); // driver id
                }
                if (mask.get(39)) {
                    buf.readUnsignedShort(); // hardware problems
                }
                if (mask.get(40)) {
                    buf.readShort(); // acceleration x
                }
                if (mask.get(41)) {
                    buf.readShort(); // acceleration y
                }
                if (mask.get(42)) {
                    buf.readShort(); // acceleration z
                }
                if (mask.get(43)) {
                    buf.skipBytes(10); // operator
                }
                if (mask.get(44)) {
                    buf.readUnsignedShort(); // power
                }
                for (int i = 45; i <= 49; i++) {
                    if (mask.get(i)) {
                        buf.readUnsignedByte(); // reserved
                    }
                }
                if (mask.get(50)) {
                    buf.readShort(); // tilt
                }
                if (mask.get(51)) {
                    buf.readUnsignedInt(); // partial hours
                }
                if (mask.get(52)) {
                    buf.readUnsignedInt(); // accumulated hours
                }

                if (position.getDeviceTime() != null && position.getFixTime() != null) {
                    positions.add(position);
                }

            }

            // ACK 0x9C

            return positions.isEmpty() ? null : positions;

        }

        return null;
    }

}


text:
<StructureDefinition xmlns="http://hl7.org/fhir">
 <id value="Media"/>
 <meta>
  <lastUpdated value="2015-09-01T19:08:30.802-04:00"/>
 </meta>
 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
  <valueInteger value="1"/>
 </extension>
 <url value="http://hl7.org/fhir/StructureDefinition/Media"/>
 <name value="Media"/>
 <status value="draft"/>
 <publisher value="Health Level Seven International (FHIR Infrastructure)"/>
 <contact>
  <telecom>
   <system value="other"/>
   <value value="http://hl7.org/fhir"/>
  </telecom>
 </contact>
 <contact>
  <telecom>
   <system value="other"/>
   <value value="http://www.hl7.org/Special/committees/fiwg/index.cfm"/>
  </telecom>
 </contact>
 <date value="2015-09-01T19:08:30-04:00"/>
 <description value="Base StructureDefinition for Media Resource"/>
 <mapping>
  <identity value="rim"/>
  <uri value="http://hl7.org/v3"/>
  <name value="RIM"/>
 </mapping>
 <mapping>
  <identity value="w5"/>
  <uri value="http://hl7.org/fhir/w5"/>
  <name value="W5 Mapping"/>
 </mapping>
 <mapping>
  <identity value="dicom"/>
  <uri value="http://nema.org/dicom"/>
  <name value="DICOM"/>
 </mapping>
 <kind value="resource"/>
 <abstract value="false"/>
 <base value="http://hl7.org/fhir/StructureDefinition/DomainResource"/>
 <snapshot>
  <element>
   <path value="Media"/>
   <short value="A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference"/>
   <definition value="A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference."/>
   <min value="0"/>
   <max value="*"/>
   <type>

   </type>
   <constraint>
    <key value="mda-1"/>
    <severity value="error"/>
    <human value="Height can only be used for a photo or video"/>
    <xpath value="not(f:type/@value='audio') or not(f:height)"/>
   </constraint>
   <constraint>
    <key value="mda-2"/>
    <severity value="error"/>
    <human value="Width can only be used for a photo or video"/>
    <xpath value="not(f:type/@value='audio') or not(f:width)"/>
   </constraint>
   <constraint>
    <key value="mda-3"/>
    <severity value="error"/>
    <human value="Frames can only be used for a photo"/>
    <xpath value="(f:type/@value='photo') or not(f:frames)"/>
   </constraint>
   <constraint>
    <key value="mda-4"/>
    <severity value="error"/>
    <human value="Length can only be used for an audio or a video"/>
    <xpath value="not(f:type/@value='photo') or not(f:length)"/>
   </constraint>
   <mapping>
    <identity value="rim"/>
    <map value="Act[classCode="DGIMG", moodCode="EVN"]"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="infrastructure.structure"/>
   </mapping>
  </element>
  <element>
   <path value="Media.id"/>
   <short value="Logical id of this artifact"/>
   <definition value="The logical id of the resource, as used in the url for the resource. Once assigned, this value never changes."/>
   <comments value="The only time that a resource does not have an id is when it is being submitted to the server using a create operation. Bundles always have an id, though it is usually a generated UUID."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
  </element>
  <element>
   <path value="Media.meta"/>
   <short value="Metadata about the resource"/>
   <definition value="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
  </element>
  <element>
   <path value="Media.implicitRules"/>
   <short value="A set of rules under which this content was created"/>
   <definition value="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content."/>
   <comments value="Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element as much as possible."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isModifier value="true"/>
   <isSummary value="true"/>
  </element>
  <element>
   <path value="Media.language"/>
   <short value="Language of the resource content"/>
   <definition value="The base language in which the resource is written."/>
   <comments value="Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies  to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource  Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute)."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <binding>
    <strength value="required"/>
    <description value="A human language"/>
    <valueSetUri value="http://tools.ietf.org/html/bcp47"/>
   </binding>
  </element>
  <element>
   <path value="Media.text"/>
   <short value="Text summary of the resource, for human interpretation"/>
   <definition value="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety."/>
   <comments value="Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative."/>
   <alias value="narrative"/>
   <alias value="html"/>
   <alias value="xhtml"/>
   <alias value="display"/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <condition value="dom-1"/>
   <mapping>
    <identity value="rim"/>
    <map value="Act.text?"/>
   </mapping>
  </element>
  <element>
   <path value="Media.contained"/>
   <short value="Contained, inline Resources"/>
   <definition value="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope."/>
   <comments value="This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again."/>
   <alias value="inline resources"/>
   <alias value="anonymous resources"/>
   <alias value="contained resources"/>
   <min value="0"/>
   <max value="*"/>
   <type>

   </type>
   <mapping>
    <identity value="rim"/>
    <map value="N/A"/>
   </mapping>
  </element>
  <element>
   <path value="Media.extension"/>
   <short value="Additional Content defined by implementations"/>
   <definition value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
   <comments value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
   <alias value="extensions"/>
   <alias value="user content"/>
   <min value="0"/>
   <max value="*"/>
   <type>

   </type>
   <mapping>
    <identity value="rim"/>
    <map value="N/A"/>
   </mapping>
  </element>
  <element>
   <path value="Media.modifierExtension"/>
   <short value="Extensions that cannot be ignored"/>
   <definition value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
   <comments value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
   <alias value="extensions"/>
   <alias value="user content"/>
   <min value="0"/>
   <max value="*"/>
   <type>

   </type>
   <isModifier value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value="N/A"/>
   </mapping>
  </element>
  <element>
   <path value="Media.type"/>
   <short value="photo | video | audio"/>
   <definition value="Whether the media is a photo (still image), an audio recording, or a video recording."/>
   <min value="1"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
   <binding>
    <strength value="required"/>
    <description value="Whether the Media is a photo, video, or audio"/>
    <valueSetReference>
     <reference value="http://hl7.org/fhir/ValueSet/digital-media-type"/>
    </valueSetReference>
   </binding>
   <mapping>
    <identity value="rim"/>
    <map value=".code"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="class"/>
   </mapping>
  </element>
  <element>
   <path value="Media.subtype"/>
   <short value="The type of acquisition equipment/process"/>
   <definition value="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
   <binding>
    <strength value="example"/>
    <description value="Detailed information about the type of the image - its kind, purpose, or the kind of equipment used to generate it"/>
    <valueSetReference>
     <reference value="http://hl7.org/fhir/ValueSet/digital-media-subtype"/>
    </valueSetReference>
   </binding>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="LIST", moodCode="EVN"].code"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0008,0060 | 0008,1032"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="class"/>
   </mapping>
  </element>
  <element>
   <path value="Media.identifier"/>
   <short value="Identifier(s) for the image"/>
   <definition value="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers."/>
   <comments value="The identifier label and use can be used to determine what kind of identifier it is."/>
   <min value="0"/>
   <max value="*"/>
   <type>

   </type>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".id"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0008,0018 | ~0008,0050 | 0020,000D | 0020,000E"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="id"/>
   </mapping>
  </element>
  <element>
   <path value="Media.subject"/>
   <short value="Who/What this Media is a record of"/>
   <definition value="Who/What this Media is a record of."/>
   <min value="0"/>
   <max value="1"/>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
   </type>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
   </type>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Group"/>
   </type>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Device"/>
   </type>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Specimen"/>
   </type>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".participation[typeCode="SUBJ"]???"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="~0010,0020"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="who.focus"/>
   </mapping>
  </element>
  <element>
   <path value="Media.operator"/>
   <short value="The person who generated the image"/>
   <definition value="The person who administered the collection of the image."/>
   <min value="0"/>
   <max value="1"/>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
   </type>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".participation[typeCode="PERF"]???"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0008,1060?"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="who.actor"/>
   </mapping>
  </element>
  <element>
   <path value="Media.view"/>
   <short value="Imaging view e.g Lateral or Antero-posterior"/>
   <definition value="The name of the imaging view e.g Lateral or Antero-posterior (AP)."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
   <binding>
    <strength value="example"/>
    <description value="Imaging view (projection) used when collecting an image"/>
    <valueSetReference>
     <reference value="http://hl7.org/fhir/ValueSet/media-view"/>
    </valueSetReference>
   </binding>
   <mapping>
    <identity value="rim"/>
    <map value="DiagnosticImage.subjectOrientationCode"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="class"/>
   </mapping>
  </element>
  <element>
   <path value="Media.deviceName"/>
   <short value="Name of the device/manufacturer"/>
   <definition value="The name of the device / manufacturer of the device  that was used to make the recording."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".participation[typeCode="DEV"].role.player.Entity[classCode="DEV"].name"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0008,0070"/>
   </mapping>
  </element>
  <element>
   <path value="Media.height"/>
   <short value="Height of the image in pixels(photo/video)"/>
   <definition value="Height of the image in pixels(photo/video)."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <condition value="mda-1"/>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0028,0010"/>
   </mapping>
  </element>
  <element>
   <path value="Media.width"/>
   <short value="Width of the image in pixels (photo/video)"/>
   <definition value="Width of the image in pixels (photo/video)."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <condition value="mda-2"/>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0028,0011"/>
   </mapping>
  </element>
  <element>
   <path value="Media.frames"/>
   <short value="Number of frames if > 1 (photo)"/>
   <definition value="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <defaultValueInteger value="1"/>
   <condition value="mda-3"/>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value"/>
   </mapping>
  </element>
  <element>
   <path value="Media.duration"/>
   <short value="Length in seconds (audio / video)"/>
   <definition value="The duration of the recording in seconds - for audio and video."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <condition value="mda-4"/>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="~0028,0002"/>
   </mapping>
  </element>
  <element>
   <path value="Media.content"/>
   <short value="Actual Media - reference or data"/>
   <definition value="The actual content of the media - inline or by direct reference to the media source file."/>
   <comments value="Recommended content types: image/jpeg, image/png, image/tiff, video/mpeg, audio/mp4, application/dicom. Application/dicom can contain the transfer syntax as a parameter.  For an media that covers a period of time (video/sound), the content.creationTime is the end time. Creation time is used for tracking, organizing versions and searching."/>
   <min value="1"/>
   <max value="1"/>
   <type>

   </type>
   <mapping>
    <identity value="rim"/>
    <map value=".text"/>
   </mapping>
  </element>
 </snapshot>
 <differential>
  <element>
   <path value="Media"/>
   <short value="A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference"/>
   <definition value="A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference."/>
   <min value="0"/>
   <max value="*"/>
   <type>

   </type>
   <constraint>
    <key value="mda-1"/>
    <severity value="error"/>
    <human value="Height can only be used for a photo or video"/>
    <xpath value="not(f:type/@value='audio') or not(f:height)"/>
   </constraint>
   <constraint>
    <key value="mda-2"/>
    <severity value="error"/>
    <human value="Width can only be used for a photo or video"/>
    <xpath value="not(f:type/@value='audio') or not(f:width)"/>
   </constraint>
   <constraint>
    <key value="mda-3"/>
    <severity value="error"/>
    <human value="Frames can only be used for a photo"/>
    <xpath value="(f:type/@value='photo') or not(f:frames)"/>
   </constraint>
   <constraint>
    <key value="mda-4"/>
    <severity value="error"/>
    <human value="Length can only be used for an audio or a video"/>
    <xpath value="not(f:type/@value='photo') or not(f:length)"/>
   </constraint>
   <mapping>
    <identity value="rim"/>
    <map value="Act[classCode="DGIMG", moodCode="EVN"]"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="infrastructure.structure"/>
   </mapping>
  </element>
  <element>
   <path value="Media.type"/>
   <short value="photo | video | audio"/>
   <definition value="Whether the media is a photo (still image), an audio recording, or a video recording."/>
   <min value="1"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
   <binding>
    <strength value="required"/>
    <description value="Whether the Media is a photo, video, or audio"/>
    <valueSetReference>
     <reference value="http://hl7.org/fhir/ValueSet/digital-media-type"/>
    </valueSetReference>
   </binding>
   <mapping>
    <identity value="rim"/>
    <map value=".code"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="class"/>
   </mapping>
  </element>
  <element>
   <path value="Media.subtype"/>
   <short value="The type of acquisition equipment/process"/>
   <definition value="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
   <binding>
    <strength value="example"/>
    <description value="Detailed information about the type of the image - its kind, purpose, or the kind of equipment used to generate it"/>
    <valueSetReference>
     <reference value="http://hl7.org/fhir/ValueSet/digital-media-subtype"/>
    </valueSetReference>
   </binding>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="LIST", moodCode="EVN"].code"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0008,0060 | 0008,1032"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="class"/>
   </mapping>
  </element>
  <element>
   <path value="Media.identifier"/>
   <short value="Identifier(s) for the image"/>
   <definition value="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers."/>
   <comments value="The identifier label and use can be used to determine what kind of identifier it is."/>
   <min value="0"/>
   <max value="*"/>
   <type>

   </type>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".id"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0008,0018 | ~0008,0050 | 0020,000D | 0020,000E"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="id"/>
   </mapping>
  </element>
  <element>
   <path value="Media.subject"/>
   <short value="Who/What this Media is a record of"/>
   <definition value="Who/What this Media is a record of."/>
   <min value="0"/>
   <max value="1"/>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
   </type>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
   </type>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Group"/>
   </type>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Device"/>
   </type>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Specimen"/>
   </type>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".participation[typeCode="SUBJ"]???"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="~0010,0020"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="who.focus"/>
   </mapping>
  </element>
  <element>
   <path value="Media.operator"/>
   <short value="The person who generated the image"/>
   <definition value="The person who administered the collection of the image."/>
   <min value="0"/>
   <max value="1"/>
   <type>

    <profile value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
   </type>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".participation[typeCode="PERF"]???"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0008,1060?"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="who.actor"/>
   </mapping>
  </element>
  <element>
   <path value="Media.view"/>
   <short value="Imaging view e.g Lateral or Antero-posterior"/>
   <definition value="The name of the imaging view e.g Lateral or Antero-posterior (AP)."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
   <binding>
    <strength value="example"/>
    <description value="Imaging view (projection) used when collecting an image"/>
    <valueSetReference>
     <reference value="http://hl7.org/fhir/ValueSet/media-view"/>
    </valueSetReference>
   </binding>
   <mapping>
    <identity value="rim"/>
    <map value="DiagnosticImage.subjectOrientationCode"/>
   </mapping>
   <mapping>
    <identity value="w5"/>
    <map value="class"/>
   </mapping>
  </element>
  <element>
   <path value="Media.deviceName"/>
   <short value="Name of the device/manufacturer"/>
   <definition value="The name of the device / manufacturer of the device  that was used to make the recording."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".participation[typeCode="DEV"].role.player.Entity[classCode="DEV"].name"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0008,0070"/>
   </mapping>
  </element>
  <element>
   <path value="Media.height"/>
   <short value="Height of the image in pixels(photo/video)"/>
   <definition value="Height of the image in pixels(photo/video)."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <condition value="mda-1"/>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0028,0010"/>
   </mapping>
  </element>
  <element>
   <path value="Media.width"/>
   <short value="Width of the image in pixels (photo/video)"/>
   <definition value="Width of the image in pixels (photo/video)."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <condition value="mda-2"/>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="0028,0011"/>
   </mapping>
  </element>
  <element>
   <path value="Media.frames"/>
   <short value="Number of frames if > 1 (photo)"/>
   <definition value="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <defaultValueInteger value="1"/>
   <condition value="mda-3"/>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value"/>
   </mapping>
  </element>
  <element>
   <path value="Media.duration"/>
   <short value="Length in seconds (audio / video)"/>
   <definition value="The duration of the recording in seconds - for audio and video."/>
   <min value="0"/>
   <max value="1"/>
   <type>

   </type>
   <condition value="mda-4"/>
   <isSummary value="true"/>
   <mapping>
    <identity value="rim"/>
    <map value=".outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value"/>
   </mapping>
   <mapping>
    <identity value="dicom"/>
    <map value="~0028,0002"/>
   </mapping>
  </element>
  <element>
   <path value="Media.content"/>
   <short value="Actual Media - reference or data"/>
   <definition value="The actual content of the media - inline or by direct reference to the media source file."/>
   <comments value="Recommended content types: image/jpeg, image/png, image/tiff, video/mpeg, audio/mp4, application/dicom. Application/dicom can contain the transfer syntax as a parameter.  For an media that covers a period of time (video/sound), the content.creationTime is the end time. Creation time is used for tracking, organizing versions and searching."/>
   <min value="1"/>
   <max value="1"/>
   <type>

   </type>
   <mapping>
    <identity value="rim"/>
    <map value=".text"/>
   </mapping>
  </element>
 </differential>
</StructureDefinition>


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ATP.TestForm
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Test message box.");
        }
    }
}


text:
// +build !ignore_autogenerated

// Code generated by deepcopy-gen. DO NOT EDIT.

package v1

import (
	runtime "k8s.io/apimachinery/pkg/runtime"
)

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicaSet) DeepCopyInto(out *ReplicaSet) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
	in.Spec.DeepCopyInto(&out.Spec)
	out.Status = in.Status
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSet.
func (in *ReplicaSet) DeepCopy() *ReplicaSet {
	if in == nil {
		return nil
	}
	out := new(ReplicaSet)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ReplicaSet) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicaSetSpec) DeepCopyInto(out *ReplicaSetSpec) {
	*out = *in
	if in.Replicas != nil {
		in, out := &in.Replicas, &out.Replicas
		if *in == nil {
			*out = nil
		} else {
			*out = new(int32)
			**out = **in
		}
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSetSpec.
func (in *ReplicaSetSpec) DeepCopy() *ReplicaSetSpec {
	if in == nil {
		return nil
	}
	out := new(ReplicaSetSpec)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicaSetStatus) DeepCopyInto(out *ReplicaSetStatus) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSetStatus.
func (in *ReplicaSetStatus) DeepCopy() *ReplicaSetStatus {
	if in == nil {
		return nil
	}
	out := new(ReplicaSetStatus)
	in.DeepCopyInto(out)
	return out
}


text:
const EventEmitter = require('events');

class MyEmitter extends EventEmitter {}

const myEmitter = new MyEmitter();

myEmitter.on('error', (err) => {
    console.log('whoops! there was an error');
});

myEmitter.emit('error', new Error('whoops!'));  // Prints: whoops! there was an error


text:
if (UNIX)
    set(CPACK_GENERATOR "RPM")
    set(CPACK_SOURCE_TGZ "ON")

    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FlatBuffers serialization library and schema compiler.")

    set(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/google/flatbuffers")
    set(CPACK_RPM_PACKAGE_MAINTAINER "Marc Butler <mockbutler@gmail.com>")

    set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
    set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
    set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
    set(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_COMMIT}")
    set(CPACK_RPM_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")

    set(CPACK_RPM_PACKAGE_NAME "flatbuffers")

    # Assume this is not a cross complation build.
    if(NOT CPACK_RPM_PACKAGE_ARCHITECTURE)
        set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
    endif(NOT CPACK_RPM_PACKAGE_ARCHITECTURE)

    set(CPACK_RPM_PACKAGE_VENDOR "Google, Inc.")
    set(CPACK_RPM_PACKAGE_LICENSE "Apache 2.0")
    set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt)
    set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/CMake/DESCRIPTION.txt)

    # This may reduce rpm compatiblity with very old systems.
    set(CPACK_RPM_COMPRESSION_TYPE lzma)

    set(CPACK_RPM_PACKAGE_NAME "flatbuffers")
    set(CPACK_PACKAGE_FILE_NAME
        "${CPACK_RPM_PACKAGE_NAME}_${CPACK_RPM_PACKAGE_VERSION}_${CPACK_RPM_PACKAGE_ARCHITECTURE}")
endif(UNIX)


text:
/**
@method Seemple.off
@module seemple/off
@importance 3
@since 1.1
@summary Удаляет обработчик события
@desc Этот статичный метод работает так же, как и {@link Seemple#off} и все его вариации, но принимает в качестве первого аргумента любой JavaScript объект.
@returns {object} Первый аргумент
@see {@link Seemple#off}
@example
const object = {};
Seemple.on(object, 'foo', evt => {
	//...
});

Seemple.off(object, 'foo');
*/


text:
<?php

namespace spec\Sylius\Bundle\ThemeBundle\Resolver;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\ThemeBundle\HierarchyProvider\ThemeHierarchyProvider;
use Sylius\Bundle\ThemeBundle\HierarchyProvider\ThemeHierarchyProviderInterface;
use Sylius\Bundle\ThemeBundle\Model\ThemeInterface;
use Sylius\Bundle\ThemeBundle\Repository\ThemeRepositoryInterface;

/**
 * @mixin ThemeHierarchyProvider
 *
 * @author Kamil Kokot <kamil.kokot@lakion.com>
 */
class ThemeHierarchyProviderSpec extends ObjectBehavior
{
    function let(ThemeRepositoryInterface $themeRepository)
    {
        $this->beConstructedWith($themeRepository);
    }

    function it_is_initializable()
    {
        $this->shouldHaveType('Sylius\Bundle\ThemeBundle\HierarchyProvider\ThemeDependenciesResolver');
    }

    function it_implements_theme_hierarchy_provider_interface()
    {
        $this->shouldImplement(ThemeHierarchyProviderInterface::class);
    }

    function it_returns_theme_list_in_hierarchized_order(ThemeRepositoryInterface $themeRepository, ThemeInterface $firstTheme, ThemeInterface $secondTheme)
    {
        $firstTheme->getName()->willReturn('foo/bar1');
        $firstTheme->getParentsNames()->willReturn(['foo/bar2']);

        $secondTheme->getName()->willReturn('foo/bar2');
        $secondTheme->getParentsNames()->willReturn([]);

        $themeRepository->findOneByName('foo/bar1')->willReturn($firstTheme);
        $themeRepository->findOneByName('foo/bar2')->willReturn($secondTheme);

        $this->getThemeHierarchy($firstTheme)->shouldReturn([$firstTheme, $secondTheme]);
    }
}