text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="a11b9b8a-d916-4beb-8102-4a1bd3a3b6d2" name="Default" comment="">
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/filerepo/dircheckingbuild.py" afterPath="$PROJECT_DIR$/filerepo/dircheckingbuild.py" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/filerepo/musicrepo.py" afterPath="$PROJECT_DIR$/filerepo/musicrepo.py" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/filerepo/view2.py" afterPath="$PROJECT_DIR$/filerepo/view2.py" />
    </list>
    <ignored path="jamarrange.io.iws" />
    <ignored path=".idea/workspace.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="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="jamarrange.io" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="musicrepo.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/filerepo/musicrepo.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1566">
              <caret line="146" column="11" selection-start-line="146" selection-start-column="11" selection-end-line="146" selection-end-column="53" />
              <folding>
                <element signature="e#230#239#0" expanded="true" />
                <element signature="e#1112#3718#0" expanded="false" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="testrun.py" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/filerepo/testrun.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="423">
              <caret line="81" column="25" selection-start-line="81" selection-start-column="25" selection-end-line="81" selection-end-column="25" />
              <folding>
                <element signature="e#197#240#1" expanded="false" />
                <element signature="e#388#484#0" expanded="false" />
                <element signature="e#626#1731#0" expanded="false" />
                <element signature="e#741#1731#0" expanded="false" />
                <element signature="e#898#1570#0" expanded="false" />
                <element signature="e#1621#1731#0" expanded="false" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="experimentation.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/audio fingerprinting/experimentation.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="18">
              <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
              <folding>
                <element signature="e#0#15#0" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="view2.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/filerepo/view2.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1062">
              <caret line="77" column="30" selection-start-line="77" selection-start-column="30" selection-end-line="77" selection-end-column="30" />
              <folding>
                <element signature="e#279#288#0" expanded="true" />
                <element signature="e#460#1057#0" expanded="false" />
                <element signature="e#4892#5254#0" expanded="false" />
                <element signature="e#5385#8293#0" expanded="false" />
                <element signature="e#8483#9917#0" expanded="false" />
                <element signature="e#10076#10580#0" expanded="false" />
                <element signature="e#10754#10952#0" expanded="false" />
                <element signature="e#11128#11447#0" expanded="false" />
                <element signature="e#11710#11807#0" expanded="false" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="dircheckingbuild.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/filerepo/dircheckingbuild.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="306">
              <caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
              <folding>
                <element signature="e#0#9#0" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="testpymedia1.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/mediaplayer/testpymedia1.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="198">
              <caret line="11" column="33" selection-start-line="11" selection-start-column="33" selection-end-line="11" selection-end-column="33" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Python Script" />
      </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$/filerepo/view2.py" />
        <option value="$PROJECT_DIR$/filerepo/dircheckingbuild.py" />
        <option value="$PROJECT_DIR$/filerepo/musicrepo.py" />
        <option value="$PROJECT_DIR$/filerepo/testrun.py" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="57" />
    <option name="y" value="24" />
    <option name="width" value="1309" />
    <option name="height" value="744" />
  </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="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="jamarrange.io" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="jamarrange.io" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="jamarrange.io" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="jamarrange.io" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="jamarrange.io" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="filerepo" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="jamarrange.io" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="jamarrange.io" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="audio fingerprinting" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
  </component>
  <component name="RunManager" selected="Python.testrun">
    <configuration default="false" name="musicrepo" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/filerepo" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/filerepo/musicrepo.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="view (1)" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/mediaplayer" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/mediaplayer/view.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="testpymedia1" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/mediaplayer" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/mediaplayer/testpymedia1.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="layout1" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/mediaplayer" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/mediaplayer/layout1.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="testrun" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/filerepo" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/filerepo/testrun.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="PythonConfigurationType" factoryName="Python">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="Tox" factoryName="Tox">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Attests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Doctests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Nosetests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="PARAMS" value="" />
      <option name="USE_PARAM" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Unittests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="PUREUNITTEST" value="true" />
      <option name="PARAMS" value="" />
      <option name="USE_PARAM" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="py.test">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="testToRun" value="" />
      <option name="keywords" value="" />
      <option name="params" value="" />
      <option name="USE_PARAM" value="false" />
      <option name="USE_KEYWORD" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="view2" type="PythonConfigurationType" factoryName="Python">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/filerepo" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="jamarrange.io" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/filerepo/view2.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <list size="6">
      <item index="0" class="java.lang.String" itemvalue="Python.view2" />
      <item index="1" class="java.lang.String" itemvalue="Python.musicrepo" />
      <item index="2" class="java.lang.String" itemvalue="Python.view (1)" />
      <item index="3" class="java.lang.String" itemvalue="Python.testpymedia1" />
      <item index="4" class="java.lang.String" itemvalue="Python.layout1" />
      <item index="5" class="java.lang.String" itemvalue="Python.testrun" />
    </list>
    <recent_temporary>
      <list size="5">
        <item index="0" class="java.lang.String" itemvalue="Python.testrun" />
        <item index="1" class="java.lang.String" itemvalue="Python.musicrepo" />
        <item index="2" class="java.lang.String" itemvalue="Python.testpymedia1" />
        <item index="3" class="java.lang.String" itemvalue="Python.layout1" />
        <item index="4" class="java.lang.String" itemvalue="Python.view (1)" />
      </list>
    </recent_temporary>
  </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="a11b9b8a-d916-4beb-8102-4a1bd3a3b6d2" name="Default" comment="" />
      <created>1469965632735</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1469965632735</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="57" y="24" width="1309" height="744" extended-state="6" />
    <editor active="false" />
    <layout>
      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24904507" 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="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="7" side_tool="false" content_ui="tabs" />
      <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32884902" sideWeight="0.5" order="7" 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.25" sideWeight="0.5" order="1" 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.33" sideWeight="0.5" order="7" 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="2" 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.32884902" 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.33" 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.44544095" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
    </layout>
  </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>
      <breakpoints-dialog>
        <breakpoints-dialog />
      </breakpoints-dialog>
      <default-breakpoints>
        <breakpoint type="python-exception">
          <properties notifyOnTerminate="true" ignoreLibraries="true" exception="BaseException">
            <option name="ignoreLibraries" value="true" />
            <option name="notifyOnTerminate" value="true" />
          </properties>
        </breakpoint>
      </default-breakpoints>
      <option name="time" value="7" />
    </breakpoint-manager>
    <watches-manager>
      <configuration name="PythonConfigurationType">
        <watch expression="CMD_STEP_OVER" />
      </configuration>
    </watches-manager>
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/filerepo/musicrepo.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="2628">
          <caret line="146" column="11" selection-start-line="146" selection-start-column="11" selection-end-line="146" selection-end-column="53" />
          <folding>
            <element signature="e#230#239#0" expanded="true" />
            <element signature="e#1112#3718#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/testrun.py">
      <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>
            <element signature="e#197#240#1" expanded="false" />
            <element signature="e#388#484#0" expanded="false" />
            <element signature="e#626#1731#0" expanded="false" />
            <element signature="e#741#1731#0" expanded="false" />
            <element signature="e#898#1570#0" expanded="false" />
            <element signature="e#1621#1731#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/audio fingerprinting/experimentation.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="18">
          <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
          <folding>
            <element signature="e#0#15#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/view2.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1062">
          <caret line="77" column="30" selection-start-line="77" selection-start-column="30" selection-end-line="77" selection-end-column="30" />
          <folding>
            <element signature="e#279#288#0" expanded="true" />
            <element signature="e#460#1057#0" expanded="false" />
            <element signature="e#4892#5254#0" expanded="false" />
            <element signature="e#5385#8293#0" expanded="false" />
            <element signature="e#8483#9917#0" expanded="false" />
            <element signature="e#10076#10580#0" expanded="false" />
            <element signature="e#10754#10952#0" expanded="false" />
            <element signature="e#11128#11447#0" expanded="false" />
            <element signature="e#11710#11807#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/dircheckingbuild.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="306">
          <caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
          <folding>
            <element signature="e#0#9#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/mediaplayer/testpymedia1.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="198">
          <caret line="11" column="33" selection-start-line="11" selection-start-column="33" selection-end-line="11" selection-end-column="33" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/musicrepo.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="2052">
          <caret line="114" column="0" selection-start-line="114" selection-start-column="0" selection-end-line="144" selection-end-column="63" />
          <folding>
            <element signature="e#230#239#0" expanded="true" />
            <element signature="e#1112#3718#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/testrun.py">
      <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>
            <element signature="e#197#240#1" expanded="false" />
            <element signature="e#388#484#0" expanded="false" />
            <element signature="e#626#1731#0" expanded="false" />
            <element signature="e#741#1731#0" expanded="false" />
            <element signature="e#898#1570#0" expanded="false" />
            <element signature="e#1621#1731#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/audio fingerprinting/experimentation.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="18">
          <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
          <folding>
            <element signature="e#0#15#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/view2.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1062">
          <caret line="77" column="30" selection-start-line="77" selection-start-column="30" selection-end-line="77" selection-end-column="30" />
          <folding>
            <element signature="e#279#288#0" expanded="true" />
            <element signature="e#460#1057#0" expanded="false" />
            <element signature="e#4892#5254#0" expanded="false" />
            <element signature="e#5385#8293#0" expanded="false" />
            <element signature="e#8483#9917#0" expanded="false" />
            <element signature="e#10076#10580#0" expanded="false" />
            <element signature="e#10754#10952#0" expanded="false" />
            <element signature="e#11128#11447#0" expanded="false" />
            <element signature="e#11710#11807#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/dircheckingbuild.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="306">
          <caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
          <folding>
            <element signature="e#0#9#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/mediaplayer/testpymedia1.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="198">
          <caret line="11" column="33" selection-start-line="11" selection-start-column="33" selection-end-line="11" selection-end-column="33" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/musicrepo.py">
      <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>
            <element signature="e#230#239#0" expanded="true" />
            <element signature="e#1112#3718#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/audio fingerprinting/experimentation.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="18">
          <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
          <folding>
            <element signature="e#0#15#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/view2.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1062">
          <caret line="77" column="30" selection-start-line="77" selection-start-column="30" selection-end-line="77" selection-end-column="30" />
          <folding>
            <element signature="e#279#288#0" expanded="true" />
            <element signature="e#460#1057#0" expanded="false" />
            <element signature="e#4892#5254#0" expanded="false" />
            <element signature="e#5385#8293#0" expanded="false" />
            <element signature="e#8483#9917#0" expanded="false" />
            <element signature="e#10076#10580#0" expanded="false" />
            <element signature="e#10754#10952#0" expanded="false" />
            <element signature="e#11128#11447#0" expanded="false" />
            <element signature="e#11710#11807#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/dircheckingbuild.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="306">
          <caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
          <folding>
            <element signature="e#0#9#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/mediaplayer/testpymedia1.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="198">
          <caret line="11" column="33" selection-start-line="11" selection-start-column="33" selection-end-line="11" selection-end-column="33" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/musicrepo.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="2916">
          <caret line="162" column="27" selection-start-line="162" selection-start-column="27" selection-end-line="162" selection-end-column="27" />
          <folding>
            <element signature="e#230#239#0" expanded="true" />
            <element signature="e#1112#3718#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/view2.py">
      <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>
            <element signature="e#279#288#0" expanded="true" />
            <element signature="e#460#1057#0" expanded="false" />
            <element signature="e#4892#5254#0" expanded="false" />
            <element signature="e#5385#8293#0" expanded="false" />
            <element signature="e#8483#9917#0" expanded="false" />
            <element signature="e#10076#10580#0" expanded="false" />
            <element signature="e#10754#10952#0" expanded="false" />
            <element signature="e#11128#11447#0" expanded="false" />
            <element signature="e#11710#11807#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file:///usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="65610">
          <caret line="3645" column="0" selection-start-line="3645" selection-start-column="0" selection-end-line="3645" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/musicrepo.py">
      <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>
            <element signature="e#230#239#0" expanded="true" />
            <element signature="e#1112#3718#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/musicrepo.py">
      <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>
            <element signature="e#230#239#0" expanded="true" />
            <element signature="e#1112#3718#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/view2.py">
      <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$/filerepo/view2.py">
      <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$/filerepo/namehandling.py">
      <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$/filerepo/notclicked.png">
      <provider selected="true" editor-type-id="images">
        <state />
      </provider>
    </entry>
    <entry file="file:///usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-90">
          <caret line="3645" column="0" selection-start-line="3645" selection-start-column="0" selection-end-line="3645" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_HOME_DIR$/helpers/pydev/pydevd.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="203">
          <caret line="1555" column="0" selection-start-line="1555" selection-start-column="0" selection-end-line="1555" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/view.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="144">
          <caret line="8" column="0" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/view3.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="162">
          <caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/mediaplayer/gridtest1.py">
      <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$/mediaplayer/view.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="126">
          <caret line="7" column="13" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/mediaplayer/layout1.py">
      <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$/filerepo/view2.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1062">
          <caret line="77" column="30" selection-start-line="77" selection-start-column="30" selection-end-line="77" selection-end-column="30" />
          <folding>
            <element signature="e#279#288#0" expanded="true" />
            <element signature="e#460#1057#0" expanded="false" />
            <element signature="e#4892#5254#0" expanded="false" />
            <element signature="e#5385#8293#0" expanded="false" />
            <element signature="e#8483#9917#0" expanded="false" />
            <element signature="e#10076#10580#0" expanded="false" />
            <element signature="e#10754#10952#0" expanded="false" />
            <element signature="e#11128#11447#0" expanded="false" />
            <element signature="e#11710#11807#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/dircheckingbuild.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="306">
          <caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
          <folding>
            <element signature="e#0#9#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/mediaplayer/model.py">
      <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$/audio fingerprinting/experimentation.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="18">
          <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
          <folding>
            <element signature="e#0#15#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/mediaplayer/testpymedia1.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="198">
          <caret line="11" column="33" selection-start-line="11" selection-start-column="33" selection-end-line="11" selection-end-column="33" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/musicrepo.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1566">
          <caret line="146" column="11" selection-start-line="146" selection-start-column="11" selection-end-line="146" selection-end-column="53" />
          <folding>
            <element signature="e#230#239#0" expanded="true" />
            <element signature="e#1112#3718#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/filerepo/testrun.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="423">
          <caret line="81" column="25" selection-start-line="81" selection-start-column="25" selection-end-line="81" selection-end-column="25" />
          <folding>
            <element signature="e#197#240#1" expanded="false" />
            <element signature="e#388#484#0" expanded="false" />
            <element signature="e#626#1731#0" expanded="false" />
            <element signature="e#741#1731#0" expanded="false" />
            <element signature="e#898#1570#0" expanded="false" />
            <element signature="e#1621#1731#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
