text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="BookmarkManager">
    <bookmark url="file://$PROJECT_DIR$/web/js/functions.js" line="46" mnemonic="1" />
  </component>
  <component name="ChangeListManager">
    <list default="true" id="f63e0e28-a649-4588-b766-008450cbab6a" name="Default" comment="" />
    <ignored path="TSP.iws" />
    <ignored path=".idea/workspace.xml" />
    <file path="/a.dummy" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379072118113" ignored="false" />
    <file path="/config.yml" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378980576687" ignored="false" />
    <file path="/routing.yml" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378485335541" ignored="false" />
    <file path="/DefaultController.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378377116856" ignored="false" />
    <file path="/ayuda.html.twig" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378317181458" ignored="false" />
    <file path="/d22565573228a41c01bf4efd2eb0.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378316718926" ignored="false" />
    <file path="/Buy.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378317941900" ignored="false" />
    <file path="/productList.html.twig" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379072994191" ignored="false" />
    <file path="/BuyRepository.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379054460347" ignored="false" />
    <file path="/SoldRepository.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378898181891" ignored="false" />
    <file path="/functions.js" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379075409966" ignored="false" />
    <file path="/AjaxController.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378376241728" ignored="false" />
    <file path="/SelectCountryController.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378376811946" ignored="false" />
    <file path="$PROJECT_DIR$/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Tests/Generator/BundleGeneratorTest.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378377353867" ignored="false" />
    <file path="/ProductListController.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379075508683" ignored="false" />
    <file path="$PROJECT_DIR$/app/cache/dev/twig/4a/a0/900bb164b74c9b0adca0ceba8399.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379059979808" ignored="false" />
    <file path="/GridController.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379071931161" ignored="false" />
    <file path="/Util.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379074864324" ignored="false" />
    <file path="/composer.json" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378447612240" ignored="false" />
    <file path="/style.css" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378463464911" ignored="false" />
    <file path="/styles.css" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379061696670" ignored="false" />
    <file path="/parameters.yml" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379058029688" ignored="false" />
    <file path="/config_prod.yml" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378895512942" ignored="false" />
    <file path="/noProducts.html.twig" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378975812826" ignored="false" />
    <file path="/frontend.html.twig" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379063885416" ignored="false" />
    <file path="/*.regexp" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1378980536354" ignored="false" />
    <file path="/SaleRepository.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379055844992" ignored="false" />
    <file path="/Sale.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379055900815" ignored="false" />
    <file path="/GridParams.php" changelist="f63e0e28-a649-4588-b766-008450cbab6a" time="1379075156255" ignored="false" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="TSP" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="ProductListController.php" pinned="false" current="true" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Controller/ProductListController.php">
          <provider selected="true" editor-type-id="text-editor">
            <state line="25" column="0" selection-start="789" selection-end="789" vertical-scroll-proportion="0.44155845">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="GridParams.php" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Util/GridParams.php">
          <provider selected="true" editor-type-id="text-editor">
            <state line="24" column="19" selection-start="379" selection-end="392" vertical-scroll-proportion="-11.769231">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="functions.js" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/web/js/functions.js">
          <provider selected="true" editor-type-id="text-editor">
            <state line="79" column="27" selection-start="2561" selection-end="2561" vertical-scroll-proportion="-16.72">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="productList.html.twig" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Resources/views/Default/productList.html.twig">
          <provider selected="true" editor-type-id="text-editor">
            <state line="97" column="68" selection-start="4578" selection-end="4578" vertical-scroll-proportion="11.54902">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="false" />
    </FindUsagesManager>
  </component>
  <component name="IdeDocumentHistory">
    <option name="changedFiles">
      <list>
        <option value="$PROJECT_DIR$/app/cache/prod/appProdProjectContainer.php" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Resources/views/Default/noProducts.html.twig" />
        <option value="$PROJECT_DIR$/app/config/config.yml" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Entity/BuyRepository.php" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Entity/Sale.php" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Entity/SaleRepository.php" />
        <option value="$PROJECT_DIR$/app/config/parameters.yml" />
        <option value="$PROJECT_DIR$/web/css/styles.css" />
        <option value="$PROJECT_DIR$/app/Resources/views/frontend.html.twig" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Controller/GridController.php" />
        <option value="$PROJECT_DIR$/app/config/routing.yml" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Util/Util.php" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Util/GridParams.php" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Resources/views/Default/productList.html.twig" />
        <option value="$PROJECT_DIR$/web/js/functions.js" />
        <option value="$PROJECT_DIR$/src/TSP/ChallengeBundle/Controller/ProductListController.php" />
      </list>
    </option>
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" interpreter_name="PHP" />
  <component name="ProjectFrameBounds">
    <option name="x" value="-8" />
    <option name="y" value="-8" />
    <option name="width" value="1936" />
    <option name="height" value="1056" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents ProjectPane="true" />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="web" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="web" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="js" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="web" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="img" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="web" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="css" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ChallengeBundle" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ChallengeBundle" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Util" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ChallengeBundle" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Resources" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="views" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Default" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ChallengeBundle" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Resources" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ChallengeBundle" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Entity" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="TSP" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ChallengeBundle" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Controller" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="recentsLimit" value="5" />
    <property name="options.lastSelected" value="project.propVCSSupport.Mappings" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
    <property name="FullScreen" value="false" />
    <property name="GoToClass.includeJavaFiles" value="false" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="options.searchVisible" value="true" />
  </component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
      <recent name="D:\programas\xampp\htdocs\TSP\web\img" />
      <recent name="D:\programas\xampp\htdocs\TSP\src\TSP\ChallengeBundle\Resources\views\Default" />
      <recent name="D:\programas\xampp\htdocs\TSP\web\css" />
      <recent name="D:\programas\xampp\htdocs\TSP\web\js" />
      <recent name="D:\programas\xampp\htdocs\TSP\src\TSP\ChallengeBundle\Controller" />
    </key>
    <key name="MoveFile.RECENT_KEYS">
      <recent name="D:\programas\xampp\htdocs\TSP\web" />
    </key>
  </component>
  <component name="RunManager" selected="PHPUnit.TSP">
    <configuration default="false" name="AjaxController.php" type="PhpLocalRunConfigurationType" factoryName="PHP Console" temporary="true" path="$PROJECT_DIR$/src/TSP/ChallengeBundle/Controller/AjaxController.php">
      <RunnerSettings RunnerId="PhpScriptDebugRunner" />
      <ConfigurationWrapper RunnerId="PhpScriptDebugRunner" />
      <method />
    </configuration>
    <configuration default="false" name="TSP" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" temporary="true">
      <TestRunner directory="$PROJECT_DIR$" />
      <RunnerSettings RunnerId="PhpUnitDebugRunner" />
      <ConfigurationWrapper RunnerId="PhpUnitDebugRunner" />
      <method />
    </configuration>
    <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
      <TestRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
      <method />
    </configuration>
    <list size="2">
      <item index="0" class="java.lang.String" itemvalue="PHP Script.AjaxController.php" />
      <item index="1" class="java.lang.String" itemvalue="PHPUnit.TSP" />
    </list>
    <recent_temporary>
      <list size="2">
        <item index="0" class="java.lang.String" itemvalue="PHPUnit.TSP" />
        <item index="1" class="java.lang.String" itemvalue="PHP Script.AjaxController.php" />
      </list>
    </recent_temporary>
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="all">
    <option name="USER" value="" />
    <option name="PASSWORD" value="" />
    <option name="mySSHConnectionTimeout" value="30000" />
    <option name="mySSHReadTimeout" value="30000" />
    <option name="LAST_MERGED_REVISION" />
    <option name="MERGE_DRY_RUN" value="false" />
    <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
    <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
    <option name="IGNORE_SPACES_IN_MERGE" value="false" />
    <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
    <option name="FORCE_UPDATE" value="false" />
    <option name="IGNORE_EXTERNALS" value="false" />
    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="f63e0e28-a649-4588-b766-008450cbab6a" name="Default" comment="" />
      <created>1378309478397</created>
      <updated>1378309478397</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="-8" y="-8" width="1936" height="1056" extended-state="7" />
    <editor active="true" />
    <layout>
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32814237" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Framework" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3062967" sideWeight="0.6718576" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39933258" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
    <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
    <option name="CHECK_NEW_TODO" value="true" />
    <option name="myTodoPanelSettings">
      <value>
        <are-packages-shown value="false" />
        <are-modules-shown value="false" />
        <flatten-packages value="false" />
        <is-autoscroll-to-source value="false" />
      </value>
    </option>
    <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
    <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
    <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
    <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
    <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
    <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
    <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
    <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
    <option name="SHORT_DIFF_HORIZONTALLY" value="true" />
    <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
    <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
    <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
    <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
    <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
    <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
    <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
    <option name="LIMIT_HISTORY" value="true" />
    <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
    <option name="UPDATE_FILTER_SCOPE_NAME" />
    <option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
    <option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
    <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
    <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
    <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
    <option name="LAST_COMMIT_MESSAGE" />
    <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
    <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
    <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
    <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
    <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
    <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
    <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
    <option name="ACTIVE_VCS_NAME" />
    <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
    <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
    <option name="UPDATE_FILTER_BY_SCOPE" value="false" />
    <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
    <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="2" />
    </breakpoint-manager>
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Entity/Sale.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="17" column="10" selection-start="330" selection-end="330" vertical-scroll-proportion="0.22077923" />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Entity/SaleRepository.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="111" column="1" selection-start="3938" selection-end="3938" vertical-scroll-proportion="0.9598583" />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/config/parameters.yml">
      <provider selected="true" editor-type-id="text-editor">
        <state line="5" column="19" selection-start="175" selection-end="175" vertical-scroll-proportion="0.09736541" />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/web/css/styles.css">
      <provider selected="true" editor-type-id="text-editor">
        <state line="0" column="11" selection-start="1" selection-end="11" vertical-scroll-proportion="0.0" />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/Resources/views/frontend.html.twig">
      <provider selected="true" editor-type-id="text-editor">
        <state line="71" column="33" selection-start="2916" selection-end="2916" vertical-scroll-proportion="-9.038462" />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Entity/Country.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="23" column="4" selection-start="372" selection-end="386" vertical-scroll-proportion="-11.115385" />
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerAware.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="20" column="29" selection-start="429" selection-end="443" vertical-scroll-proportion="0.2609209">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="jar://$APPLICATION_HOME_DIR$/plugins/php/lib/php.jar!/com/jetbrains/php/lang/psi/stubs/data/_superglobals.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="99" column="6" selection-start="3039" selection-end="3042" vertical-scroll-proportion="0.68476975">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/config/routing.yml">
      <provider selected="true" editor-type-id="text-editor">
        <state line="7" column="0" selection-start="201" selection-end="201" vertical-scroll-proportion="0.13631158">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Util/Util.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="151" column="32" selection-start="5054" selection-end="5054" vertical-scroll-proportion="-24.076923">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Util/GridParams.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="24" column="19" selection-start="379" selection-end="392" vertical-scroll-proportion="-11.769231">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Resources/views/Default/productList.html.twig">
      <provider selected="true" editor-type-id="text-editor">
        <state line="97" column="68" selection-start="4578" selection-end="4578" vertical-scroll-proportion="11.54902">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/web/js/functions.js">
      <provider selected="true" editor-type-id="text-editor">
        <state line="79" column="27" selection-start="2561" selection-end="2561" vertical-scroll-proportion="-16.72">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/TSP/ChallengeBundle/Controller/ProductListController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="25" column="0" selection-start="789" selection-end="789" vertical-scroll-proportion="0.44155845">
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
layout: post
category: poem
title: Advice to a Poet
published: true
author: Lee Elenbaas
---
Aim the camera in your head

