text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="0f521d99-1962-4bd7-af1d-e0e9f8bf67c7" name="Default" comment="">
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/config/config.php" afterPath="$PROJECT_DIR$/application/config/config.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/config/database.php" afterPath="$PROJECT_DIR$/application/config/database.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/modules/admin/views/product/edit.php" afterPath="$PROJECT_DIR$/application/modules/admin/views/product/edit.php" />
    </list>
    <ignored path="ShopCart.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path=".idea/dataSources.local.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <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="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="ShopCart" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="index.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/application/modules/site/views/login/index.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1566">
              <caret line="87" column="87" selection-start-line="87" selection-start-column="87" selection-end-line="87" selection-end-column="87" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/application/modules/site/views/home/index.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="54">
              <caret line="3" column="35" selection-start-line="3" selection-start-column="35" selection-end-line="3" selection-end-column="35" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="site.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/application/modules/site/views/layouts/site.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="990">
              <caret line="55" column="14" selection-start-line="55" selection-start-column="14" selection-end-line="55" selection-end-column="14" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="home.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/public/assets/js/site/home.js">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1422">
              <caret line="79" column="20" selection-start-line="79" selection-start-column="20" selection-end-line="79" selection-end-column="20" />
              <folding>
                <marker date="1500368305845" expanded="true" signature="8349:8381" ph="..." />
                <marker date="1500368305845" expanded="true" signature="11713:11745" ph="..." />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="validation.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/public/assets/js/site/validation.js">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="72">
              <caret line="4" column="16" selection-start-line="4" selection-start-column="16" selection-end-line="4" selection-end-column="16" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Category.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/application/modules/admin/controllers/Category.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1062">
              <caret line="59" column="19" selection-start-line="59" selection-start-column="19" selection-end-line="59" selection-end-column="19" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="edit.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/application/modules/admin/views/product/edit.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="334">
              <caret line="71" column="33" selection-start-line="71" selection-start-column="33" selection-end-line="71" selection-end-column="33" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="routes.php" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/application/config/routes.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="-665">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/application/hooks/index.html">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="0">
              <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Login.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/application/modules/admin/controllers/Login.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1062">
              <caret line="59" column="58" selection-start-line="59" selection-start-column="58" selection-end-line="59" selection-end-column="58" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="CSS File" />
        <option value="JavaScript File" />
        <option value="tsconfig.json" />
      </list>
    </option>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/application/modules/admin/controllers/User.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/banner/edit.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/models/Product_model.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/product/add.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/banner/add.php" />
        <option value="$PROJECT_DIR$/public/assets/js/admin/product_table.js" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/coupon/edit.php" />
        <option value="$PROJECT_DIR$/public/assets/js/admin/function.js" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/coupon/index.php" />
        <option value="$PROJECT_DIR$/public/assets/js/admin/coupon_table.js" />
        <option value="$PROJECT_DIR$/application/modules/admin/models/Coupon_model.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/coupon/add.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/controllers/Coupon.php" />
        <option value="$PROJECT_DIR$/application/core/Base_Site_Controller.php" />
        <option value="$PROJECT_DIR$/application/third_party/MX/Controller.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/models/Banner_model.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/layouts/admin.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/models/Category_model.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/category/add.php" />
        <option value="$PROJECT_DIR$/application/modules/site/views/home/test.php" />
        <option value="$PROJECT_DIR$/site_asset/index.html" />
        <option value="$PROJECT_DIR$/application/modules/site/views/home/slider.php" />
        <option value="$PROJECT_DIR$/application/modules/site/models/Home_model.php" />
        <option value="$PROJECT_DIR$/application/modules/site/controllers/Home.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/product/index.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/controllers/Category.php" />
        <option value="$PROJECT_DIR$/application/modules/site/views/home/index.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/controllers/Banner.php" />
        <option value="$PROJECT_DIR$/application/modules/site/models/Login_model.php" />
        <option value="$PROJECT_DIR$/application/modules/site/views/login/forgot.php" />
        <option value="$PROJECT_DIR$/application/modules/site/views/layouts/site.php" />
        <option value="$PROJECT_DIR$/application/modules/site/controllers/Authenticate.php" />
        <option value="$PROJECT_DIR$/application/modules/site/views/login/index.php" />
        <option value="$PROJECT_DIR$/application/libraries/Facebook.php" />
        <option value="$PROJECT_DIR$/application/modules/site/controllers/test_redis.php" />
        <option value="$PROJECT_DIR$/application/modules/site/controllers/Test_redis.php" />
        <option value="$PROJECT_DIR$/application/config/redis.php" />
        <option value="$PROJECT_DIR$/application/core/Site_Controller.php" />
        <option value="$PROJECT_DIR$/application/config/sendgrid.php" />
        <option value="$PROJECT_DIR$/application/libraries/Sendgrid_Mail.php" />
        <option value="$PROJECT_DIR$/application/config/autoload.php" />
        <option value="$PROJECT_DIR$/application/modules/site/models/Email_model.php" />
        <option value="$PROJECT_DIR$/application/config/constants.php" />
        <option value="$PROJECT_DIR$/application/modules/site/controllers/Login.php" />
        <option value="$PROJECT_DIR$/index.php" />
        <option value="$PROJECT_DIR$/public/assets/js/site/home.js" />
        <option value="$PROJECT_DIR$/application/config/database.php" />
        <option value="$PROJECT_DIR$/application/config/config.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/controllers/Reports.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/controllers/Product.php" />
        <option value="$PROJECT_DIR$/application/modules/admin/views/product/edit.php" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="MessDetectorBlackList">
    <option name="filePaths">
      <list>
        <option value="$PROJECT_DIR$/application/config/config.php" />
      </list>
    </option>
  </component>
  <component name="PhpServers">
    <servers />
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  <component name="ProjectFrameBounds">
    <option name="x" value="65" />
    <option name="y" value="24" />
    <option name="width" value="1215" />
    <option name="height" value="1000" />
  </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="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scratches" />
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="site_asset" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="application" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="application" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="modules" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ShopCart" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="application" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="config" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$/../blog" />
    <property name="list.type.of.created.stylesheet" value="CSS" />
    <property name="js-jscs-nodeInterpreter" value="$USER_HOME$/.nvm/versions/node/v8.2.1/bin/node" />
  </component>
  <component name="RecentsManager">
    <key name="MoveFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$/application/modules/welcome/views" />
      <recent name="$PROJECT_DIR$/application/modules/welcome/controllers" />
      <recent name="$PROJECT_DIR$/application/views" />
      <recent name="$PROJECT_DIR$/application/controllers" />
    </key>
    <key name="CopyFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$/application/modules/admin/views/coupon" />
      <recent name="$PROJECT_DIR$/application/modules/admin/views/product" />
      <recent name="$PROJECT_DIR$/application/modules/admin/views/category" />
      <recent name="$PROJECT_DIR$/application/modules/admin/views/banner" />
      <recent name="$PROJECT_DIR$/application/modules/admin/views/config" />
    </key>
  </component>
  <component name="RunManager">
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
      <TestRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpBehatConfigurationType" factoryName="Behat">
      <BehatRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-interpreter>project</node-interpreter>
      <node-options />
      <gulpfile />
      <tasks />
      <arguments />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.npm" factoryName="npm">
      <command value="run-script" />
      <scripts />
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="0f521d99-1962-4bd7-af1d-e0e9f8bf67c7" name="Default" comment="" />
      <created>1494235519862</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1494235519862</updated>
      <workItem from="1494235521445" duration="8838000" />
      <workItem from="1494391677114" duration="29040000" />
      <workItem from="1494473590308" duration="33844000" />
      <workItem from="1494560325825" duration="30569000" />
      <workItem from="1494819476645" duration="20754000" />
      <workItem from="1494843691003" duration="61000" />
      <workItem from="1494843829629" duration="794000" />
      <workItem from="1494852978317" duration="503000" />
      <workItem from="1494853550887" duration="7150000" />
      <workItem from="1494905679195" duration="32824000" />
      <workItem from="1494992030542" duration="33604000" />
      <workItem from="1495077982604" duration="23811000" />
      <workItem from="1495164219535" duration="32056000" />
      <workItem from="1495251869434" duration="162523000" />
      <workItem from="1495796131464" duration="20297000" />
      <workItem from="1495858464204" duration="15118000" />
      <workItem from="1496032083802" duration="1513000" />
      <workItem from="1496033667818" duration="9690000" />
      <workItem from="1496047798813" duration="19986000" />
      <workItem from="1496115595806" duration="1000" />
      <workItem from="1496132764456" duration="1609000" />
      <workItem from="1496135041953" duration="1806000" />
      <workItem from="1496201403210" duration="4204000" />
      <workItem from="1496207178121" duration="63000" />
      <workItem from="1496287786291" duration="3857000" />
      <workItem from="1497680912047" duration="22000" />
      <workItem from="1504164265093" duration="28812000" />
      <workItem from="1504796781104" duration="6733000" />
      <workItem from="1505137731519" duration="3933000" />
      <workItem from="1505455205581" duration="91000" />
      <workItem from="1506697980247" duration="141000" />
      <workItem from="1507291762405" duration="2206000" />
      <workItem from="1508921714564" duration="2110000" />
      <workItem from="1509022084832" duration="2323000" />
      <workItem from="1509950514890" duration="647000" />
      <workItem from="1510578348603" duration="1782000" />
      <workItem from="1510844044537" duration="205000" />
      <workItem from="1512025738897" duration="7155000" />
      <workItem from="1512132896488" duration="3106000" />
      <workItem from="1513341604717" duration="73000" />
      <workItem from="1513577361791" duration="720000" />
      <workItem from="1513582031277" duration="141000" />
      <workItem from="1513588726252" duration="1266000" />
      <workItem from="1513759580186" duration="2149000" />
      <workItem from="1513864218658" duration="2605000" />
      <workItem from="1514368331123" duration="1243000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="561978000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="65" y="24" width="1215" height="1000" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2677502" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" 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" show_stripe_button="true" weight="0.3287037" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24940239" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3287037" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32853982" sideWeight="0.5" order="1" 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" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
    </layout>
    <layout-to-restore>
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3287037" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.26693228" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3287037" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24940239" sideWeight="0.5" order="2" 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" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
    </layout-to-restore>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="4" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/application/modules/site/views/login/forgot.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="252">
          <caret line="14" column="26" selection-start-line="14" selection-start-column="26" selection-end-line="14" selection-end-column="26" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/tsconfig.json" />
    <entry file="file://$PROJECT_DIR$/composer.json">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="414">
          <caret line="23" column="0" selection-start-line="23" selection-start-column="0" selection-end-line="23" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/system/libraries/Session/Session.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="133">
          <caret line="143" column="0" selection-start-line="143" selection-start-column="0" selection-end-line="143" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/controllers/Email.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-1404">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/controllers/Account.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/views/authenticate/get_email.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/views/checkout/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/controllers/Authenticate.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1026">
          <caret line="63" column="33" selection-start-line="63" selection-start-column="33" selection-end-line="63" selection-end-column="33" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/system/database/DB_cache.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/system/database/DB_driver.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/libraries/Facebook.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="69" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/core/Admin_Controller.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="252">
          <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/redis.php" />
    <entry file="file://$PROJECT_DIR$/application/libraries/Redis.php" />
    <entry file="file://$PROJECT_DIR$/application/core/Base_Controller.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="69">
          <caret line="4" column="45" selection-start-line="4" selection-start-column="45" selection-end-line="4" selection-end-column="45" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/controllers/Test_redis.php" />
    <entry file="file://$PROJECT_DIR$/application/modules/site/models/Login_model.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-301">
          <caret line="123" column="13" selection-start-line="123" selection-start-column="13" selection-end-line="123" selection-end-column="13" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/libraries/Sendgrid_Mail.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="306">
          <caret line="95" column="7" selection-start-line="95" selection-start-column="7" selection-end-line="95" selection-end-column="7" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/sendgrid.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="90">
          <caret line="5" column="0" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/core/Site_Controller.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="216">
          <caret line="12" column="1" selection-start-line="12" selection-start-column="1" selection-end-line="12" selection-end-column="1" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/constants.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="469">
          <caret line="95" column="72" selection-start-line="95" selection-start-column="72" selection-end-line="95" selection-end-column="72" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/models/Email_model.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="702">
          <caret line="39" column="30" selection-start-line="39" selection-start-column="30" selection-end-line="39" selection-end-column="33" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/controllers/Reports.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="919">
          <caret line="54" column="30" selection-start-line="54" selection-start-column="30" selection-end-line="54" selection-end-column="30" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/models/Reports_model.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/views/reports/chart.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/controllers/Home.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="198">
          <caret line="11" column="0" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/views/layouts/admin.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="7704">
          <caret line="428" column="15" selection-start-line="428" selection-start-column="8" selection-end-line="428" selection-end-column="15" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/views/product/add.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1296">
          <caret line="72" column="4" selection-start-line="72" selection-start-column="4" selection-end-line="72" selection-end-column="4" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/controllers/Login.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="558">
          <caret line="31" column="28" selection-start-line="31" selection-start-column="28" selection-end-line="31" selection-end-column="28" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/views/category/edit.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/controllers/Product.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1278">
          <caret line="71" column="61" selection-start-line="71" selection-start-column="61" selection-end-line="71" selection-end-column="61" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.htaccess">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="540">
          <caret line="65" column="20" selection-start-line="65" selection-start-column="20" selection-end-line="65" selection-end-column="20" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/controllers/Banner.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="540">
          <caret line="30" column="29" selection-start-line="30" selection-start-column="29" selection-end-line="30" selection-end-column="29" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/autoload.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1080">
          <caret line="60" column="104" selection-start-line="60" selection-start-column="104" selection-end-line="60" selection-end-column="104" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/config.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="432">
          <caret line="24" column="2" selection-start-line="24" selection-start-column="2" selection-end-line="24" selection-end-column="2" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/database.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1440">
          <caret line="80" column="25" selection-start-line="80" selection-start-column="25" selection-end-line="80" selection-end-column="25" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/helpers/global_helper.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="108">
          <caret line="6" column="22" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/views/login/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1566">
          <caret line="87" column="87" selection-start-line="87" selection-start-column="87" selection-end-line="87" selection-end-column="87" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/views/home/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="54">
          <caret line="3" column="35" selection-start-line="3" selection-start-column="35" selection-end-line="3" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/site/views/layouts/site.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="990">
          <caret line="55" column="14" selection-start-line="55" selection-start-column="14" selection-end-line="55" selection-end-column="14" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/controllers/Login.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1062">
          <caret line="59" column="58" selection-start-line="59" selection-start-column="58" selection-end-line="59" selection-end-column="58" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/hooks/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/controllers/Category.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1062">
          <caret line="59" column="19" selection-start-line="59" selection-start-column="19" selection-end-line="59" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/assets/js/site/validation.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="72">
          <caret line="4" column="16" selection-start-line="4" selection-start-column="16" selection-end-line="4" selection-end-column="16" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/assets/js/site/home.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1422">
          <caret line="79" column="20" selection-start-line="79" selection-start-column="20" selection-end-line="79" selection-end-column="20" />
          <folding>
            <marker date="1500368305845" expanded="true" signature="8349:8381" ph="..." />
            <marker date="1500368305845" expanded="true" signature="11713:11745" ph="..." />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/logs/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/modules/admin/views/product/edit.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="334">
          <caret line="71" column="33" selection-start-line="71" selection-start-column="33" selection-end-line="71" selection-end-column="33" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/routes.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-665">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