var mysqlUtil = require('../utils/mysqlUtil');
var util = require('util');
var Connection = require('mysql/lib/Connection.js');

var config = require('../config');

// 添加订单
exports.addOrder = function(uid, cart, cb){

	mysqlUtil.getConnection(function(err, conn) {

		if(err){
			console.log('add order connection err:'+err.stack());
			return next(err);
		}

		autoRelease(conn);

	    conn.beginTransaction(function(err) {

		  if (err) {
		  	console.log('begin transaction');
		  	return next(err);
		  }

		  var sql_1 = 'insert into ' + config.menu_t;
		  sql_1 += ' set ? ';
		  var t = {user_id: uid, add_time: new Date().Format('YYYY-MM-dd HH:mm:ss')};

		  conn.query(sql_1, t, function(err, result) {
		    if (err) {
		      return conn.rollback(function() {
		      	cosole.log('insert into menu error');
		        return next(err);
		      });
		    }

		    var sql_2 = 'insert into ' + config.menu_wine_t;
		    sql_2 += ' (wine_id, menu_id, wine_num) values ? ';

		    // format insert data
		    var menu = [];
		    cart = JSON.parse(cart);
		    for(var i=0, l=cart.length; i<l; i++){
		    	var item = [];
		    	item.push(cart[i].wine_id);
		    	item.push(result.insertId);
		    	item.push(cart[i].wine_num);
		    	menu.push(item);
		    }

		    conn.query(sql_2, [menu], function(err, result) {
		      if (err) {
		        return conn.rollback(function() {
		        	console.log('insert into menu_wine error');
		            return next(err);
		        });
		      }
		      conn.commit(function(err) {
		        if (err) {
		          return conn.rollback(function() {
		          	console.log('commit error');
		            return next(err);
		          });
		        }
		        // transction success
		        cb(null, true);

		      });  // commit

		    });  // insert into menu_wine

		  });  // insert into menu

		});	  // begin transction
	});

	function after(fn, cb) {
	  return function () {
	    fn.apply(this, arguments);
	    cb();
	  }
	}

	function autoRelease(conn) {

	    if (conn.commit == Connection.prototype.commit) {
	        conn.commit = after(conn.commit, release);
	        conn.rollback = after(conn.rollback, release);
	    }

	    function release() {
	        if (conn) {
	            conn.release();
	        }
	    }
	}

}