click, and the moment is frozen in your memory

take out the tools

chisels, hammers and pokes

shape this image into words

work fast before it melts

not that it will ever go away

but hurry before it became something new.

<br>

When the work is done

Don't ever look back

The frozen fragment that was left from the moment

Never feels the same any more

Just take your distance

And read it a while later

As a new experience.

---------------------

- published on [new stage](http://stage.co.il/Stories/344580)

redpajama_set_name: RedPajamaGithub


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_snprintf_84_bad.cpp
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE806.label.xml
Template File: sources-sink-84_bad.tmpl.cpp
*/
/*
 * @description
 * CWE: 121 Stack Based Buffer Overflow
 * BadSource:  Initialize data as a large string
 * GoodSource: Initialize data as a small string
 * Sinks: swprintf
 *    BadSink : Copy data to string using swprintf
 * Flow Variant: 84 Data flow: data passed to class constructor and destructor by declaring the class object on the heap and deleting it after use
 *
 * */
#ifndef OMITBAD

#include "std_testcase.h"
#include "CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_snprintf_84.h"

#ifdef _WIN32
#define SNPRINTF _snwprintf
#else
#define SNPRINTF swprintf
#endif

namespace CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_snprintf_84
{
CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_snprintf_84_bad::CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_snprintf_84_bad(wchar_t * dataCopy)
{
    data = dataCopy;
    /* FLAW: Initialize data as a large buffer that is larger than the small buffer used in the sink */
    wmemset(data, L'A', 100-1); /* fill with L'A's */
    data[100-1] = L'\0'; /* null terminate */
}

CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_snprintf_84_bad::~CWE121_Stack_Based_Buffer_Overflow__CWE806_wchar_t_declare_snprintf_84_bad()
{
    {
        wchar_t dest[50] = L"";
        /* POTENTIAL FLAW: Possible buffer overflow if data is larger than dest */
        SNPRINTF(dest, wcslen(data), L"%s", data);
        printWLine(data);
    }
}
}
#endif /* OMITBAD */


text:
class SeleniumServerStandalone < Formula
  desc "Browser automation for testing purposes"
  homepage "https://www.seleniumhq.org/"
  url "https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar"
  sha256 "acf71b77d1b66b55db6fb0bed6d8bae2bbd481311bcbedfeff472c0d15e8f3cb"
  license "Apache-2.0"
  revision 2

  livecheck do
    url "https://www.selenium.dev/downloads/"
    regex(/href=.*?selenium-server-standalone[._-]v?(\d+(?:\.\d+)+)\.jar/i)
  end

  depends_on "openjdk"

  def install
    libexec.install "selenium-server-standalone-#{version}.jar"
    bin.write_jar_script libexec/"selenium-server-standalone-#{version}.jar", "selenium-server"
  end

  plist_options manual: "selenium-server -port 4444"

  def plist
    <<~EOS
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>#{plist_name}</string>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <false/>
        <key>ProgramArguments</key>
        <array>
          <string>#{Formula["openjdk"].opt_bin}/java</string>
          <string>-jar</string>
          <string>#{libexec}/selenium-server-standalone-#{version}.jar</string>
          <string>-port</string>
          <string>4444</string>
        </array>
        <key>ServiceDescription</key>
        <string>Selenium Server</string>
        <key>StandardErrorPath</key>
        <string>#{var}/log/selenium-error.log</string>
        <key>StandardOutPath</key>
        <string>#{var}/log/selenium-output.log</string>
      </dict>
      </plist>
    EOS
  end

  test do
    port = free_port
    fork { exec "#{bin}/selenium-server -port #{port}" }
    sleep 6
    output = shell_output("curl --silent localhost:#{port}/wd/hub/status")
    output = JSON.parse(output)

    assert_equal 0, output["status"]
    assert_equal true, output["value"]["ready"]
    assert_equal version, output["value"]["build"]["version"]
  end
end


text:
The .csv files of this directory contain logs of the movements of the centroids of two objects: red, green. Recorded using https://github.com/roboticslab-uc3m/teo-head/blob/095d7e3497d2a0c1253082c53aeff66e989acbd9/share/cv1/scripts/cv1.xml

The data delimiter used is the space character ('\ '), and decimals are separated by the point character ('.').

#### Codebook
The data is set in the following order, in plain text and no specific header:

- Timestamp [s]
- x1 (X coordinate of the position of the centroid of red object [mm])
- y1 (Y coordinate of the position of the centroid of red object [mm])
- z1 (Z coordinate of the position of the centroid of red object [mm])
- x2 (X coordinate of the position of the centroid of green object [mm])
- y2 (Y coordinate of the position of the centroid of green object [mm])
- z2 (Z coordinate of the position of the centroid of green object [mm])
- x1-x2
- y1-y2
- z1-z2
- fabs(x1-x2)
- fabs(y1-y2)
- fabs(z1-z2)
- sqrt( pow((x1-x2),2) + pow((y1-y2),2) + pow((z1-z2),2) )

### selected-demonstrations folder
The .csv files of this directory are a selection of those in the raw folder, using different algorithms (the file implementing the demonstration selector is in https://github.com/smorante/continuous-goal-directed-actions/blob/master/demonstration-feature-selection/src/main_demons_selector.py). The .csv files are unmodified version of those in raw folder. Each algorithm just selects those it believes relevant, and place a copy in the corresponcet folder.


text:
package logbook.api;

import java.util.Map;

import javax.json.JsonObject;

import logbook.bean.Createitem;
import logbook.bean.SlotItem;
import logbook.bean.SlotItemCollection;
import logbook.internal.log.CreateitemLogFormat;
import logbook.internal.log.LogWriter;
import logbook.proxy.RequestMetaData;
import logbook.proxy.ResponseMetaData;

/**
 * /kcsapi/api_req_kousyou/createitem
 *
 */
@API("/kcsapi/api_req_kousyou/createitem")
public class ApiReqKousyouCreateitem implements APIListenerSpi {

    @Override
    public void accept(JsonObject json, RequestMetaData req, ResponseMetaData res) {
        JsonObject data = json.getJsonObject("api_data");
        if (data != null) {
            Createitem createitem = Createitem.toCreateitem(data, req);

            // 開発装備を反映
            for (SlotItem item : createitem.getGetItems()) {
                if (item != null && item.getId() > 0) {
                    Map<Integer, SlotItem> map = SlotItemCollection.get()
                            .getSlotitemMap();
                    item.setLevel(0);
                    item.setLocked(false);
                    map.put(item.getId(), item);
                }
                // 開発ログに書き込む
                createitem.setSlotItem(item);
                LogWriter.getInstance(CreateitemLogFormat::new)
                        .write(createitem);
            }
        }
    }
}


text:
<?php

namespace Eix\Services\Data;

use Eix\Services\Log\Logger;

/**
 * Structured representation of a set of related data that can be persisted.
 */
abstract class Entity
{
    protected $dataSource;
    protected $id;
    protected $fields = array();
    protected $fieldValidators = array();
    protected $isNew;

    /**
     * @param array   $data  the properties of the object.
     * @param boolean $isNew whether the data is fresh (true) or coming from a
     * previously persisted object (false).
     */
    public function __construct(array $data, $isNew = true)
    {
        $this->update($data);

        $this->isNew = $isNew;

        $this->fieldValidators = $this->getFieldValidators();
    }

    /**
     * Allow direct read access to fields (persistable properties).
     *
     * @param  string $field the field name
     * @return mixed
     */
    public function __get($field)
    {
        if (in_array($field, $this->getFields())) {
            return $this->$field;
        }
    }

    /**
     * Update an entity's data.
     *
     * @param array   $data     the data to update the entity with.
     * @param boolean $isAtomic whether a non-valid value cancels the update
     * operation. Set to false if the valid fields need to be kept in spite
     * of the invalid ones.
     */
    // FIXME: Optimise, perhaps moving the validator to a __set function.
    public function update(array $data, $isAtomic = true)
    {
        $validationStatus = array();
        // Check all values before modifying the object.
        foreach ($data as $name => $value) {
            $fieldValidationStatus = $this->validate($name, $value);
            if ($fieldValidationStatus) {
                $validationStatus[$name] = $fieldValidationStatus;
            } elseif (!$isAtomic) {
                // If the field is valid and the operation does not need
                // to be atomic, keep the value.
                $this->$name = $value;
            }
        }

        if (empty($validationStatus)) {
            // If the operation is not atomic, the valid values have
            // already been set. Otherwise, all the values can now
            // be safely assigned.
            if ($isAtomic) {
                // The fields' values are valid, the object can be updated.
                foreach ($data as $name => $value) {
                    // Check each value before modifying the object.
                    $this->$name = $value;
                }
            }
        } else {
            // If there is something in the validation status, the validation
            // failed. Load the validation status into an exception.
            $exception = new Validators\Exception;
            $exception->setValidationStatus($validationStatus);
            throw $exception;
        }

        // If the entity has an now an ID, register it with its Factory.
        $id = @$data['id'];
        if ($id && !$this->getFactory()->getEntity($id)) {
            $this->getFactory()->registerEntity($this);
        }
    }

    /**
     * Validates a field.
     *
     * @param string   $name       the field name
     * @param mixed    $value      the field value
     * @param string[] $validators custom validators for that field. If
     * not set, the entity's validators defined for that field will be used.
     * @return array an array of the invalid fields and the validations they
     * have failed.
     */
    // FIXME: Part of the fix of bringing each field into a Field object.
    protected function validate($name, $value, $validators = null)
    {
        if (empty($validators)) {
            $validators = @$this->fieldValidators[$name];
        }
        $failedValidations = array();

        if (!empty($validators)) {
            foreach ($validators as $type) {
                Logger::get()->debug("Validating $name with $type...");
                $validator = Validators::get($type);
                if (!$validator->isValid($value)) {
                    Logger::get()->debug('Failed!');
                    // The validation has failed, report its data.
                    $failedValidations[] = $validator->getFailMessage();
                }
            }
        }

        return $failedValidations;
    }

    /**
     * Obtains the data source that this entity uses if none other has been set.
     * This function is called from getDataSource() so that a data source is
     * available when it is needed, but not until it is.
     */
    abstract protected function getDefaultDataSource();

    /**
     * Returns the set of properties that need to be kept when the object is
     * stored.
     *
     * @return string[] the names of the class members that need to be stored.
     */
    abstract protected function getFields();

    /**
     * Returns a list of validators for each field that needs them.
     *
     * @return array
     */
    abstract protected function getFieldValidators();

    /**
     * Returns a list of all the entity's fields that can be displayed.
     *
     * @return mixed[] the fields and their values.
     */
    abstract public function getForDisplay();

    /**
     * Returns the factory instance that serves objects of the current class.
     * @return Factory
     */
    abstract protected function getFactory();

    /**
     * Sets the entity's field validators.
     * @param array $fieldValidators the field validators as an array
     * in the form: array(fieldName => array(validatorType1[, validatorType2]...))
     */
    public function setFieldValidators(array $fieldValidators)
    {
        $this->fieldValidators = $fieldValidators;
    }

    /**
     * Adds field validators to the existing ones.
     * @param array $fieldValidators the field validators as an array
     * in the form: array(fieldName => array(validatorType1[, validatorType2]...))
     */
    public function addFieldValidators(array $fieldValidators)
    {
        foreach ($fieldValidators as $fieldName => $validators) {
            $this->fieldValidators[$fieldName] = $validators;
        }
    }

    /**
     * Returns an array composed of all the persistable fields.
     *
     * @return array
     */
    public function getFieldsData()
    {
        $fieldsData = array();
        foreach ($this->getFields() as $field) {
            $fieldData = $this->$field;
            // If the field is an Entity, decode it.
            if ($fieldData instanceof self) {
                $fieldData = $fieldData->getFieldsData();
            } elseif (@reset($fieldData) instanceof Entity) {
                // If the field is an array of Entity, decode them all.
                $newFieldData = array();
                foreach ($fieldData as $key => $entity) {
                    $newFieldData[$key] = $entity->getFieldsData();
                }
                $fieldData = $newFieldData;
            }

            $fieldsData[$field] = $fieldData;
        }

        return $fieldsData;
    }

    public function getDataSource()
    {
        if (empty($this->dataSource)) {
            // Since no data source is available, retrieve the default one.
            $this->dataSource = $this->getDefaultDataSource();
            // If, after assigning the data source, there is still nothing in
            // the property, then fail.
            if (empty($this->dataSource)) {
                throw new Exception('No datasource has been defined.');
            }
        }

        return $this->dataSource;
    }

    /**
     * Stores the object in the persistence layer.
     */
    public function store()
    {
        // Check whether the object has ever been stored.
        if ($this->isNew) {
            Logger::get()->debug('Storing new entity ' . get_class($this) . '...');
            // Create the record. Get an ID back.
            $this->id = $this->getDataSource()->create($this->getFieldsData());
            // Store this object in the appropriate factory for further use.
            $this->getFactory()->registerEntity($this);
        } else {
            Logger::get()->debug('Updating entity ' . get_class($this) . ":{$this->id}...");
            $this->getDataSource()->update($this->id, $this->getFieldsData());
        }

        // Once stored, the entity is no longer new.
        $this->isNew = false;
    }

    /**
     * Destroys all copies of the object, even the persisted ones.
     */
    public function destroy()
    {
        // Delete from the persistence layer.
        $this->getDataSource()->destroy($this->id);
        // Remove from the registry.
        $this->getFactory()->unregisterEntity($this);
        // Done, garbage collection should do the rest.
    }

    /**
     * Retrieves the entity's ID.
     *
     * @return string the entity's ID.
     */
    public function getId()
    {
        return $this->id;
    }
}


text:
using Microsoft.Practices.Unity;
using mrjobs.Interface;
using mrjobs.Services;
using mrjobs.Pages;
using Xamarin.Forms;
using System.Threading.Tasks;

namespace mrjobs
{
	public partial class App : Application
	{
		public App()
		{
			InitializeComponent();
			NavigationPage navPage = new NavigationPage(new MainPage());
			navPage.BarBackgroundColor = (Color)Resources["AppNavBarColor"];
			navPage.BarTextColor = Color.White;
			MainPage = navPage;
		}

		public static UnityContainer Container { get; set; }

		protected override void OnStart()
		{
			// Handle when your app starts
			Container = new UnityContainer();
#if RELEASE
			Container.RegisterType<IAppService, MockAppService>(new ContainerControlledLifetimeManager());
#else
			Container.RegisterType<IAppService, AzureAppService>(new ContainerControlledLifetimeManager());
#endif

			//Initialize the MobileService here...
			Task.Run(async () =>
			{
				var appService = Container.Resolve<IAppService>();
				if (appService != null)
				{
					await appService.Initialize();
				}
			});
		}

		protected override void OnSleep()
		{
			// Handle when your app sleeps
		}

		protected override void OnResume()
		{
			// Handle when your app resumes
		}
	}
}


text:
interface IInput {
	mousePosition: IPos;
	isMouseDown: boolean;

	arrowLeft: boolean;
	arrowUp: boolean;
	arrowRight: boolean;
	arrowDown: boolean;
}

interface IPos {
	x: number;
	y: number;
}

interface IBullet {
	position: IPos;
	origin: IPos;
	angle: number;
	speed: number;
}

interface IPlayer {
	position: IPos;
	speed: number;
}

enum GameState {
	Menu,
	Running,
	EndGame,
	Credits
};

class Enemy {
	type: number;
	angle: number;
	rotatingSpeed: number;
	rotatingClockWise: boolean;
	growing: boolean;
	size: number;

	constructor(public position: IPos, public speed: number) {
		this.type = Math.floor(Math.random() * 3);
		this.angle = 0;
		this.rotatingSpeed = Math.random() * 0.007;
		this.rotatingClockWise = Math.random() < 0.5 ? true : false;
		this.growing = true;
		this.size = 10;
	}

	drawPath(context: CanvasRenderingContext2D, period: number): void {
		var x: number = this.position.x,
			y: number = this.position.y;

		if (this.type === 1) {
			context.strokeStyle = "#b84eb8";
			context.beginPath();
			context.moveTo(x + 10, y);
			context.lineTo(x, y - 20);
			context.lineTo(x - 10, y);
			context.lineTo(x, y + 20);
			context.closePath();
			context.stroke();
		} else if (this.type === 2) {
			// rotating cube

			if (this.rotatingClockWise) {
				this.angle += period * this.rotatingSpeed;
			} else {
				this.angle -= period * this.rotatingSpeed;
			}
			if (this.angle > 2 * Math.PI) { this.angle = 0; }

			context.strokeStyle = "#abb4e5";
			context.save();
			context.translate(x, y);
			context.rotate(this.angle);
			context.translate(-x, -y);

			context.beginPath();
			context.moveTo(x - 15, y - 15);
			context.lineTo(x - 15, y + 15);
			context.lineTo(x + 15, y + 15);
			context.lineTo(x + 15, y - 15);
			context.lineTo(x - 15, y - 15);
			context.lineTo(x + 15, y + 15);
			context.moveTo(x - 15, y + 15);
			context.lineTo(x + 15, y - 15);
			context.closePath();
			context.stroke();

			context.restore();
		} else {
			// growing Circle
			if (this.growing) {
				this.size += period * 0.01;
				if (this.size >= 20) {
					this.size = 20;
					this.growing = false;
				}
			} else {
				this.size -= period * 0.1;
				if (this.size <= 10) {
					this.size = 10;
					this.growing = true;
				}
			}

			context.strokeStyle = "#9a8ed6";
			context.beginPath();
			context.arc(x, y, this.size, 0, 2 * Math.PI);
			context.closePath();
			context.stroke();
		}
	}
}

class Game {
	private context: CanvasRenderingContext2D;
	private player: IPlayer;
	private lastShot: number;
	private rateOfFire: number;
	private bullets: Array<IBullet>;
	private lastFrameTime: number;
	private enemies: Array<Enemy>;
	private lastEnemySpawn: number;
	private baseEnemySpeed: number;
	private spawnRate: number;
	private score: number;
	private lives: number;
	private state: GameState;
	private startGameTime: number;
	private mouseWasUp: boolean; // prevents people from flying through the menus
	private lastInput: IInput;
	private music: boolean;
	private musicGame: HTMLAudioElement;
	private audioMenuClick: HTMLAudioElement;
	private audioDead: HTMLAudioElement;

	constructor(public document: HTMLDocument, public canvas: HTMLCanvasElement) {
		this.context = this.canvas.getContext("2d");
		this.music = false;

		this.audioMenuClick = document.createElement("audio");
		this.audioMenuClick.src = "./media/click.mp3";

		this.audioDead = document.createElement("audio");
		this.audioDead.src = "./media/dead.mp3";

		this.musicGame = document.createElement("audio");
		this.musicGame.src = "./media/game.mp3";

		this.lastInput = {
			mousePosition: { x: 0, y: 0 },
			isMouseDown: false,
			arrowLeft: false,
			arrowUp: false,
			arrowRight: false,
			arrowDown: false
		};

		canvas.onmousemove = (e: MouseEvent): void => {
			var target: HTMLElement = <HTMLElement>e.currentTarget;

			this.lastInput.mousePosition = { x: (e.clientX - target.offsetLeft), y: (e.clientY - target.offsetTop) };
		};
		canvas.onmousedown = (): void => {
			this.lastInput.isMouseDown = true;
		};
		canvas.onmouseup = (): void => {
			this.lastInput.isMouseDown = false;
		};
		document.onkeydown = (e: KeyboardEvent): void => {
			switch (e.which) {
				case 37:
					this.lastInput.arrowLeft = true;
					break;
				case 38:
					this.lastInput.arrowUp = true;
					break;
				case 39:
					this.lastInput.arrowRight = true;
					break;
				case 40:
					this.lastInput.arrowDown = true;
					break;
			}
		};
		document.onkeyup = (e: KeyboardEvent): void => {
			switch (e.which) {
				case 37:
					this.lastInput.arrowLeft = false;
					break;
				case 38:
					this.lastInput.arrowUp = false;
					break;
				case 39:
					this.lastInput.arrowRight = false;
					break;
				case 40:
					this.lastInput.arrowDown = false;
					break;
			}
		};
	}

	private drawFrame(): void {
		if (!this.lastInput.isMouseDown) {
			this.mouseWasUp = true;
		}

		if (this.state === GameState.Menu) {
			this.drawGrid();
			this.drawMenu();
		} else if (this.state === GameState.Running) {
			this.setDifficulty();
			this.drawGrid();
			this.drawPlayer();
			this.shoot();
			this.drawAmmo();
			this.drawEnemies();
			this.drawScore();

			this.lastFrameTime = new Date().getTime();
		} else if (this.state === GameState.EndGame) {
			if (this.music) {
				this.musicGame.currentTime = 0;
				this.musicGame.pause();
			}
			this.drawGrid();
			this.drawEndScreen();
		} else if (this.state === GameState.Credits) {
			this.drawGrid();
			this.drawCredits();
		}

		requestAnimationFrame((): void => this.drawFrame());
	}

	private changeState(newState: GameState): void {
		this.mouseWasUp = false;
		this.state = newState;
	}

	private drawMenu(): void {
		var cursor: string = "default";

		this.context.globalAlpha = 1;
		this.context.font = "24px xirod, sans-serif";
		this.context.textBaseline = "middle";
		this.context.textAlign = "center";
		this.context.fillStyle = "#99ccff";

		this.context.fillText("GeoWars: The Revenge", this.canvas.width / 2, this.canvas.height * 1 / 4);

		// click to start
		var textWidth: number = this.context.measureText("Click to start").width;

		// check if mouse is over the text
		if (this.lastInput.mousePosition !== null &&
			this.lastInput.mousePosition.x > (this.canvas.width / 2 - textWidth / 2) &&
			this.lastInput.mousePosition.x < (this.canvas.width / 2 + textWidth / 2) &&
			this.lastInput.mousePosition.y > (this.canvas.height * 2 / 4 - 12) &&
			this.lastInput.mousePosition.y < (this.canvas.height * 2 / 4 + 12)) {
			this.context.fillStyle = "#ffffff";
			cursor = "pointer";
		} else {
			this.context.fillStyle = "#99ccff";
		}

		this.context.fillText("Click to start", this.canvas.width / 2, this.canvas.height * 2 / 4);

		if (this.context.fillStyle === "#ffffff" && this.lastInput.isMouseDown && this.mouseWasUp) {
			cursor = "crosshair";

			this.audioMenuClick.play();
			this.startGame();
		}

		// music on/off
		var musicText: string;

		if (this.music) {
			musicText = "music on";
		} else {
			musicText = "music off";
		}

		textWidth = this.context.measureText(musicText).width;

		// check if mouse is over the text
		if (this.lastInput.mousePosition !== null &&
			this.lastInput.mousePosition.x > (this.canvas.width / 2 - textWidth / 2) &&
			this.lastInput.mousePosition.x < (this.canvas.width / 2 + textWidth / 2) &&
			this.lastInput.mousePosition.y > (this.canvas.height * 3 / 4 - 12) &&
			this.lastInput.mousePosition.y < (this.canvas.height * 3 / 4 + 12)) {
			this.context.fillStyle = "#ffffff";
			cursor = "pointer";
		} else {
			this.context.fillStyle = "#99ccff";
		}

		this.context.fillText(musicText, this.canvas.width / 2, this.canvas.height * 3 / 4);

		if (this.context.fillStyle === "#ffffff" && this.lastInput.isMouseDown && this.mouseWasUp) {
			this.audioMenuClick.play();
			this.music = !this.music;
			this.mouseWasUp = false;
		}

		this.canvas.style.cursor = cursor;
	}

	private startGame(): void {
		this.player = { position: { x: this.canvas.width / 2, y: this.canvas.height / 2 }, speed: 0.25};
		this.rateOfFire = 100;

		this.score = 0;
		this.lives = 3;
		this.bullets = [];
		this.enemies = [];
		this.baseEnemySpeed = 0.08;
		this.spawnRate = 5500;
		if (this.music) {
			this.musicGame.play();
		}
		this.lastEnemySpawn = new Date().getTime();
		this.lastShot = new Date().getTime();
		this.startGameTime = new Date().getTime();
		this.changeState(GameState.Running);
	}

	private setDifficulty(): void {
		var gameLength: number = new Date().getTime() - this.startGameTime;

		if (gameLength > 75000) {
			this.baseEnemySpeed = 0.2;
			this.spawnRate = 300;
		} else if (gameLength > 68000) {
			this.baseEnemySpeed = 0.12;
			this.spawnRate = 150;
		} else if (gameLength > 56500) {
			this.spawnRate = 250;
		} else if (gameLength > 50000) {
			this.lastEnemySpawn = new Date().getTime(); // don't spawn enemies now
		} else if (gameLength > 40000) {
			this.spawnRate = 500;
		} else if (gameLength > 28000) {
			this.spawnRate = 600;
		} else if (gameLength > 24500) {
			this.lastEnemySpawn = new Date().getTime(); // don't spawn enemies now
		} else if (gameLength > 16500) {
			this.spawnRate = 750;
		} else if (gameLength > 5500) {
			this.spawnRate = 1000;
		}
	}

	private drawGrid(): void {
		var i: number;
		var width: number = this.canvas.width;
		var height: number = this.canvas.height;

		this.context.fillStyle = "#000";
		this.context.fillRect(0, 0, width,height);

		this.context.strokeStyle = "#639";
		this.context.globalAlpha = 0.25;
		this.context.lineWidth = 1;

		// tinygrid
		this.context.beginPath();
		for (i = 0; i < 37; i++) {
			this.context.moveTo(i * 15 + 7.5, 0);
			this.context.lineTo(i * 15 + 7.5, height);
		}
		for (i = 0; i < 20; i++) {
			this.context.moveTo(0, i * 15 + 7.5);
			this.context.lineTo(width, i * 15 + 7.5);
		}
		this.context.stroke();

		// maingrid
		this.context.strokeStyle = "#663399";
		this.context.lineWidth = 1;
		this.context.globalAlpha = 0.5;

		this.context.beginPath();
		for (i = 1; i < 36; i++) {
			this.context.moveTo(i * 15 + 0.5, 0);
			this.context.lineTo(i * 15 + 0.5, height);
		}
		for (i = 1; i < 20; i++) {
			this.context.moveTo(0, i * 15 + 0.5);
			this.context.lineTo(width, i * 15 + 0.5);
		}
		this.context.stroke();
	}

	private drawPlayer(): void {
		var timePassed: number = new Date().getTime() - this.lastFrameTime,
			x: number = this.player.position.x,
			y: number = this.player.position.y;

		// move player if arrow keys are pressed;
		if (this.lastInput.arrowUp) { y -= this.player.speed * timePassed; }
		if (this.lastInput.arrowDown) { y += this.player.speed * timePassed; }
		if (this.lastInput.arrowLeft) { x -= this.player.speed * timePassed; }
		if (this.lastInput.arrowRight) { x += this.player.speed * timePassed; }

		if (y < 0) {
			y = 0;
		}
		if (y > this.canvas.height) {
			y = this.canvas.height;
		}
		if (x < 0) {
			x = 0;
		}
		if (x > this.canvas.width) {
			x = this.canvas.width;
		}

		this.player.position = {x: x, y: y };

		this.context.lineWidth = 2;
		this.context.lineJoin = "miter";
		this.context.lineCap = "butt";
		this.context.strokeStyle = "#4395e1";
		this.context.globalAlpha = 1;

		this.context.save();
		this.context.translate(x, y);
		if (this.lastInput.mousePosition) {
			this.context.rotate(Math.atan2(this.lastInput.mousePosition.y - y, this.lastInput.mousePosition.x - x));
		}
		this.context.translate(-x, -y);

		this.context.beginPath();
		this.context.moveTo(x + 11, y - 5);
		this.context.lineTo(x, y - 12);
		this.context.lineTo(x - 12, y);
		this.context.lineTo(x, y + 12);
		this.context.lineTo(x + 11, y + 5);
		this.context.lineTo(x + 3, y + 9);
		this.context.lineTo(x - 6, y);
		this.context.lineTo(x + 3, y - 9);

		this.context.closePath();
		this.context.stroke();

		this.context.restore();
	}

	private shoot(): void {
		if (this.lastInput.isMouseDown && new Date().getTime() - this.lastShot >= this.rateOfFire) {
			var playerPos: IPos = this.player.position;
			var angle: number = Math.atan2(this.lastInput.mousePosition.y - playerPos.y, this.lastInput.mousePosition.x - playerPos.x);
			var startPos: IPos = { x: playerPos.x + Math.cos(angle) * 15, y: playerPos.y + Math.sin(angle) * 15 };
			var b: IBullet = {origin: startPos, position: playerPos, angle: angle, speed: 0.3 };

			this.bullets.push(b);
			this.lastShot = new Date().getTime();
		}
	}

	private drawAmmo(): void {
		var timePassed: number = new Date().getTime() - this.lastFrameTime;
		var newBulletArray: Array<IBullet> = [];

		this.context.strokeStyle = "#c09";
		this.context.lineWidth = 3;
		this.context.globalAlpha = 1;

		for (var i: number = 0; i < this.bullets.length; i++) {
			var b: IBullet = this.bullets[i];

			var x: number = b.position.x + Math.cos(b.angle) * (b.speed * timePassed);
			var y: number = b.position.y + Math.sin(b.angle) * (b.speed * timePassed);
			b.position = { x: x, y: y };

			this.context.beginPath();
			this.context.moveTo(x, y);
			this.context.lineTo(x - Math.cos(b.angle) * 10, y - Math.sin(b.angle) * 10);
			this.context.stroke();

			if (!(x < 0 || y < 0 || x > this.canvas.width || y > this.canvas.height)) {
				newBulletArray.push(b);
			}
		}

		this.bullets = newBulletArray;
	}

	private drawEnemies(): void {
		var e: Enemy;

		// create new enemies
		if (new Date().getTime() - this.lastEnemySpawn >= this.spawnRate && this.enemies.length < 50) {
			var x: number;
			var y: number;

			x = Math.random() * this.canvas.width * 2 - this.canvas.width / 2;
			if (x < 0 || x > this.canvas.width) {
				y = Math.random() * this.canvas.height;
			} else {
				y = Math.random() > 0.5 ? -50 : this.canvas.width + 50;
			}

			e = new Enemy({ x: x, y: y }, this.baseEnemySpeed + Math.random() * 0.03); // 0.08
			this.enemies.push(e);

			this.lastEnemySpawn = new Date().getTime();
		}

		var timePassed: number = new Date().getTime() - this.lastFrameTime;
		var newEnemies: Array<Enemy> = [];

		this.context.globalAlpha = 1;
		this.context.lineWidth = 2;

		for (var i: number = 0; i < this.enemies.length; i++) {
			e = this.enemies[i];

			var x1: number = e.position.x, // enemy location
				y1: number = e.position.y,
				x2: number = this.player.position.x, // player location
				y2: number = this.player.position.y,
				angle: number = Math.atan2(y2 - y1, x2 - x1),
				newX: number = x1 + Math.cos(angle) * (e.speed * timePassed), // calculate new position
				newY: number = y1 + Math.sin(angle) * (e.speed * timePassed);

			e.position = { x: newX, y: newY };

			e.drawPath(this.context, timePassed);

			// check if player got hit by enemy
			if (this.context.isPointInPath(x2, y2)) {
				console.log("Life lost - Enemy: " + i + " x:" + x1.toString() +
					" y:" + y1.toString() + " - Player: " + x2.toString() + " " + y2.toString());
				console.log("Time passed: " + timePassed + " - Speed: " + e.speed);

				this.audioDead.play();
				this.loseLife();
				return;
			}

			// check if enemy got hit by ammo
			var targetHit: boolean = false;
			for (var j: number = 0; j < this.bullets.length; j++) {
				var b: IBullet = this.bullets[j];

				if (this.context.isPointInPath(b.position.x, b.position.y)) {
					this.score += 100;
					targetHit = true;
				}
				if (targetHit) { break; }
			}
			if (targetHit) { continue; }

			newEnemies.push(e);
		}
		this.enemies = newEnemies;
	}

	private loseLife(): void {
		this.enemies = [];
		this.lives -= 1;

		if (this.lives === 0) {
			this.canvas.style.cursor = "default";
			this.changeState(GameState.EndGame);
		}
	}

	private drawScore(): void {
		this.context.globalAlpha = 1;
		this.context.fillStyle = "#99ccff";
		this.context.textBaseline = "top";
		this.context.font = "16px xirod, sans-serif";

		this.context.textAlign = "left";
		this.context.fillText(this.lives + (this.lives === 1 ? " life" : " lives"), 8, 8);

		this.context.textAlign = "right";
		this.context.fillText(this.score + " pts", this.canvas.width - 8, 8);

		if (new Date().getTime() - this.startGameTime < 5500) {
			var countDown: number = Math.floor((5500 - new Date().getTime() + this.startGameTime) / 1000);
			var countDownText: string;

			if (countDown === 0) {
				countDownText = "Start";
			} else {
				countDownText = countDown.toString();
			}
			this.context.textAlign = "center";
			this.context.fillText(countDownText, this.canvas.width / 2, this.canvas.height * 1 / 3);
		}
	}

	private drawEndScreen(): void {
		var cursor: string = "default";

		this.context.globalAlpha = 1;
		this.context.fillStyle = "#99ccff";
		this.context.textBaseline = "middle";
		this.context.font = "25px xirod, sans-serif";

		this.context.textAlign = "center";
		this.context.fillText("You scored: " + this.score, this.canvas.width / 2, this.canvas.height / 2);

		var textWidth: number = this.context.measureText("Try again?").width;

		// check if mouse is over the text
		if (this.lastInput.mousePosition !== null &&
			this.lastInput.mousePosition.x > (this.canvas.width / 2 - textWidth / 2) &&
			this.lastInput.mousePosition.x < (this.canvas.width / 2 + textWidth / 2) &&
			this.lastInput.mousePosition.y > (this.canvas.height * 3 / 4 - 12.5) &&
			this.lastInput.mousePosition.y < (this.canvas.height * 3 / 4 + 12.5)) {
			this.context.fillStyle = "#ffffff";
			cursor = "pointer";
		} else {
			this.context.fillStyle = "#99ccff";
		}

		this.context.fillText("Try again?", this.canvas.width / 2, this.canvas.height * 3 / 4);
		if (this.context.fillStyle === "#ffffff" && this.lastInput.isMouseDown && this.mouseWasUp) {
			cursor = "crosshair";
			this.audioMenuClick.play();
			this.startGame();
		}

		// credits
		this.context.font = "12px xirod, sans-serif";
		this.context.textBaseline = "bottom";
		this.context.textAlign = "right";
		textWidth = this.context.measureText("Credits").width;

		// check if mouse is over the text
		if (this.lastInput.mousePosition !== null &&
			this.lastInput.mousePosition.x > (this.canvas.width - 10 - textWidth) &&
			this.lastInput.mousePosition.x < (this.canvas.width - 10) &&
			this.lastInput.mousePosition.y > (this.canvas.height - 10 - 12) &&
			this.lastInput.mousePosition.y < (this.canvas.height - 10)) {
			this.context.fillStyle = "#ffffff";
			cursor = "pointer";
		} else {
			this.context.fillStyle = "#99ccff";
		}

		this.context.fillText("Credits", this.canvas.width - 10, this.canvas.height - 10);

		if (this.context.fillStyle === "#ffffff" && this.lastInput.isMouseDown && this.mouseWasUp) {
			cursor = "default";
			this.audioMenuClick.play();
			this.changeState(GameState.Credits);
		}

		this.canvas.style.cursor = cursor;
	}

	private drawCredits(): void {
		// show credits

		this.context.globalAlpha = 1;
		this.context.fillStyle = "#99ccff";
		this.context.textBaseline = "middle";
		this.context.font = "16px xirod, sans-serif";

		this.context.textAlign = "center";
		this.context.fillText("Programmer: Steve Vaneeckhout", this.canvas.width / 2, this.canvas.height * 1 / 5);
		this.context.fillText("Music: Cold Storage - Messij", this.canvas.width / 2, this.canvas.height * 2 / 5);
		this.context.fillText("Sounds: soundjay.com", this.canvas.width / 2, this.canvas.height * 3 / 5);
		this.context.fillText("Font: xirod - Ray Larabie", this.canvas.width / 2, this.canvas.height * 4 / 5);

		// back to score
		this.context.font = "12px xirod, sans-serif";
		this.context.textBaseline = "bottom";
		this.context.textAlign = "right";
		var textWidth: number = this.context.measureText("Score").width;
		var cursor: string = "default";

		// check if mouse is over the text
		if (this.lastInput.mousePosition !== null &&
			this.lastInput.mousePosition.x > (this.canvas.width - 10 - textWidth) &&
			this.lastInput.mousePosition.x < (this.canvas.width - 10) &&
			this.lastInput.mousePosition.y > (this.canvas.height - 10 - 12) &&
			this.lastInput.mousePosition.y < (this.canvas.height - 10)) {
			this.context.fillStyle = "#ffffff";
			cursor = "pointer";
		} else {
			this.context.fillStyle = "#99ccff";
		}

		this.context.fillText("Score", this.canvas.width - 10, this.canvas.height - 10);

		if (this.context.fillStyle === "#ffffff" && this.lastInput.isMouseDown && this.mouseWasUp) {
			cursor = "default";
			this.audioMenuClick.play();
			this.changeState(GameState.EndGame);
		}

		this.canvas.style.cursor = cursor;
	}

	start(): void {
		this.changeState(GameState.Menu);

		requestAnimationFrame((): void => this.drawFrame());
	}
}

var g: Game;

window.onload = (): void => {
	var canvas: HTMLCanvasElement = <HTMLCanvasElement>document.getElementById("game");

	g = new Game(document, canvas);
	g.start();
};


text:
using System;

namespace NUnit.Framework.Internal
{
    partial class ValueGenerator
    {
        private sealed class SingleValueGenerator : ValueGenerator<float>
        {
            public override bool TryCreateStep(object value, out ValueGenerator.Step step)
            {
                if (value is float)
                {
                    step = new ComparableStep<float>((float)value, (prev, stepValue) =>
                    {
                        var next = prev + stepValue;
                        if (stepValue > 0 ? next <= prev : prev <= next)
                            throw new ArithmeticException($"Not enough precision to represent the next step; {prev:r} + {stepValue:r} = {next:r}.");
                        return next;
                    });
                    return true;
                }

                return base.TryCreateStep(value, out step);
            }
        }
    }
}


text:
'use strict';

//Letters service used for communicating with the letters REST endpoints
angular.module('letters').factory('Articles', ['$resource',
    function($resource) {
        return $resource('articles/:articleId/:controller', {
            articleId: '@_id'
        }, {
            update: {
                method: 'PUT'
            }
        });
    }
]);


text:
<xlink:locator xmlns:xlink="http://www.w3.org/1999/xlink"
	xlink:type="locator"
	xlink:href="https://github.com/highsource/w3c-schemas"
	xlink:role="urn:none"
	xlink:title="Locator Title"
	xlink:label="label">
	<xlink:title xlink:type="title" xml:lang="en">Title</xlink:title>
</xlink:locator>


text:
package com.cflint.plugins.core;

import com.cflint.BugList;
import com.cflint.plugins.CFLintScannerAdapter;
import com.cflint.plugins.Context;

/**
 * Check the length of a block of code.
 */
public class LengthChecker extends CFLintScannerAdapter {

    /**
     *  Check the length of a block of code.
     *
     * @param maxLength maximimum length.
     * @param message message to display.
     * @param context current context.
     * @param atLine  current line.
     * @param atOffset current offset.
     * @param linesLength no of lines.
     * @param bugs list of bugs.
     */
    protected void checkSize(final int maxLength, final String message, final Context context, final int atLine, final int atOffset, final int linesLength, final BugList bugs) {
        final String lengthThreshold = context.getConfiguration().getParameter(this,"length");
        int length = maxLength;

        if (lengthThreshold != null) {
            length = Integer.parseInt(lengthThreshold);
        }

        if (linesLength > length) {
            context.addMessage(message, Integer.toString(linesLength), this, atLine, atOffset);

        }
    }
}


text:
<?php

echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";

$uid = '123';

$extra_arg = '12312';

var_dump(posix_setuid( $uid, $extra_arg ) );

var_dump(posix_setuid(  ) );

?>


text:
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace WJStore.Application.Interfaces.Common
{
    public interface IAppService<TEntity> : IWriteOnlyAppService<TEntity>, IDisposable
        where TEntity : class
    {
        TEntity Get(int id, bool @readonly = false);
        IEnumerable<TEntity> All(bool @readonly = false);
        IEnumerable<TEntity> Find(Expression<Func<TEntity, bool>> predicate, bool @readonly = false);
    }
}


text:
module OffsitePayments #:nodoc:
  module Integrations #:nodoc:
    module A1agregator
      mattr_accessor :service_url
      self.service_url = 'https://partner.a1agregator.ru/a1lite/input/'

      mattr_accessor :signature_parameter_name
      self.signature_parameter_name = 'check'

      def self.notification(*args)
        Notification.new(*args)
      end

      def self.status(login, password)
        Status.new(login, password)
      end

      class Helper < OffsitePayments::Helper
        # public key
        mapping :account, 'key'

        mapping :amount, 'cost'

        mapping :order, 'order_id'

        mapping :customer, :email => 'email',
                           :phone => 'phone_number'

         # payment description
        mapping :credential2, 'name'

        mapping :credential3, 'comment'

        # on error
        # 1 - raise error
        # 0 - redirect
        mapping :credential4, 'verbose'
      end

      class Notification < OffsitePayments::Notification
        self.production_ips = [
          '78.108.178.206',
          '79.137.235.129',
          '95.163.96.79',
          '212.24.38.100'
        ]

        def initialize(*args)
          super
          guess_notification_type
        end

        # Simple notification request params:
        # tid
        # name
        # comment
        # partner_id
        # service_id
        # order_id
        # type
        # partner_income
        # system_income

        def complete?
          true
        end

        def transaction_id
          params['tid']
        end

        def title
          params['name']
        end

        def comment
          params['comment']
        end

        def partner_id
          params['partner_id']
        end

        def service_id
          params['service_id']
        end

        def item_id
          params['order_id']
        end

        def type
          params['type']
        end

        # Additional notification request params:
        # tid
        # name
        # comment
        # partner_id
        # service_id
        # order_id
        # type
        # cost
        # income_total
        # income
        # partner_income
        # system_income
        # command
        # phone_number
        # email
        # resultStr
        # date_created
        # version
        # check

        def inclome_total
          params['income_total']
        end

        def income
          params['income']
        end

        def partner_income
          params['partner_income']
        end

        def system_income
          params['system_income']
        end

        def command
          params['command']
        end

        def phone_number
          params['phone_number']
        end

        def payer_email
          params['email']
        end

        def result_string
          params['resultStr']
        end

        def received_at
          params['date_created']
        end

        def version
          params['version']
        end

        def security_key
          params[A1agregator.signature_parameter_name].to_s.downcase
        end

        # the money amount we received in X.2 decimal.
        alias_method :gross, :system_income

        def currency
          'RUB'
        end

        # Was this a test transaction?
        def test?
          params['test'] == '1'
        end

        def simple_notification?
          @notification_type == :simple
        end

        def additional_notification?
          @notification_type == :additional
        end

        def acknowledge(authcode = nil)
          security_key == signature
        end

        private

        def signature
          data = "#{params['tid']}\
#{params['name']}\
#{params['comment']}\
#{params['partner_id']}\
#{params['service_id']}\
#{params['order_id']}\
#{params['type']}\
#{params['partner_income']}\
#{params['system_income']}\
#{params['test']}\
#{@options[:secret]}"
          Digest::MD5.hexdigest(data)
        end

        def guess_notification_type
          @notification_type = params['version'] ? :additional : :simple
        end
      end

      class Status
        include ActiveUtils::PostsData

        STATUS_TEST_URL = 'https://partner.a1pay.ru/a1lite/info/'

        attr_accessor :login, :password

        def initialize(login, password)
          @login, @password = login, password
        end

        # agregator provides two methods:
        # by tid - transaction id
        # by order_id & service_id
        def update(options = {})
          data = PostData.new
          data[:user] = @login
          data[:pass] = @password
          if options[:tid]
            data[:tid] = options[:tid]
          else
            data[:ord_id] = options[:ord_id]
            data[:service_id] = options[:service_id]
          end

          ssl_post(STATUS_TEST_URL, data.to_post_data)
        end
      end
    end
  end
end