namespace System.Configuration.Assemblies
{

#if !ECMA_COMPAT

public enum AssemblyHashAlgorithm
{
	None = 0x0000,
	MD5  = 0x8003,
	SHA1 = 0x8004

}; // enum AssemblyHashAlgorithm

#endif // !ECMA_COMPAT

}; // namespace System.Configuration.Assemblies

redpajama_set_name: RedPajamaGithub


text:
module Data.FenwickSemi
(FenwickSemi(..), fromList, update, prefix)
where

import Control.Arrow ((***))
import Data.Semigroup

-- | (Binary) Fenwick tree ordered according to some input indexing.
data FenwickSemi a
  -- | Intersection of two branches, which also stores an accumulator and the number of leafs.
  = Branch a Integer (FenwickSemi a) (FenwickSemi a)
  -- | Leaf containing an input value.
  | Leaf a
  deriving (Eq, Show)

-- | Type of input indices.
type Index = Integer

-- | Build a Fenwick tree given an input list.
--   Will throw an exception if given an empty list (only source of exceptions).
fromList :: Semigroup a => [a] -> FenwickSemi a
fromList [] = error "fenwick-semi: Can't construct empty tree"
fromList l = takeTree $ go l
  where
  takeTree (_, _, t) = t

  go :: Semigroup a => [a] -> (a, Integer, FenwickSemi a)
  go [single] = (single, 1, Leaf single)
  go l = (sum, leafs, Branch sum leafs t1 t2)
    where
    sum = s1 <> s2
    leafs = c1 + c2
    ((s1, c1, t1), (s2, c2, t2)) = go *** go $ splitAt half l
    half = ceiling $ realToFrac (length l) / realToFrac 2