// 从menu_wine 中获取add_time
exports.getAddTime = function(uid, spend, cb){

	var sql = 'select menu_id, add_time from ' + config.menu_t;
	sql += ' where ';
	sql += ' user_id = ?';

	mysqlUtil.query(sql, [uid], function(err, rows, fields){
		if(err){
			console.log('get wine id num error');
			return next(err);
		}

		if(rows.length !== 0){
			for(var i=0, l=rows.length; i<l; i++){
				var item = rows[i];
				spend[item.menu_id] += ','+item.add_time;
			}
			cb(null, spend);

		}
	});

}

// 从menu_wine wine中获取wine info
exports.getById = function(menu_id, cb){

	var sql = 'select '+config.wine_t+'.wine_id, '+config.menu_wine_t+'.wine_num, '+config.wine_t+'.wine_price, '+config.wine_t+'.wine_name from ' + config.wine_t;
	sql += ' JOIN ' + config.menu_wine_t;
	sql += ' where '+ config.wine_t +'.wine_id = '+config.menu_wine_t + '.wine_id ';
	sql += ' AND '+ config.menu_wine_t +'.menu_id = ?';

	mysqlUtil.query(sql, [menu_id], function(err, rows, fields){
		if(err){
			console.log('get wine id num error');
			return next(err);
		}
		if(rows.length !== 0){

			cb(null, rows);

		}
	});

}

// 根据bar_id status 获取 menu
exports.getByBS = function(bar_id, statu, cb){
	var sql = 'select menu_id, add_time from ' + config.menu_t;
	sql += ' where ';
	sql += ' user_id = ?';

	mysqlUtil.query(sql, [uid], function(err, rows, fields){
		if(err){
			console.log('get wine id num error');
			return next(err);
		}

		if(rows.length !== 0){
			for(var i=0, l=rows.length; i<l; i++){
				var item = rows[i];
				spend[item.menu_id] += ','+item.add_time;
			}
			cb(null, spend);

		}
	});
}

// 根据用户名查找菜单 测试用
exports.getByUserId = function(uid, cb){

	var sql = 'select * from '+config.menu_t;
	sql += ' where user_id = ?';
	mysqlUtil.query(sql, [uid], function(err, rows, fields){
		if(err){
			console.log('get menu id  error');
			return next(err);
		}

		if(rows.length !== 0){
			cb(null, rows[0].menu_id);

		}
	});

}

redpajama_set_name: RedPajamaGithub


text:
{% load i18n %}

{% load foirequest_tags %}

  {% if object|can_write_foirequest:request and attachment.can_link %}
    {# Link to attachment when unapproved, but write allowed and cannot redact #}
    {% include "foirequest/snippets/attachment_item.html" %}
  {% else %}
    {% comment %}
      When unapproved and user can redact and can write, disallow direct access
      and force to review.
    {% endcomment %}
    {% if object|can_write_foirequest:request and attachment.can_edit %}

    {% endif %}

      {{ attachment.name|truncatefilename:20 }}
      {{ attachment.name }}

    {% if object|can_write_foirequest:request and attachment.can_edit %}

    {% endif %}

      {{ attachment.size|filesizeformat }}

  {% endif %}
  {% if attachment.pending %}

      {% blocktrans %}PDF Pending{% endblocktrans %}

  {% endif %}

    {% blocktrans %}Not public!{% endblocktrans %}

  {% if attachment.is_mail_decoration and object|can_write_foirequest:request %}
    <span data-toggle="tooltip" data-html="true" title="
{{ attachment.name }}
 ">

  {% endif %}

    {% if object|can_write_foirequest:request %}
      {% if attachment.can_edit %}

          {% trans "Edit" %}

      {% endif %}
    {% endif %}


text:
package org.cloudfoundry.operations.serviceadmin;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * Main entry point to the Cloud Foundry Service Admin API
 */
public interface ServiceAdmin {

    /**
     * Create a new service broker
     *
     * @param request The Create Service Broker request
     * @return a completion indicator
     */
    Mono<Void> create(CreateServiceBrokerRequest request);

    /**
     * Deletes a service broker
     *
     * @param request the Delete Service Broker request
     * @return a completion indicator
     */
    Mono<Void> delete(DeleteServiceBrokerRequest request);

    /**
     * Lists the service brokers
     *
     * @return the service brokers
     */
    Flux<ServiceBroker> list();

}


text:
<?php

namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;

use Symfony\Component\Console\Input\InputArgument,
    Symfony\Component\Console\Input\InputOption,
    Symfony\Component\Console\Input\InputInterface,
    Symfony\Component\Console\Output\OutputInterface,
    Doctrine\ORM\Tools\SchemaTool;

/**
 * Command to update the database schema for a set of classes based on their mappings.
 *
 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @link    www.doctrine-project.org
 * @since   2.0
 * @version $Revision$
 * @author  Benjamin Eberlei <kontakt@beberlei.de>
 * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
 * @author  Jonathan Wage <jonwage@gmail.com>
 * @author  Roman Borschel <roman@code-factory.org>
 */
class UpdateCommand extends AbstractCommand
{
    /**
     * @see Console\Command\Command
     */
    protected function configure()
    {
        $this
        ->setName('orm:schema-tool:update')
        ->setDescription(
            'Processes the schema and either update the database schema of EntityManager Storage Connection or generate the SQL output.'
        )
        ->setDefinition(array(
            new InputOption(
                'complete', null, InputOption::VALUE_NONE,
                'If defined, all assets of the database which are not relevant to the current metadata will be dropped.'
            ),
            new InputOption(
                'dump-sql', null, InputOption::VALUE_NONE,
                'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.'
            ),
            new InputOption(
                'force', null, InputOption::VALUE_NONE,
                "Don't ask for the incremental update of the database, but force the operation to run."
            ),
        ))
        ->setHelp(<<<EOT
Processes the schema and either update the database schema of EntityManager Storage Connection or generate the SQL output.
Beware that if --complete is not defined, it will do a save update, which does not delete any tables, sequences or affected foreign keys.
If defined, all assets of the database which are not relevant to the current metadata are dropped by this command.
EOT
        );
    }

    protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas)
    {
        // Defining if update is complete or not (--complete not defined means $saveMode = true)
        $saveMode = ($input->getOption('complete') !== true);

        if ($input->getOption('dump-sql') === true) {
            $sqls = $schemaTool->getUpdateSchemaSql($metadatas, $saveMode);
            $output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL);
        } else if ($input->getOption('force') === true) {
            $output->write('Updating database schema...' . PHP_EOL);
            $schemaTool->updateSchema($metadatas, $saveMode);
            $output->write('Database schema updated successfully!' . PHP_EOL);
        } else {
            $output->write('ATTENTION: This operation should not be executed in a production environment.' . PHP_EOL);
            $output->write('Use the incremental update to detect changes during development and use' . PHP_EOL);
            $output->write('this SQL DDL to manually update your database in production.' . PHP_EOL . PHP_EOL);

            $sqls = $schemaTool->getUpdateSchemaSql($metadatas, $saveMode);

            if (count($sqls)) {
                $output->write('Schema-Tool would execute ' . count($sqls) . ' queries to update the database.' . PHP_EOL);
                $output->write('Please run the operation with --force to execute these queries or use --dump-sql to see them.' . PHP_EOL);
            } else {
                $output->write('Nothing to update. The database is in sync with the current entity metadata.' . PHP_EOL);
            }
        }
    }
}


