text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="df44723c-0ae3-49c9-bc49-3e2c0ab24767" name="Default" comment="">
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/ast.py" />
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/sql_parsers.py" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/pysql.py" afterPath="$PROJECT_DIR$/pysql.py" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/sql_constants.py" afterPath="$PROJECT_DIR$/sql_constants.py" />
    </list>
    <ignored path="pysql.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
    <option name="REVERSE_PATCH" value="false" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="FavoritesManager">
    <favorites_list name="pysql" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="pysql.py" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/pysql.py">
          <provider selected="true" editor-type-id="text-editor">
            <state line="453" column="48" selection-start="12575" selection-end="12575" vertical-scroll-proportion="0.0">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="sql_parsers.py" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/sql_parsers.py">
          <provider selected="true" editor-type-id="text-editor">
            <state line="33" column="26" selection-start="810" selection-end="810" vertical-scroll-proportion="0.0">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="sql_test.py" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/sql_test.py">
          <provider selected="true" editor-type-id="text-editor">
            <state line="14" column="43" selection-start="758" selection-end="758" vertical-scroll-proportion="0.0">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="sql_constants.py" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/sql_constants.py">
          <provider selected="true" editor-type-id="text-editor">
            <state line="191" column="1" selection-start="4692" selection-end="4692" vertical-scroll-proportion="0.0">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="ast.py" pinned="false" current="true" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/ast.py">
          <provider selected="true" editor-type-id="text-editor">
            <state line="20" column="32" selection-start="466" selection-end="466" vertical-scroll-proportion="0.31850117">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="false" />
    </FindUsagesManager>
  </component>
  <component name="Git.Settings">
    <option name="CHECKOUT_INCLUDE_TAGS" value="false" />
    <option name="UPDATE_CHANGES_POLICY" value="STASH" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="changedFiles">
      <list>
        <option value="$PROJECT_DIR$/sql_opertors.py" />
        <option value="C:/Python26/Lib/sre_parse.py" />
        <option value="$PROJECT_DIR$/sql_test.py" />
        <option value="$PROJECT_DIR$/pysql.py" />
        <option value="$PROJECT_DIR$/sql_parsers.py" />
        <option value="$PROJECT_DIR$/sql_constants.py" />
        <option value="$PROJECT_DIR$/ast.py" />
      </list>
    </option>
  </component>
  <component name="ProjectLevelVcsManager">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="Favorites" />
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="pysql" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="pysql" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="pysql" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="WebServerToolWindowFactoryState" value="true" />
    <property name="recentsLimit" value="5" />
    <property name="options.lastSelected" value="project.propVCSSupport.Mappings" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="options.searchVisible" value="true" />
  </component>
  <component name="PublishConfig">
    <servers>
      <server id="bf7ecff0-aa02-4ca2-9077-23f6d7aa9f75">
        <serverdata>
          <mappings>
            <mapping local="$PROJECT_DIR$" />
          </mappings>
        </serverdata>
      </server>
    </servers>
  </component>
  <component name="RunManager" selected="Python.Run Server">
    <configuration default="true" type="PythonUnitTestConfigurationType" factoryName="Python's unittest">
      <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" />
      <module name="pysql" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="PATTERN" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <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" />
      <module name="pysql" />
      <option name="SCRIPT_NAME" value="" />
      <option name="PARAMETERS" value="" />
      <method />
    </configuration>
    <configuration default="true" type="PythonDocTestRunConfigurationType" factoryName="Python's 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" />
      <module name="pysql" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="PATTERN" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <method />
    </configuration>
    <configuration default="false" name="Run Server" 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="C:/Python26/python.exe" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="IS_MODULE_SDK" value="false" />
      <module name="pysql" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/pysql.py" />
      <option name="PARAMETERS" value="" />
      <RunnerSettings RunnerId="PyDebugRunner" />
      <RunnerSettings RunnerId="PythonRunner" />
      <ConfigurationWrapper RunnerId="PyDebugRunner" />
      <ConfigurationWrapper RunnerId="PythonRunner" />
      <method />
    </configuration>
    <configuration default="false" name="Run All Tests" type="PythonUnitTestConfigurationType" factoryName="Python's unittest">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="C:/Python26/python.exe" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <module name="pysql" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="$PROJECT_DIR$" />
      <option name="PATTERN" value="" />
      <option name="TEST_TYPE" value="TEST_FOLDER" />
      <RunnerSettings RunnerId="PythonRunner" />
      <ConfigurationWrapper RunnerId="PythonRunner" />
      <method />
    </configuration>
    <list size="2">
      <item index="0" class="java.lang.String" itemvalue="Python.Run Server" />
      <item index="1" class="java.lang.String" itemvalue="Python's unittest.Run All Tests" />
    </list>
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration" maxAnnotateRevisions="500">
    <option name="USER" value="" />
    <option name="PASSWORD" value="" />
    <option name="LAST_MERGED_REVISION" />
    <option name="UPDATE_RUN_STATUS" value="false" />
    <option name="MERGE_DRY_RUN" value="false" />
    <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
    <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
    <option name="IGNORE_SPACES_IN_MERGE" value="false" />
    <option name="DETECT_NESTED_COPIES" value="true" />
    <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
    <configuration useDefault="true">C:\Users\Jon\AppData\Roaming\Subversion</configuration>
    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="df44723c-0ae3-49c9-bc49-3e2c0ab24767" name="Default" comment="" />
      <created>1305392920280</created>
      <updated>1305392920280</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="-8" y="-8" width="1696" height="1036" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="CSS-X-Fire" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24755502" sideWeight="0.49602723" order="4" side_tool="true" content_ui="tabs" />
      <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.19070904" sideWeight="0.70520234" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.27514452" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24755502" sideWeight="0.49602723" order="3" side_tool="false" content_ui="combo" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2947977" sideWeight="0.9988439" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32947975" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" 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" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="VcsManagerConfiguration">
    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
    <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
    <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
    <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
    <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
    <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
    <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
    <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
    <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
    <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
    <option name="LAST_COMMIT_MESSAGE" value="Added real SQL string scanning, slightly improved parsing." />
    <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
    <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
    <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
    <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
    <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
    <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
    <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
    <option name="ACTIVE_VCS_NAME" />
    <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
    <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
    <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
    <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
    <MESSAGE value="First commit." />
    <MESSAGE value="Added proof-of-concept MongoDB querying." />
    <MESSAGE value="Added real SQL string scanning, slightly improved parsing." />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://C:/Python26/Lib/socket.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="182" column="25" selection-start="6122" selection-end="6122" vertical-scroll-proportion="0.29454544" />
      </provider>
    </entry>
    <entry file="file://$USER_HOME$/.PyCharm10/system/python_stubs/-891257481/__builtin__.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="4915" column="8" selection-start="167805" selection-end="167887" vertical-scroll-proportion="0.0">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python26/Lib/SocketServer.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="321" column="0" selection-start="11182" selection-end="11182" vertical-scroll-proportion="0.93333334">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python26/Lib/site-packages/pymongo/collection.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="961" column="0" selection-start="39385" selection-end="39385" vertical-scroll-proportion="0.6333333">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python26/Lib/unittest.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="278" column="0" selection-start="9830" selection-end="9830" vertical-scroll-proportion="0.33333334">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://C:/Python26/Lib/sre_parse.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="518" column="47" selection-start="16748" selection-end="16748" vertical-scroll-proportion="0.9451115">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/pysql.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="453" column="48" selection-start="12575" selection-end="12575" vertical-scroll-proportion="0.0">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/sql_test.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="14" column="43" selection-start="758" selection-end="758" vertical-scroll-proportion="0.0">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/sql_parsers.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="33" column="26" selection-start="810" selection-end="810" vertical-scroll-proportion="0.0">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/sql_constants.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="191" column="1" selection-start="4692" selection-end="4692" vertical-scroll-proportion="0.0">
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/ast.py">
      <provider selected="true" editor-type-id="text-editor">
        <state line="20" column="32" selection-start="466" selection-end="466" vertical-scroll-proportion="0.31850117">
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
import * as Common from '../../core/common/common.js';
import * as UI from '../../ui/legacy/legacy.js';