-- | Update some input value and rebuild the tree structure.
update :: Semigroup a => Index -> a -> FenwickSemi a -> FenwickSemi a
update idx new tree = go path
  where
  path = traverseSeq idx tree

  go [(Leaf _, _)] = Leaf new
  go ((Branch _ count t1 _, RightBranch) : t) = rebuild t1 (go t) count t
  go ((Branch _ count _ t2, LeftBranch) : t) = rebuild (go t) t2 count t

  rebuild t1 t2 count t =
    Branch (extractValue t1 <> extractValue t2) count t1 t2

-- | Extract the top-most value in a tree, i.e. either an accumulator or a leaf value.
extractValue :: FenwickSemi a -> a
extractValue (Leaf val) = val
extractValue (Branch val _ _ _) = val

-- | Direction type recording which branch was taken.
data Direction
  -- | The left branch was taken.
  = LeftBranch
  -- | The right branch was taken.
  | RightBranch
  -- | No direction available (leaf node).
  | NoBranch
  deriving (Eq, Show)

-- | Traverse the tree top-down to some leaf which is identified by an index.
--   Records the path taken with all branches and the final leaf node.
traverseSeq :: Index -> FenwickSemi a -> [(FenwickSemi a, Direction)]
traverseSeq _ l@(Leaf _) = [(l, NoBranch)]
traverseSeq idx b@(Branch _ leafs t1 t2)
  | idx < half = (b, LeftBranch)  : traverseSeq idx t1
  | otherwise  = (b, RightBranch) : traverseSeq (idx - half) t2
  where
  half = ceiling $ realToFrac leafs / realToFrac 2

-- | Prefix accumulator operation, calculates the prefix up to (inclusive) some index.
prefix :: Semigroup a => Index -> FenwickSemi a -> a
prefix idx tree = go path
  where
  path = traverseSeq idx tree

  go [(Leaf val, _)] = val
  go ((Branch val _ t1 _, RightBranch) : t) = extractValue t1 <> go t
  go (_ : t) = go t


text:
<?php
/**
* Handles payment information for /payment endpoint
*/
class aceitaFacil_payment {
  static public function create($arrData) {
    // print_r($arrData);

    $return = aceitaFacil_apiRequestor::callAPI('POST', 'payment', $arrData);

    return $return;
  }
}


text:
//  SDLShowConstantTBTResponse.h
//

#import "SDLRPCResponse.h"

NS_ASSUME_NONNULL_BEGIN

/**
 Response to SDLShowConstantTBT

 Since SmartDeviceLink 2.0
 */
@interface SDLShowConstantTBTResponse : SDLRPCResponse

@end

NS_ASSUME_NONNULL_END


text:
using System;
using System.Diagnostics;
using System.Xml;

namespace SeraphimEngine.ContentPipeline.TiledMap.Serialization
{
    public class TiledMapDeserializer : XmlDeserializer<TiledMap>
    {
        public override TiledMap Retrieve(XmlElement element)
        {
            TiledMap map = new TiledMap
            {
                Width = Convert.ToInt32(element.GetAttribute("width")),
                Height = Convert.ToInt32(element.GetAttribute("height")),
                TileWidth = Convert.ToInt32(element.GetAttribute("tilewidth")),
                TileHeight = Convert.ToInt32(element.GetAttribute("tileheight"))
            };

            XmlNodeList tilesetNodeList = element.SelectNodes("tileset");
            if (tilesetNodeList.Count > 0)
            {
                TiledMapTilesetDeserializer deserializer = new TiledMapTilesetDeserializer();
                foreach (XmlElement tileset in tilesetNodeList)
                    map.Tilesets.Add(deserializer.Retrieve(tileset));
            }

            XmlNodeList layerNodeList = element.SelectNodes("layer");
            if (layerNodeList.Count > 0)
            {
                TiledMapLayerDeserializer deserializer = new TiledMapLayerDeserializer();
                foreach (XmlElement layer in layerNodeList)
                    map.Layers.Add(deserializer.Retrieve(layer));
            }

            return map;
        }
    }
}


text:
<!DOCTYPE html>
<html lang="en">
	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
		<title><?= $title ?></title>
		<!-- Bootstrap core CSS -->
		<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
		<!-- MDB core CSS -->
		<link href="http://mdbootstrap.com/mdbcdn/mdb.min.css" rel="stylesheet">

	</head>
	<body ng-app="rexon">

	<?php
		if (isset($isLoggedIn)) {
			$this->load->view('common/navbar');
		}


text:
module Mongoid

  module Userstamp
    extend ActiveSupport::Concern

    included do
      Mongoid::Userstamp.add_model_class(self)
    end

    module ClassMethods

      def mongoid_userstamp(opts = {})
        mongoid_userstamp_config(opts)
        self.send(:include, Mongoid::Userstamp::Model) unless self.included_modules.include?(Mongoid::Userstamp::Model)
      end

      def mongoid_userstamp_config(opts = {})
        @mongoid_userstamp_config ||= Mongoid::Userstamp::ModelConfig.new(opts)
      end
    end

    class << self

      def config(&block)
        @config ||= Mongoid::Userstamp::GemConfig.new(&block)
      end

      # @deprecated
      def configure(&block)
        warn 'Mongoid::Userstamp.configure is deprecated. Please use Mongoid::Userstamp.config instead'
        config(&block)
      end

      def current_user(user_class = nil)
        user_class ||= user_classes.first
        store[userstamp_key(user_class)]
      end

      def current_user=(value)
        set_current_user(value)
      end

      # It is better to provide the user class, in case the value is nil.
      def set_current_user(value, user_class = nil)
        user_class ||= value ? value.class : user_classes.first
        store[userstamp_key(user_class)] = value
      end

      def model_classes
        (@model_classes || []).map{|c| c.is_a?(Class) ? c : c.to_s.classify.constantize }
      end

      def add_model_class(model)
        @model_classes ||= []
        @model_classes << model
      end

      def user_classes
        (@user_classes || []).map{|c| c.is_a?(Class) ? c : c.to_s.classify.constantize }
      end

      def add_user_class(user)
        @user_classes ||= []
        @user_classes << user
      end

      def userstamp_key(model)
        "mongoid_userstamp/#{model.to_s.underscore}".to_sym
      end

      def store
        defined?(RequestStore) ? RequestStore.store : Thread.current
      end
    end
  end
end


text:
1rm.js
===