text:
<?php

namespace Kanboard\Api;

use LogicException;
use Kanboard\Core\Security\Role;
use Kanboard\Core\Ldap\Client as LdapClient;
use Kanboard\Core\Ldap\ClientException as LdapException;
use Kanboard\Core\Ldap\User as LdapUser;

/**
 * User API controller
 *
 * @package  api
 * @author   Frederic Guillot
 */
class User extends \Kanboard\Core\Base
{
    public function getUser($user_id)
    {
        return $this->user->getById($user_id);
    }

    public function getUserByName($username)
    {
        return $this->user->getByUsername($username);
    }

    public function getAllUsers()
    {
        return $this->user->getAll();
    }

    public function removeUser($user_id)
    {
        return $this->user->remove($user_id);
    }

    public function disableUser($user_id)
    {
        return $this->user->disable($user_id);
    }

    public function enableUser($user_id)
    {
        return $this->user->enable($user_id);
    }

    public function isActiveUser($user_id)
    {
        return $this->user->isActive($user_id);
    }

    public function createUser($username, $password, $name = '', $email = '', $role = Role::APP_USER)
    {
        $values = array(
            'username' => $username,
            'password' => $password,
            'confirmation' => $password,
            'name' => $name,
            'email' => $email,
            'role' => $role,
        );

        list($valid, ) = $this->userValidator->validateCreation($values);
        return $valid ? $this->user->create($values) : false;
    }

    public function createLdapUser($username)
    {
        try {

            $ldap = LdapClient::connect();
            $user = LdapUser::getUser($ldap, sprintf(LDAP_USER_FILTER, $username));

            if ($user === null) {
                $this->logger->info('User not found in LDAP server');
                return false;
            }

            if ($user->getUsername() === '') {
                throw new LogicException('Username not found in LDAP profile, check the parameter LDAP_USER_ATTRIBUTE_USERNAME');
            }

            $values = array(
                'username' => $user->getUsername(),
                'name' => $user->getName(),
                'email' => $user->getEmail(),
                'role' => $user->getRole(),
                'is_ldap_user' => 1,
            );

            return $this->user->create($values);

        } catch (LdapException $e) {
            $this->logger->error($e->getMessage());
            return false;
        }
    }

    public function updateUser($id, $username = null, $name = null, $email = null, $role = null)
    {
        $values = array(
            'id' => $id,
            'username' => $username,
            'name' => $name,
            'email' => $email,
            'role' => $role,
        );

        foreach ($values as $key => $value) {
            if (is_null($value)) {
                unset($values[$key]);
            }
        }

        list($valid, ) = $this->userValidator->validateApiModification($values);
        return $valid && $this->user->update($values);
    }
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Linq;
using System.Reflection;
using Nohros.Extensions;
using Nohros.Metrics.Annotations;

namespace Nohros.Metrics
{
  /// <summary>
  /// A default registry that delegates all actions to a either class
  /// configured  through the <see cref="Configure"/> method, the class
  /// defined by the the key "DefaultMetricsRegistry" in the
  /// <see cref="ConfigurationManager.AppSettings"/> configuration section,
  /// or the default registry(<see cref="MetricsRegistry"/>).
  /// <para>
  /// The class defined by the key "DefaultMetricsRegistry" must have a
  /// constructor with no arguments. If the class cannot be loaded
  /// de defualt metrics registry approach will be used.
  /// </para>
  /// <para>
  /// In metrics all <see cref="IMetric"/> should be registered to be reported.
  /// One critically important thing to remember is that they need to be
  /// registered exactly once. The main ways achieve this:
  /// <para>
  /// Monitors are static members of the class and registered in a static
  /// initializer block:
  /// <example>
  /// public class AlertEvaluator {
  ///   private static Counter alert_notification_failures =
  ///     Counter
  ///       .Create("notificationFailures");
  ///
  ///   static AlertEvaluator() {
  ///     AppMetrics.RegisterObject(alert_notification_failures);
  ///   }
  /// }
  /// </example>
  /// </para>
  /// <para>
  /// Metrics are members of a singleton and registered in the constructor.
  /// <example>
  /// public class SomeSingleton {
  ///   readonly Counter counter_ = Counter.Create("someCount");
  ///
  ///   SomeSingleton() {
  ///     AppMetrics.RegisterObject(this);
  ///   }
  /// }
  /// </example>
  /// Nore that the call to AppMetrics.Register(this) will use reflection to
  /// add all instances of <see cref="IMetric"/> objects that have been
  /// declared, and also add a tag class with the value set to the class'
  /// simple name(<see cref="Type.Name"/>).
  /// </para>
  /// </para>
  /// </summary>
  public class AppMetrics
  {
    /// <summary>
    /// Wraps another <see cref="ICompositeMetric"/> object providing an
    /// alternative configuration.
    /// </summary>
    class CompositeMetricWrapper : AbstractMetric, ICompositeMetric
    {
      public CompositeMetricWrapper(Tags tags, ICompositeMetric composite)
        : base(composite.Config.WithAdditionalTags(tags)) {
        List<IMetric> wrapped =
          composite
            .Metrics
            .Select(x => Wrap(x, Config.Tags))
            .ToList();
        Metrics = new ReadOnlyCollection<IMetric>(wrapped);
      }

      /// <inheritdoc/>
      public IEnumerator<IMetric> GetEnumerator() {
        return Metrics.GetEnumerator();
      }

      /// <inheritdoc/>
      IEnumerator IEnumerable.GetEnumerator() {
        return GetEnumerator();
      }

      /// <inheritdoc/>
      public ICollection<IMetric> Metrics { get; private set; }

      /// <inheritdoc/>
      protected internal override Measure Compute(long tick) {
        return CreateMeasure(Metrics.Count);
      }
    }