import type * as Screencast from './screencast.js';

let loadedScreencastModule: (typeof Screencast|undefined);

async function loadScreencastModule(): Promise<typeof Screencast> {
  if (!loadedScreencastModule) {
    loadedScreencastModule = await import('./screencast.js');
  }
  return loadedScreencastModule;
}

UI.Toolbar.registerToolbarItem({
  async loadItem() {
    const Screencast = await loadScreencastModule();
    return Screencast.ScreencastApp.ToolbarButtonProvider.instance();
  },
  order: 1,
  location: UI.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_LEFT,
  showLabel: undefined,
  condition: undefined,
  separator: undefined,
  actionId: undefined,
});

Common.AppProvider.registerAppProvider({
  async loadAppProvider() {
    const Screencast = await loadScreencastModule();
    return Screencast.ScreencastApp.ScreencastAppProvider.instance();
  },
  order: 1,
  condition: undefined,
});

UI.ContextMenu.registerItem({
  location: UI.ContextMenu.ItemLocation.MAIN_MENU,
  order: 10,
  actionId: 'components.request-app-banner',
});

redpajama_set_name: RedPajamaGithub


text:
from urwid import WidgetWrap, Text, Pile
from ubuntui.utils import Color

class StatusBarWidget(WidgetWrap):

    """ Displays text in the footers status area."""

    INFO = "[INFO]"
    ERROR = "[ERROR]"
    ARROW = " \u21e8 "

    def __init__(self, text=''):
        self._pending_deploys = Text('')
        self._status_line = Text(text, align="center")
        self._status_extra = self._build_status_extra()
        status = Pile([self._pending_deploys,
                       self._status_extra])
        super().__init__(status)

    def _build_status_extra(self):
        return Color.frame_footer(
            Pile([
                self._status_line
            ]))

    def message(self, text):
        """Write `text` on the footer."""
        self._status_line.set_text(text)

    def error_message(self, text):
        self.message([('status_error', self.ERROR),
                      self.ARROW + text])

    def info_message(self, text):
        self.message([('status_info', self.INFO),
                      self.ARROW + text])

    def set_pending_deploys(self, pending_deploys):
        if len(pending_deploys) > 0:
            msg = "Pending deploys: " + ", ".join(pending_deploys)
            self._pending_deploys.set_text(msg)
        else:
            self._pending_deploys.set_text('')

    def clear(self):
        """Clear the text."""
        self._w.set_text('')