[![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/1rm.js.svg)](https://greenkeeper.io/)

Estimate one rep maximum lifts in JS using a variety of formulas

## Setup
```bash
$ npm install 1rm
```
```js
var rm = require('1rm');
```

## Formulas
* `epley`: [Epley](http://en.wikipedia.org/wiki/One-repetition_maximum#Epley_Formula)
* `brzycki`: [Brzycki](http://en.wikipedia.org/wiki/One-repetition_maximum#Brzycki)
* `lander`: [Lander](http://en.wikipedia.org/wiki/One-repetition_maximum#Lander)
* `lombardi`: [Lombardi](http://en.wikipedia.org/wiki/One-repetition_maximum#Lombardi)
* `mayhew`: [Mayhew et al.](http://en.wikipedia.org/wiki/One-repetition_maximum#Mayhew_et_al.)
* `oconner`: [O'Conner et al.](http://en.wikipedia.org/wiki/One-repetition_maximum#O.27Conner_et_al.)
* `wathan`: [Wathan](http://en.wikipedia.org/wiki/One-repetition_maximum#Wathan)

## API

#### `{{method}}(weight, reps)` -> `Number`
Accepts `weight` and `reps` both `Number` and outputs the estimated one rep maximum (also `Number`). For browser use, make sure to parse your numeric inputs. Numeric strings are not supported.

## Example

```js
rm.epley(400, 4) // 453.33...
```


text:
#include <common.h>
#include <blk.h>
#include <dm.h>
#include <usb.h>
#include <mmc.h>
#include <efi_loader.h>
#include <inttypes.h>
#include <part.h>

/* template END node: */
static const struct efi_device_path END = {
	.type     = DEVICE_PATH_TYPE_END,
	.sub_type = DEVICE_PATH_SUB_TYPE_END,
	.length   = sizeof(END),
};

#define U_BOOT_GUID \
	EFI_GUID(0xe61d73b9, 0xa384, 0x4acc, \
		 0xae, 0xab, 0x82, 0xe8, 0x28, 0xf3, 0x62, 0x8b)

/* template ROOT node: */
static const struct efi_device_path_vendor ROOT = {
	.dp = {
		.type     = DEVICE_PATH_TYPE_HARDWARE_DEVICE,
		.sub_type = DEVICE_PATH_SUB_TYPE_VENDOR,
		.length   = sizeof(ROOT),
	},
	.guid = U_BOOT_GUID,
};

#if defined(CONFIG_DM_MMC) && defined(CONFIG_MMC)
/*
 * Determine if an MMC device is an SD card.
 *
 * @desc	block device descriptor
 * @return	true if the device is an SD card
 */
static bool is_sd(struct blk_desc *desc)
{
	struct mmc *mmc = find_mmc_device(desc->devnum);

	if (!mmc)
		return false;

	return IS_SD(mmc) != 0U;
}
#endif

static void *dp_alloc(size_t sz)
{
	void *buf;

	if (efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, sz, &buf) != EFI_SUCCESS)
		return NULL;

	return buf;
}

/*
 * Iterate to next block in device-path, terminating (returning NULL)
 * at /End* node.
 */
struct efi_device_path *efi_dp_next(const struct efi_device_path *dp)
{
	if (dp == NULL)
		return NULL;
	if (dp->type == DEVICE_PATH_TYPE_END)
		return NULL;
	dp = ((void *)dp) + dp->length;
	if (dp->type == DEVICE_PATH_TYPE_END)
		return NULL;
	return (struct efi_device_path *)dp;
}

/*
 * Compare two device-paths, stopping when the shorter of the two hits
 * an End* node.  This is useful to, for example, compare a device-path
 * representing a device with one representing a file on the device, or
 * a device with a parent device.
 */
int efi_dp_match(const struct efi_device_path *a,
		 const struct efi_device_path *b)
{
	while (1) {
		int ret;

		ret = memcmp(&a->length, &b->length, sizeof(a->length));
		if (ret)
			return ret;

		ret = memcmp(a, b, a->length);
		if (ret)
			return ret;

		a = efi_dp_next(a);
		b = efi_dp_next(b);

		if (!a || !b)
			return 0;
	}
}

/*
 * See UEFI spec (section 3.1.2, about short-form device-paths..
 * tl;dr: we can have a device-path that starts with a USB WWID
 * or USB Class node, and a few other cases which don't encode
 * the full device path with bus hierarchy:
 *
 *   - MESSAGING:USB_WWID
 *   - MESSAGING:USB_CLASS
 *   - MEDIA:FILE_PATH
 *   - MEDIA:HARD_DRIVE
 *   - MESSAGING:URI
 */
static struct efi_device_path *shorten_path(struct efi_device_path *dp)
{
	while (dp) {
		/*
		 * TODO: Add MESSAGING:USB_WWID and MESSAGING:URI..
		 * in practice fallback.efi just uses MEDIA:HARD_DRIVE
		 * so not sure when we would see these other cases.
		 */
		if (EFI_DP_TYPE(dp, MESSAGING_DEVICE, MSG_USB_CLASS) ||
		    EFI_DP_TYPE(dp, MEDIA_DEVICE, HARD_DRIVE_PATH) ||
		    EFI_DP_TYPE(dp, MEDIA_DEVICE, FILE_PATH))
			return dp;

		dp = efi_dp_next(dp);
	}

	return dp;
}

static struct efi_object *find_obj(struct efi_device_path *dp, bool short_path,
				   struct efi_device_path **rem)
{
	struct efi_object *efiobj;
	unsigned int dp_size = efi_dp_size(dp);

	list_for_each_entry(efiobj, &efi_obj_list, link) {
		struct efi_handler *handler;
		struct efi_device_path *obj_dp;
		efi_status_t ret;

		ret = efi_search_protocol(efiobj->handle,
					  &efi_guid_device_path, &handler);
		if (ret != EFI_SUCCESS)
			continue;
		obj_dp = handler->protocol_interface;

		do {
			if (efi_dp_match(dp, obj_dp) == 0) {
				if (rem) {
					/*
					 * Allow partial matches, but inform
					 * the caller.
					 */
					*rem = ((void *)dp) +
						efi_dp_size(obj_dp);
					return efiobj;
				} else {
					/* Only return on exact matches */
					if (efi_dp_size(obj_dp) == dp_size)
						return efiobj;
				}
			}

			obj_dp = shorten_path(efi_dp_next(obj_dp));
		} while (short_path && obj_dp);
	}

	return NULL;
}

/*
 * Find an efiobj from device-path, if 'rem' is not NULL, returns the
 * remaining part of the device path after the matched object.
 */
struct efi_object *efi_dp_find_obj(struct efi_device_path *dp,
				   struct efi_device_path **rem)
{
	struct efi_object *efiobj;

	/* Search for an exact match first */
	efiobj = find_obj(dp, false, NULL);

	/* Then for a fuzzy match */
	if (!efiobj)
		efiobj = find_obj(dp, false, rem);

	/* And now for a fuzzy short match */
	if (!efiobj)
		efiobj = find_obj(dp, true, rem);

	return efiobj;
}

/* return size not including End node: */
unsigned efi_dp_size(const struct efi_device_path *dp)
{
	unsigned sz = 0;

	while (dp) {
		sz += dp->length;
		dp = efi_dp_next(dp);
	}

	return sz;
}

struct efi_device_path *efi_dp_dup(const struct efi_device_path *dp)
{
	struct efi_device_path *ndp;
	unsigned sz = efi_dp_size(dp) + sizeof(END);

	if (!dp)
		return NULL;

	ndp = dp_alloc(sz);
	memcpy(ndp, dp, sz);

	return ndp;
}

struct efi_device_path *efi_dp_append(const struct efi_device_path *dp1,
				      const struct efi_device_path *dp2)
{
	struct efi_device_path *ret;

	if (!dp1) {
		ret = efi_dp_dup(dp2);
	} else if (!dp2) {
		ret = efi_dp_dup(dp1);
	} else {
		/* both dp1 and dp2 are non-null */
		unsigned sz1 = efi_dp_size(dp1);
		unsigned sz2 = efi_dp_size(dp2);
		void *p = dp_alloc(sz1 + sz2 + sizeof(END));
		memcpy(p, dp1, sz1);
		memcpy(p + sz1, dp2, sz2);
		memcpy(p + sz1 + sz2, &END, sizeof(END));
		ret = p;
	}

	return ret;
}

struct efi_device_path *efi_dp_append_node(const struct efi_device_path *dp,
					   const struct efi_device_path *node)
{
	struct efi_device_path *ret;

	if (!node && !dp) {
		ret = efi_dp_dup(&END);
	} else if (!node) {
		ret = efi_dp_dup(dp);
	} else if (!dp) {
		unsigned sz = node->length;
		void *p = dp_alloc(sz + sizeof(END));
		memcpy(p, node, sz);
		memcpy(p + sz, &END, sizeof(END));
		ret = p;
	} else {
		/* both dp and node are non-null */
		unsigned sz = efi_dp_size(dp);
		void *p = dp_alloc(sz + node->length + sizeof(END));
		memcpy(p, dp, sz);
		memcpy(p + sz, node, node->length);
		memcpy(p + sz + node->length, &END, sizeof(END));
		ret = p;
	}

	return ret;
}

#ifdef CONFIG_DM
/* size of device-path not including END node for device and all parents
 * up to the root device.
 */
static unsigned dp_size(struct udevice *dev)
{
	if (!dev || !dev->driver)
		return sizeof(ROOT);

	switch (dev->driver->id) {
	case UCLASS_ROOT:
	case UCLASS_SIMPLE_BUS:
		/* stop traversing parents at this point: */
		return sizeof(ROOT);
	case UCLASS_MMC:
		return dp_size(dev->parent) +
			sizeof(struct efi_device_path_sd_mmc_path);
	case UCLASS_MASS_STORAGE:
	case UCLASS_USB_HUB:
		return dp_size(dev->parent) +
			sizeof(struct efi_device_path_usb_class);
	default:
		/* just skip over unknown classes: */
		return dp_size(dev->parent);
	}
}

static void *dp_fill(void *buf, struct udevice *dev)
{
	if (!dev || !dev->driver)
		return buf;

	switch (dev->driver->id) {
	case UCLASS_ROOT:
	case UCLASS_SIMPLE_BUS: {
		/* stop traversing parents at this point: */
		struct efi_device_path_vendor *vdp = buf;
		*vdp = ROOT;
		return &vdp[1];
	}
#if defined(CONFIG_DM_MMC) && defined(CONFIG_MMC)
	case UCLASS_MMC: {
		struct efi_device_path_sd_mmc_path *sddp =
			dp_fill(buf, dev->parent);
		struct mmc *mmc = mmc_get_mmc_dev(dev);
		struct blk_desc *desc = mmc_get_blk_desc(mmc);

		sddp->dp.type     = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
		sddp->dp.sub_type = is_sd(desc) ?
			DEVICE_PATH_SUB_TYPE_MSG_SD :
			DEVICE_PATH_SUB_TYPE_MSG_MMC;
		sddp->dp.length   = sizeof(*sddp);
		sddp->slot_number = dev->seq;

		return &sddp[1];
	}
#endif
	case UCLASS_MASS_STORAGE:
	case UCLASS_USB_HUB: {
		struct efi_device_path_usb_class *udp =
			dp_fill(buf, dev->parent);
		struct usb_device *udev = dev_get_parent_priv(dev);
		struct usb_device_descriptor *desc = &udev->descriptor;

		udp->dp.type     = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
		udp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_USB_CLASS;
		udp->dp.length   = sizeof(*udp);
		udp->vendor_id   = desc->idVendor;
		udp->product_id  = desc->idProduct;
		udp->device_class    = desc->bDeviceClass;
		udp->device_subclass = desc->bDeviceSubClass;
		udp->device_protocol = desc->bDeviceProtocol;

		return &udp[1];
	}
	default:
		debug("unhandled device class: %s (%u)\n",
		      dev->name, dev->driver->id);
		return dp_fill(buf, dev->parent);
	}
}

/* Construct a device-path from a device: */
struct efi_device_path *efi_dp_from_dev(struct udevice *dev)
{
	void *buf, *start;

	start = buf = dp_alloc(dp_size(dev) + sizeof(END));
	buf = dp_fill(buf, dev);
	*((struct efi_device_path *)buf) = END;

	return start;
}
#endif

static unsigned dp_part_size(struct blk_desc *desc, int part)
{
	unsigned dpsize;

#ifdef CONFIG_BLK
	dpsize = dp_size(desc->bdev->parent);
#else
	dpsize = sizeof(ROOT) + sizeof(struct efi_device_path_usb);
#endif

	if (part == 0) /* the actual disk, not a partition */
		return dpsize;

	if (desc->part_type == PART_TYPE_ISO)
		dpsize += sizeof(struct efi_device_path_cdrom_path);
	else
		dpsize += sizeof(struct efi_device_path_hard_drive_path);

	return dpsize;
}

/*
 * Create a device path for a block device or one of its partitions.
 *
 * @buf		buffer to which the device path is wirtten
 * @desc	block device descriptor
 * @part	partition number, 0 identifies a block device
 */
static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
{
	disk_partition_t info;

#ifdef CONFIG_BLK
	buf = dp_fill(buf, desc->bdev->parent);
#else
	/*
	 * We *could* make a more accurate path, by looking at if_type
	 * and handling all the different cases like we do for non-
	 * legacy (ie CONFIG_BLK=y) case.  But most important thing
	 * is just to have a unique device-path for if_type+devnum.
	 * So map things to a fictitious USB device.
	 */
	struct efi_device_path_usb *udp;

	memcpy(buf, &ROOT, sizeof(ROOT));
	buf += sizeof(ROOT);

	udp = buf;
	udp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
	udp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_USB;
	udp->dp.length = sizeof(*udp);
	udp->parent_port_number = desc->if_type;
	udp->usb_interface = desc->devnum;
	buf = &udp[1];
#endif

	if (part == 0) /* the actual disk, not a partition */
		return buf;

	part_get_info(desc, part, &info);

	if (desc->part_type == PART_TYPE_ISO) {
		struct efi_device_path_cdrom_path *cddp = buf;

		cddp->boot_entry = part;
		cddp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
		cddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_CDROM_PATH;
		cddp->dp.length = sizeof(*cddp);
		cddp->partition_start = info.start;
		cddp->partition_end = info.size;

		buf = &cddp[1];
	} else {
		struct efi_device_path_hard_drive_path *hddp = buf;

		hddp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
		hddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH;
		hddp->dp.length = sizeof(*hddp);
		hddp->partition_number = part;
		hddp->partition_start = info.start;
		hddp->partition_end = info.size;
		if (desc->part_type == PART_TYPE_EFI)
			hddp->partmap_type = 2;
		else
			hddp->partmap_type = 1;

		switch (desc->sig_type) {
		case SIG_TYPE_NONE:
		default:
			hddp->signature_type = 0;
			memset(hddp->partition_signature, 0,
			       sizeof(hddp->partition_signature));
			break;
		case SIG_TYPE_MBR:
			hddp->signature_type = 1;
			memset(hddp->partition_signature, 0,
			       sizeof(hddp->partition_signature));
			memcpy(hddp->partition_signature, &desc->mbr_sig,
			       sizeof(desc->mbr_sig));
			break;
		case SIG_TYPE_GUID:
			hddp->signature_type = 2;
			memcpy(hddp->partition_signature, &desc->guid_sig,
			       sizeof(hddp->partition_signature));
			break;
		}

		buf = &hddp[1];
	}

	return buf;
}

/* Construct a device-path from a partition on a blk device: */
struct efi_device_path *efi_dp_from_part(struct blk_desc *desc, int part)
{
	void *buf, *start;

	start = buf = dp_alloc(dp_part_size(desc, part) + sizeof(END));

	buf = dp_part_fill(buf, desc, part);

	*((struct efi_device_path *)buf) = END;

	return start;
}

/* convert path to an UEFI style path (ie. DOS style backslashes and utf16) */
static void path_to_uefi(u16 *uefi, const char *path)
{
	while (*path) {
		char c = *(path++);
		if (c == '/')
			c = '\\';
		*(uefi++) = c;
	}
	*uefi = '\0';
}

/*
 * If desc is NULL, this creates a path with only the file component,
 * otherwise it creates a full path with both device and file components
 */
struct efi_device_path *efi_dp_from_file(struct blk_desc *desc, int part,
		const char *path)
{
	struct efi_device_path_file_path *fp;
	void *buf, *start;
	unsigned dpsize = 0, fpsize;

	if (desc)
		dpsize = dp_part_size(desc, part);

	fpsize = sizeof(struct efi_device_path) + 2 * (strlen(path) + 1);
	dpsize += fpsize;

	start = buf = dp_alloc(dpsize + sizeof(END));

	if (desc)
		buf = dp_part_fill(buf, desc, part);

	/* add file-path: */
	fp = buf;
	fp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
	fp->dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH;
	fp->dp.length = fpsize;
	path_to_uefi(fp->str, path);
	buf += fpsize;

	*((struct efi_device_path *)buf) = END;

	return start;
}

#ifdef CONFIG_NET
struct efi_device_path *efi_dp_from_eth(void)
{
	struct efi_device_path_mac_addr *ndp;
	void *buf, *start;
	unsigned dpsize = 0;

	assert(eth_get_dev());

#ifdef CONFIG_DM_ETH
	dpsize += dp_size(eth_get_dev());
#else
	dpsize += sizeof(ROOT);
#endif
	dpsize += sizeof(*ndp);

	start = buf = dp_alloc(dpsize + sizeof(END));

#ifdef CONFIG_DM_ETH
	buf = dp_fill(buf, eth_get_dev());
#else
	memcpy(buf, &ROOT, sizeof(ROOT));
	buf += sizeof(ROOT);
#endif

	ndp = buf;
	ndp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
	ndp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR;
	ndp->dp.length = sizeof(*ndp);
	memcpy(ndp->mac.addr, eth_get_ethaddr(), ARP_HLEN);
	buf = &ndp[1];

	*((struct efi_device_path *)buf) = END;

	return start;
}
#endif

/* Construct a device-path for memory-mapped image */
struct efi_device_path *efi_dp_from_mem(uint32_t memory_type,
					uint64_t start_address,
					uint64_t end_address)
{
	struct efi_device_path_memory *mdp;
	void *buf, *start;

	start = buf = dp_alloc(sizeof(*mdp) + sizeof(END));

	mdp = buf;
	mdp->dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE;
	mdp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MEMORY;
	mdp->dp.length = sizeof(*mdp);
	mdp->memory_type = memory_type;
	mdp->start_address = start_address;
	mdp->end_address = end_address;
	buf = &mdp[1];

	*((struct efi_device_path *)buf) = END;

	return start;
}

/*
 * Helper to split a full device path (containing both device and file
 * parts) into it's constituent parts.
 */
void efi_dp_split_file_path(struct efi_device_path *full_path,
			    struct efi_device_path **device_path,
			    struct efi_device_path **file_path)
{
	struct efi_device_path *p, *dp, *fp;

	dp = efi_dp_dup(full_path);
	p = dp;
	while (!EFI_DP_TYPE(p, MEDIA_DEVICE, FILE_PATH))
		p = efi_dp_next(p);
	fp = efi_dp_dup(p);

	p->type = DEVICE_PATH_TYPE_END;
	p->sub_type = DEVICE_PATH_SUB_TYPE_END;
	p->length = sizeof(*p);

	*device_path = dp;
	*file_path = fp;
}


text:
<?php

declare(strict_types=1);

namespace MyNamespace;

class EnumConsumer
{
    public MyEnum $myEnum = MyEnum::VALUE1;

    public function consume(MyEnum $enum = MyEnum::VALUE1): MyEnum
    {
        $this->myEnum = $enum;
    }
}


text:
Introduction
------------

The viz package in pydy is designed to facilitate browser based animations for
PyDy framework.

Typically the plugin is used to generate animations for multibody systems. The
systems are defined with sympy.physics.mechanics, solved numerically with the
codegen package and scipy, and then visualized with this package. But the
required data for the animations can theorectically be generated by other
methods and passed into a Scene object.

The frontend is based on three.js, a popular interface to the WebGraphics
Library (WegGL). The package provides a Python wrapper for some basic
functionality for Three.js i.e Geometries, Lights, Cameras etc.


text:
var React = require('react'),
	SetClass = require('classnames'),
	Tappable = require('react-tappable'),
	Navigation = require('touchstonejs').Navigation,
	Link = require('touchstonejs').Link,
	UI = require('touchstonejs').UI;

var Months = require('../../../data/months');

var MonthList = React.createClass({
	render: function () {

		var months = [];
		var	lastSeason = '';
		var filterState = this.props.filterState;

		this.props.months.forEach(function (month, i) {

			if (filterState !== 'all' && filterState !== month.season.toLowerCase()) {
				return;
			}

			var season = month.season;

			if (lastSeason !== season) {
				lastSeason = season;

				months.push(

{season}

				);
			}

			month.key = 'month-' + i;
			months.push(

{month.name}

);
		});

		return (

				{months}

		);
	}
});

module.exports = React.createClass({
	mixins: [Navigation],

	getInitialState: function () {
		return {
			activeToggleItemKey: 'all',
			typeKey: 'primary',
			months: Months
		}
	},

	handleToggleActiveChange: function (newItem) {

		var selectedItem = newItem;

		if (this.state.activeToggleItemKey === newItem) {
			selectedItem = 'all';
		}

		this.setState({
			activeToggleItemKey: selectedItem
		});

	},

	render: function () {

		return (
			<UI.View>
				<UI.Headerbar type="default" label="Toggle">
					<UI.HeaderbarButton showView="home" transition="reveal-from-right" label="Back" icon="ion-chevron-left" />
				</UI.Headerbar>
				<UI.Headerbar type="default" height="36px" className="Subheader">
					<UI.Toggle value={this.state.activeToggleItemKey} onChange={this.handleToggleActiveChange} options={[
						{ label: 'Summer', value: 'summer' },
						{ label: 'Autumn', value: 'autumn' },
						{ label: 'Winter', value: 'winter' },
						{ label: 'Spring', value: 'spring' }
					]} />
				</UI.Headerbar>
				<UI.ViewContent grow scrollable>
					<MonthList months={this.state.months} filterState={this.state.activeToggleItemKey} />
				</UI.ViewContent>
			</UI.View>
		);
	}
});


text:
package org.ovirt.engine.core.bll;

import java.util.List;

import org.ovirt.engine.core.common.businessentities.VmTemplate;
import org.ovirt.engine.core.common.queries.VdcQueryParametersBase;
import org.ovirt.engine.core.dal.dbbroker.DbFacade;

public class GetAllVmTemplatesQuery<P extends VdcQueryParametersBase> extends QueriesCommandBase<P> {
    public GetAllVmTemplatesQuery(P parameters) {
        super(parameters);
    }

    @Override
    protected void executeQueryCommand() {
        List<VmTemplate> retval = DbFacade.getInstance().getVmTemplateDAO().getAll();
        for (VmTemplate template : retval) {
            AnonymousMethod1(template);
        }
        getQueryReturnValue().setReturnValue(retval);
    }

    private void AnonymousMethod1(VmTemplate vmt) {
        VmTemplateHandler.UpdateDisksFromDb(vmt);
    }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
in Falck, Mykol. Untersuch. Ber. 319 (1923)

#### Original name
null

### Remarks
null


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Xna.Framework;
using Vector3 = Microsoft.Xna.Framework.Vector3;
using Vector4 = Microsoft.Xna.Framework.Vector4;

namespace Myre.Tests
{
    [TestClass]
    public class Playground
    {
        private static Func<Vector3, Vector3> Swizzler(string str)
        {
            str = str.ToLowerInvariant();
            if (string.IsNullOrWhiteSpace(str) || str == "null" || str == "none" || str == "x,y,z")
                return a => a;

            var parts = str.Split(',');
            if (parts.Length != 3)
                throw new Exception(string.Format("Swizzle vector '{0}' has {1} elements; expected three", str, parts.Length));

            var vectors = new Vector4[4];
            for (int i = 0; i < 3; i++)
            {
                float p = parts[i].StartsWith("-") ? -1 : 1;

                if (parts[i].Contains("x"))
                    vectors[i].X = p;
                else if (parts[i].Contains("y"))
                    vectors[i].Y = p;
                else if (parts[i].Contains("z"))
                    vectors[i].Z = p;
            }

            var swizzle = new Matrix(
                vectors[0].X, vectors[1].X, vectors[2].X, vectors[3].X,
                vectors[0].Y, vectors[1].Y, vectors[2].Y, vectors[3].Y,
                vectors[0].Z, vectors[1].Z, vectors[2].Z, vectors[3].Z,
                vectors[0].W, vectors[1].W, vectors[2].W, vectors[3].W
            );

            return a => Vector3.Transform(a, swizzle);
        }

        [TestMethod]
        public void MethodName()
        {
            var a = new Vector3(1, 2, 3);
            var b = Swizzler("-z,+x,-x")(a);

            Assert.AreEqual(new Vector3(-3, 1, -1), b);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="format_array">
        <item>json</item>
        <item>protobuf</item>
    </string-array>
</resources>


text:
export interface Theme {
  name: string;
  properties: any;
  other: string;
}


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28642_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans13.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Existing Wells Within Spacing Unit

    <p class="styleSans72.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Continental Resources, Inc. has identified the following wells which currently exist in the spacing unit consisting of: Sec 13, 24, 2584 36, T155N, R98W Williams County, ND
File Number API Number Well Name Wellbore 8140 3310500886 NWNE Sec 13, 155N, 98W Solberg State 1 660 FNL 1880 FEL Vertical (Dry) 20970 3310502226 SWSE Sec 24, 155N, 98W 250 FSL 1880 FEL

22143 3310502493 NWNE Sec 25 155N, 98W Boston 1 25H 200 FNL 1980 FEL 8047 3310500876 SWSE Sec 36, ISSN 98W State 36-1 1000 FSL 1640 FEL Vertica|(Dry)
CRI has determined that the identified existing wells in the spacing unit specified above are not within 500' of the proposed Boston 3-25H1 wellbore and do not pose any collision threats during drilling or completion operations.

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
<?xml version="1.0" encoding="UTF-8"?>
<ldswebml type="image" uri="/media-library/images/church-history/illinois#nauvoo-riser-book-shop-766072" xml:lang="eng" locale="eng" status="publish">
  <search-meta>
      <uri-title its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">nauvoo-riser-book-shop-766072</uri-title>
      <source>nauvoo-riser-book-shop-766072</source>
      <publication-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</publication-type>
      <media-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</media-type>
      <publication value="ldsorg">LDS.org</publication>
      <publication-date value="2012-04-09">2012-04-09</publication-date>
      <title/>
      <description/>
      <collections>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">global-search</collection>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">media</collection>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">images</collection>
      </collections>
      <subjects>
          <subject>Nauvoo</subject>
          <subject>Illinois</subject>
          <subject>Bookshop</subject>
          <subject>Nauvoo Riser Bookshop</subject>
          <subject>Shoemaker</subject>
      </subjects>
  </search-meta>
  <no-search>
      <path>http://media.ldscdn.org/images/media-library/church-history/illinois/nauvoo-riser-book-shop-766072-gallery.jpg</path>
      <images>
          http://media.ldscdn.org/images/media-library/church-history/illinois/nauvoo-riser-book-shop-766072-thumbnail.jpg
      </images>
          <download-urls>
              <download-url>
                  Mobile
                  <size>172 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/church-history/illinois/nauvoo-riser-book-shop-766072-mobile.jpg</path>
              </download-url>
              <download-url>
                  Tablet
                  <size>247 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/church-history/illinois/nauvoo-riser-book-shop-766072-tablet.jpg</path>
              </download-url>
              <download-url>
                  Print
                  <size>588 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/church-history/illinois/nauvoo-riser-book-shop-766072-print.jpg</path>
              </download-url>
          </download-urls>
  </no-search>
<ldse-meta its:translate="no" xmlns="http://lds.org/code/lds-edit" xmlns:its="http://www.w3.org/2005/11/its"><document id="nauvoo-riser-book-shop-766072" locale="eng" uri="/media-library/images/church-history/illinois#nauvoo-riser-book-shop-766072" status="publish" site="ldsorg" source="chq" words="122" tgp="0.4266"/><created username="lds-edit" userid=""/><last-modified date="2012-05-10T12:26:12.550235-06:00" username="lds-edit" userid=""/></ldse-meta></ldswebml>


text:
<?php
/**
 * BMBtnSkillRandomBM: Code specific to RandomBM
 *
 * @author: james
 */

/**
 * This class currently supports the special skills of RandomBM
 */
class BMBtnSkillRandomBM extends BMBtnSkill {
    /**
     * An array containing the names of functions run by
     * BMCanHaveSkill->run_hooks()
     *
     * @var array
     */
    public static $hooked_methods = array('specify_recipes');

    /**
     * Array of standard die sizes found in Soldiers
     *
     * @var array
     */
    public static $die_sizes_soldiers = array(4, 6, 8, 10, 12, 20);

    /**
     * Hooked method applied when specifying recipes
     *
     * @param array $args
     * @return bool
     */
    public static function specify_recipes(array $args) {
        // implement functionality that will be shared by all child classes
        if (!array_key_exists('button', $args) ||
            !($args['button'] instanceof BMButton)) {
            throw new LogicException('specify_recipes requires a BMButton input argument');
        }

        $button = $args['button'];

        if (!empty($button->recipe)) {
            return FALSE;
        }

        $button->hasAlteredRecipe = TRUE;
        return TRUE;
    }

    /**
     * Choose n skills from an array of possible skills
     *
     * @param array $possibleSkillArray
     * @param int $nSkills
     * @return array
     */
    public static function randomly_select_skills(array $possibleSkillArray, $nSkills) {
        if (count($possibleSkillArray) < $nSkills) {
            throw new LogicException('Not enough possible skills to select from');
        }

        $skillArray = array();
        $nPossibleSkills = count($possibleSkillArray);

        while (count($skillArray) < $nSkills) {
            $skillArray[$possibleSkillArray[bm_rand(0, $nPossibleSkills - 1)]] = TRUE;
        }

        return array_keys($skillArray);
    }

    /**
     * Generates an array of die sizes
     *
     * @param int $nDice
     * @return array
     */
    protected static function generate_die_sizes($nDice) {
        $dieSizeArray = array_fill(0, $nDice, NULL);
        $validDieSizeArray = self::$die_sizes_soldiers;
        $nValidDieSizes = count($validDieSizeArray);

        foreach ($dieSizeArray as &$dieSize) {
            $dieSize = $validDieSizeArray[bm_rand(0, $nValidDieSizes - 1)];
        }

        sort($dieSizeArray, SORT_NUMERIC);

        return $dieSizeArray;
    }

    /**
     * Generates an array of skill strings
     *
     * @param int                                $nDice number of dice in total
     * @param array $validDieSkillLetterArray    skill letters to be used
     * @param int $nSkillsToBeGeneratedRandomly  number of times to choose a skill at random
     * @param int $nTimesToGenerateAllSkills     number of times to generate all skills
     * @param int $maxSkillsPerDie               maximum number of skills per die
     * @return array
     */
    protected static function generate_die_skills(
        $nDice,
        array $validDieSkillLetterArray,
        $nSkillsToBeGeneratedRandomly,
        $nTimesToGenerateAllSkills,
        $maxSkillsPerDie = PHP_INT_MAX
    ) {
        if ($nDice*$maxSkillsPerDie < $nSkillsToBeGeneratedRandomly +
                                      $nTimesToGenerateAllSkills*count($validDieSkillLetterArray)) {
            throw new LogicException('Each die would have too many skills');
        }

        $dieSkillLetterArrayArray = array_fill(0, $nDice, array());

        foreach ($validDieSkillLetterArray as $skillLetter) {
            for ($nSkillIdx = 0; $nSkillIdx < $nTimesToGenerateAllSkills; $nSkillIdx++) {
                $assigned = FALSE;
                while (!$assigned) {
                    $dieIdx = bm_rand(0, $nDice - 1);
                    if ((count($dieSkillLetterArrayArray[$dieIdx]) < $maxSkillsPerDie) &&
                        (!in_array($skillLetter, $dieSkillLetterArrayArray[$dieIdx]))) {
                        // add the $skillLetter to the index to ensure that the final
                        // string is sorted in alphabetical order
                        $dieSkillLetterArrayArray[$dieIdx][$skillLetter] = $skillLetter;
                        $assigned = TRUE;
                    }
                }
            }
        }

        $nSkills = count($validDieSkillLetterArray);
        $nSkillsGenerated = 0;

        while ($nSkillsGenerated < $nSkillsToBeGeneratedRandomly) {
            $skillChosen = $validDieSkillLetterArray[bm_rand(0, $nSkills - 1)];
            $dieIdx = bm_rand(0, $nDice - 1);
            if ((count($dieSkillLetterArrayArray[$dieIdx]) < $maxSkillsPerDie) &&
                (!in_array($skillChosen, $dieSkillLetterArrayArray[$dieIdx]))) {
                // add the $skillChosen to the index to ensure that the final
                // string is sorted in alphabetical order
                $dieSkillLetterArrayArray[$dieIdx][$skillChosen] = $skillChosen;
                $nSkillsGenerated++;
            }
        }

        return $dieSkillLetterArrayArray;
    }

    /**
     * Generates random recipe
     *
     * @param array $dieSizeArray
     * @param array $dieSkillLetterArrayArray
     * @return string
     */
    protected static function generate_recipe(
        array $dieSizeArray,
        array $dieSkillLetterArrayArray
    ) {
        if (count($dieSizeArray) != count($dieSkillLetterArrayArray)) {
            throw new LogicException('die sizes and skills must have the same length');
        }

        $dieRecipeArray = array_fill(0, count($dieSizeArray), NULL);

        foreach ($dieRecipeArray as $dieIdx => &$dieRecipe) {
            $dieRecipe = '(' .
                         $dieSizeArray[$dieIdx] .
                         ')';

            if (!empty($dieSkillLetterArrayArray[$dieIdx])) {
                foreach ($dieSkillLetterArrayArray[$dieIdx] as $skillLetter) {
                    $skillNameArray = BMSkill::expand_skill_string($skillLetter);
                    $skillName = 'BMSkill' . $skillNameArray[0];
                    $skill = new $skillName;

                    if ($skill::do_print_skill_preceding()) {
                        $dieRecipe = $skillLetter . $dieRecipe;
                    } else {
                        $dieRecipe = $dieRecipe . $skillLetter;
                    }
                }
            }
        }

        $recipe = implode(' ', $dieRecipeArray);

        return $recipe;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(NewsPlus.Api.Startup))]

namespace NewsPlus.Api
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
        }
    }
}


text:
#ifndef _LOGGING_H
#define _LOGGING_H

#include <QtDebug>

void setDebugLogging(bool);
void initLogging(bool);
bool debugLogging();

/* Before QT5 we won't have qInfo. Use preprocessor to prefix strings
   with an indicator character so the formatter can print it as
   info string */
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#define qInfo() qDebug() << "@"
#endif

#endif


text:
"""
text.py

Created by Thomas Mangin on 2009-08-25.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""

from exabgp.configuration.configuration import Configuration
from exabgp.configuration.core.format import formated
from exabgp.configuration.operational.parser import operational

from exabgp.protocol.family import AFI
from exabgp.protocol.family import SAFI
from exabgp.protocol.family import Family
# from exabgp.protocol.ip import IP
# from exabgp.bgp.message import OUT

# from exabgp.bgp.message.update.nlri import INET
# from exabgp.bgp.message.update.nlri import IPVPN
from exabgp.bgp.message.refresh import RouteRefresh

# from exabgp.rib.change import Change

# XXX: Need to remove the need to use scope to parse things

# ========================================================================= Text
#

class Text (object):
	def __init__ (self,reactor):
		self.configuration = Configuration('')
		self.reactor = reactor

		# we should store the nexthops of peer in a easy to grab way
		# self.nhs = reactor.configuration.nexthops()  # nhs : next-hop-self

	@staticmethod
	def extract_neighbors (command):
		"""return a list of neighbor definition : the neighbor definition is a list of string which are in the neighbor indexing string"""
		# This function returns a list and a string
		# The first list contains parsed neighbor to match against our defined peers
		# The string is the command to be run for those peers
		# The parsed neighbor is a list of the element making the neighbor string so each part can be checked against the neighbor name

		returned = []
		neighbor,remaining = command.split(' ',1)
		if neighbor != 'neighbor':
			return [],command

		ip,command = remaining.split(' ',1)
		definition = ['neighbor %s' % (ip)]

		while True:
			try:
				key,value,remaining = command.split(' ',2)
			except ValueError:
				key,value = command.split(' ',1)
			if key == ',':
				returned.append(definition)
				_,command = command.split(' ',1)
				definition = []
				continue
			if key not in ['neighbor','local-ip','local-as','peer-as','router-id','family-allowed']:
				if definition:
					returned.append(definition)
				break
			definition.append('%s %s' % (key,value))
			command = remaining

		return returned,command

	def api_route (self, command, peers):
		action, line = command.split(' ',1)

		self.configuration.static.clear()
		if not self.configuration.partial('static',line):
			return []

		changes = self.configuration.scope.pop('routes',[])
		return zip([peers]*len(changes),changes)

	def api_flow (self, command, peers):
		action, flow, line = command.split(' ',2)

		self.configuration.static.clear()
		if not self.configuration.partial('flow',line):
			return []

		changes = self.configuration.scope.pop('routes',[])
		return zip([peers]*len(changes),changes)

	def api_vpls (self, command, peers):
		action, line = command.split(' ',1)

		self.configuration.static.clear()
		if not self.configuration.partial('l2vpn',line):
			return []

		changes = self.configuration.scope.pop('routes',[])
		return zip([peers]*len(changes),changes)

	def api_attributes (self, command, peers):
		action, line = command.split(' ',1)

		self.configuration.static.clear()
		if not self.configuration.partial('static',line):
			return []

		changes = self.configuration.scope.pop('routes',[])
		return zip([peers]*len(changes),changes)

	def api_refresh (self, command):
		tokens = formated(command).split(' ')[2:]
		if len(tokens) != 2:
			return False
		afi = AFI.value(tokens.pop(0))
		safi = SAFI.value(tokens.pop(0))
		if afi is None or safi is None:
			return False
		return RouteRefresh(afi,safi)

	def api_eor (self, command):
		tokens = formated(command).split(' ')[2:]
		number = len(tokens)

		if not number:
			return Family(1,1)

		if number != 2:
			return False

		afi = AFI.fromString(tokens[0])
		if afi == AFI.undefined:
			return False

		safi = SAFI.fromString(tokens[1])
		if safi == SAFI.undefined:
			return False

		return Family(afi,safi)

	def api_operational (self, command):
		tokens = formated(command).split(' ')

		op = tokens[1].lower()
		what = tokens[2].lower()

		if op != 'operational':
			return False

		self.configuration.tokeniser.iterate.replenish(tokens[3:])
		# None or a class
		return operational(what,self.configuration.tokeniser.iterate)


text:
package pamasich.strategy.objects;

import java.util.ArrayList;
import java.util.List;

import pamasich.strategy.objects.environment.Environment;
import pamasich.strategy.objects.ground.Ground;
import pamasich.strategy.objects.interfaces.Killable;
import pamasich.strategy.objects.resources.Resource;
import pamasich.strategy.objects.structures.Structure;
import pamasich.strategy.objects.units.Unit;

public class Cell {

	private Ground ground = null;
	private Environment env = null;
	private Resource res = null;
	private Unit unit = null;
	private Structure structure = null;

	private List<String> flags = new ArrayList<>();

	public Cell setGround(Ground ground) {
		if (this.ground != null) flags.removeAll(this.ground.getFlags());
		this.ground = ground;
		flags.addAll(ground.getFlags());
		return this;
	}

	public Cell setEnvironment(Environment env) {
		if (this.env != null) flags.removeAll(this.env.getFlags());
		this.env = env;
		flags.addAll(env.getFlags());
		return this;
	}

	public Cell setResource(Resource res) {
		if (this.res != null) flags.removeAll(this.res.getFlags());
		this.res = res;
		flags.addAll(res.getFlags());
		return this;
	}

	public Cell setStructure(Structure structure) {
		if (this.structure != null) flags.removeAll(this.structure.getFlags());
		this.structure = structure;
		flags.addAll(structure.getFlags());
		return this;
	}

	public void remove(Killable killable) {
		if (killable instanceof Structure) {
			this.structure = null;
		} else if (killable instanceof Unit) {
			this.unit = null;
		}
	}

	public Structure getStructure() {
		return structure;
	}

	public Cell setUnit(Unit unit) {
		this.unit = unit;
		return this;
	}

	public Unit getUnit() {
		return unit;
	}

	public Environment getEnvironment() {
		return env;
	}

	public void removeEnvironment() {
		this.env = null;
	}

	public Ground getGround() {
		return ground;
	}

	public Resource getResource() {
		return res;
	}

	public List<String> getFlags() {
		return new ArrayList<>(flags);
	}

	public boolean hasFlag(String flag) {
		return flags.contains(flag);
	}

	public boolean hasResource(String resource) {
		boolean result = false;

		if (res != null && res.getID().equals(resource)
				|| resource.equals("food") && ground != null && ground.hasFlag("farmable")
				|| env != null && env.hasResource(resource)) {
			result = true;
		}

		return result;
	}

	public boolean canMoveHere(Unit moving_unit) {
		return canMoveHere(moving_unit, false);
	}

	public boolean canMoveHere(Unit moving_unit, boolean preemptive) {
		boolean return_value = true;
		if (!moving_unit.hasFlag("marine") && flags.contains("aquatic")) return_value = false;
		if (flags.contains("impassable")) return_value = false;
		if (!preemptive && unit != null) return_value = false;
		return return_value;
	}

}