    /// <summary>
    /// A class that is used to configure the behavior of the
    /// global <see cref="AppMetrics"/>.
    /// </summary>
    public class Configurer
    {
      internal Configurer() {
        process_tags_
          .WithTag("ns.node", Environment.MachineName);
      }

      /// <summary>
      /// Define the collection of tags that should be associated with
      /// all metrics registered through the <see cref="AppMetrics"/>.
      /// </summary>
      /// <param name="tags">
      /// The list of tags to be associated with all metrics registered
      /// through the <see cref="AppMetrics"/>.
      /// </param>
      /// <remarks>
      /// This method should be used only if you want to remove all the
      /// tags that is automatically created by the metrics library and
      /// provide your own list of tags. If the intend is to increment
      /// the default list of tags, use the <see cref="WithAdditionalTags(Tags)"/>
      /// method instead.
      /// </remarks>
      public Configurer WithTags(Tags tags) {
        process_tags_ = new Tags.Builder(tags);
        return this;
      }

      /// <summary>
      /// Adds the given collection of tags to the current list of
      /// tags that is associated with all the metrics registered through
      /// the <see cref="AppMetrics"/>.
      /// </summary>
      /// <param name="tags">
      /// The list of tags to be associated with all metrics registered
      /// through the <see cref="AppMetrics"/>.
      /// </param>
      public Configurer WithAdditionalTags(Tags tags) {
        process_tags_.WithTags(tags);
        return this;
      }

      /// <summary>
      /// Adds the given collection of tags to the current list of
      /// tags that will be associated with all the metrics registered
      /// through the <see cref="AppMetrics"/>.
      /// </summary>
      /// <param name="tags">
      /// The list of tags to be merged with the list of all tags that
      /// will be associated with all metrics registered through the
      /// <see cref="AppMetrics"/>.
      /// </param>
      public Configurer WithAdditionalTags(IEnumerable<Tag> tags) {
        process_tags_.WithTags(tags);
        return this;
      }

      /// <summary>
      /// Adds the given tag to the current list of tags that will be
      /// associated with all the metrics registered through
      /// the <see cref="AppMetrics"/>.
      /// </summary>
      /// <param name="tag">
      /// The tag to be added to the list of tags that will be associated
      /// with all metrics registered through the <see cref="AppMetrics"/>.
      /// </param>
      public Configurer WithAdditionalTag(Tag tag) {
        process_tags_.WithTag(tag);
        return this;
      }

      /// <summary>
      /// Adds the given tag to the current list of tags that will be
      /// associated with all the metrics registered through
      /// the <see cref="AppMetrics"/>.
      /// </summary>
      /// <param name="name">
      /// The name of the tag to be added to the list of tags that
      /// will be associated with all metrics registered through the
      /// <see cref="AppMetrics"/>.
      /// </param>
      /// <param name="value">
      /// The value of the tag to be added to the list of tags that
      /// will be associated with all metrics registered through the
      /// <see cref="AppMetrics"/>.
      /// </param>
      public Configurer WithAdditionalTag(string name, string value) {
        process_tags_.WithTag(name, value);
        return this;
      }
    }

    /// <summary>
    /// Wraps another <see cref="IMetric"/> object providing an alternative
    /// configuration.
    /// </summary>
    class MetricWrapper : IMetric
    {
      readonly IMetric metric_;

      /// <summary>
      /// Initializes a new instance of the <see cref="MetricWrapper"/> class
      /// by using the given <paramref name="tags"/> and
      /// <paramref name="metric"/>.
      /// </summary>
      /// <param name="tags">
      /// The alternate configuration.
      /// </param>
      /// <param name="metric">
      /// The metric to be wrapped.
      /// </param>
      public MetricWrapper(Tags tags, IMetric metric) {
        Config = metric.Config.WithAdditionalTags(tags);
        metric_ = metric;
      }

      /// <inheritdoc/>
      public void GetMeasure(Action<Measure> callback) {
        metric_.GetMeasure(m => callback(WrapMeasure(m)));
      }

      /// <inheritdoc/>
      public void GetMeasure<T>(Action<Measure, T> callback, T state) {
        metric_.GetMeasure(m => callback(WrapMeasure(m), state));
      }

      /// <inheritdoc/>
      public MetricConfig Config { get; private set; }

      protected Measure WrapMeasure(Measure measure) {
        return new Measure(Config, measure.Value, measure.IsObservable);
      }
    }

    class StepMetricWrapper : MetricWrapper, IStepMetric
    {
      readonly IStepMetric metric_;

      public StepMetricWrapper(Tags tags, IStepMetric metric)
        : base(tags, metric) {
        metric_ = metric;
      }

      public void GetMeasure(Action<Measure> callback, bool reset) {
        metric_.GetMeasure(m => callback(WrapMeasure(m)), reset);
      }

      public void GetMeasure<T>(Action<Measure, T> callback, T state, bool reset) {
        metric_.GetMeasure(m => callback(WrapMeasure(m), state), reset);
      }
    }

    const string kDefaultMetricsRegistryKey = "DefaultMetricsRegistry";

    static bool configured_;
    static Tags.Builder process_tags_;

    static AppMetrics() {
      string default_metrics_registry_class =
        ConfigurationManager.AppSettings[kDefaultMetricsRegistryKey];

      if (default_metrics_registry_class != null) {
        var runtime_type = new RuntimeType(default_metrics_registry_class);

        Type type = RuntimeType.GetSystemType(runtime_type);

        if (type != null) {
          ForCurrentProcess =
            RuntimeTypeFactory<IMetricsRegistry>
              .CreateInstanceFallback(runtime_type);
        }
      }

      if (ForCurrentProcess == null) {
        ForCurrentProcess = new MetricsRegistry();
      }

      process_tags_ = new Tags.Builder();

      Configure();

      // Mark the class as not configured to allow users to
      // overrite the default behavior.
      configured_ = false;
    }

    /// <summary>
    /// Configure the behavior of the <see cref="AppMetrics"/>.
    /// </summary>
    /// <returns>
    /// A <see cref="Configurer"/> that can be used to manage the
    /// behavior of the <see cref="AppMetrics"/>.
    /// </returns>
    /// <exception cref="InvalidOperationException">
    /// The <see cref="Configure"/> method was already called.
    /// </exception>
    /// <remarks>
    /// This method should be called before the usage of any
    /// method of the <see cref="AppMetrics"/>, usually at the application
    /// startup.
    ///<para>
    /// This method should be called once per application and calling it
    /// a second time will throw an exception.
    /// </para>
    /// </remarks>
    public static Configurer Configure() {
      if (configured_) {
        throw new ArgumentException("The AppMetrics was already configured.");
      }
      configured_ = true;
      return new Configurer();
    }

    /// <summary>
    /// Register the given metric in the default registry.
    /// </summary>
    public static void Register(IMetric metric) {
      ForCurrentProcess.Register(metric);
    }

    /// <summary>
    /// Register the given metrics in the default registry.
    /// </summary>
    public static void Register(IEnumerable<IMetric> metrics) {
      foreach (var metric in metrics) {
        Register(metric);
      }
    }

    /// <summary>
    /// Unregister the given metrics from the default registry.
    /// </summary>
    public static void Unregister(IMetric metric) {
      ForCurrentProcess.Unregister(metric);
    }