text:
package volume

import (
	"errors"
	"fmt"

	"k8s.io/kubernetes/pkg/api/resource"
	"k8s.io/kubernetes/pkg/volume/util"
)

var _ MetricsProvider = &metricsDu{}

// metricsDu represents a MetricsProvider that calculates the used and available
// Volume space by executing the "du" command and gathering filesystem info for the Volume path.
type metricsDu struct {
	// the directory path the volume is mounted to.
	path string
}

// NewMetricsDu creates a new metricsDu with the Volume path.
func NewMetricsDu(path string) MetricsProvider {
	return &metricsDu{path}
}

// See MetricsProvider.GetMetrics
// GetMetrics calculates the volume usage and device free space by executing "du"
// and gathering filesystem info for the Volume path.
func (md *metricsDu) GetMetrics() (*Metrics, error) {
	metrics := &Metrics{}
	if md.path == "" {
		return metrics, errors.New("no path defined for disk usage metrics.")
	}

	err := md.runDu(metrics)
	if err != nil {
		return metrics, err
	}

	err = md.getFsInfo(metrics)
	if err != nil {
		return metrics, err
	}

	return metrics, nil
}

// runDu executes the "du" command and writes the results to metrics.Used
func (md *metricsDu) runDu(metrics *Metrics) error {
	used, err := util.Du(md.path)
	if err != nil {
		return err
	}
	metrics.Used = used
	return nil
}

// getFsInfo writes metrics.Capacity and metrics.Available from the filesystem info
func (md *metricsDu) getFsInfo(metrics *Metrics) error {
	available, capacity, _, err := util.FsInfo(md.path)
	if err != nil {
		return fmt.Errorf("Failed to get FsInfo due to error %v", err)
	}
	metrics.Available = resource.NewQuantity(available, resource.BinarySI)
	metrics.Capacity = resource.NewQuantity(capacity, resource.BinarySI)
	return nil
}


text:
/*
 * FRC 4931 (http://www.evilletech.com)
 *
 * Open source software. Licensed under the FIRST BSD license file in the
 * root directory of this project's Git repository.
 */
package org.frc4931.robot.mock;

import org.frc4931.robot.component.Solenoid;

/**
 * A test implementation of Solenoid that can be used without any
 * hardware. This class should be instantiated through MockFactory.
 *
 * @author Zach Anderson
 * @see Solenoid
 */
public final class MockSolenoid implements Solenoid {

    /**
     * Create an extending solenoid.
     *
     * @return the solenoid
     */
    public static MockSolenoid extending() {
        return new MockSolenoid(Direction.EXTENDING);
    }

    /**
     * Create a retracting solenoid.
     *
     * @return the solenoid
     */
    public static MockSolenoid retracting() {
        return new MockSolenoid(Direction.RETRACTING);
    }

    private Direction direction;

    private MockSolenoid(Direction action) {
        this.direction = action;
    }

    @Override
    public void extend() {
        direction = Direction.EXTENDING;
    }

    @Override
    public void retract() {
        direction = Direction.RETRACTING;
    }

    @Override
    public Direction getDirection() {
        return direction;
    }

    /**
     * Determine whether this solenoid has been extended. This mock solenoid is considered to be instantaneous: as soon as {@link #extend()}
     * or {@link #retract()} is called, then it is assumed to be in that state.
     * @return true if the solenoid has been extended, or false otherwise
     */
    public boolean isExtended() {
        return direction == Direction.EXTENDING;
    }

    /**
     * Determine whether this solenoid has been retracted. This mock solenoid is considered to be instantaneous: as soon as {@link #extend()}
     * or {@link #retract()} is called, then it is assumed to be in that state.
     * @return true if the solenoid has been retracted, or false otherwise
     */
    public boolean isRetracted() {
        return direction == Direction.RETRACTING;
    }

    @Override
    public String toString() {
        return direction.toString();
    }
}


text:
package com.box.l10n.mojito.service.pollableTask;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;

import com.box.l10n.mojito.entity.PollableTask;
import com.box.l10n.mojito.service.assetExtraction.ServiceTestBase;
import com.box.l10n.mojito.service.blobstorage.BlobStorage;
import com.box.l10n.mojito.service.blobstorage.database.DatabaseBlobStorage;
import com.box.l10n.mojito.test.TestIdWatcher;
import java.util.Objects;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

public class PollableTaskBlobStorageTest extends ServiceTestBase {

  @Autowired PollableTaskBlobStorage pollableTaskBlobStorage;

  @Autowired PollableTaskService pollableTaskService;

  @Rule public TestIdWatcher testIdWatcher = new TestIdWatcher();

  @Autowired BlobStorage blobStorage;

  @Before
  public void before() {
    // to be sure ids in the db and in the storage are in sync (if using s3, data might be there
    // from previous run)
    Assume.assumeTrue(blobStorage instanceof DatabaseBlobStorage);
  }

