text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CMakeRunConfigurationManager" shouldGenerate="true" buildAllGenerated="true">
    <generated>
      <config projectName="CustomList" targetName="CustomList" />
    </generated>
  </component>
  <component name="CMakeSettings">
    <configurations>
      <configuration CONFIG_NAME="Debug" />
    </configurations>
  </component>
  <component name="ChangeListManager">
    <list default="true" id="26e4918a-de92-459b-a550-78ed09ccc4c4" name="Default" comment="" />
    <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="FileEditorManager">
    <leaf>
      <file leaf-file-name="CMakeLists.txt" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="0">
              <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="main.cpp" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/main.cpp">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="119">
              <caret line="7" column="10" lean-forward="true" selection-start-line="7" selection-start-column="10" selection-end-line="7" selection-end-column="10" />
              <folding>
                <element signature="e#0#19#0" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="ListIterator.cpp" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/core/ListIterator.cpp">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="102">
              <caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="24" selection-end-column="1" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="ListIterator.h" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/core/ListIterator.h">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="125">
              <caret line="10" column="0" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="28" selection-end-column="2" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="List.cpp" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/core/List.cpp">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="748">
              <caret line="44" column="3" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="76" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="List.h" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/core/List.h">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="244">
              <caret line="34" column="2" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="34" selection-end-column="2" />
              <folding>
                <element signature="e#92#109#0" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Node.cpp" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/core/Node.cpp">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="278">
              <caret line="22" column="1" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="22" selection-end-column="1" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Node.h" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/core/Node.h">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="329">
              <caret line="22" column="2" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="22" selection-end-column="2" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>node</find>
      <find>push</find>
      <find>insert(</find>
      <find>tail</find>
      <find>head</find>
      <find>Node</find>
      <find>_Node*</find>
      <find>erase</find>
    </findStrings>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/core/Node.h" />
        <option value="$PROJECT_DIR$/core/Node.cpp" />
        <option value="$PROJECT_DIR$/core/ListIterator.cpp" />
        <option value="$PROJECT_DIR$/core/ListIterator.h" />
        <option value="$PROJECT_DIR$/core/List.h" />
        <option value="$PROJECT_DIR$/main.cpp" />
        <option value="$PROJECT_DIR$/core/List.cpp" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="OCFindUsagesOptions" text="true" ivars="false" properties="true" derivedClasses="false" />
  <component name="ProjectFrameBounds">
    <option name="x" value="-8" />
    <option name="y" value="-8" />
    <option name="width" value="1382" />
    <option name="height" value="744" />
  </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="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="CustomList" />
              <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="CustomList" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="CustomList" />
              <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="CustomList" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="core" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="settings.editor.selected.configurable" value="editor.preferences.import" />
    <property name="settings.editor.splitter.proportion" value="0.2" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="nodejs_interpreter_path" value="C:/Program Files/nodejs/node" />
    <property name="js.eslint.eslintPackage" value="" />
    <property name="js-jscs-nodeInterpreter" value="C:\Program Files\nodejs\node.exe" />
  </component>
  <component name="RunManager" selected="Application.Build All">
    <configuration default="true" type="CMakeGoogleTestRunConfigurationType" factoryName="Google Test" PASS_PARENT_ENVS_2="true" PROJECT_NAME="CustomList" TARGET_NAME="CustomList" CONFIG_NAME="Debug" TEST_MODE="SUITE_TEST">
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS_2="true">
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
      <config-file value="" />
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <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="CustomList" />
      <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="CustomList" />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.npm" factoryName="npm">
      <command value="run" />
      <scripts />
      <node-interpreter value="project" />
      <envs />
      <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="CustomList" />
      <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="CustomList" />
      <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="CustomList" />
      <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="CustomList" />
      <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="CustomList" />
      <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="CustomList" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS_2="true" PROJECT_NAME="CustomList" TARGET_NAME="CustomList" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="CustomList" RUN_TARGET_NAME="CustomList">
      <envs />
      <method />
    </configuration>
    <configuration default="false" name="Build All" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS_2="true" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="CustomList" RUN_TARGET_NAME="CustomList" EXPLICIT_BUILD_TARGET_NAME="all">
      <envs />
      <method />
    </configuration>
    <list size="2">
      <item index="0" class="java.lang.String" itemvalue="Application.CustomList" />
      <item index="1" class="java.lang.String" itemvalue="Application.Build All" />
    </list>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="26e4918a-de92-459b-a550-78ed09ccc4c4" name="Default" comment="" />
      <created>1494959744940</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1494959744940</updated>
      <workItem from="1494959747910" duration="9767000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="9767000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="-8" y="-8" width="1382" height="744" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24963397" 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="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.329653" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="CMake" 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="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="-1" 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="false" weight="0.33" sideWeight="0.5" order="-1" 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.329653" sideWeight="0.5" order="2" 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="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39905363" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="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="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="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="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="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" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="processedProjectFiles" value="true" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="28" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/list">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/bits/stl_list.h">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="122">
          <caret line="95" column="9" lean-forward="true" selection-start-line="95" selection-start-column="9" selection-end-line="95" selection-end-column="9" />
          <folding>
            <element signature="e#58523#58542#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/core/Node.h">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="329">
          <caret line="22" column="2" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="22" selection-end-column="2" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/core/Node.cpp">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="278">
          <caret line="22" column="1" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="22" selection-end-column="1" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/core/ListIterator.h">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="125">
          <caret line="10" column="0" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="28" selection-end-column="2" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/core/List.h">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="244">
          <caret line="34" column="2" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="34" selection-end-column="2" />
          <folding>
            <element signature="e#92#109#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/main.cpp">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="119">
          <caret line="7" column="10" lean-forward="true" selection-start-line="7" selection-start-column="10" selection-end-line="7" selection-end-column="10" />
          <folding>
            <element signature="e#0#19#0" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/core/ListIterator.cpp">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="102">
          <caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="24" selection-end-column="1" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/core/List.cpp">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="748">
          <caret line="44" column="3" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="76" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
package gnu.javax.print.ipp;

import javax.print.MultiDoc;
import javax.print.MultiDocPrintJob;
import javax.print.PrintException;
import javax.print.attribute.PrintRequestAttributeSet;

/**
 * Implementation of the MultiDocPrintJob interface. Implementation
 * is specific to the IppPrintService implementation.
 *
 * @author Wolfgang Baer (WBaer@gmx.de)
 */
public class MultiDocPrintJobImpl extends DocPrintJobImpl
  implements MultiDocPrintJob
{

  /**
   * Constructor forwarding arguments to the super constructor.
   *
   * @param service the print service instance.
   * @param user the user of this print service.
   * @param passwd the password of the user.
   */
  public MultiDocPrintJobImpl(IppPrintService service, String user,
                              String passwd)
  {
    super(service, user, passwd);
  }

  /**
   * @see MultiDocPrintJob#print(MultiDoc, PrintRequestAttributeSet)
   */
  public void print(MultiDoc multiDoc, PrintRequestAttributeSet attributes)
      throws PrintException
  {
    // FIXME Implement
    throw new PrintException("Multidoc not yet supported by implementation.");
  }

}

redpajama_set_name: RedPajamaGithub


text:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "unity.h"

#include "touch_element/touch_element_private.h"
#include "touch_element/touch_slider.h"

static const touch_pad_t slider_channel_array[5] = {
    TOUCH_PAD_NUM1,
    TOUCH_PAD_NUM2,
    TOUCH_PAD_NUM3,
    TOUCH_PAD_NUM4,
    TOUCH_PAD_NUM5
};
static const float slider_sens_array[5] = {
    0.1F,
    0.1F,
    0.1F,
    0.1F,
    0.1F
};
const uint8_t SLIDER_CHANNEL_NUM = sizeof(slider_channel_array) / sizeof(touch_pad_t);

typedef struct {
    QueueHandle_t valid_msg_handle;
    SemaphoreHandle_t response_sig_handle;
} test_monitor_t;

/* ------------------------------------------------------------------------------------------------------------------ */
void test_slider_event_simulator(touch_slider_handle_t slider_handle, touch_slider_event_t slider_event, uint32_t random);
void test_slider_event_check(touch_elem_message_t *valid_message, touch_elem_message_t *current_message);
static void test_slider_callback_check(touch_slider_handle_t current_handle, touch_slider_message_t *current_message, touch_elem_message_t *valid_message);
void test_slider_event_trigger_and_check(touch_slider_handle_t handle, touch_slider_event_t slider_event, uint32_t random_channel);
void test_slider_callback_trigger_and_check(touch_slider_handle_t handle, touch_slider_event_t slider_event, bool should_trigger, test_monitor_t *monitor, uint32_t random_channel);
/* ------------------------------------------------ Dispatch method test -------------------------------------------- */
static void test_slider_disp_event(void);
static void test_slider_disp_callback(void);
static void test_slider_handler(touch_slider_handle_t handle, touch_slider_message_t *message, void *arg);
/* ------------------------------------------------------------------------------------------------------------------ */

TEST_CASE("Touch slider dispatch methods test", "[slider][touch_element]")
{
    touch_elem_global_config_t global_config = TOUCH_ELEM_GLOBAL_DEFAULT_CONFIG();
    TEST_ESP_OK(touch_element_install(&global_config));
    test_slider_disp_event();
    test_slider_disp_callback();
    touch_element_uninstall();
}

void test_slider_event_simulator(touch_slider_handle_t slider_handle, touch_slider_event_t slider_event, uint32_t random)
{
    te_slider_handle_t te_slider = (te_slider_handle_t) slider_handle;
    touch_pad_t channel = te_slider->device[random % te_slider->channel_sum]->channel;
    if (slider_event == TOUCH_SLIDER_EVT_ON_PRESS) {
        touch_pad_set_cnt_mode(channel, TOUCH_PAD_SLOPE_3, TOUCH_PAD_TIE_OPT_DEFAULT);
    } else if (slider_event == TOUCH_SLIDER_EVT_ON_RELEASE) {
        touch_pad_set_cnt_mode(channel, TOUCH_PAD_SLOPE_7, TOUCH_PAD_TIE_OPT_DEFAULT);
    }
}

void test_slider_event_check(touch_elem_message_t *valid_message, touch_elem_message_t *current_message)
{
    TEST_ASSERT_MESSAGE(current_message->handle == valid_message->handle, "check handle failed");
    TEST_ASSERT_MESSAGE(current_message->element_type == valid_message->element_type, "check element type failed");
    const touch_slider_message_t *valid_slider_message = touch_slider_get_message(valid_message);
    const touch_slider_message_t *current_slider_message = touch_slider_get_message(current_message);
    TEST_ASSERT_MESSAGE(current_slider_message->event == valid_slider_message->event, "check event failed");
}

static void test_slider_callback_check(touch_slider_handle_t current_handle, touch_slider_message_t *current_message, touch_elem_message_t *valid_message)
{
    const touch_slider_message_t *valid_slider_message = touch_slider_get_message(valid_message);
    TEST_ASSERT_MESSAGE(valid_message->handle == current_handle, "check handle failed");
    TEST_ASSERT_MESSAGE(valid_message->element_type == TOUCH_ELEM_TYPE_SLIDER, "check element type failed");
    TEST_ASSERT_MESSAGE(valid_slider_message->event == current_message->event, "check event failed");
}

void test_slider_event_trigger_and_check(touch_slider_handle_t handle, touch_slider_event_t slider_event, uint32_t random_channel)
{
    touch_elem_message_t valid_message, current_message;
    touch_slider_message_t slider_message;
    valid_message.handle = handle;
    valid_message.element_type = TOUCH_ELEM_TYPE_SLIDER;
    slider_message.event = slider_event;
    memcpy(valid_message.child_msg, &slider_message, sizeof(touch_slider_message_t));
    test_slider_event_simulator(handle, slider_event, random_channel);
    esp_err_t ret = touch_element_message_receive(&current_message, 300);
    TEST_ASSERT_MESSAGE(ret == ESP_OK, "slider event receive timeout");
    test_slider_event_check(&valid_message, &current_message);
}

void test_slider_callback_trigger_and_check(touch_slider_handle_t handle, touch_slider_event_t slider_event, bool should_trigger, test_monitor_t *monitor, uint32_t random_channel)
{
    if (should_trigger) {
        touch_elem_message_t valid_message = {
            .handle = handle,
            .element_type = TOUCH_ELEM_TYPE_SLIDER,
            .arg = NULL
        };
        touch_slider_message_t slider_message = {
            .event = slider_event,
            .position = 0  //No use
        };
        memcpy(valid_message.child_msg, &slider_message, sizeof(touch_slider_message_t));  //Construct valid_message
        xQueueSend(monitor->valid_msg_handle, &valid_message, portMAX_DELAY);
    }

    test_slider_event_simulator(handle, slider_event, random_channel);  //Trigger signal

    BaseType_t os_ret = xSemaphoreTake(monitor->response_sig_handle, pdMS_TO_TICKS(300));
    if (should_trigger) {
        TEST_ASSERT_MESSAGE(os_ret == pdPASS, "Button queue timeout");
    } else {
        TEST_ASSERT_MESSAGE(os_ret == pdFALSE, "Button invalid trigger");
    }
}

static void test_slider_disp_event(void)
{
    touch_slider_handle_t slider_handle;
    touch_slider_global_config_t global_config = TOUCH_SLIDER_GLOBAL_DEFAULT_CONFIG();
    TEST_ESP_OK(touch_slider_install(&global_config));
    /*< Create Touch Slider */
    touch_slider_config_t slider_config = {
        .channel_array = slider_channel_array,
        .sensitivity_array = slider_sens_array,
        .channel_num = SLIDER_CHANNEL_NUM,
        .position_range = 101
    };
    TEST_ESP_OK(touch_slider_create(&slider_config, &slider_handle));
    TEST_ESP_OK(touch_slider_subscribe_event(slider_handle, TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE, (void *) slider_handle));
    TEST_ESP_OK(touch_slider_set_dispatch_method(slider_handle, TOUCH_ELEM_DISP_EVENT));
    TEST_ESP_OK(touch_element_start());

    vTaskDelay(pdMS_TO_TICKS(500));  //Mention in README, code-block-1

    srandom((unsigned int)time(NULL));
    //10 times random (x channels) press/release test
    printf("Touch slider event test start\n");
    for (int i = 0; i < 10; i++) {
        printf("Touch slider event test... (%d/10)\n", i + 1);
        uint32_t random_channel = random() % SLIDER_CHANNEL_NUM;
        test_slider_event_trigger_and_check(slider_handle, TOUCH_SLIDER_EVT_ON_PRESS, random_channel);
        test_slider_event_trigger_and_check(slider_handle, TOUCH_SLIDER_EVT_ON_RELEASE, random_channel);
    }
    printf("Touch slider event test finish\n");
    TEST_ESP_OK(touch_element_stop());
    TEST_ESP_OK(touch_slider_delete(slider_handle));
    touch_slider_uninstall();
}

static void test_slider_disp_callback(void)
{
    test_monitor_t monitor;
    monitor.valid_msg_handle = xQueueCreate(10, sizeof(touch_elem_message_t));
    monitor.response_sig_handle = xSemaphoreCreateBinary();
    TEST_ASSERT(monitor.valid_msg_handle != NULL || monitor.response_sig_handle != NULL);

    touch_slider_handle_t slider_handle;
    touch_slider_global_config_t global_config = TOUCH_SLIDER_GLOBAL_DEFAULT_CONFIG();
    TEST_ESP_OK(touch_slider_install(&global_config));
    touch_slider_config_t slider_config = {
        .channel_array = slider_channel_array,
        .sensitivity_array = slider_sens_array,
        .channel_num = SLIDER_CHANNEL_NUM,
        .position_range = 101
    };
    TEST_ESP_OK(touch_slider_create(&slider_config, &slider_handle));
    TEST_ESP_OK(touch_slider_subscribe_event(slider_handle, TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE, (void *) &monitor));
    TEST_ESP_OK(touch_slider_set_dispatch_method(slider_handle, TOUCH_ELEM_DISP_CALLBACK));
    TEST_ESP_OK(touch_slider_set_callback(slider_handle, test_slider_handler));
    TEST_ESP_OK(touch_element_start());

    vTaskDelay(pdMS_TO_TICKS(500));  //Mention in README, code-block-1

    srandom((unsigned int)time(NULL));
    printf("Touch slider callback test start\n");
    for (int i = 0; i < 10; i++) {
        printf("Touch slider callback test... (%d/10)\n", i + 1);
        uint32_t random_channel = random() % SLIDER_CHANNEL_NUM;
        test_slider_callback_trigger_and_check(slider_handle, TOUCH_SLIDER_EVT_ON_PRESS, true, &monitor, random_channel);
        test_slider_callback_trigger_and_check(slider_handle, TOUCH_SLIDER_EVT_ON_RELEASE, true, &monitor, random_channel);
    }
    printf("Touch slider callback test finish\n");

    TEST_ESP_OK(touch_element_stop());
    TEST_ESP_OK(touch_slider_delete(slider_handle));
    touch_slider_uninstall();
    vQueueDelete(monitor.valid_msg_handle);
    vSemaphoreDelete(monitor.response_sig_handle);
}

static void test_slider_handler(touch_slider_handle_t handle, touch_slider_message_t *message, void *arg)
{
    test_monitor_t *monitor = (test_monitor_t *)arg;
    touch_elem_message_t valid_message;
    BaseType_t os_ret = xQueueReceive(monitor->valid_msg_handle, &valid_message, pdMS_TO_TICKS(200));  //Get the valid message for verification, 200ms timeout
    TEST_ASSERT_MESSAGE(os_ret == pdPASS, "test_slider_handler: queue timeout");

    test_slider_callback_check(handle, message, &valid_message);  //Verification

    xSemaphoreGive(monitor->response_sig_handle);
}


text:
RSpec.describe UsersController do
  describe "GET index" do
    it "succeeds when logged out" do
      get :index
      expect(response).to have_http_status(200)
    end

    it "succeeds when logged in" do
      login
      get :index
      expect(response).to have_http_status(200)
    end

    it "does not return deleted users" do
      user = create(:user, deleted: true)
      create_list(:user, 4)
      get :index
      expect(assigns(:users).length).to eq(4)
      expect(assigns(:users)).not_to include(user)
    end

    context "with moieties" do
      render_views

      it "displays the name" do
        create(:user, moiety: 'fed123', moiety_name: 'moietycolor')
        get :index
        expect(response.body).to include('moietycolor')
        expect(response.body).to include('fed123')
      end
    end
  end

  describe "GET new" do
    it "succeeds when logged out" do
      get :new
      expect(response).to have_http_status(200)
      expect(assigns(:page_title)).to eq('Sign Up')
      expect(controller.gon.min).to eq(User::MIN_USERNAME_LEN)
      expect(controller.gon.max).to eq(User::MAX_USERNAME_LEN)
    end

    it "complains when logged in" do
      login
      post :create
      expect(response).to redirect_to(continuities_path)
      expect(flash[:error]).to eq('You are already logged in.')
    end
  end

  describe "POST create" do
    it "complains when logged in" do
      login
      post :create
      expect(response).to redirect_to(continuities_path)
      expect(flash[:error]).to eq('You are already logged in.')
    end

    it "requires tos acceptance" do
      post :create
      expect(response).to render_template(:new)
      expect(flash[:error]).to eq("You must accept the Terms and Conditions to use the Constellation.")
      expect(assigns(:user)).not_to be_valid
      expect(assigns(:page_title)).to eq('Sign Up')
      expect(controller.gon.min).to eq(User::MIN_USERNAME_LEN)
      expect(controller.gon.max).to eq(User::MAX_USERNAME_LEN)
    end

    it "requires stupid captcha" do
      post :create, params: { tos: true }
      expect(response).to render_template(:new)
      expect(flash[:error]).to eq("Please check your math and try again.")
      expect(assigns(:user)).not_to be_valid
      expect(assigns(:page_title)).to eq('Sign Up')
    end

    it "requires valid fields" do
      post :create, params: { secret: "ALLHAILTHECOIN", tos: true, addition: '14' }
      expect(response).to render_template(:new)
      expect(flash[:error][:message]).to eq("There was a problem completing your sign up.")
      expect(assigns(:user)).not_to be_valid
      expect(assigns(:page_title)).to eq('Sign Up')
      expect(controller.gon.min).to eq(User::MIN_USERNAME_LEN)
      expect(controller.gon.max).to eq(User::MAX_USERNAME_LEN)
    end

    it "rejects short passwords" do
      user = build(:user).attributes.with_indifferent_access.merge(password: 'short', password_confirmation: 'short')
      post :create, params: { secret: 'ALLHAILTHECOIN', tos: true, addition: '14' }.merge(user: user)
      expect(response).to render_template(:new)
      expect(flash[:error][:message]).to eq('There was a problem completing your sign up.')
      expect(flash[:error][:array]).to eq(['Password is too short (minimum is 6 characters)'])
      expect(assigns(:user)).not_to be_valid
      expect(assigns(:page_title)).to eq('Sign Up')
    end

    it "signs you up" do
      pass = 'testpassword'
      user = build(:user).attributes.with_indifferent_access.merge(password: pass, password_confirmation: pass, email: 'testemail@example.com')

      expect {
        post :create, params: { secret: "ALLHAILTHECOIN", tos: true, addition: '14' }.merge(user: user)
      }.to change { User.count }.by(1)
      expect(response).to redirect_to(root_url)
      expect(flash[:success]).to eq("User created! You have been logged in.")

      new_user = assigns(:current_user)
      expect(new_user).not_to be_nil
      expect(new_user.username).to eq(user[:username])
      expect(new_user.authenticate(user[:password])).to eq(true)
      expect(new_user.email).to eq(user[:email])
      expect(new_user.read_only?).to eq(false)
    end

    it "creates reader account without secret" do
      pass = 'testpassword'
      user = build(:user).attributes.with_indifferent_access.merge(password: pass, password_confirmation: pass, email: 'testemail@example.com')

      post :create, params: { tos: true, addition: '14' }.merge(user: user)

      expect(response).to redirect_to(root_url)
      expect(flash[:success]).to eq("User created! You have been logged in.")
      expect(assigns(:user).read_only?).to eq(true)
    end

    it "allows long passwords" do
      pass = 'this is a long password to test the password validation feature and to see if it accepts this'
      user = build(:user).attributes.with_indifferent_access.merge(password: pass, password_confirmation: pass)
      expect {
        post :create, params: { secret: 'ALLHAILTHECOIN', tos: true, addition: '14' }.merge(user: user)
      }.to change { User.count }.by(1)
      expect(response).to redirect_to(root_url)
      expect(flash[:success]).to eq("User created! You have been logged in.")
      expect(assigns(:current_user)).not_to be_nil
      expect(assigns(:current_user).username).to eq(user['username'])
      expect(assigns(:current_user).authenticate(pass)).to eq(true)
    end

    it "strips spaces" do
      user = build(:user, username: 'withspace ').attributes
      user = user.with_indifferent_access.merge(password: 'password', password_confirmation: 'password')
      post :create, params: { secret: 'ALLHAILTHECOIN', tos: true, addition: '14' }.merge(user: user)
      expect(flash[:success]).to eq("User created! You have been logged in.")
      expect(assigns(:current_user).username).to eq('withspace')
    end
  end

  describe "GET show" do
    it "requires valid user" do
      get :show, params: { id: -1 }
      expect(response).to redirect_to(users_url)
      expect(flash[:error]).to eq("User could not be found.")
    end

    it "requires non-deleted user" do
      user = create(:user, deleted: true)
      get :show, params: { id: user.id }
      expect(response).to redirect_to(users_url)
      expect(flash[:error]).to eq("User could not be found.")
    end

    it "works when logged out" do
      user = create(:user)
      get :show, params: { id: user.id }
      expect(response.status).to eq(200)
    end

    it "works when logged in as someone else" do
      user = create(:user)
      login
      get :show, params: { id: user.id }
      expect(response.status).to eq(200)
    end

    it "works when logged in as yourself" do
      user = create(:user)
      login_as(user)
      get :show, params: { id: user.id }
      expect(response.status).to eq(200)
    end

    it "sets the correct variables" do
      user = create(:user)
      posts = Array.new(3) { create(:post, user: user) }
      create(:post)
      get :show, params: { id: user.id }
      expect(assigns(:page_title)).to eq(user.username)
      expect(assigns(:posts).to_a).to match_array(posts)
    end

    it "sorts posts correctly" do
      user = create(:user)
      post1 = create(:post)
      post2 = create(:post, user: user)
      post3 = create(:post)
      create(:reply, post: post3, user: user)
      create(:reply, post: post2)
      create(:reply, post: post1, user: user)
      create(:post)
      get :show, params: { id: user.id }
      expect(assigns(:posts).to_a).to eq([post1, post2, post3])
    end

    it "calculates OpenGraph meta for a bare user" do
      user = create(:user, username: 'user')

      get :show, params: { id: user.id }

      meta_og = assigns(:meta_og)
      expect(meta_og.keys).to match_array([:url, :title, :description])
      expect(meta_og[:url]).to eq(user_url(user))
      expect(meta_og[:title]).to eq('user')
      expect(meta_og[:description]).to eq('No continuities.')
    end

    it "calculates OpenGraph meta for user with settings and an avatar" do
      user = create(:user, username: 'user')
      user.update!(avatar: create(:icon))
      create(:board, name: "Board 1", creator: user)
      create(:board, name: "Board 2", creator: user)

      get :show, params: { id: user.id }

      meta_og = assigns(:meta_og)
      expect(meta_og.keys).to match_array([:url, :title, :description, :image])
      expect(meta_og[:url]).to eq(user_url(user))
      expect(meta_og[:title]).to eq('user')
      expect(meta_og[:description]).to eq('Continuities: Board 1, Board 2')
      expect(meta_og[:image].keys).to match_array([:src, :width, :height])
      expect(meta_og[:image][:src]).to eq(user.avatar.url)
      expect(meta_og[:image][:width]).to eq('75')
      expect(meta_og[:image][:width]).to eq('75')
    end
  end

  describe "GET edit" do
    it "requires login" do
      get :edit, params: { id: -1 }
      expect(response).to redirect_to(root_url)
      expect(flash[:error]).to eq("You must be logged in to view that page.")
    end

    it "requires own user" do
      user = create(:user)
      login
      get :edit, params: { id: user.id }
      expect(response).to redirect_to(continuities_url)
      expect(flash[:error]).to eq('You do not have permission to edit that user.')
    end

    it "succeeds" do
      user_id = login
      get :edit, params: { id: user_id }
      expect(response.status).to eq(200)
    end

    context "with views" do
      render_views

      it "displays options" do
        user_id = login
        get :edit, params: { id: user_id }
      end
    end
  end

  describe "PUT update" do
    it "requires login" do
      put :update, params: { id: -1 }
      expect(response).to redirect_to(root_url)
      expect(flash[:error]).to eq("You must be logged in to view that page.")
    end

    it "requires valid params" do
      user = create(:user)
      login_as(user)
      put :update, params: { id: user.id, user: { moiety: 'A' } }
      expect(response).to render_template(:edit)
      expect(flash[:error][:message]).to eq('There was a problem updating your account.')
    end

    it "does not update another user" do
      user1 = create(:user)
      user2 = create(:user)
      login_as(user1)
      put :update, params: { id: user2.id, user: { email: 'bademail@example.com' } }
      expect(response).to redirect_to(continuities_url)
      expect(flash[:error]).to eq('You do not have permission to edit that user.')
      expect(user2.reload.email).not_to eq('bademail@example.com')
    end

    it "works with valid params" do
      user = create(:user)
      login_as(user)

      user_details = {
        email: 'testuser314@example.com',
        email_notifications: true,
        moiety_name: 'Testmoiety',
        moiety: 'AAAAAA',
        favorite_notifications: false,
        show_user_in_switcher: false,
        default_character_split: 'none',
      }

      # ensure new values are different, so test tests correct things
      user_details.each do |key, value|
        expect(user.public_send(key)).not_to eq(value)
      end

      put :update, params: { id: user.id, user: user_details }
      expect(response).to redirect_to(edit_user_url(user))
      expect(flash[:success]).to eq('Changes saved successfully.')

      user.reload
      user_details.each do |key, value|
        expect(user.public_send(key)).to eq(value)
      end
    end

    it "updates username and still allows login" do
      pass = 'password123'
      user = create(:user, username: 'user123', password: pass)
      expect(user.authenticate(pass)).to eq(true)
      login_as(user)
      put :update, params: { id: user.id, user: { username: 'user124' } }
      expect(response).to redirect_to(edit_user_url(user))
      expect(flash[:success]).to eq('Changes saved successfully.')

      user.reload
      expect(user.username).to eq('user124')
      expect(user.authenticate(pass)).to eq(true)
      expect(user.authenticate(pass + '1')).not_to eq(true)
    end

    context "tos" do
      it "saves update" do
        user = create(:user, tos_version: nil)
        login_as(user)
        put :update, params: { id: user.id, tos_check: true }
        expect(user.reload.tos_version).to eq(User::CURRENT_TOS_VERSION)
        expect(flash[:success]).to eq('Acceptance saved successfully. Thank you!')
        expect(response).to redirect_to(root_url)
      end

      it "handles failures" do
        user = create(:user, tos_version: nil)
        login_as(user)
        user.update_columns(username: 'a') # too short to validate # rubocop:disable Rails/SkipsModelValidations
        put :update, params: { id: user.id, tos_check: true }
        expect(user.reload.tos_version).to be_nil
        expect(flash[:error][:message]).to eq('There was an error saving your changes. Please try again.')
        expect(flash[:error][:array]).to eq(["Username is too short (minimum is 3 characters)"])
        expect(response).to render_template('about/accept_tos')
      end
    end
  end

  describe "PUT password" do
    it "requires login" do
      put :password, params: { id: -1 }
      expect(response).to redirect_to(root_url)
      expect(flash[:error]).to eq("You must be logged in to view that page.")
    end

    it "requires own user" do
      user = create(:user)
      login
      put :password, params: { id: user.id }
      expect(response).to redirect_to(continuities_url)
      expect(flash[:error]).to eq('You do not have permission to edit that user.')
    end

    it "requires correct password" do
      pass = 'testpass'
      fakepass = 'wrongpass'
      newpass = 'newpass'
      user = create(:user, password: 'testpass')
      login_as(user)

      put :password, params: {
        id: user.id,
        old_password: fakepass,
        user: { password: newpass, password_confirmation: newpass },
      }

      expect(response).to render_template(:edit)
      expect(flash[:error]).to eq('Incorrect password entered.')
      user.reload
      expect(user.authenticate(pass)).to eq(true)
      expect(user.authenticate(fakepass)).not_to eq(true)
      expect(user.authenticate(newpass)).not_to eq(true)
    end

    it "requires valid password" do
      pass = 'testpass'
      newpass = 'bad'
      user = create(:user, password: pass)
      login_as(user)

      put :password, params: {
        id: user.id,
        old_password: pass,
        user: { password: newpass, password_confirmation: newpass },
      }

      expect(response).to render_template(:edit)
      expect(flash[:error][:message]).to eq('There was a problem with your changes.')
      expect(user.authenticate(pass)).to eq(true)
      expect(user.authenticate(newpass)).not_to eq(true)
    end

    it "requires valid confirmation" do
      pass = 'testpass'
      newpass = 'newpassword'
      user = create(:user, password: pass)
      login_as(user)

      put :password, params: {
        id: user.id,
        old_password: pass,
        user: { password: newpass, password_confirmation: 'wrongconfirmation' },
      }

      expect(response).to render_template(:edit)
      expect(flash[:error][:message]).to eq('There was a problem with your changes.')
      user.reload
      expect(user.authenticate(pass)).to eq(true)
      expect(user.authenticate(newpass)).not_to eq(true)
    end

    it "succeeds" do
      pass = 'testpass'
      newpass = 'newpassword'
      user = create(:user, password: pass)
      login_as(user)

      put :password, params: {
        id: user.id,
        old_password: pass,
        user: { password: newpass, password_confirmation: newpass },
      }

      expect(response).to redirect_to(edit_user_url(user))
      expect(flash[:success]).to eq('Changes saved successfully.')
      user.reload
      expect(user.authenticate(pass)).not_to eq(true)
      expect(user.authenticate(newpass)).to eq(true)
    end

    it "has more tests" do
      skip
    end
  end

  describe "GET search" do
    it "works logged in" do
      login
      get :search
      expect(response).to have_http_status(200)
      expect(assigns(:search_results)).to be_nil
    end

    it "works logged out" do
      get :search
      expect(response).to have_http_status(200)
      expect(assigns(:search_results)).to be_nil
    end

    it "subsearches correctly" do
      create(:user, username: 'baa') # firstuser
      create(:user, username: 'aba') # miduser
      create(:user, username: 'aab') # enduser
      create(:user, username: 'aaa') # notuser
      User.all.each do |user|
        create(:user, username: user.username.upcase + 'c')
      end
      get :search, params: { commit: 'Search', username: 'b' }
      expect(response).to have_http_status(200)
      expect(assigns(:search_results)).to be_present
      expect(assigns(:search_results).count).to eq(6)
    end

    it "orders users correctly" do
      create(:user, username: 'baa')
      create(:user, username: 'aba')
      create(:user, username: 'aab')
      get :search, params: { commit: 'Search', username: 'b' }
      expect(assigns(:search_results).map(&:username)).to eq(['aab', 'aba', 'baa'])
    end

    it "does not include deleted users" do
      user = create(:user, deleted: true)
      create_list(:user, 4)
      get :search, params: { commit: 'Search', username: 'Doe' }
      expect(assigns(:search_results).length).to eq(4)
      expect(assigns(:search_results)).not_to include(user)
    end

    it "does not include deleted users even on exact match" do
      create(:user, username: "testUser", deleted: true)
      create_list(:user, 4)
      get :search, params: { commit: 'Search', username: "testUser" }
      expect(assigns(:search_results)).to be_empty
    end
  end

  describe "GET output" do
    let(:user) { create(:user) }

    it "requires login" do
      get :output, params: { id: user.id }
      expect(response).to redirect_to(root_url)
      expect(flash[:error]).to eq("You must be logged in to view that page.")
    end

    it "handles invalid date" do
      login_as(user)
      get :output, params: { id: user.id, day: 'asdf' }
      expect(response).to have_http_status(200)
      expect(flash[:error]).to eq('Please note that this page does not include edit history.')
      expect(assigns(:total)).to eq(0)
    end

    it "handles out of range date" do
      login_as(user)
      get :output, params: { id: user.id, day: '2018-28-10' }
      expect(response).to have_http_status(200)
      expect(flash[:error]).to eq('Please note that this page does not include edit history.')
      expect(assigns(:total)).to eq(0)
    end

    it "works for default of today" do
      login_as(user)

      Timecop.freeze(Time.zone.now) do
        post = create(:post, user: user, content: 'two words')
        create_list(:reply, 2, user: user, post: post, content: 'three words each')
        get :output, params: { id: user.id }
      end

      expect(response).to have_http_status(200)
      expect(flash[:error]).to eq('Please note that this page does not include edit history.')
      expect(assigns(:total)).to eq(8)
    end

    it "works for previous days" do
      login_as(user)

      day = Time.zone.now.to_date - 1.day
      Timecop.freeze(day) do
        post = create(:post, user: user, content: 'two words')
        create_list(:reply, 2, user: user, post: post, content: 'three words each')
      end
      create(:post, user: user, content: 'not in word count')

      get :output, params: { id: user.id, day: day.to_s }
      expect(response).to have_http_status(200)
      expect(flash[:error]).to eq('Please note that this page does not include edit history.')
      expect(assigns(:total)).to eq(8)
    end
  end
end


text:
<?php

namespace Lighthouse\Core;

abstract class Entity
{
    public function __construct(array $params = [])
    {
        $this->setupWith($params);
    }

    /**
     * @param $data
     *
     * @return Entity
     */
    private function setupWith($params)
    {
        foreach ($params as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }

    public function toArray()
    {
        return get_object_vars($this);
    }
}


text:
package org.shirdrn.smart.dag;

@InterfaceAudience.Private
public final class RunningVertex extends DAGMetric {

	private final Vertex<?> vertex;

	public RunningVertex(Vertex<?> vertex) {
		super();
		this.vertex = vertex;
	}
	public RunningVertex(String name, Vertex<?> vertex) {
		super(name);
		this.vertex = vertex;
	}

	public Vertex<?> getVertex() {
		return vertex;
	}

 }


text:
layout: post
title: Path to OSCP - Part 10, Days 9, 10 and 11
date: 2016-03-10 07:03:14.000000000 +03:00
type: post
published: true
status: publish
categories:
- Path to OSCP
tags:
- oscp
- vuln
meta:
  _rest_api_published: '1'
  _rest_api_client_id: '43452'
  _publicize_job_id: '20607926205'
  publicize_linkedin_url: https://www.linkedin.com/updates?discuss=&scope=106127&stype=M&topic=6113544514813648896&type=U&a=TODB
  _publicize_done_13656638: '1'
  _wpas_done_13596824: '1'
  _publicize_done_external: a:2:{s:7:"twitter";a:1:{i:13596827;s:50:"https://twitter.com/unfo/status/707778831340310528";}s:8:"facebook";a:1:{i:13596832;s:38:"https://facebook.com/10154037546183281";}}
  _publicize_done_13656641: '1'
  _wpas_done_13596827: '1'
  publicize_twitter_user: unfo
  _publicize_done_13656646: '1'
  _wpas_done_13596832: '1'
  publicize_tumblr_url: http://.tumblr.com/post/140781173995
  _publicize_done_13656651: '1'
  _wpas_done_13596836: '1'
  publicize_google_plus_url: https://plus.google.com/+JanWikholm/posts/gZkQ2eYY8LF
  _publicize_done_13855399: '1'
  _wpas_done_13786862: '1'
author:
  login: jwikholm
  email: jw@jw.fi
  display_name: Jan Wikholm
  first_name: ''
  last_name: ''
---

https://www.youtube.com/watch?v=0x75b9xA2Og

[ sorry for the rasping sounds caused by the mic rubbing against my coarse beard :/ ]

I barely got myself to do this vlog, because I wanted to just try and get root! But I really needed to do it so that a lot of this new stuff doesn't get lost in my enthusiasm.

PIVOT!

My first pivot from a compromised host into a new network behind a firewall!

If you don't know what pivoting is, this Wikipedia paragraph explains:

Pivoting refers to a method used by penetration testers that uses the compromised system to attack other systems on the same network to avoid restrictions such as firewall configurations, which may prohibit direct access to all machines. For example, if an attacker compromises a web server on a corporate network, the attacker can then use the compromised web server to attack other systems on the network. These types of attacks are often called multi-layered attacks. Pivoting is also known as island hopping.

So yeah! I managed to pivot my way behind a firewall. And there was much rejoicing!

Have been using Metasploit to help me do recon / probing / exploiting. Also; the hosts and services commands in msf are really awesome for gathering information on the target network and systems.

The grokking has begun

I have truly begun to grok the attacker mindset! Instead of being in a defensive traditional blue team reactive stance, I am starting to think like an attacker. If I see someone in our security monitoring systems trying to bruteforce / attack in general some services we have, my gut tells me that I should do an nmap scan of the services to check what the attackers see -- and then check searchsploit for any tips.

Real world use

I have already started to see real world use for the skills and tools I am using on this course.

netsh trace to capture traffic without wireshark / pcap.

Nice set of PDF cheat sheets from packetlife.

Misconfigurations and demo sites will kill your infosec posture.

That might be a slightly clickbait-y headline, but there is a kernel of truth there. It doesn't matter how shiny and blinky your new Next-Gen-Semantic-AI-Software-Defined-Matrix-Neural-Firewall is, if you have ftp/ssh/whatever open to the world and your admins have by accident left some very simple to guess user credentials on the system, you are in for a bad day.

"But SELinux/AppArmor/GRC will save the day!" I hear you say. Yes! It might. Hence you need skilled and motivated admins to do the needful i.e. remove the mis- from misconfiugration.

Excellent example of this is this new post on Facebook bug bounty, where a smart guy bagged $15'000 for basically finding that the beta (and some dev) version of Facebook didn't have the proper rate-limiting in place for a security related API: the forgot password feature.

You woulda thunk that it would be like base level of security that people will try to bruteforce these services and they should not be allowed to.

Don't assume something's fixed. Poke it with a stick and see if it breaks!

And on that bombshell, it's time to end the show...!

[Edit:]

Forgot to add this Youtube link:

https://www.youtube.com/watch?v=vdnCZZepcUU