    /// <summary>
    /// Register a <see cref="ICompositeMetric"/> that is a composite for all
    /// metric fields and annotated attributes of a given object.
    /// </summary>
    /// <remarks>
    /// Object to search for metrics on. All fields of type
    /// <see cref="IMetric"/> and fields/methods with a
    /// <see cref="MetricAttribute"/> attribute will be extracted and
    /// returned using <see cref="ICompositeMetric.Metrics"/>
    /// <para>
    /// Note that the <see cref="RegisterObject(object)"/>  will use
    /// reflection to add all instances of <see cref="IMetric"/> that have
    /// been declared, and also add a tag with the value set to class simple
    /// name (<see cref="Type.Name"/>) and namespace (
    /// <see cref="Type.Namespace"/>).
    /// </para>
    /// </remarks>
    /// <returns>
    /// A <see cref="ICompositeMetric"/> based on the fields of the class
    /// <paramref name="klass"/>.
    /// </returns>
    public static ICompositeMetric RegisterObject(Type klass) {
      return RegisterObject(klass, null);
    }

    /// <summary>
    /// Register a <see cref="ICompositeMetric"/> that is a composite for all
    /// metric fields and annotated attributes of a given object.
    /// </summary>
    /// <remarks>
    /// Object to search for metrics on. All fields of type
    /// <see cref="IMetric"/> and fields/methods with a
    /// <see cref="MetricAttribute"/> attribute will be extracted and
    /// returned using <see cref="ICompositeMetric.Metrics"/>
    /// <para>
    /// Note that the <see cref="RegisterObject(object)"/>  will use
    /// reflection to add all instances of <see cref="IMetric"/> that have
    /// been declared, and also add a tag with the value set to class simple
    /// name (<see cref="Type.Name"/>) and namespace (
    /// <see cref="Type.Namespace"/>).
    /// </para>
    /// </remarks>
    /// <returns>
    /// A <see cref="ICompositeMetric"/> based on the fields of the class of
    /// <paramref name="obj"/>.
    /// </returns>
    public static ICompositeMetric RegisterObject(object obj) {
      return RegisterObject(obj.GetType(), obj);
    }

    static ICompositeMetric RegisterObject(Type klass, object obj) {
      // The tags defined at the class level should be merged with the tags
      // defined for the fields and methods of the class.
      Tags tags =
        new Tags.Builder()
          .WithTags(process_tags_.Build())
          .WithTags(GetTags(klass, true)) // static class tags
          .WithTags(GetTagsList(klass, obj)) // dynamic class tags
          .WithTag("class", klass.Name)
          .WithTag("namespace", klass.Namespace)
          .Build();

      var metrics = new List<IMetric>();
      for (Type type = klass; type != null; type = type.BaseType) {
        AddMetrics(metrics, tags, obj, type);
      }

      var config = new MetricConfig("annotated", tags);
      var composite = new BasicCompositeMetric(config, metrics);
      Register((IMetric) composite);

      return composite;
    }

    /// <summary>
    /// Extract all fields of <paramref name="obj"/> that are of type
    /// <see cref="IMetric"/> and add them to <paramref name="metrics"/>.
    /// </summary>
    /// <param name="metrics">
    /// A <see cref="List{T}"/> object to add the extracted metrics.
    /// </param>
    /// <param name="tags">
    /// A <see cref="Tags"/> object contained a list of tags that should be
    /// added to the extracted metrics.
    /// </param>
    /// <param name="obj">
    /// The object to extract the monitor fields.
    /// </param>
    /// <param name="type">
    /// The type to extract the fields. This type is one of the types of
    /// the <paramref name="obj"/> hierarchy.
    /// </param>
    static void AddMetrics(List<IMetric> metrics, Tags tags, object obj,
      Type type) {
      // For non-instance object we should register only the static metrics
      // and for instance objects we should register only instance metrics
      IEnumerable<FieldInfo> metric_fields =
        (obj == null)
          ? GetFields(type).Where(x => IsMetricType(x) && x.IsStatic)
          : GetFields(type).Where(x => IsMetricType(x) && !x.IsStatic);

      foreach (FieldInfo field in metric_fields) {
        var metric = field.GetValue(obj) as IMetric;
        if (metric == null) {
          throw new ArgumentNullException(Resources.NullAnnotatedField.Fmt());
        }
        metrics.Add(Wrap(metric, tags, field));
      }
    }

    static IMetric Wrap(IMetric metric, Tags tags, FieldInfo field) {
      var field_tags =
        new Tags.Builder(tags)
          .WithTags(metric.Config.Tags)
          .WithTags(GetTags(field))
          .Build();
      return Wrap(metric, field_tags);
    }

    static IMetric Wrap(IMetric metric, Tags tags) {
      if (metric is ICompositeMetric) {
        return new CompositeMetricWrapper(tags, metric as ICompositeMetric);
      }
      var step = metric as IStepMetric;
      if (step != null) {
        return new StepMetricWrapper(tags, step);
      }
      return new MetricWrapper(tags, metric);
    }

    /// <summary>
    /// Gets a <see cref="IEnumerable{Tag}"/> containing the list of tags that
    /// was dynamically registered on the class <paramref name="klass"/> for
    /// the given <paramref name="obj"/>.
    /// </summary>
    /// <param name="klass">
    /// The type from which the dynamically list of tags should be extracted.
    /// </param>
    /// <param name="obj">
    /// An object of type <paramref name="klass"/> from which the list of tags
    /// should be extracted. If the field or method that definy the list
    /// of tags is static <paramref name="obj"/> should be <c>null</c>.
    /// </param>
    /// <returns>
    /// A <see cref="IEnumerable{Tag}"/> contianing the list of tags that was
    /// dynamically registered on the class <paramref name="klass"/> for the
    /// given <paramref name="obj"/>.
    /// </returns>
    /// <remarks>
    /// The <see cref="GetTagsList"/> method search for first a field that can
    /// be assigned to or a method that returns a <see cref="IEnumerable{Tag}"/>
    /// and use this to get the list of tags. If the field or method is not
    /// found an empty enumerable is returned.
    /// </remarks>
    static IEnumerable<Tag> GetTagsList(Type klass, object obj) {
      FieldInfo field =
        GetFields(klass)
          .Where(IsTagList)
          .FirstOrDefault();

      if (field != null) {
        return (IEnumerable<Tag>) field.GetValue(obj);
      }

      MethodInfo method =
        GetMethods(klass)
          .Where(IsTagList)
          .FirstOrDefault(m => m.GetParameters().Length == 0);

      if (method != null) {
        return (IEnumerable<Tag>) method.Invoke(obj, new object[0]);
      }
      return Enumerable.Empty<Tag>();
    }

    /// <summary>
    /// Checks if the given <paramref name="field"/> represents a
    /// type that can be is assiged to an <see cref="IMetric"/>.
    /// </summary>
    /// <param name="field">
    /// A <see cref="FieldInfo"/> contianing the type information
    /// about the field to check.
    /// </param>
    /// <returns>
    /// <c>true</c> if the type associated with the given
    /// <paramref name="field"/> can be assigned to a
    /// <see cref="IMetric"/>.
    /// </returns>
    static bool IsMetricType(FieldInfo field) {
      return typeof (IMetric).IsAssignableFrom(field.FieldType);
    }

    /// <summary>
    /// Checks if the given <paramref name="field"/> represents a
    /// type that can be is assiged to an
    /// <see cref="IEnumerable{T}"/> of <see cref="Tag"/>.
    /// </summary>
    /// <param name="field">
    /// A <see cref="FieldInfo"/> contianing the type information
    /// about the field to check.
    /// </param>
    /// <returns>
    /// <c>true</c> if the type associated with the given
    /// <paramref name="field"/> can be assigned to a
    /// <see cref="IEnumerable{T}"/> of <see cref="Tag"/>.
    /// </returns>
    static bool IsTagList(FieldInfo field) {
      return IsTagList(field.FieldType);
    }