  @Test
  public void inputNull() {
    PollableTask createPollableTask =
        pollableTaskService.createPollableTask(
            null, testIdWatcher.getEntityName("inputNull"), null, 0);
    pollableTaskBlobStorage.saveInput(createPollableTask.getId(), null);
    String input = pollableTaskBlobStorage.getInput(createPollableTask.getId(), String.class);
    assertNull(input);
  }

  @Test
  public void inputNotNull() {
    PollableTask createPollableTask =
        pollableTaskService.createPollableTask(
            null, testIdWatcher.getEntityName("inputNotNull"), null, 0);
    TestData testData = new TestData();
    testData.setId(10L);
    testData.setName("somename");
    pollableTaskBlobStorage.saveInput(createPollableTask.getId(), testData);
    TestData input = pollableTaskBlobStorage.getInput(createPollableTask.getId(), TestData.class);
    assertEquals(testData, input);
  }

  @Test
  public void missingInput() {
    // that'd fail if the storage has data for that id ... like if db is not cleaned up
    long pollableId = 999999999999999999L;
    try {
      TestData input = pollableTaskBlobStorage.getInput(pollableId, TestData.class);
      fail();
    } catch (RuntimeException e) {
      assertEquals("Can't get the input json for: " + pollableId, e.getMessage());
    }
  }

  static class TestData {

    Long id;
    String name;

    public Long getId() {
      return id;
    }

    public void setId(Long id) {
      this.id = id;
    }

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;
      TestData testData = (TestData) o;
      return Objects.equals(id, testData.id) && Objects.equals(name, testData.name);
    }

    @Override
    public int hashCode() {
      return Objects.hash(id, name);
    }
  }
}


text:
export { Directionality, DIRECTIONALITY_PROVIDER_FACTORY, DIRECTIONALITY_PROVIDER, DIR_DOCUMENT, Direction } from './directionality';
export { Dir } from './dir';
export * from './bidi-module';


text:
This is a custom action for SharePoint 2013 that enables multiple file download as a zip file (Bulk file download)

This is based on an existing SharePoint 2010 multi file download solution. Original solution can be found at SharePoint 2010 Download as Zip File Custom Ribbon Action. Credit goes to the original developer Bart X. Tubalinal for his solution.

This solution will work only on SharePoint 2013. (Will not work in SharePoint 2010)

#How to Deploy
Deploy the "BulkDownload.wsp" included above and activate the Site Level (web) feature "Bulk Download". This will include a "Download as Zip" button to the SharePoint ribbon control next to "Download a Copy" button. This button is visible only in document libraries.

If you want to make modifications please use the Visual Studio 2012 solution and make modifications as necessary.


text:
const AWS = require('aws-sdk'),
    fs = require('fs')

function instanceFromArgs() {
    const args = process.argv.slice(2)
    const instanceName = args[0]
    if (!instanceName) {
        let scriptName = process.argv[1].split('/').pop()
        console.error(`Usage: node ${scriptName} <instanceName>`)
        return
    }

    return instanceName
}

function createInstance(defineInstanceFunction) {
    const instanceName = instanceFromArgs()
    if (instanceName) {
        return defineInstanceFunction(instanceName).create().then( () => console.log(`Instance ${instanceName} created`))
    } else {
        return Promise.reject("Instance name required")
    }
}

function destroyInstance(defineInstanceFunction) {
    const instanceName = instanceFromArgs()
    if (instanceName) {
        return defineInstanceFunction(instanceName).destroy().then( () => console.log(`Instance ${instanceName} destroyed`))
    } else {
        return Promise.reject("Instance name required")
    }
}

let awsConfig
function configureFromFile(filePath) {
    AWS.config.loadFromPath('./awsConfig.json')
    awsConfig = JSON.parse(fs.readFileSync(filePath, "utf8"))
}

function getConfig() { return awsConfig }

module.exports = {instanceFromArgs, createInstance, destroyInstance, configureFromFile, getConfig}


text:
package net.cloudkit.enterprises.interfaces.commons.web;

import net.cloudkit.enterprises.infrastructure.utilities.CaptchaImageUtility;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MaxUploadSizeExceededException;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.support.RequestContext;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URLEncoder;
import java.util.*;
import java.util.List;

/**
 * CommonController.java
 * Default Bootstrap
 *
 * @author hongquanli <hongquanli@qq.com>
 * @version 1.0 2015年05月13日 上午11:38:34
 */
@Controller
public class CommonController implements HandlerExceptionResolver {

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

    public static final String SESSION_CAPTCHA_NAME_KEY = "SESSION_CAPTCHA";

    /**
     * HTTP 404 Resource not found
     *
     * @param request
     * @return
     */
    @RequestMapping({"/resource_not_found"})
    public String resourceNotFound(HttpServletRequest request) {

        /*
        String webAppRoot = ContextLoader.getCurrentWebApplicationContext().getServletContext().getRealPath("/");
        System.setProperty("webapp.root", webAppRoot);

        File tpl = new File(webAppRoot + File.separator + "default.ftl");
        if (!tpl.exists()) {
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("data", "123456");
            FreemarkerHelper.process("default.ftl", map, webAppRoot + File.separator + "default.ftl");
        }
        */

        return "/resource_not_found";
    }