    /// <summary>
    /// Checks if the given <paramref name="method"/> returns am
    /// object that can be is assiged to an
    /// <see cref="IEnumerable{T}"/> of <see cref="Tag"/>.
    /// </summary>
    /// <param name="method">
    /// A <see cref="MethodInfo"/> contianing the type information
    /// about the method to check.
    /// </param>
    /// <returns>
    /// <c>true</c> if the return type of the given
    /// <paramref name="method"/> can be assigned to a
    /// <see cref="IEnumerable{T}"/> of <see cref="Tag"/>.
    /// </returns>
    static bool IsTagList(MethodInfo method) {
      return IsTagList(method.ReturnType);
    }

    /// <summary>
    /// Checks if the given type is assignable to an
    /// <see cref="IEnumerable{T}"/> of <see cref="Tag"/>
    /// </summary>
    /// <param name="type">
    /// The type to check for assignability.
    /// </param>
    /// <returns>
    /// <c>true</c> if <paramref name="type"/> can be assigned
    /// to a <see cref="IEnumerable{T}"/> of <see cref="Tag"/>.
    /// </returns>
    static bool IsTagList(Type type) {
      return typeof (IEnumerable<Tag>).IsAssignableFrom(type);
    }

    static IEnumerable<FieldInfo> GetFields(Type type) {
      const BindingFlags kFlags =
        BindingFlags.Instance |
          BindingFlags.Static |
          BindingFlags.Public |
          BindingFlags.NonPublic |
          BindingFlags.DeclaredOnly;

      return type.GetFields(kFlags);
    }

    static IEnumerable<MethodInfo> GetMethods(Type type) {
      const BindingFlags kFlags =
        BindingFlags.Instance |
          BindingFlags.Static |
          BindingFlags.Public |
          BindingFlags.NonPublic |
          BindingFlags.DeclaredOnly;

      return type.GetMethods(kFlags);
    }

    /// <summary>
    /// Gets the tags declared for the given member.
    /// </summary>
    /// <param name="member">
    /// The type to get the tags.
    /// </param>
    /// <param name="inherit">
    /// <c>true</c> to search this member's inheritance chain to find the
    /// tags; otherwise, <c>false</c>. This parameter is ignored for
    /// fields.
    /// </param>
    /// <returns>
    /// A <see cref="Tags"/> object containing the tags declared for the
    /// given member.
    /// </returns>
    static IEnumerable<Tag> GetTags(MemberInfo member, bool inherit = false) {
      return
        GetAttributes<TagAttribute>(member, inherit)
          .Select(t => t.Tag);
    }

    static IEnumerable<T> GetAttributes<T>(MemberInfo member,
      bool inherit = false) {
      return
        member
          .GetCustomAttributes(typeof (T), inherit)
          .Cast<T>();
    }

    /// <summary>
    /// Gets the default configured <see cref="IMetricsRegistry"/>.
    /// </summary>
    public static IMetricsRegistry ForCurrentProcess { get; private set; }
  }
}


text:
package alluxio.worker.block.allocator;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;

import alluxio.worker.block.BlockMetadataEvictorView;
import alluxio.worker.block.BlockMetadataManager;
import alluxio.worker.block.BlockStoreLocation;
import alluxio.worker.block.TieredBlockStoreTestUtils;
import alluxio.worker.block.meta.BlockMeta;
import alluxio.worker.block.meta.StorageDir;
import alluxio.worker.block.meta.StorageDirView;
import alluxio.worker.block.meta.StorageTier;
import alluxio.worker.block.meta.TempBlockMeta;

import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;

import java.io.IOException;
import java.util.HashSet;

/**
 * Base class for allocator tests.
 */
public class AllocatorTestBase {

  protected static final long SESSION_ID = 1;
  protected int mTestBlockId = 0;

  // Default tier/dir configurations we use for testing
  public static final long DEFAULT_RAM_SIZE = 1000;
  public static final long DEFAULT_SSD_SIZE = 2000;
  public static final long DEFAULT_HDD_SIZE = 3000;

  public static final int[] TIER_LEVEL = {0, 1, 2};
  public static final String[] TIER_ALIAS = {"MEM", "SSD", "HDD"};
  public static final String[][] TIER_PATH = {{"/ramdisk"}, {"/ssd1", "/ssd2"},
      {"/disk1", "/disk2", "/disk3"}};
  public static final String[][] TIER_MEDIA_TYPE = {{"MEM"}, {"SSD", "SSD"},
      {"HDD", "HDD", "HDD"}};
  public static final long[][] TIER_CAPACITY_BYTES = {{DEFAULT_RAM_SIZE},
      {DEFAULT_SSD_SIZE, DEFAULT_SSD_SIZE},
      {DEFAULT_HDD_SIZE, DEFAULT_HDD_SIZE, DEFAULT_HDD_SIZE}};

  public static final int DEFAULT_RAM_NUM  = TIER_PATH[0].length;
  public static final int DEFAULT_SSD_NUM  = TIER_PATH[1].length;
  public static final int DEFAULT_HDD_NUM  = TIER_PATH[2].length;

  protected BlockMetadataManager mManager = null;
  protected Allocator mAllocator = null;

  protected BlockStoreLocation mAnyTierLoc = BlockStoreLocation.anyTier();
  protected BlockStoreLocation mAnyDirInTierLoc1 = BlockStoreLocation.anyDirInTier("MEM");
  protected BlockStoreLocation mAnyDirInTierLoc2 = BlockStoreLocation.anyDirInTier("SSD");
  protected BlockStoreLocation mAnyDirInTierLoc3 = BlockStoreLocation.anyDirInTier("HDD");

  /** Rule to create a new temporary folder during each test. */
  @Rule
  public TemporaryFolder mTestFolder = new TemporaryFolder();

  /**
   * Sets up all dependencies before a test runs.
   */
  @Before
  public void before() throws Exception {
    resetManagerView();
  }

  /**
   * Resets the manager view configured by the parameters in this base class.
   */
  protected void resetManagerView() throws Exception {
    String alluxioHome = mTestFolder.newFolder().getAbsolutePath();
    TieredBlockStoreTestUtils.setupConfWithMultiTier(alluxioHome, TIER_LEVEL, TIER_ALIAS,
        TIER_PATH, TIER_CAPACITY_BYTES, TIER_MEDIA_TYPE, null);
    mManager = BlockMetadataManager.createBlockMetadataManager();
  }

  /**
   * Given an allocator with the location and blockSize, we assert whether the block can be
   * allocated.
   *
   * @param allocator the allocation manager of Alluxio managed data
   * @param location the location in block store
   * @param blockSize the size of block in bytes
   * @param avail the block should be successfully allocated or not
   */
  protected void assertTempBlockMeta(Allocator allocator, BlockStoreLocation location,
      long blockSize, boolean avail) throws IOException {

    mTestBlockId++;
    StorageDirView dirView =
        allocator.allocateBlockWithView(SESSION_ID, blockSize, location, getMetadataEvictorView());
    TempBlockMeta tempBlockMeta =
        dirView == null ? null : dirView.createTempBlockMeta(SESSION_ID, mTestBlockId, blockSize);

    if (!avail) {
      assertTrue(tempBlockMeta == null);
    } else {
      assertTrue(tempBlockMeta != null);
    }
  }

  /**
   * Given an allocator with the location, blockSize, tierAlias and dirIndex,
   * we assert whether the block can be allocated.
   *
   * @param allocator the allocation manager of Alluxio managed data
   * @param location the location in block store
   * @param blockSize the size of block in bytes
   * @param avail the block should be successfully allocated or not
   * @param tierAlias the block should be allocated at this tier
   * @param dirIndex  the block should be allocated at this dir
   */
  protected void assertTempBlockMeta(Allocator allocator, BlockStoreLocation location,
      int blockSize, boolean avail, String tierAlias, int dirIndex) throws Exception {

    mTestBlockId++;

    StorageDirView dirView =
        allocator.allocateBlockWithView(SESSION_ID, blockSize, location, getMetadataEvictorView());
    TempBlockMeta tempBlockMeta =
        dirView == null ? null : dirView.createTempBlockMeta(SESSION_ID, mTestBlockId, blockSize);

    if (!avail) {
      assertTrue(tempBlockMeta == null);
    } else {
      assertTrue(tempBlockMeta != null);

      StorageDir pDir = tempBlockMeta.getParentDir();
      StorageTier pTier = pDir.getParentTier();

      assertTrue(pDir.getDirIndex() == dirIndex);
      assertEquals(tierAlias, pTier.getTierAlias());

      //update the dir meta info
      pDir.addBlockMeta(new BlockMeta(mTestBlockId, blockSize, pDir));
    }
  }

  protected BlockMetadataEvictorView getMetadataEvictorView() {
    return new BlockMetadataEvictorView(mManager, new HashSet<Long>(), new HashSet<Long>());
  }
}


text:
Read and display raw values from capacitive touch pad sensors.

Once configured, ESP32 is continuously measuring capacitance of touch pad sensors. Measurement is reflected as numeric value inversely related to sensor's capacitance. The capacitance is bigger when sensor is touched with a finger and the measured value smaller. In opposite situation, when finger is released, capacitance is smaller and the measured value bigger.

To detect when a sensor is touched and when not, each particular design should be calibrated by obtaining both measurements for each individual sensor. Then a threshold between both values should be established. Using specific threshold, API is then able to distinguish whether specific sensor is touched or released.

ESP32 supports reading up to ten capacitive touch pad sensors T0 - T9, connected to specific GPIO pins. For information on available pins please refer to [Technical Reference Manual](http://espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf). Application initializes all ten sensor pads. Then in a loop reads sensors T0 - T9 and displays obtained values (after a colon) on a serial terminal:

```
T0: 486 T1:   1 T2: 559 T3: 567 T4: 871 T5: 522 T6:1174 T7:1531 T8:1508 T9:1640
T0: 485 T1:   1 T2: 559 T3: 568 T4: 871 T5: 521 T6:1176 T7:1536 T8:1509 T9:1635
T0: 485 T1:   1 T2: 559 T3: 568 T4: 871 T5: 521 T6:1172 T7:1536 T8:1507 T9:1640
T0:  11 T1:   1 T2: 558 T3: 568 T4: 871 T5: 522 T6:1172 T7:1535 T8:1507 T9:1638
```

Above log is prepared using [ESP32 Demo Board V2](https://dl.espressif.com/dl/schematics/ESP32-Demo-Board-V2_sch.pdf) that has all ten pad sensors exposed. Values will be different depending on layout of pads on particular board.

![alt text](http://dl.espressif.com/dl/schematics/pictures/esp32-demo-board-v2.jpg "ESP32 Demo Board V2")

There is another similar example that demonstrates how to perform simple calibration and trigger an interrupt when a pat is touched - see [touch_pad_interrupt](../touch_pad_interrupt).

See the README.md file in the upper level 'examples' directory for more information about examples.


text:
var hasOwnProperty = exports.hasOwnProperty = Object.prototype.hasOwnProperty;
var toString = exports.toString = Object.prototype.toString;

var each = exports.each = function (object, fn, context) {
	if (object && fn) {
		var l = object.length;
		for (var i = 0; i < l && fn.call(context, object[i], i) !== false; i++) {}
	}
};

exports.trim = function (str) {
	return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
};

exports.assign = function (target) {
	for (var i=1; i<arguments.length; i++) {
		var nextSource = arguments[i];

		if (nextSource != null) { // Skip over if undefined or null
			for (var nextKey in nextSource) {
				if (hasOwnProperty.call(nextSource, nextKey)) {
					target[nextKey] = nextSource[nextKey];
				}
			}
		}
	}

	return target;
};

exports.isUndefined = function (obj) { return obj === void 0; }

each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function (type) {
	exports['is' + type] = function (o) {
		return toString.call(o) === '[object ' + type + ']';
	};
});

exports.throttle = function (fn, minDelay, scope) {
	var lastCall = 0;
	return function() {
		var now = +new Date();
		if (now - lastCall < minDelay) {
			return;
		}
		lastCall = now;
		fn.apply(scope, arguments);
	};
};

exports.inView = function (rect, viewport) {
	// Intersection
	return rect.right >= viewport.left &&
		rect.bottom >= viewport.top &&
		rect.left <= viewport.right &&
		rect.top <= viewport.bottom;
};


text: Categorizer for your daily news


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Please enter language data in the fields below.  All data should be entered in English -->
<ldml xmlns:sil="urn://www.sil.org/ldml/0.1">
	<identity>
		<version number="0.0.1"/>
		<!-- name.en(wan)="Wan" -->
		<language type="wan"/>
		<special>
			<sil:identity defaultRegion="CI" script="Latn"/>
		</special>
	</identity>
	<localeDisplayNames>
		<special>
			<sil:names>
				<sil:name xml:lang="en">Wan</sil:name>
			</sil:names>
		</special>
	</localeDisplayNames>
	<characters>
		<exemplarCharacters>[a b {bh} c d e ɛ f g {gb} {gw} i j k {kp} {kw} l m n ŋ o ɔ p r s t u v w y]</exemplarCharacters>
		<exemplarCharacters type="auxiliary">[q x z]</exemplarCharacters>
	</characters>
	<special>
		<sil:external-resources>
			<sil:font name="Charis SIL" types="default" features="cv43=0 cv46=1">
				<sil:url>https://wirl.api.sil.org/CharisSILReg&type=ttf</sil:url>
			</sil:font>
			<sil:font name="Noto Sans"><!--types="ui"-->
				<sil:url>https://github.com/googlefonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Regular.ttf</sil:url>
			</sil:font>
			<sil:font name="Noto Serif">
				<sil:url>https://github.com/googlefonts/noto-fonts/raw/main/hinted/ttf/NotoSerif/NotoSerif-Regular.ttf</sil:url>
			</sil:font>
		</sil:external-resources>
	</special>
</ldml>


text:
layout: post
title: "APRwin and wine"
published: true
---
{% include JB/setup %}

Here's what I did to get [APRwin](http://www.occ.gov/tools-forms/tools/compliance-bsa/aprwin-software.html)
running under wine and packaged in an OSX dmg.

```sh
# INSTALL wine, winetrick
brew update
brew install wine winetricks

# INSTALL dependency
winetricks mfc42 # Visual C++ 6.0 run-time

# RUN
wine aprwin-software-exe.exe

# PACKAGE 'Bottle' into OSX dmg

\curl -O http://winebottler.kronengberg.org/combo/builds/WineBottlerCombo__1.7.31.dmg
open WineBottlerCombo__1.7.31.dmg

1. Drag 'wine' and 'wine bottler' to Applications
2. open 'wine bottler'
3. advanced, create a new prefix
4. select the aprwin-software-exe.exe file
5. check the box for mfc42
6. check the box to include all files in the .app
7. create it in your Applications folder named e.g. APRWIN

Aside: If you managed to extract the chm from the exe, you can read it with CHMOX
```