    /**
     * Error
     *
     * @return
     */
    @RequestMapping({"/error"})
    public String error() {
        return "/error";
    }

    /**
     * Site disabled
     *
     * @return
     */
    @RequestMapping({"/disabled"})
    public String isDisabled() {
        // localSetting.getIsSiteEnabled().booleanValue()
        boolean isSiteEnabled = true;
        if (isSiteEnabled) {
            // return "redirect:/";
            return InternalResourceViewResolver.REDIRECT_URL_PREFIX + "/";
        }
        return "disabled";
    }

    /**
     * Unauthorized
     *
     * @return
     */
    @RequestMapping({"/unauthorized"})
    public String unauthorized() {
        return "/unauthorized";
    }

    /**
     * URL Redirect
     *
     * @param url
     * @return
     */
    @RequestMapping(value = "/redirect")
    public ModelAndView redirect(String url) {

        ModelAndView mv = new ModelAndView();
        // 设置逻辑视图名,视图解析器会根据该名字解析到具体的视图页面
        // mv.setViewName("forward:selected");
        if (url != null) {
            mv.setViewName("redirect:" + url);
        } else {
            mv.setViewName("redirect:/");
            mv.setViewName(InternalResourceViewResolver.REDIRECT_URL_PREFIX + "/");
        }
        return mv;
    }

    /**
     * ie6
     *
     * @return
     */
    @RequestMapping({"/ie6"})
    public String ie6() {
        return "/ie6";
    }

    /**
     * 获取验证码图片和文本 verify_code_image
     *
     * @param request
     * @param response
     * @throws IOException
     */
    @RequestMapping("/captcha_image")
    public void captchaImages(HttpServletRequest request, HttpServletResponse response) throws IOException {

        // 设置页面不缓存
        response.setHeader("Pragma", "no-cache");
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);

        try {

            String verifyCode = CaptchaImageUtility.generateTextCode(CaptchaImageUtility.TYPE_NUM_ONLY, 4, null);
            // 将验证码放到HttpSession里面
            request.getSession().setAttribute(CommonController.SESSION_CAPTCHA_NAME_KEY, verifyCode);
            System.out.println("生成的验证码为[" + verifyCode + "]");
            // 设置输出的内容的类型为JPEG图像
            response.setContentType("image/jpeg");
            BufferedImage bufferedImage = CaptchaImageUtility.generateImageCode(verifyCode, 90, 30, 3, true, Color.WHITE, Color.BLACK, null);
            // 写给浏览器
            ImageIO.write(bufferedImage, "JPEG", response.getOutputStream());
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
    }

    /*
    @ExceptionHandler(Exception.class)
    @ResponseBody
    @ResponseStatus(value = HttpStatus.BAD_REQUEST)
    public Response handleException(Exception e) {
        Response response = new Response();
        if(e instanceof MethodArgumentNotValidException){
            MethodArgumentNotValidException methodException = (MethodArgumentNotValidException)e;
            BindingResult bindingResult =methodException.getBindingResult();
            if(bindingResult!=null && bindingResult.hasErrors()){
                List<FieldError> fieldErrorList= bindingResult.getFieldErrors();
                for(FieldError fieldError: fieldErrorList ){
                    response.adderror(fieldError.getDefaultMessage());
                }
            }
        }
        return response;
    }
    */

    /**
     * Mobile
     *
     * @param request
     * @param model
     * @return
     */
    @RequestMapping(value = {"/mobile"}, method = RequestMethod.GET)
    public String mobile(HttpServletRequest request, Model model) {
        return "/mobile";
    }

    /**
     * Downloads
     *
     * @param request
     * @param model
     * @return
     */
    @RequestMapping(value = {"/downloads"}, method = RequestMethod.GET)
    public String downloads(HttpServletRequest request, Model model) {
        return "/downloads";
    }

    /**
     * Download
     *
     * @param request
     * @param model
     * @return
     */
    @RequestMapping(value = {"/download"}, method = RequestMethod.GET)
    public void download(@RequestParam(name = "id", required = true) String id, HttpServletRequest request, HttpServletResponse response, Model model) {

        if (null != id) {
            return;
        }

        // TODO 根据ID查找文件
        File downloadFile = new File("");
        if (!downloadFile.exists()) {
            return;
        }

        BufferedInputStream bis = null;
        BufferedOutputStream bos = null;

        try {
            bis = new BufferedInputStream(new FileInputStream(downloadFile));
            bos = new BufferedOutputStream(response.getOutputStream());

            // 中文文件名支持
            String encodedFileName = null;
            String agent = request.getHeader("USER-AGENT");
            // IE
            if (null != agent && -1 != agent.indexOf("MSIE")) {
                encodedFileName = java.net.URLEncoder.encode(downloadFile.getName(), "UTF-8");
            } else if (null != agent && -1 != agent.indexOf("Mozilla")) {
                encodedFileName = new String(downloadFile.getName().getBytes("UTF-8"), "ISO-8859-1");
            } else {
                encodedFileName = URLEncoder.encode(downloadFile.getName(), "UTF-8");
            }
            response.setHeader("Content-Disposition", "attachment; filename=\"" + encodedFileName + "\"");

            int byteRead = 0;
            byte[] buffer = new byte[8192];
            while ((byteRead = bis.read(buffer, 0, 8192)) != -1) {
                bos.write(buffer, 0, byteRead);
            }
            bos.flush();
        } catch (Exception e) {
            logger.info(e.getMessage(), e);
        } finally {
            // IOUtils.closeQuietly(bis);
            // IOUtils.closeQuietly(bos);
            if(bis != null) {
                try {
                    bis.close();
                } catch (IOException e) {
                    ;
                }
            }
            if(bos != null) {
                try {
                    bos.close();
                } catch (IOException e) {
                    ;
                }
            }
        }
    }

    @RequestMapping(value = "/download_file", params = "method=file")
    public void download(HttpServletRequest request, HttpServletResponse response) {

        // 设置下载文件名字
        String realName = "test.txt";
        // 获取完整的文件名
        String fileName = request.getParameter("fileName");

        BufferedInputStream bis = null;
        BufferedOutputStream bos = null;
        try {
            long fileLength = new File(fileName).length();
            String ctxPath = request.getSession().getServletContext().getRealPath("/");
            response.setContentType("application/octet-stream");
            response.setHeader("Content-disposition", "attachment; filename=" + new String(realName.getBytes("UTF-8"), "ISO8859-1"));
            response.setHeader("Content-Length", String.valueOf(fileLength));

            bis = new BufferedInputStream(new FileInputStream(fileName));
            bos = new BufferedOutputStream(response.getOutputStream());
            byte[] buff = new byte[2048];
            int bytesRead;
            while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
                bos.write(buff, 0, bytesRead);
            }
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        } finally {
            // IOUtils.closeQuietly(bis);
            // IOUtils.closeQuietly(bos);
            if(bis != null) {
                try {
                    bis.close();
                } catch (IOException e) {
                    ;
                }
            }
            if(bos != null) {
                try {
                    bos.close();
                } catch (IOException e) {
                    ;
                }
            }
        }
    }

    @RequestMapping(value = "upload", method = RequestMethod.POST)
    public Model upload(@ModelAttribute(value = "file") CommonsMultipartFile file, HttpServletRequest request, BindingResult result, Model model) {

        model.addAttribute("success", "false");

        /*
        // 判断文件是否为空,空直接返回上传错误
        if(!file.isEmpty()){
            // TODO
        }
        // 获取本地文件存储目录
        String path = request.getServletContext().getRealPath("/fileupload/");
        // 获得文件名
        String fileName = file.getOriginalFilename();
        // 获得文件后缀名
        String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
        // 拼接文件路径,以UUID生成文件名
        String filePath = path + File.separator + UUID.randomUUID().toString()+ suffix;
        // 创建一个要保存的新文件
        File saveFile = new File(filePath);
        // 将文件写入到新文件中
        file.getFileItem().write(saveFile);
        */

        if (!result.hasErrors()) {
            FileOutputStream outputStream = null;
            String filePath = System.getProperty("java.io.tmpdir") + "/" + file.getOriginalFilename();
            try {
                outputStream = new FileOutputStream(new File(filePath));
                outputStream.write(file.getFileItem().get());
                outputStream.close();
            } catch (Exception e) {
                // System.out.println("Error while saving file");
                model.addAttribute("message", "Error while saving file");
                return model;
            }
            model.addAttribute("success", "true");
            return model;
        } else {
            model.addAttribute("message", "Error while saving file");
            return model;
        }
    }

    @Override
    public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response
            , Object object, Exception exception) {

        Map<String, Object> model = new HashMap<>();
        if (exception instanceof MaxUploadSizeExceededException) {
            model.put("errors", "File size should be less then " + ((MaxUploadSizeExceededException) exception).getMaxUploadSize() + " byte.");
        } else {
            model.put("errors", "Unexpected error: " + exception.getMessage());
        }
        // model.put("FORM", new UploadForm());
        return new ModelAndView("/upload", model);
    }

    /**
     * test
     *
     * @param name
     * @param offset
     * @param limit
     * @param url
     * @return
     */
    @RequestMapping(value = "/test")
    @ResponseBody
    public Model test(@RequestParam("name") String name, @RequestParam int offset, @RequestParam int limit, @RequestBody String url, Model model) {

        model.addAttribute("success", false);
        try {
            List<String> data = new ArrayList<String>();
            data.add("123456");
            data.add("456789");

            model.addAttribute("data", data);
            model.addAttribute("success", true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
        return model;
    }

    /*
    // @RestController
    // @RequestMapping(value="/api/mail")
    @RequestMapping(produces = "application/json" ,method=RequestMethod.POST )
    @ResponseBody
    public ResponseEntity<HttpStatus> sendMail(@RequestBody MailRequest mailRequest){

        System.out.println("MailRequest 2 mailRequest!!!!!!!!!!!!!!!!!!! " );

        //  dispatcher.SendMail(new MailRequestEvent(mailRequest));
        return new ResponseEntity<HttpStatus>(HttpStatus.OK);
    }
    */

    // @RequestMapping("/valid/{username}")
    // @PathVariable String username
    // @RequestHeader("Accept-Encoding") String encoding,
    // @RequestHeader("Keep-Alive") long keepAlive
    // @CookieValue("JSESSIONID") String cookie
    // @RequestParam("username") String username
    // @RequestBody String body 用来处理Content-Type: 不是application/x-www-form-urlencoded编码的内容,例如application/json, application/xml等;
    // @SessionAttributes("user") 用来绑定HttpSession中的attribute对象的值,便于在方法中的参数里使用。
    // @ModelAttribute 用于方法上时:通常用来在处理@RequestMapping之前,为请求绑定需要从后台查询的model;用于参数上时:用来通过名称对应,把相应名称的值绑定到注解的参数bean上;

    // 验证分组 First @Validated({First.class})
    @RequestMapping(value = "/valid", produces = "application/json")
    @ResponseBody
    public Model valid(HttpServletRequest request, @Valid @ModelAttribute("user") User user, BindingResult result, Model model) {

        RequestContext requestContext = new RequestContext(request);
        model.addAttribute("success", false);
        try {

            // ResourceBundle myResources = ResourceBundle.getBundle("messages", Locale.getDefault());
            // System.out.println(myResources.getString("Pattern.user.username"));

            if (result.hasErrors()) {
                List<FieldError> errs = result.getFieldErrors();
                Map<String, String> mapErrors = new LinkedHashMap<String, String>();
                for (FieldError fieldError : errs) {
                    // fieldError.getDefaultMessage()
                    // System.out.println("fieldError:" + fieldError.getCodes()[0]);
                    /*
                    System.out.println("fieldError:" + fieldError.getCode() + " " + fieldError.getDefaultMessage());
                    for(String code : fieldError.getCodes()) {
                        System.out.println("code:" + code);
                    }
                    */
                    mapErrors.put(fieldError.getField(), requestContext.getMessage(fieldError.getCodes()[0]));
                }
                model.addAttribute("success", false);
                model.addAttribute("errors", mapErrors);
                // model.addAttribute("error", requestContext.getMessage(result.getFieldErrors().get(0).getCodes()[0]));
                return model;
            }

            List<String> data = new ArrayList<String>();
            data.add("123456");
            data.add("456789");

            model.addAttribute("data", data);
            model.addAttribute("success", true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            model.addAttribute("message", "error!");
        }
        return model;
    }

    // isAvailable
    // isUsernameAvailability
    // isEmailAvailability
    // isMobileAvailability

    // supplementary
}


text:
namespace Beefeater
{
    public struct Option<T>
    {
        private readonly T _value;

        public Option(T value) : this()
        {
            if (value != null)
            {
                HasValue = true;
                _value = value;
            }
        }

        public T ValueOr(T fallbackValue)
        {
            return !HasValue ? fallbackValue : _value;
        }

        public static Option<T> None => new Option<T>();

        public bool HasValue { get; }

        public static implicit operator Option<T>(T item)
        {
            return new Option<T>(item);
        }

        public static explicit operator T(Option<T> option)
        {
            if (option.HasValue)
            {
                return option._value;
            }

            throw new PanicException();
        }
    }
}


text:
enum GPUArch { NVPTX64, SPIR32, SPIR64 };

/// The GPU Runtime implementation to use.
enum GPURuntime { CUDA, OpenCL };

namespace polly {
extern bool PollyManagedMemory;
}

#endif // POLLY_PPCGCODEGENERATION_H


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls mycol. 20(5/6): 326 (1922)

#### Original name
Plectophomopsis Petr.

### Remarks
null


text:
class EntriesController < ApplicationController
  include CSVDownload

  DATE_FORMAT = "%d/%m/%Y".freeze

  def index
    @user = User.find_by_slug(params[:user_id])
    @hours_entries = @user.hours.by_date.page(params[:hours_pages]).per(20)
    @mileages_entries = @user.mileages.by_date.page(
      params[:mileages_pages]).per(20)

    respond_to do |format|
      format.html { @mileages_entries + @hours_entries }
      format.csv do
        send_csv(
          name: @user.name,
          hours_entries: @user.hours.by_date,
          mileages_entries: @user.mileages.by_date)
      end
    end
  end

  def destroy
    resource.destroy
    redirect_to user_entries_path(current_user) + "##{controller_name}",
                notice: t("entry_deleted.#{controller_name}")
  end

  def edit
    @entry_type = set_entry_type
  end

  private

  def set_entry_type
    params[:controller]
  end

  def parsed_date(entry_type)
    Date.strptime(params[entry_type][:date], DATE_FORMAT)
  end
end


text:
      <form novalidate name="productForm" class="form-horizontal" role="form">

          商品名称:

            <input type="text" class="form-control" name="name" placeholder="商品名称" ng-model="derivatives.name" required>

          艺术家:

            <select class="form-control" name="derivativesAuthor" required ng-model="derivatives.derivativesAuthor">
              <option value="">----选择艺术家----</option>
              <option ng-repeat="item in derivatives.artistList" value="{{item.id}}">{{item.name}}</option>
            </select>

          商品类别:

            <select class="form-control" name="derivativesCategory" required ng-model="derivatives.derivativesCategory">
              <option value="">----选择分类----</option>
              <option ng-repeat="item in derivatives.categoryList" value="{{item.id}}">{{item.name}}</option>
            </select>

          商品售价:

           <input type="text" class="form-control" name="price" placeholder="商品售价" ng-model="derivatives.price" required>

          商品材质:

            <select class="form-control" name="material" required ng-model="derivatives.material">
              <option value="">----选择材质----</option>
              <option ng-repeat="item in derivatives.materialList" value="{{item.id}}">{{item.name}}</option>
            </select>

          商品规格:

            <input type="number" class="form-control fl w80" name="width" placeholder="长" ng-model="derivatives.width" required>
            <input type="number" class="form-control fl w80" name="height" placeholder="宽" ng-model="derivatives.height" require>
            <input type="text" class="form-control fl w80" name="unit" placeholder="单位" ng-model="derivatives.unit" required>

          商品图片:

            <input type="file" class="form-control" name="icon" placeholder="上传图片" ng-model="derivatives.icon">

          商品介绍:

            <textarea name="content" placeholder="商品介绍" id="editor" ng-model="derivatives.content" keditor data-config="options" required>
            </textarea>

          标签:

            <input type="text" class="form-control" name="keyword" placeholder="使用空格分隔不同标签" ng-model="derivatives.keyword">

          状态:

            <select class="form-control" name="commodityStates" required ng-model="derivatives.commodityStates">
              <option value="">----请选择----</option>
              <option ng-repeat="item in derivatives.commodityStatesList" value="{{item.id}}">{{item.name}}</option>
            </select>

          文章排序:

            <input type="number" class="form-control" name="sorts" placeholder="排序值" ng-model="derivatives.sorts">

          浏览数:

            <input type="number" class="form-control" name="pv" placeholder="浏览数" ng-model="derivatives.pv">

          收藏数:

            <input type="number" class="form-control" name="like" placeholder="收藏数" ng-model="derivatives.like">

          其它设置:

            <input type="checkbox" name="isRecommend" icheck ng-model="derivatives.isRecommend">推荐

            <button class="btn btn-primary" ng-click="submitForm()" ng-disabled="productForm.$invalid">保存</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>

      </form>


text:
package DesignPatterns.Observer.Simple;

/**
 * Project: LearnJava
 * Package: DesignPatterns.Observer.Simple
 * Author:  Novemser
 * 2016/10/10
 */
public interface Observer {
    void update(Observable observable, Object object);
}


text:
<?php

/**
 * Thrown when an assertion for array equality failed.
 *
 * @package    PHPUnit
 * @subpackage Framework_ComparisonFailure
 * @author     Sebastian Bergmann <sebastian@phpunit.de>
 * @copyright  2002-2011 Sebastian Bergmann <sebastian@phpunit.de>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: 3.5.13
 * @link       http://www.phpunit.de/
 * @since      Class available since Release 3.0.0
 */
class PHPUnit_Framework_ComparisonFailure_Array extends PHPUnit_Framework_ComparisonFailure
{
    /**
     * Returns a string describing the difference between the expected and the
     * actual array.
     *
     * @return string
     */
    public function toString()
    {
        if (!$this->identical) {
            ksort($this->expected);
            ksort($this->actual);
        }

        $diff = PHPUnit_Util_Diff::diff(
          print_r($this->expected, TRUE),
          print_r($this->actual, TRUE)
        );

        if ($diff !== FALSE) {
            return trim($diff);
        }

        // Fallback: Either diff is not available or the print_r() output for
        // the expected and the actual array are equal (but the arrays are not).

        $expectedOnly = array();
        $actualOnly   = array();
        $diff         = '';

        foreach ($this->expected as $expectedKey => $expectedValue) {
            if (!array_key_exists($expectedKey, $this->actual)) {
                $expectedOnly[] = $expectedKey;
                continue;
            }

            if ($expectedValue === $this->actual[$expectedKey]) {
                continue;
            }

            $diffObject = PHPUnit_Framework_ComparisonFailure::diffIdentical(
              $expectedValue,
              $this->actual[$expectedKey],
              sprintf(
                '%sarray key %s: ',

                $this->message,
                PHPUnit_Util_Type::toString($expectedKey)
              )
            );

            $diff .= $diffObject->toString() . "\n";
        }

        foreach ($this->actual as $actualKey => $actualValue) {
            if (!array_key_exists($actualKey, $this->expected)) {
                $actualOnly[] = $actualKey;
                continue;
            }
        }

        foreach ($expectedOnly as $expectedKey) {
            $diff .= sprintf(
              "array key %s: only in expected %s\n",

              PHPUnit_Util_Type::toString($expectedKey),
              PHPUnit_Util_Type::toString($this->expected[$expectedKey])
            );
        }

        foreach ($actualOnly as $actualKey) {
            $diff .= sprintf(
              "array key %s: only in actual %s\n",

              PHPUnit_Util_Type::toString($actualKey),
              PHPUnit_Util_Type::toString($this->actual[$actualKey])
            );
        }

        return $diff;
    }
}


text:
article-url: http://www.salzburg.com/nachrichten/lifestyle/genuss-leben/sn/artikel/jumpcube-ermoeglicht-virtuellen-fallschirmsprung-ueber-wien-151734/
---