text:
namespace mx
{
    namespace core
    {
        GraceNoteGroup::GraceNoteGroup()
        :myGrace( makeGrace() )
        ,myFullNoteGroup( makeFullNoteGroup() )
        ,myTieSet()
        {}

        bool GraceNoteGroup::hasAttributes() const
        {
            return false;
        }

        std::ostream& GraceNoteGroup::streamAttributes( std::ostream& os ) const
        {
            return os;
        }

        std::ostream& GraceNoteGroup::streamName( std::ostream& os ) const
        {
            return os;
        }

        bool GraceNoteGroup::hasContents() const
        {
            return true;
        }

        std::ostream& GraceNoteGroup::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const
        {
            myGrace->toStream( os, indentLevel );
            os << std::endl;
            myFullNoteGroup->streamContents( os, indentLevel, isOneLineOnly );
            for ( auto x : myTieSet )
            {
                os << std::endl;
                x->toStream( os, indentLevel );
            }
            isOneLineOnly = false;
            return os;
        }

        GracePtr GraceNoteGroup::getGrace() const
        {
            return myGrace;
        }

        void GraceNoteGroup::setGrace( const GracePtr& value )
        {
            if ( value )
            {
                myGrace = value;
            }
        }

        FullNoteGroupPtr GraceNoteGroup::getFullNoteGroup() const
        {
            return myFullNoteGroup;
        }

        void GraceNoteGroup::setFullNoteGroup( const FullNoteGroupPtr& value )
        {
            if ( value )
            {
                myFullNoteGroup = value;
            }
        }

        const TieSet& GraceNoteGroup::getTieSet() const
        {
            return myTieSet;
        }

        void GraceNoteGroup::addTie( const TiePtr& value )
        {
            if ( value )
            {
                if ( myTieSet.size() < 2 )
                {
                    myTieSet.push_back( value );
                }
            }
        }

        void GraceNoteGroup::removeTie( const TieSetIterConst& value )
        {
            if ( value != myTieSet.cend() )
            {
                myTieSet.erase( value );
            }
        }

        void GraceNoteGroup::clearTieSet()
        {
            myTieSet.clear();
        }

        TiePtr GraceNoteGroup::getTie( const TieSetIterConst& setIterator ) const
        {
            if( setIterator != myTieSet.cend() )
            {
                return *setIterator;
            }
            return TiePtr();
        }

        MX_FROM_XELEMENT_UNUSED( GraceNoteGroup );

    }
}


text:
package com.iknowers.learning.gc;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * 不断创建和回收对象,观察GC
 *
 * 可通过-Xms, -Xmx等参数调节堆大小。
 *
 *  -XX:+PrintFlagsFinal -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseG1GC -Xloggc:g1-gc.log
 *
 * http://gceasy.io/ 可支持GC 日志文件分析
 *
 * @author Shun Xu
 */
public class GCDemo implements Runnable {

    private static ScheduledExecutorService executorService
            = Executors.newScheduledThreadPool(2);

    private Deque<byte[]> deque;
    private int objectSize;
    private int queueSize;

    public GCDemo(int objectSize, int ttl) {
        this.deque = new ArrayDeque<>();
        this.objectSize = objectSize;
        this.queueSize = ttl * 1000;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            deque.add(new byte[objectSize]);
            if (deque.size() > queueSize) {
                deque.poll();
            }
        }
    }

    public static void main(String[] args)
            throws InterruptedException {
        executorService.scheduleAtFixedRate(
                new GCDemo(200 * 1024 * 1024 / 1000, 5),
                0, 100, TimeUnit.MILLISECONDS
        );
        executorService.scheduleAtFixedRate(
                new GCDemo(50 * 1024 * 1024 / 1000, 120),
                0, 100, TimeUnit.MILLISECONDS);
        TimeUnit.MINUTES.sleep(10);
        executorService.shutdownNow();
    }
}

redpajama_set_name: RedPajamaGithub


text: sudo docker build -t magnetikonline/buildnginx .


text:
promotion_condition do
  name :manual
  plugin_id 'promoted-builds'
  parameters [
    :users
  ]

  xml do |params|
    send('hudson.plugins.promoted__builds.conditions.ManualCondition') do
      users params[:users]
    end
  end
end

promotion_condition do
  name :self_promotion
  plugin_id 'promoted-builds'
  parameters [
    :even_if_unstable
  ]

  xml do |params|
    send('hudson.plugins.promoted__builds.conditions.SelfPromotionCondition') do
      evenIfUnstable true if params[:even_if_unstable].nil?
      evenIfUnstable params[:even_if_unstable]
    end
  end
end

promotion_condition do
  name :parameterized_self_promotion
  plugin_id 'promoted-builds'
  parameters %i[
    parameter_name
    parameter_value
    even_if_unstable
  ]

  xml do |params|
    send('hudson.plugins.promoted__builds.conditions.ParameterizedSelfPromotionCondition') do
      parameterName params[:parameter_name]
      parameterValue true if params[:parameter_value].nil?
      evenIfUnstable true if params[:even_if_unstable].nil?
      parameterValue params[:parameter_value]
      evenIfUnstable params[:even_if_unstable]
    end
  end
end

promotion_condition do
  name :downstream_pass
  plugin_id 'promoted-builds'
  parameters %i[
    jobs
    even_if_unstable
  ]

  xml do |params|
    send('hudson.plugins.promoted__builds.conditions.DownstreamPassCondition') do
      jobs params[:jobs] || '{{Example}}-Commit'
      evenIfUnstable true if params[:even_if_unstable].nil?
      evenIfUnstable params[:even_if_unstable]
    end
  end
end

promotion_condition do
  name :upstream_promotion
  plugin_id 'promoted-builds'
  parameters [
    :promotion_name
  ]

  xml do |params|
    send('hudson.plugins.promoted__builds.conditions.UpstreamPromotionCondition') do
      promotionName '01. Staging Promotion' if params[:promotion_name].nil?
      promotionName params[:promotion_name]
    end
  end
end


text:
/**
 * For @NonNull annotations on implementation classes
 */
@NonNullApi
@NonNullFields
package org.springframework.web.testfixture.http.server.reactive;

import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="e51fda4a-8f23-416a-acbc-d7e4bea629c3" name="Default" comment="" />
    <ignored path="$PROJECT_DIR$/out/" />
    <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 SIDE_TABS_SIZE_LIMIT_KEY="450">
      <file leaf-file-name="BigDecimalMoneyTest.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/number/BigDecimalMoneyTest.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="315">
              <caret line="9" column="13" lean-forward="false" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="MoneyTransform.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/string/MoneyTransform.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="805">
              <caret line="27" column="32" lean-forward="false" selection-start-line="27" selection-start-column="32" selection-end-line="27" selection-end-column="32" />
              <folding>
                <element signature="imports" expanded="false" />
                <element signature="e#341#357#0" expanded="false" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="LocalDateTest.java" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/time/LocalDateTest.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="140">
              <caret line="10" column="16" lean-forward="false" selection-start-line="10" selection-start-column="16" selection-end-line="10" selection-end-column="16" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="GradleLocalSettings">
    <option name="externalProjectsViewState">
      <projects_view />
    </option>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/time/LocalDateTest.java" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds">
    <option name="y" value="30" />
    <option name="width" value="2560" />
    <option name="height" value="1410" />
  </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="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="time" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="string" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="essentials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="number" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
      <pane id="PackagesPane" />
      <pane id="Scratches" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$PROJECT_DIR$/../exception" />
    <property name="project.structure.last.edited" value="Project" />
    <property name="project.structure.proportion" value="0.0" />
    <property name="project.structure.side.proportion" value="0.2" />
  </component>
  <component name="RunManager" selected="Application.Main">
    <configuration default="false" name="Main" type="Application" factoryName="Application" temporary="true">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" value="cn.edu.sdut.softlab.Main" />
      <option name="VM_PARAMETERS" value="" />
      <option name="PROGRAM_PARAMETERS" value="" />
      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" value="" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="essentials" />
      <envs />
      <RunnerSettings RunnerId="Run" />
      <ConfigurationWrapper RunnerId="Run" />
      <method />
    </configuration>
    <configuration default="true" type="Application" factoryName="Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
      <ExternalSystemSettings>
        <option name="executionName" />
        <option name="externalProjectPath" />
        <option name="externalSystemIdString" value="GRADLE" />
        <option name="scriptParameters" />
        <option name="taskDescriptions">
          <list />
        </option>
        <option name="taskNames">
          <list />
        </option>
        <option name="vmOptions" />
      </ExternalSystemSettings>
      <method />
    </configuration>
    <configuration default="true" type="JUnit" factoryName="JUnit">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="TEST_OBJECT" value="class" />
      <option name="VM_PARAMETERS" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <envs />
      <patterns />
      <method />
    </configuration>
    <configuration default="true" type="JarApplication" factoryName="JAR Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="Java Scratch" factoryName="Java Scratch">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="SCRATCH_FILE_ID" value="0" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="essentials" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="filePath" />
      <option name="vmParameters" />
      <option name="alternativeJrePath" />
      <option name="programParameters" />
      <option name="passParentEnvs" value="true" />
      <option name="workingDirectory" />
      <option name="isAlternativeJrePathEnabled" value="false" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="TestNG" factoryName="TestNG">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="SUITE_NAME" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="GROUP_NAME" />
      <option name="TEST_OBJECT" value="CLASS" />
      <option name="VM_PARAMETERS" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" />
      <option name="OUTPUT_DIRECTORY" />
      <option name="ANNOTATION_TYPE" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <option name="USE_DEFAULT_REPORTERS" value="false" />
      <option name="PROPERTIES_FILE" />
      <envs />
      <properties />
      <listeners />
      <method />
    </configuration>
    <list size="1">
      <item index="0" class="java.lang.String" itemvalue="Application.Main" />
    </list>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="e51fda4a-8f23-416a-acbc-d7e4bea629c3" name="Default" comment="" />
      <created>1488187015067</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1488187015067</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="30" width="2560" height="1410" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="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="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <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="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/number/BigDecimalMoneyTest.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="315">
          <caret line="9" column="13" lean-forward="false" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/string/MoneyTransform.java">
      <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>
            <element signature="imports" expanded="false" />
            <element signature="e#341#357#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/Main.java" />
    <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/number/BigDecimalMoneyTest.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="315">
          <caret line="9" column="13" lean-forward="false" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/string/MoneyTransform.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="805">
          <caret line="27" column="32" lean-forward="false" selection-start-line="27" selection-start-column="32" selection-end-line="27" selection-end-column="32" />
          <folding>
            <element signature="imports" expanded="false" />
            <element signature="e#341#357#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/cn/edu/sdut/softlab/essentials/time/LocalDateTest.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="140">
          <caret line="10" column="16" lean-forward="false" selection-start-line="10" selection-start-column="16" selection-end-line="10" selection-end-column="16" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
  <component name="masterDetails">
    <states>
      <state key="ArtifactsStructureConfigurable.UI">
        <settings>
          <artifact-editor />
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="GlobalLibrariesConfigurable.UI">
        <settings>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="JdkListConfigurable.UI">
        <settings>
          <last-edited>1.8</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="ModuleStructureConfigurable.UI">
        <settings>
          <last-edited>essentials</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
                <option value="0.6" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="ProjectLibrariesConfigurable.UI">
        <settings>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
    </states>
  </component>
</project>


text:
import java.util.StringJoiner;

class Test {
  void test2(String s, CharSequence s1) {
    StringJoiner s<caret>j = new StringJoiner("");
    sj.add("foo"); // comment1
    sj.add(s); // comment2
    sj.add("bar"); // comment3
    sj.add(s1); // comment4
    System.out.println(sj.toString());
  }
}


text:
include $(TOPDIR)/rules.mk

LUCI_TITLE:=LuCI Support for DynaPoint
LUCI_DEPENDS:=+luci-lib-ipkg +dynapoint

PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Tobias Ilte <tobias.ilte@campus.tu-berlin.de>
include ../../luci.mk

# call BuildPackage - OpenWrt buildroot signature


text:
import copy

UNKNOWN_ERROR = 1000
DEFAULT_ERROR_MESSAGE = "Unknown error occured"

class BaseException(Exception):
    """
    Base Tavrida exception
    """

    _msg_template = DEFAULT_ERROR_MESSAGE
    _service_error_code = UNKNOWN_ERROR

    def __init__(self, **kwargs):
        super(BaseException, self).__init__()
        self._kwargs = kwargs

    def __str__(self):
        return self._msg_template % self._kwargs

    @property
    def message_template(self):
        return self._msg_template

    @property
    def kwargs(self):
        return copy.deepcopy(self._kwargs)

    @property
    def code(self):
        return self._service_error_code

class AckableException(object):
    pass

class BaseAckableException(BaseException, AckableException):
    pass

class NackableException(object):
    pass

class BaseNackableException(BaseException, NackableException):
    pass

class FieldMustExist(BaseAckableException):

    _msg_template = "Field %(field)s must exists in message"
    _service_error_code = 1001

class FieldMustFullyDefined(BaseAckableException):

    _msg_template = "Field %(field)s must not contain null values"
    _service_error_code = 1003

class UnsuitableFieldValue(BaseAckableException):

    _msg_template = "Unsuitable field %(field)s value %(value)s"
    _service_error_code = 1002

class HandlerNotFound(BaseAckableException):

    _msg_template = "Handler for %(entry_point)s (%(message_type)s) not found"
    _service_error_code = 1004

class NeedToBeController(BaseException):

    _msg_template = "Service %(service)s should be of ServiceController class"
    _service_error_code = 1005

class WrongEntryPointFormat(BaseAckableException):

    _msg_template = "EntryPoint should be of pattern 'service.method'"
    _service_error_code = 1006

class UnableToDiscover(BaseAckableException):

    _msg_template = "Service %(service)s could not be discovered"
    _service_error_code = 1007

class IncorrectAMQPConfig(BaseException):

    _msg_template = "Wrong amqp url %(amqp_url)s"
    _service_error_code = 1008

class WrongResponse(BaseException):

    _msg_template = ("Got incorrect response %(response)s. Response should "
                     "be of types: Response, Error, dict.")
    _service_error_code = 1009

class IncorrectAMQPLibrary(BaseException):

    _msg_template = "Incorrect value for amqp library"
    _service_error_code = 1010

class ServiceNotFound(BaseAckableException):

    _msg_template = "Service for %(entry_point)s is not found"
    _service_error_code = 1022

class UnknownService(BaseAckableException):

    _msg_template = "Service %(service)s unknown for server"
    _service_error_code = 1022

class DuplicatedServiceRegistration(BaseAckableException):

    _msg_template = "Service %(service)s is already registered"
    _service_error_code = 1023

class DuplicatedEntryPointRegistration(BaseAckableException):

    _msg_template = "Service %(entry_point)s is already registered"
    _service_error_code = 1024

class ServiceIsNotRegister(BaseAckableException):

    _msg_template = "Service %(service)s is not registered"
    _service_error_code = 1026

class PublisherEndpointNotFound(BaseAckableException):

    _msg_template = ("Remote Method (event) name for given handler "
                     "%(method_name)s is not found")
    _service_error_code = 1027

class DuplicatedMethodRegistration(BaseException):

    _msg_template = "Duplicated registration of method '%(method_name)s'"
    _service_error_code = 1028

class ForbiddenHeaders(BaseException):
    _msg_template = "Headers are forbidden to re-define %(headers)s"
    _service_error_code = 1029

class SubscriptionHandlerNotFound(BaseAckableException):
    _msg_template = "Subscription handler for %(entry_point)s is not found"
    _service_error_code = 1030

class IncorrectOutgoingMessage(BaseException):

    _msg_template = ("Got incorrect outgoing message %(message)s. "
                     "Message should "
                     "be of types: Request, Response, Error, Notification")
    _service_error_code = 1031

class IncorrectMessage(BaseException):

    _msg_template = ("Got incorrect message %(message)s. "
                     "Message should "
                     "be of types: IncomingRequest, Response, Error")
    _service_error_code = 1031

class CantRegisterRemotePublisher(BaseException):
    """Raises from FileBasedDiscoveryService.

    If service try to subscribe to unknown service
    """

    _msg_template = "Can't register remote publisher for service %(service)s"
    _service_error_code = 1030

class ConfigFileIsNotDefined(BaseException):
    _msg_template = "Config file is not defined"
    _service_error_code = 1050


text:
ESP8266 (NodeMCU) controlled beer fermentation chamber.

## Hardware

The whole project is created by modifying a wine cooler, similar to [this one](http://www.amazon.com/NewAir-AW-121E-Bottle-Thermoelectric-Cooler/dp/B0046XD52W) without the digital temperature controls or LCD.

The microcontroller is an [ESP8266 board v0.9](
http://www.dx.com/p/nodemcu-esp8266-esp-12-deleopment-board-lua-wi-fi-module-w-built-in-antennas-385190).

The ESP8266 controls a [two channel relay module](http://www.dx.com/p/2-channel-relay-module-extension-board-for-arduino-51-avr-avr-arm-143916).

One of the relays control the [peltier cooler](http://www.dx.com/p/tec1-12706-semiconductor-thermoelectric-cooler-peltier-white-157283).

The other relay controls the fans for the heatsinks that are connected to the peltier cooler. The temperature readings are provided by a  [DS18B20 temperature probe](http://www.dx.com/p/ds18b20-waterproof-digital-temperature-probe-black-silver-204290). You'll also need a 4k pullup resistor between the data and the power lines.

The power supply, heatsinks and fans are reused from the wine cooler itself.

### Pinout

- D0 - controls the relay of the cooling fans (high - fan on)
- D1 - controls the relay for the peltier (high - power on)
- D4 -  the data pin for the DS18B20

## Software

### Flashing the NodeMCU firmware

Use ESP8266Flasher to upload the firmware in the repository. If you want to build your own, use http://nodemcu-build.com/, use the dev branch and enable the following modules: file,gpio,http,mdns,net,node,ow,sntp,tmr,uart,wifi

### Uploading the lua files to the ESP8266

Use ESPLorer for uploading the files.

You will need an additional "credentials.lua" file with contents like this:

```lua
wifi_ssid = "MyWifi"
wifi_password = "MyPassword"
thingspeak_api_key = 'MYTHINGSPEAKAPIKEY'
thingspeak_channel_id = 123456
```
### How it works

Every 30 seconds, it takes a temp reading. It enables/disables the cooling based on the temperature, then submits the temperature data to thingspeak ([check out my channel here](https://thingspeak.com/channels/100779)).

It also runs a HTTP server for setting the target temperature.

# BUGS

- if the wifi goes away, the main loop stops (?)

# TODO

- don't lose thingspeak data if there is no wifi
- enable heating by reversing the peltier polarity
- make it possible to update the wifi ssid/password from the http control site


text:
import { access } from '@gqlapp/authentication-server-ts';
import User from '../sql';

export async function onAuthenticationSuccess(req, res) {
  const user = await User.getUserWithPassword(req.user.id);
  const redirectUrl = req.query.state;
  const tokens = await access.grantAccess(user, req, user.passwordHash);

  if (redirectUrl) {
    res.redirect(redirectUrl + (tokens ? `?data=${JSON.stringify({ tokens })}` : ''));
  } else {
    res.redirect('/profile');
  }
}

export const registerUser = async ({ id, username, displayName, emails: [{ value }] }) => {
  return User.register({
    username: username || displayName,
    email: value,
    password: id,
    isActive: true,
  });
};


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets the include_path configuration option</title>

restore_include_path

set_magic_quotes_runtime

PHP Options/Info Functions

PHP Manual

set_include_path

(PHP 4 >= 4.3.0, PHP 5)

set_include_path — Sets the include_path configuration option

Description

   string set_include_path
    ( string $new_include_path
   )

   Sets the include_path
   configuration option for the duration of the script.

Parameters

new_include_path

       The new value for the include_path

Return Values

   Returns the old include_path on
   success or FALSE on failure.

Examples

Example #1 set_include_path() example

<?php
// Works as of PHP 4.3.0
set_include_path('/usr/lib/pear');

// Works in all PHP versions
ini_set('include_path', '/usr/lib/pear');
?>

Example #2 Adding to the include path

     Making use of the PATH_SEPARATOR constant, it is
     possible to extend the include path regardless of the operating system.

     In this example we add <var class="filename">/usr/lib/pear</var> to the end of
     the existing include_path.

<?php
$path = '/usr/lib/pear';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
?>

See Also

ini_set() - Sets the value of a configuration option

get_include_path() - Gets the current include_path configuration option

restore_include_path() - Restores the value of the include_path configuration option

include - include

restore_include_path

set_magic_quotes_runtime

PHP Options/Info Functions

PHP Manual


text:
package a_java_core.d_ClassAndObjects;

import a_java_core.c_Array.A_ArrayBasic;

public class J_ImportClasses
{
	public static void main(String[] args) {
		A_ArrayBasic a = new A_ArrayBasic();
		a.ArrayOneDimensionalWrite();
		a.ArrayOneDimensionalRead();
	}
}


text:
[ ![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-ftp.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-ftp)
[![Gem Version](https://badge.fury.io/rb/sensu-plugins-ftp.svg)](http://badge.fury.io/rb/sensu-plugins-ftp)
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ftp/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ftp)
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ftp/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ftp)
[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-ftp.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-ftp)

## Functionality

## Files
 * bin/check-ftp.rb

## Usage

## Installation

[Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)

## Notes


text:
package org.jboss.hal.core.runtime;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;

import org.jboss.hal.core.runtime.server.Server;
import org.jboss.hal.dmr.ModelNode;
import org.jboss.hal.dmr.NamedNode;
import org.jboss.hal.dmr.Property;

import static java.util.stream.Collectors.toList;

public abstract class HasServersNode extends NamedNode {

    private final List<Server> servers;

    public HasServersNode(String name, ModelNode node) {
        super(name, node);
        this.servers = new ArrayList<>();
    }

    public HasServersNode(Property property) {
        super(property);
        this.servers = new ArrayList<>();
    }

    public boolean hasServers() {
        return !servers.isEmpty();
    }

    public boolean hasServers(Predicate<Server> predicate) {
        return servers.stream().anyMatch(predicate);
    }

    public void addServer(Server server) {
        servers.add(server);
    }

    public List<Server> getServers() {
        return servers;
    }

    public List<Server> getServers(Predicate<Server> predicate) {
        return servers.stream().filter(predicate).collect(toList());
    }
}


text:
> New Generation Build System

[![][fly-badge]][fly]
[![npm package][npm-ver-link]][fly]
[![][dl-badge]][npm-pkg-link]
[![][travis-logo]][travis]
![][mit-badge]

  About
  |
  Usage
  |
  Documentation
  |
  Plugins
  |
  Contributing

## About

_Fly_ is a modern [build system](https://en.wikipedia.org/wiki/Build_automation) for [Node](https://nodejs.org/) based in [_co_-routines](https://medium.com/@tjholowaychuk/callbacks-vs-coroutines-174f1fe66127), [generators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) and [promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

_Fly_ has [callback _heaven_](http://jakearchibald.com/2014/es7-async-functions/), [concurrent tasks](https://github.com/flyjs/fly/blob/master/docs/README.md#features), [robust error handling](https://medium.com/@tjholowaychuk/callbacks-vs-coroutines-174f1fe66127), [cascading tasks](https://github.com/flyjs/fly/blob/master/CHANGELOG.md#cascading-tasks) and a simple [API](https://github.com/flyjs/fly/blob/master/docs/README.md#api).

See the [documentation](/docs/README.md) to learn more about Fly.

## Usage
### Install

```
npm install fly
```

### _Flyfile_

> Flyfiles can be written in ES5/[6][es6-example]/[7][es7-example] and [other](https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS) variants.

```js
const paths = {
  scripts: ["src/**/*.js", "!src/ignore/**/*.js"]
}

export default function* () {
  yield this.watch(paths.scripts, "build")
}

export function* build () {
  yield this.clear("dist")
  yield this
    .source(paths.scripts)
    .babel({ stage: 0 })
    .uglify()
    .concat("all.min.js")
    .target("dist")
}
```

# Contributing

Contributions are _absolutely_ welcome. Check out our [contribution guide](/CONTRIBUTING.md).

# License

[MIT](http://opensource.org/licenses/MIT) © [Jorge Bucaran][Author] et [al][contributors]
:heart:

[author]: http://about.bucaran.me
[fly]: https://www.github.com/flyjs/fly
[fly-badge]: https://img.shields.io/badge/fly-JS-05B3E1.svg?style=flat-square
[mit-badge]: https://img.shields.io/badge/license-MIT-444444.svg?style=flat-square
[npm-pkg-link]: https://www.npmjs.org/package/fly
[npm-ver-link]: https://img.shields.io/npm/v/fly.svg?style=flat-square
[dl-badge]: http://img.shields.io/npm/dm/fly.svg?style=flat-square
[travis-logo]: http://img.shields.io/travis/flyjs/fly.svg?style=flat-square
[travis]: https://travis-ci.org/flyjs/fly
[contributors]: https://github.com/flyjs/fly/graphs/contributors
[es6-example]: https://github.com/flyjs/fly/blob/master/examples/Flyfile.babel.js
[es7-example]: https://github.com/flyjs/fly/blob/master/examples/async/Flypath.babel.js


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
N. Amer. Fl. (New York) 9(5): 316 (1916)

#### Original name
Omphalopsis convexa Murrill

### Remarks
null


text:
package org.springframework.boot.yaml;

import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Properties;

import org.springframework.beans.factory.config.YamlProcessor.DocumentMatcher;
import org.springframework.beans.factory.config.YamlProcessor.MatchStatus;
import org.springframework.core.env.Environment;
import org.springframework.util.StringUtils;

/**
 * {@link DocumentMatcher} backed by {@link Environment#getActiveProfiles()}. A YAML
 * document may define a "spring.profiles" element as a comma-separated list of Spring
 * profile names, optionally negated using the {@code !} character. If both negated and
 * non-negated profiles are specified for a single document, at least one non-negated
 * profile must match and no negated profiles may match.
 *
 * @author Dave Syer
 * @author Matt Benson
 * @author Phillip Webb
 */
public class SpringProfileDocumentMatcher implements DocumentMatcher {

	private static final String[] DEFAULT_PROFILES = new String[] { "^\\s*$" };

	private static final String SPRING_PROFILES = "spring.profiles";

	private String[] activeProfiles = new String[0];

	public SpringProfileDocumentMatcher() {
	}

	public SpringProfileDocumentMatcher(String... profiles) {
		addActiveProfiles(profiles);
	}

	public void addActiveProfiles(String... profiles) {
		LinkedHashSet<String> set = new LinkedHashSet<String>(
				Arrays.asList(this.activeProfiles));
		Collections.addAll(set, profiles);
		this.activeProfiles = set.toArray(new String[set.size()]);
	}

	@Override
	public MatchStatus matches(Properties properties) {
		DocumentMatcher activeProfilesMatcher = getActiveProfilesDocumentMatcher();
		String profiles = properties.getProperty(SPRING_PROFILES);
		String negative = extractProfiles(profiles, ProfileType.NEGATIVE);
		String positive = extractProfiles(profiles, ProfileType.POSITIVE);
		if (StringUtils.hasLength(negative)) {
			properties = new Properties(properties);
			properties.setProperty(SPRING_PROFILES, negative);
			switch (activeProfilesMatcher.matches(properties)) {
			case FOUND:
				return MatchStatus.NOT_FOUND;
			case NOT_FOUND:
				return MatchStatus.FOUND;
			}
			properties.setProperty(SPRING_PROFILES, positive);
		}
		return activeProfilesMatcher.matches(properties);
	}

	private DocumentMatcher getActiveProfilesDocumentMatcher() {
		String[] profiles = this.activeProfiles;
		if (profiles.length == 0) {
			profiles = DEFAULT_PROFILES;
		}
		return new ArrayDocumentMatcher(SPRING_PROFILES, profiles);
	}

	private String extractProfiles(String profiles, ProfileType type) {
		if (profiles == null) {
			return null;
		}
		StringBuilder result = new StringBuilder();
		for (String candidate : StringUtils.commaDelimitedListToSet(profiles)) {
			ProfileType candidateType = ProfileType.POSITIVE;
			if (candidate.startsWith("!")) {
				candidateType = ProfileType.NEGATIVE;
			}
			if (candidateType == type) {
				result.append(result.length() > 0 ? "," : "");
				result.append(candidate.substring(type == ProfileType.POSITIVE ? 0 : 1));
			}
		}
		return result.toString();
	}

	/**
	 * Profile match types.
	 */
	enum ProfileType {
		POSITIVE, NEGATIVE
	}

}


text:
package edu.washington.cs.dericp.diffutils;

import edu.washington.cs.dericp.diffutils.change.LineChange;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * This class provides utility functions that are used throughout diff-utils.
 * Utils is a collection of static methods and does not represent anything.
 */
public class Utils {

    public static final boolean DEBUG = true;

    /**
     * This private constructor prevents clients from instantiating Utils.
     */
    private Utils() {

    }

    /**
     * Reads the file at the specified pathname and returns it as a List of
     * Strings, one per line of the file. The newline terminators will be
     * stripped from each line when stored.
     *
     * @param pathname a String, the path of the file on the machine
     * @return a List of Strings representing the lines of the file
     * at the specified pathname
     * @throws IOException if the file at pathname cannot be read
     */
    public static List<String> readFile(String pathname) throws IOException {
        List<String> lines = new ArrayList<>();
        BufferedReader reader = new BufferedReader(new FileReader(pathname));
        while (reader.ready()) {
            lines.add(reader.readLine());
        }
        reader.close();
        return lines;
    }

    /**
     * Writes a List of Strings, each String representing a line in the file,
     * to the file at the specified pathname. Each line in the output file will
     * be newline-terminated.
     *
     * @param fileLines are the lines of file stored as a List of Strings, one
     *                  String per line of the file
     * @param pathname  is the path of the file to be created/modified
     */
    public static void writeFile(List<String> fileLines, String pathname) {
        try {
            BufferedWriter writer = new BufferedWriter(new FileWriter(pathname));
            Iterator<String> lineIter = fileLines.iterator();
            if (lineIter.hasNext()) {
                writer.write(lineIter.next());
            }
            while (lineIter.hasNext()) {
                writer.newLine();
                writer.write(lineIter.next());
            }
            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


text:
package org.switchyard.component.camel.quartz.model.v1;

import org.switchyard.component.camel.common.model.v1.V1BaseCamelMarshaller;
import org.switchyard.config.Configuration;
import org.switchyard.config.model.Descriptor;
import org.switchyard.config.model.Model;
import org.switchyard.config.model.composite.BindingModel;

/**
 * Camel quartz v1 model marshaler.
 */
public class V1CamelQuartzModelMarshaller extends V1BaseCamelMarshaller {

    private static final String BINDING_QUARTZ = BindingModel.BINDING + '.' + V1CamelQuartzBindingModel.QUARTZ;

    /**
     * Creates new marshaller.
     *
     * @param desc Descriptor
     */
    public V1CamelQuartzModelMarshaller(Descriptor desc) {
        super(desc);
    }

    /**
     * Reads in the Configuration, looking for various knowledge models.
     * If not found, it falls back to the super class (V1BaseCamelMarshaller).
     *
     * @param config the Configuration
     * @return the Model
     */
    @Override
    public Model read(Configuration config) {
        String name = config.getName();
        Descriptor desc = getDescriptor();
        if (BINDING_QUARTZ.equals(name)) {
            return new V1CamelQuartzBindingModel(config, desc);
        }
        return super.read(config);
    }

}


text:
package com.ov3rk1ll.kinocast.utils;

import android.content.Context;

import com.ov3rk1ll.kinocast.api.Parser;
import com.ov3rk1ll.kinocast.data.ViewModel;
import com.ov3rk1ll.kinocast.ui.helper.smartimageview.CoverImage;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.ref.SoftReference;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TheMovieDb {
    public static final String IMAGE_BASE_PATH = "http://image.tmdb.org/t/p/";
    private static final String DISK_CACHE_PATH = "/themoviedb_cache/";
    private static final String API_KEY = "f9dc7e5d12b2640bf4ef1cf20835a1cc";

    private ConcurrentHashMap<String, SoftReference<JSONObject>> memoryCache;
    private String diskCachePath;
    private boolean diskCacheEnabled = false;
    private ExecutorService writeThread;

    public TheMovieDb(Context context) {
        // Set up in-memory cache store
        memoryCache = new ConcurrentHashMap<String, SoftReference<JSONObject>>();

        // Set up disk cache store
        Context appContext = context.getApplicationContext();
        diskCachePath = appContext.getCacheDir().getAbsolutePath() + DISK_CACHE_PATH;

        File outFile = new File(diskCachePath);
        outFile.mkdirs();

        diskCacheEnabled = outFile.exists();

        // Set up threadpool for image fetching tasks
        writeThread = Executors.newSingleThreadExecutor();
    }

    public JSONObject get(CoverImage.Request request) {
        JSONObject json = null;
        String url = request.getUrl();

        // Check for image in memory
        json = getFromMemory(url);

        // Check for image on disk cache
        if(json == null) {
            json = getFromDisk(url);

            // Write bitmap back into memory cache
            if(json != null) {
                cacheToMemory(url, json);
            }
        }
        if(json == null) {
            try {
                ViewModel item = request.getItem();
                // Get IMDB-ID from page
                if(item.getImdbId() == null) {
                    item = Parser.getInstance().loadDetail(item);
                }
                String param = url.substring(url.indexOf("#") + 1);
                // tt1646971?api_key=f9dc7e5d12b2640bf4ef1cf20835a1cc&language=de&external_source=imdb_id
                JSONObject data = Utils.readJson("http://api.themoviedb.org/3/find/" + item.getImdbId() + "?api_key=" + API_KEY + "&external_source=imdb_id&" + param);
                if(data.getJSONArray("movie_results").length() > 0) {
                    json = data.getJSONArray("movie_results").getJSONObject(0);
                }else if(data.getJSONArray("tv_results").length() > 0) {
                    json = data.getJSONArray("tv_results").getJSONObject(0);
                }
                if(json != null) {
                    put(url, json);
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }

        return json;
    }

    public void put(String url, JSONObject json) {
        cacheToMemory(url, json);
        cacheToDisk(url, json);
    }

    private JSONObject getFromMemory(String url) {
        JSONObject json = null;
        SoftReference<JSONObject> softRef = memoryCache.get(getCacheKey(url));
        if(softRef != null){
            json = softRef.get();
        }

        return json;
    }

    private JSONObject getFromDisk(String url) {
        JSONObject json = null;
        if(diskCacheEnabled){
            String filePath = getFilePath(url);
            File file = new File(filePath);
            if(file.exists()) {
                try {
                    BufferedReader input = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
                    StringBuffer content = new StringBuffer();
                    char[] buffer = new char[1024];
                    int num;
                    while ((num = input.read(buffer)) > 0) {
                        content.append(buffer, 0, num);
                    }
                    json = new JSONObject(content.toString());
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                } catch (JSONException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }

            }
        }
        return json;
    }

    private void cacheToMemory(final String url, final JSONObject json) {
        memoryCache.put(getCacheKey(url), new SoftReference<JSONObject>(json));
    }

    private void cacheToDisk(final String url, final JSONObject json) {
        writeThread.execute(new Runnable() {
            @Override
            public void run() {
                if(diskCacheEnabled) {
                    FileOutputStream ostream = null;
                    try {
                        ostream = new FileOutputStream(new File(diskCachePath, getCacheKey(url)));
                        ostream.write(json.toString().getBytes());
                    } catch (FileNotFoundException e) {
                        e.printStackTrace();
                    } catch (IOException e) {
                        e.printStackTrace();
                    } finally {
                        try {
                            if(ostream != null) {
                                ostream.flush();
                                ostream.close();
                            }
                        } catch (IOException e) {}
                    }
                }
            }
        });
    }

    private String getFilePath(String url) {
        return diskCachePath + getCacheKey(url);
    }

    private String getCacheKey(String url) {
        if(url == null){
            throw new RuntimeException("Null url passed in");
        } else {
            if(url.contains("#"))
                url = url.substring(0, url.indexOf("#"));
            return url.replaceAll("[.:/,%?&=]", "+").replaceAll("[+]+", "+");
        }
    }
}


text:
//
//  SRKResizeableCropOverlayView.h
//  SRKImagePicker
//
//  Created by sagar kothari
//  Copyright © 2016 sagar kothari. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SRKCropBorderView.h"
#import "SRKImageCropOverlayView.h"

typedef struct {
    int widhtMultiplyer;
    int heightMultiplyer;
    int xMultiplyer;
    int yMultiplyer;
}SRKResizeableViewBorderMultiplyer;

@interface SRKResizeableCropOverlayView : SRKImageCropOverlayView

@property (nonatomic, strong) UIView* contentView;
@property (nonatomic, strong, readonly) SRKCropBorderView *cropBorderView;

/**
 call this method to create a resizable crop view
 @param frame frame for image
 @param contentSize crop size
 @return crop view instance
 */
-(id)initWithFrame:(CGRect)frame andInitialContentSize:(CGSize)contentSize;

@end


text:
def choose_class(name):
	if name == 'foo':
		class Foo(object):
			pass
		return Foo
	else:
		class Bar(object):
			pass
		return Bar

my_class = choose_class('foo')
print(my_class)


text:
alias reload!='source ~/.zshrc'
alias reload_d!='LOG_LEVEL=debug source ~/.zshrc'
alias reload_t!='LOG_LEVEL=trace source ~/.zshrc'

# Serve current directory on port (default 3000)
# Usage: serve 80
function serve {
  port="${1:-3000}"
  ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => $port, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start"
}


text:
<?php

namespace Mif\MifBundle\Entity;

use Mif\MifBundle\Entity\RemoteBook;
use Mif\MifBundle\Entity\Thumbnail;
use Mif\MifBundle\Entity\Tag;
use Mif\MifBundle\Entity\AmazonCredentials;
use Mif\MifBundle\Utility\HtmlParser;
use Mif\MifBundle\Utility\Thumbnailer;
use JMS\SerializerBundle\Annotation\Exclude;
use \Exception;

class AmazonBook extends RemoteBook {
	/**
	 * @var Tag[]
	 */
	protected $tags;

	/**
	 * @var string
	 * @Exclude
	 */
	protected $reviewsUrl;

	/**
	 * @var float
	 */
	protected $rating;

	/**
	 * @var integer
	 */
	protected $reviewsCount;

	/**
	 * @var array
	 */
	protected $reviews;

	/**
	 * @var integer
	 */
	protected $bestsellersRank;

	/**
	 * @var AmazonCredentials
	 * @Exclude
	 */
	protected $credentials;

	/**
	 * @param integer $id
	 * @param AmazonCredentials $credentials
	 * @param bool $withoutThumbnails
	 */
	public function __construct($id, $credentials, $withoutThumbnails = false) {
		parent::__construct($id, $credentials, $withoutThumbnails);
		$this->setThumbnailsEditionTag(Thumbnail::original);
	}

	public function makeLink($id) {
		$this->link = $this->credentials->getUrlBase().$this->id;
	}

	public function fetch() {
		$response = $this->makeAWSRequest();
		$this->parseResponse($response);
	}

	/**
	 * @return string Response
	 */
	public function makeAWSRequest() {
		// формируем список параметров запроса
		$fields = array();
		$fields['AWSAccessKeyId'] = $this->credentials->getAccessKeyId();
		$fields['AssociateTag'] = $this->credentials->getAssociateTag();
		$fields['ItemId'] = $this->id;
		$fields['MerchantId'] = 'All';
		$fields['Operation'] = 'ItemLookup';
		$fields['ResponseGroup'] = 'Request,Large';
		$fields['Service'] = 'AWSECommerceService';
		$fields['Version'] = '2009-01-06';
		$fields['Timestamp'] = gmdate('Y-m-d\TH:i:s\Z');

		// сортируем параметры согласно спецификации Amazon API
		ksort($fields);

		$query = array();
		foreach ($fields as $key => $value) {
			$query[] = "$key=" . urlencode($value);
		}

		// подписываем запрос секретным ключом
		$string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode('&', $query);
		$signed = urlencode(base64_encode(hash_hmac('sha256', $string, $this->credentials->getSecretAccessKey(), true)));

		// формируем строку запроса к сервису
		$url = 'http://webservices.amazon.com/onca/xml?' . implode('&', $query) . '&Signature=' . $signed;

		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
		$response = curl_exec($ch);
		$info = curl_getinfo($ch);

		if ($info['http_code'] != '200') return false;

		return $response;
	}

	function parseResponse($response) {
		$response = str_replace('<?xml version="1.0" ?>', '', $response);
		$xml = new \SimpleXMLElement($response);

		// Check for errors
		if ($xml->Items->Request->Errors) {
			$message = (string) $xml->Items->Request->Errors->Error->Message;
			throw new Exception($message);
		}

		$itemXml = $xml->Items->Item;
		$thumbnailsXml = $itemXml->ImageSets->ImageSet;
		$attributesXml = $itemXml->ItemAttributes;
		$browseNodesXml = $itemXml->BrowseNodes;

		$itemXml = $xml->Items->Item;

		$largeThumbnail = new Thumbnail();
		if ($thumbnailsXml && $thumbnailsXml->LargeImage) {
			$largeThumbnail->setUrl((string) $thumbnailsXml->LargeImage->URL);
			$largeThumbnail->setWidth((integer) $thumbnailsXml->LargeImage->Width);
			$largeThumbnail->setHeight((integer) $thumbnailsXml->LargeImage->Height);
		}
		else {
			$largeThumbnail->setPath(Thumbnailer::getDefaultThumbnailPath());
			$size = getimagesize(Thumbnailer::getDefaultThumbnailPath());
			$largeThumbnail->setWidth($size[0]);
			$largeThumbnail->setHeight($size[1]);
		}
		$this->thumbnails[Thumbnail::large] = $largeThumbnail;

		$this->title = (string) $attributesXml->Title;
		$this->author = (string) $attributesXml->Author;
		$this->publisher = (string) $attributesXml->Publisher;
		$this->edition = (integer) $attributesXml->Edition;
		$this->edition = $this->edition ? $this->edition : 1;
		$this->publishDate = new \DateTime((string) $attributesXml->PublicationDate, new \DateTimeZone('UTC'));

		$this->tags = $this->extractTags($browseNodesXml);

		$this->bestsellersRank = (integer) $itemXml->SalesRank;

		$reviewsUrl = (string) $itemXml->CustomerReviews->IFrameURL;
		$this->reviewsUrl = $reviewsUrl;

		$reviewsHtml = $this->getReviewsPage($reviewsUrl);

		$reviewsData = $this->parseReviewsHtml($reviewsHtml);
		$this->reviewsCount = $reviewsData['reviewsCount'];
		$this->rating = $reviewsData['rating'];
		$this->reviews = $reviewsData['reviews'];
	}

	/**
	 * @param \SimpleXMLElement $node
	 * @return Tag[]
	 */
	function extractTags(\SimpleXMLElement $node) {
		$rawTags = $this->parseCategoriesAsTags($node);
		$tags = array();
		foreach ($rawTags as $rawTag) {
			$tag = new Tag();
			$tag->setName(strtolower($rawTag));
			$tags[] = $tag;
		}
		return $tags;
	}

	/**
	 * @param \SimpleXMLElement $node
	 * @param  $tags array
	 * @return array
	 */
	function parseCategoriesAsTags(\SimpleXMLElement $node, $tags = array()) {
		foreach ($node->children() as $child) {
			$name = (string) $child->Name;
			if ($name && !in_array($name, $tags) && !in_array($name, array('Subjects', 'Books', 'All Products', 'Products'))) {
				$tags[] = $name;
			}
			if ($child->Ancestors) {
				$tags = $this->parseCategoriesAsTags($child->Ancestors, $tags);
			}
		}
		return $tags;
	}

	function getReviewsPage($url) {
		$response = file_get_contents($url);
//		$response = file_get_contents('mocks/amazon_reviews.html');
		return $response;
	}

	function parseReviewsHtml($html) {
		$doc = new \DOMDocument();
		@$doc->loadHTML($html);

		$data = array();
		$data['rating'] = $this->extractRating($doc);
		$data['reviewsCount'] = $this->extractReviewsCount($doc);
		$data['reviews'] = $this->extractReviewsRating($doc);

		return $data;
	}

	/**
	 * @param DOMElement $parent
	 * @return float
	 */
	function extractRating($parent) {
		$rating = null;
		$spans = HtmlParser::getElementsByClassName($parent, 'span', 'asinReviewsSummary');
		if ($spans && count($spans)) {
			$span = $spans[0];
			/** @var $span DOMElement  */
			$imgs = $span->getElementsByTagName('img');
			/** @var $imgs DOMNodeList  */
			$img = $imgs->item(0);
			/** @var $img DOMElement  */
			$rating = $img->attributes->getNamedItem('title')->value;
			$rating = str_replace(' out of 5 stars', '', $rating);
			$rating = (float) $rating;
		}
		return $rating;
	}

	/**
	 * @param DOMElement $parent
	 * @return integer
	 */
	function extractReviewsCount($parent) {
		$count = null;
		$divs = HtmlParser::getElementsByClassName($parent, 'div', 'crIFrameNumCustReviews');
		if ($divs && count($divs)) {
			$div = $divs[0];
			/** @var $div DOMElement  */
			$spans = HtmlParser::getChildrenByTagName($div, 'span');
			$span = $spans[0];
			$as = HtmlParser::getChildrenByTagName($span, 'a');
			$a = $as[0];
			/** @var $a DOMElement  */
			$count = $a->textContent;
			$count = preg_replace('/ customer reviews?/', '', $count);
			$count = str_replace(',', '', $count);
			$count = (integer) $count;
		}
		return $count;
	}

	/**
	 * @param DOMElement $parent
	 * @return array
	 */
	function extractReviewsRating($parent) {
		$reviews = array();
		$divs = HtmlParser::getElementsByClassName($parent, 'div', 'crIFrameHeaderHistogram');
		if ($divs && count($divs)) {
			$div = $divs[0];
			/** @var $div DOMElement  */
			$tables = $div->getElementsByTagName('table');
			/** @var $tables DOMNodeList  */
			$table = $tables->item(0);
			/** @var $table DOMElement  */
			$rows = $table->getElementsByTagName('tr');
			/** @var $rows DOMNodeList  */
			$reviews = array();
			for ($i = 0; $i < $rows->length; $i ++) {
				// Only five rows (five stars)
				if ($i >= 5) {
					break;
				}
				$row = $rows->item($i);
				/** @var $row DOMElement  */
				$text = $row->textContent;
				$starMatches = array();
				preg_match('/(\d) star/', $text, $starMatches);
				$stars = (integer) $starMatches[1];
				$countMatches = array();
				preg_match('/\(([\d,]+)\)/', $text, $countMatches);
				$count = str_replace(',', '', $countMatches[1]);
				$count = (integer) $count;
				$reviews[$stars] = $count;
			}
		}
		return $reviews;
	}
}

?>


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var Class = require('../constituent.min.js').Class;

exports.Financers = Class(function(_financers) {
  this._financers = _financers;
})
.method("getAll", function() {
  return this._financers.findAll({attributes: ["id", "name"]});
})


text:
'use strict';

class LoadBalancerEditController {
    static $inject: string [] = ['$scope', '$routeParams', 'loadBalancerService', 'configuration'];

    service: kubernetes.ILoadBalancer;
    source: string;
    isNew: boolean;

    constructor(private $scope: any,
                private $routeParams: any,
                private loadBalancerService: ILoadBalancerService,
                private configuration: sextant.IConfiguration) {
        if (!_.isEmpty($routeParams.serviceid)) {
            loadBalancerService.getLoadBalancer($routeParams.serviceid).then((data: kubernetes.ILoadBalancer) => {
                this.service = data;
                this.source = JSON.stringify(data, undefined, 2);
                this.isNew = false;
            });
        } else {
            this.service = {};
            this.source = JSON.stringify(this.service);
            this.isNew = true;
        }
        $scope.vm = this;
    }

    update(): void {
        this.loadBalancerService.saveOrUpdate(this.service);
    }
}

sextant.controller('loadBalancerEditController', LoadBalancerEditController);


text:
package com.trandi.opentld;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Mat;
import org.opencv.highgui.Highgui;
import org.opencv.imgproc.Imgproc;

import android.R.integer;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.util.Log;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.view.accessibility.AccessibilityEvent;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;
import android.widget.RelativeLayout.LayoutParams;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.trandi.opentld.TLDView.ViewUpdateEventListener;
import com.trandi.opentld.tld.Util;

public class MainActivity extends Activity {
	private TLDView _tldView;
	private ArrayList<Rect> boxes = new ArrayList<Rect>();
	private ArrayList<ImageView> boxViews = new ArrayList<ImageView>();
	private ArrayList<String> boxLabels = new ArrayList<String>();
	private ArrayList<RelativeLayout.LayoutParams> originalParams = new ArrayList<RelativeLayout.LayoutParams>();
	private int _mainBoxIndex;
	private double displayRatio;

	private String sessionName;

    private AsyncHttpClient mHttpclient = new AsyncHttpClient();
    private ProgressDialog sendingDialog = null;

    private Button mCaptureButton;

    private String jsonFromHttp;

	private static final String TAG = "TLDActivity";

	private void uploadPicture() throws FileNotFoundException{
		RequestParams params = new RequestParams();
		String storageStatusString = Environment.getExternalStorageState();
        Log.d("MainActivity", storageStatusString);

        String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
        File imgDir = new File(extStorageDirectory, "tldimgs");
	    File mediaFile = new File(imgDir, sessionName+".jpg");
	    params.put("pictures[0]", mediaFile);

		//File imgFile = new File(passedImgPathString);

		mHttpclient.post(this, "http://roc.cs.rochester.edu/ccvideo/RegionSpeak/php/upload.php?session="+sessionName, params, new AsyncHttpResponseHandler() {
		    @Override
		    public void onSuccess(String response) {
			    sendingDialog.dismiss();
			    mCaptureButton.setText("Start tracking");
			    //mCaptureButton.setEnabled(false);
				_tldView.frameSelected = true;
			    Toast.makeText(getApplicationContext(), "Please wait for us to process the photo.", Toast.LENGTH_SHORT).show();
		    }
		    @Override
		    public void onFailure(int statusCode, org.apache.http.Header[] headers, byte[] responseBody, java.lang.Throwable error){
		    	 Log.v("Main", "fail"+statusCode+responseBody+","+error.toString());
		    	 Toast.makeText(getApplicationContext(), "Sending failed", Toast.LENGTH_SHORT).show();
		    	 sendingDialog.dismiss();
		    }
		});
	}

    private BaseLoaderCallback _openCVCallBack = new BaseLoaderCallback(this) {
    	@Override
    	public void onManagerConnected(int status) {
    		switch (status) {
				case LoaderCallbackInterface.SUCCESS:
				{
					Log.i(Util.TAG, "OpenCV loaded successfully");

			        setContentView(R.layout.activity_main);

					_tldView = (TLDView) findViewById(R.id.tld_view);
					_tldView.setVisibility(SurfaceView.VISIBLE);
					_tldView.enableView();

					//_tldView.connectCamera(640,480);

					Handler mainHandler = new Handler(Looper.getMainLooper());
					Runnable myRunnable = new Runnable(){

						@Override
						public void run() {
							// TODO Auto-generated method stub

							mCaptureButton = new Button(getApplicationContext());
							mCaptureButton.setText("Capture a photo");
							//captureButton.setBackgroundColor(getResources().getColor(android.R.color.black));

							RelativeLayout rl = (RelativeLayout) findViewById(R.id.rlay);
							RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(_tldView.getWidth(), _tldView.getHeight());
							params.leftMargin = 0;
							params.topMargin = 0;
							params.height = rl.getHeight();
							params.width = rl.getWidth();

							mCaptureButton.setOnClickListener(new View.OnClickListener() {
								@Override

								public void onClick(View v) {
									//_tldView.setResolution(640, 480);

									if (!_tldView.frameSelected && !_tldView.bbgot) {

										String storageStatusString = Environment.getExternalStorageState();
								        Log.d("MainActivity", storageStatusString);

								        String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
								        File imgDir = new File(extStorageDirectory, "tldimgs");
									    if (!imgDir.exists()){
									    	Boolean dirBool = imgDir.mkdirs();
									        if (dirBool)
									            Log.i(Util.TAG, "SUCCESS creating folder");
									           else
									            Log.i(Util.TAG, "Fail creating folder");
									    }
								        sessionName = new SimpleDateFormat("hh:mm:ssa-MMM-dd-yy", Locale.US).format(new Date());
									    File mediaFile = new File(imgDir, sessionName+".jpg");
									    Mat fileMat = new Mat();
										Imgproc.cvtColor(_tldView._frozeFrame, fileMat, Imgproc.COLOR_BGR2RGB);
									    Boolean bool = Highgui.imwrite(mediaFile.getAbsolutePath(), fileMat);
								        if (bool)
								            Log.i(Util.TAG, "SUCCESS writing image to external storage");
								           else
								            Log.i(Util.TAG, "Fail writing image to external storage");
								        sendingDialog = ProgressDialog.show(MainActivity.this, "Uploading, please wait",
											    null, true);
										sendingDialog.setOnDismissListener(new OnDismissListener() {

											@Override
											public void onDismiss(DialogInterface dialog) {
												// TODO Auto-generated method stub
												mHttpclient.cancelRequests(getApplicationContext(), true);
											}
										});

										sendingDialog.show();
										try {
											uploadPicture();
										} catch (FileNotFoundException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}

									} else if (_tldView.frameSelected && !_tldView.bbgot) {
										//get json return string

										String jsonURL = "http://roc.cs.rochester.edu/ccvideo/RegionSpeak/php/getMasksForPhone.php?&session="+sessionName;
										mHttpclient.get(MainActivity.this, jsonURL, new AsyncHttpResponseHandler() {
										    @Override
										    public void onSuccess(String response) {
										    	jsonFromHttp = response;
												_tldView.jsonBoxReady = true;
												mCaptureButton.setVisibility(View.INVISIBLE);
										    	Log.e("JSONPHP", "Success to get JSON back");

										    }

										    @Override
										    public void onFailure(int statusCode, org.apache.http.Header[] headers, byte[] responseBody, java.lang.Throwable error){
										    	Log.e("JSONPHP", "Failed to get JSON back");
										    }

										});
									}
								}
							});

							Log.v("MainActivity", "added button" + params.width);

							rl.addView(mCaptureButton, params);
						}

					};
					mainHandler.post(myRunnable);

					_tldView.setEventListener(new ViewUpdateEventListener(){

						@Override
						public void onViewUpdated() {
							Log.v(TAG, "view updated!");
							if (!_tldView.jsonBoxReady || !_tldView.getViewReady()) {
								return;
							} else if (_tldView.getTrackedBox() == null) {
						        double bgwidth = _tldView.getFrameSize().width;
						        String jsonString = loadJSONFromHttp();
						        //String jsonString = loadJSONFromAsset();
								try {
									JSONObject obj = new JSONObject(jsonString);
									int mainIndex = 0;
									int maxSize = 0;
									int imgwidth = Integer.parseInt(obj.getJSONArray("resolution").get(0).toString());
									//int imgheight = Integer.parseInt(obj.getJSONArray("resolution").get(1).toString());
									double workratio = (double)imgwidth/(double)bgwidth;
									JSONArray boxesJsonArray = obj.getJSONArray("box");
									if (boxesJsonArray != null) {
										int len = boxesJsonArray.length();
										for (int i=0 ; i < len; i++){
											JSONArray thisbox = boxesJsonArray.getJSONArray(i);
											boxes.add(new Rect((int)(Integer.parseInt(thisbox.getString(0))/workratio),
													(int)(Integer.parseInt(thisbox.getString(1))/workratio),
													(int)(Integer.parseInt(thisbox.getString(2))/workratio),
													(int)(Integer.parseInt(thisbox.getString(3))/workratio)));
											boxLabels.add(thisbox.getString(4));
											int size = boxes.get(i).width() * boxes.get(i).height();
											if (size > maxSize) {
												mainIndex = i;
												maxSize = size;
											}
										}
										_mainBoxIndex = mainIndex;
										Rect mainBox = boxes.get(mainIndex);
										_tldView.setMainBox(mainBox);

										Handler mainHandler = new Handler(Looper.getMainLooper());
										Runnable myRunnable = new Runnable(){

											@Override
											public void run() {
												// TODO Auto-generated method stub
												//ImageView bg =
												for (int i=0 ; i<boxes.size();i++){
													ImageView iv;
													RelativeLayout.LayoutParams params;
													Rect thisRect = boxes.get(i);

													RelativeLayout rl = (RelativeLayout) findViewById(R.id.rlay);
													displayRatio = rl.getHeight()/_tldView.getFrameSize().height;
													double xoffset = (rl.getWidth() - _tldView.getFrameSize().width*displayRatio)/2;
													//Log.v(TAG, "rl width:" + rl.getWidth() + "," + _tldView.getFrameSize().width);
													//Log.v(TAG, "rl height:" + rl.getHeight() + "," + _tldView.getFrameSize().height);

													double yoffset = (rl.getHeight() - _tldView.getFrameSize().height*displayRatio)/2;

													iv = new ImageView(getApplicationContext());
													iv.setImageResource(R.drawable.ic_launcher);
													//if (i==_mainBoxIndex) {
														// iv.setBackgroundColor(Color.GREEN);
													//}

													params = new RelativeLayout.LayoutParams(thisRect.right-thisRect.left,thisRect.bottom-thisRect.top);
													params.leftMargin = (int) (thisRect.left*displayRatio+xoffset);
													params.topMargin = (int) (thisRect.top*displayRatio+yoffset);
													params.height = (int) ((double)params.height*displayRatio);
													params.width = (int) ((double)params.width*displayRatio);
													boxes.set(i, new Rect(params.leftMargin, params.topMargin, params.leftMargin+params.width, params.topMargin+params.height));

													rl.addView(iv, params);
													originalParams.add(params);
													iv.setFocusable(true);
													iv.setAlpha(1);
													boxViews.add(iv);
													iv.setContentDescription(boxLabels.get(i));
													iv.setTag(Integer.valueOf(i));
													iv.setFocusable(true);

													iv.setOnHoverListener(new View.OnHoverListener() {

														@Override
														public boolean onHover(View v, MotionEvent event) {
															// TODO Auto-generated method stub
															switch (event.getAction()) {
															case MotionEvent.ACTION_HOVER_EXIT:
																Boolean contained = false;

																for(int i=0;i<boxes.size();i++){
																	//String cd = v.getContentDescription().toString();
																	//Find out if it's the same
																	//int thisIndex = cd.charAt(cd.length()-1)-48;
																	int thisIndex = ((Integer) v.getTag()).intValue();
																	if (boxes.get(i).contains((int)event.getRawX(), (int)event.getRawY()) && i!=thisIndex) {
																		boxViews.get(i).requestFocus();
																		boxViews.get(i).sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
																		contained = true;
																		break;
																		}
																}
																if (!contained) {
																	TLDView bg = (TLDView)findViewById(R.id.tld_view);
																	bg.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
																}
																break;

															default:
																break;
															}
															return false;
														}
													});
													for (int j=0; j<i ; j++){
														if(thisRect.contains(boxes.get(j))){
															boxViews.get(j).bringToFront();
														}
													}
													///iv.bringToFront();
												}
											}
										};
										mainHandler.post(myRunnable);
									}

								} catch (JSONException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
							} else {
								org.opencv.core.Rect mainRect = _tldView.getMainBox();
								org.opencv.core.Rect trackedRect = _tldView.getTrackedBox();
								if (trackedRect == null) {
									return;
								}
								if (mainRect == null) {
									mainRect = trackedRect;
								}
								//final double xoffset = trackedRect.x + (double)trackedRect.width/2 - mainRect.x - (double)mainRect.width/2;
								//final double yoffset = trackedRect.y + (double)trackedRect.height/2 - mainRect.y - (double)mainRect.height/2;

								final double xoffset = trackedRect.x - mainRect.x;
								final double yoffset = trackedRect.y - mainRect.y;

								final double widthPer = (double)trackedRect.width/(double)mainRect.width;
								final double heightPer = (double)trackedRect.height/(double)mainRect.height;
								Log.v(TAG, "update tracked" + trackedRect.x+","+trackedRect.y+","+trackedRect.width+","+trackedRect.height);
								Log.v(TAG, "update main" + mainRect.x+","+mainRect.y+","+mainRect.width+","+mainRect.height);
								Log.v(TAG, "update change" + xoffset+","+yoffset+","+widthPer+","+heightPer);

								Handler mainHandler = new Handler(Looper.getMainLooper());
								Runnable myRunnable = new Runnable(){

									@Override
									public void run() {
										RelativeLayout relativeL = (RelativeLayout) findViewById(R.id.rlay);
										for(int i=0 ; i<boxViews.size();i++){

											ImageView thisImageView = boxViews.get(i);
											/*if(Integer.parseInt((String) thisImageView.getContentDescription()) != _mainBoxIndex){
												continue;
											}*/

											RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(originalParams.get(i));

											params.width = (int) (params.width / widthPer);
											params.height = (int) (params.height / heightPer);
											params.leftMargin = (int) (params.leftMargin - xoffset*displayRatio);
											params.topMargin = (int) (params.topMargin - yoffset*displayRatio);
											//Hide none main views
											if (!_tldView.isTracked()) {
												thisImageView.setVisibility(View.INVISIBLE);
												Log.v(TAG, "set to invisible!!!!!");
												//params.leftMargin = 10000;
												//thisImageView.requestLayout();
												//continue;
											}
											/*else if (!_tldView.isMainBoxClose() && ((Integer) thisImageView.getTag()).intValue() != _mainBoxIndex ) {
												//thisImageView.setVisibility(View.INVISIBLE);
												//params.leftMargin = 10000;

												//if(relativeL.add)
											}*/
											else {
												thisImageView.setVisibility(View.VISIBLE);

											}
											thisImageView.setLayoutParams(params);
											//relativeL.updateViewLayout(thisImageView, params);
										}
									}

								};

								mainHandler.post(myRunnable);

							}
						}

					});
				} break;
				default:
				{
					Log.e(Util.TAG, "OpenCV can NOT be loaded");
					super.onManagerConnected(status);
				} break;
			}
    	}
    };

    @Override
    public void onBackPressed()
    {
         // code here to show dialog
         super.onBackPressed();  // optional depending on your needs
 		mHttpclient.get(this, "http://roc.cs.rochester.edu/ccvideo/RegionSpeak/php/setInactive.php?session="+sessionName, new AsyncHttpResponseHandler() {
		    @Override
		    public void onSuccess(String response) {
		    	finish();
		    }
		    @Override
		    public void onFailure(int statusCode, org.apache.http.Header[] headers, byte[] responseBody, java.lang.Throwable error){
		    	 Log.v("Main", "fail"+statusCode+responseBody+","+error.toString());
		    	 Toast.makeText(getApplicationContext(), "Check internet connection.", Toast.LENGTH_SHORT).show();
		    	 //sendingDialog.dismiss();
		    }
		});
    }

    protected void onUserLeaveHint () {

		mHttpclient.get(this, "http://roc.cs.rochester.edu/ccvideo/RegionSpeak/php/setInactive.php?session="+sessionName, new AsyncHttpResponseHandler() {
		    @Override
		    public void onSuccess(String response) {
		    	finish();
		    }
		    @Override
		    public void onFailure(int statusCode, org.apache.http.Header[] headers, byte[] responseBody, java.lang.Throwable error){
		    	 Log.v("Main", "fail"+statusCode+responseBody+","+error.toString());
		    	 Toast.makeText(getApplicationContext(), "Check internet connection.", Toast.LENGTH_SHORT).show();
		    	 //sendingDialog.dismiss();
		    }
		});
    }

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        Log.i(Util.TAG, "Trying to load OpenCV library");
        if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_6, this, _openCVCallBack)) {
        	Log.e(Util.TAG, "Cannot connect to OpenCV Manager");
        }

        String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
        File imgDir = new File(extStorageDirectory, "tldimgs");
        if(!imgDir.isDirectory()) {
        	imgDir.mkdir();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    public String loadJSONFromHttp(){
    	return jsonFromHttp;
    }

	public String loadJSONFromAsset() {
        String json = null;
        try {

            InputStream is = getAssets().open("testjson.json");

            int size = is.available();

            byte[] buffer = new byte[size];

            is.read(buffer);

            is.close();

            json = new String(buffer, "UTF-8");

        } catch (IOException ex) {
            ex.printStackTrace();
            return null;
        }
        return json;

    }
}


text:
import cluster from 'cluster';

export default class ReloadNodejsServerWebpackPlugin {
  constructor(options) {
    this.workers = [];
    this.pluginCallback = null;

    this.options = Object.assign(
      {
        path: 'index.js',
        isDebuggerEnabled: false,
        args: [],
      },
      options || {});

    cluster.on('online', (worker) => {
      this.workers.push(worker);

      if (this.pluginCallback) {
        this.pluginCallback();
      }
    });
  }

  apply(compiler) {
    compiler.plugin('after-emit', (_, callback) => {
      this.pluginCallback = callback;

      this.workers.forEach((worker) => {
        try {
          worker.kill();
        } catch (e) {
          console.error(`Master process can't kill worker #${worker.process.pid}`);
        }
      });

      this.workers = [];

      const args = this.options.isDebuggerEnabled
        ? ['--inspect'].concat(this.options.args)
        : this.options.args;

      cluster.setupMaster({
        args,
        exec: this.options.path,
      });

      cluster.fork();
    });
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         id="org.chibios.spc5.components.nil.rtos.spc560dxx"
         name="NIL RTOS for SPC560Dxx Component"
         point="com.st.tools.spc5.extension.v1">
      <component
            headerName="nil.h,osal.h,isrs.h,hal.h"
            icon="rsc/chibios.ico"
            initFunction="halInit,osalInit,isrInit,chSysInit"
            isPlatform="false">
            <description>
                This is a meta component that depends on all components required to create a NIL RTOS environment for the STMicroelectronics SPC560Dxx automotive microcontrollers family.
            </description>
            <categories>
               <category
                     id="NIL RTOS/Platforms/SPC560Dxx">
               </category>
            </categories>
            <configuration>
               <description>
                  This is a meta components with no settings.
               </description>
               <image
                     align="left"
                     file="rsc/chibios48x48.png">
                  <text>
                     NIL RTOS is GPL3-licensed free software. A special exception has been added to the GPL3 in order to allow inclusion in closed source applications, details are in the exception.txt document.
                  </text>
               </image>
            </configuration>
            <requiredFeatures>
               <requiredFeature
                     id="com.st.tools.spc5.features.build.gccenv">
               </requiredFeature>
               <requiredFeature
                     id="com.st.tools.spc5.features.platform.spc560dxx">
               </requiredFeature>
               <requiredFeature
                     id="org.chibios.spc5.features.platform.spc560dxx">
               </requiredFeature>
            </requiredFeatures>
            <exportedFeatures>
               <exportedFeature
                     brief="NIL RTOS"
                     exclusive="false"
                     id="com.st.tools.spc5.services.rtos">
               </exportedFeature>
               <exportedFeature
                     brief="Generic NIL RTOS environment."
                     exclusive="false"
                     id="org.chibios.spc5.components.chibios.nil">
               </exportedFeature>
               <exportedFeature
                     brief="SPC560Dxx NIL RTOS environment."
                     exclusive="false"
                     id="org.chibios.spc5.components.chibios.nil.spc560dxx">
               </exportedFeature>
            </exportedFeatures>
      </component>
   </extension>

</plugin>


text:
<?php

namespace Lug\Component\Behat\Extension\Api\Context\Initializer;

use Behat\Behat\Context\Context;
use Behat\Behat\Context\Initializer\ContextInitializer;
use Http\Client\HttpClient;
use Http\Discovery\HttpClientDiscovery;
use Http\Discovery\MessageFactoryDiscovery;
use Http\Message\MessageFactory;
use Lug\Component\Behat\Extension\Api\Context\ApiContextInterface;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\FileLocatorInterface;

/**
 * @author GeLo <geloen.eric@gmail.com>
 */
class ApiContextInitializer implements ContextInitializer
{
    /**
     * @var string
     */
    private $baseUrl;

    /**
     * @var HttpClient
     */
    private $client;

    /**
     * @var MessageFactory
     */
    private $messageFactory;

    /**
     * @var FileLocatorInterface
     */
    private $fileLocator;

    /**
     * @param string   $baseUrl
     * @param string[] $filePaths
     */
    public function __construct($baseUrl, array $filePaths)
    {
        $this->baseUrl = $baseUrl;
        $this->client = HttpClientDiscovery::find();
        $this->messageFactory = MessageFactoryDiscovery::find();
        $this->fileLocator = new FileLocator($filePaths);
    }

    /**
     * {@inheritdoc}
     */
    public function initializeContext(Context $context)
    {
        if (!$context instanceof ApiContextInterface) {
            return;
        }

        $context->setBaseUrl($this->baseUrl);
        $context->setClient($this->client);
        $context->setRequestFactory($this->messageFactory);
        $context->setFileLocator($this->fileLocator);
    }
}


text:
namespace Atata
{
    ///
    /// Represents the image control (<c></c>).
    /// Default search finds the first occurring <c></c> element.
    ///
    /// <typeparam name="TOwner">The type of the owner page object.</typeparam>
    [ControlDefinition("img", ComponentTypeName = "image")]
    public class Image<TOwner> : Control<TOwner>
        where TOwner : PageObject<TOwner>
    {
        ///
        /// Gets the <see cref="DataProvider{TData, TOwner}"/> instance for the <c>src</c> attribute.
        ///
        public DataProvider<string, TOwner> Source => Attributes.Src;

        ///
        /// Gets the <see cref="DataProvider{TData, TOwner}"/> instance for the value indicating whether the image file is loaded.
        ///
        public DataProvider<bool, TOwner> IsLoaded => GetOrCreateDataProvider("loaded state", GetIsLoaded);

        protected virtual bool GetIsLoaded()
        {
            return Script.ExecuteAgainst<bool>("return arguments[0].complete && (typeof arguments[0].naturalWidth) != 'undefined' && arguments[0].naturalWidth > 0;");
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLToolkit.Data;
using bv.model.BLToolkit;
using bv.model.Model.Core;

namespace bv.model.Model.Extenders
{
    public interface ICreateExtender<T, R>
    {
        R Create(DbManagerProxy manager, IObject Parent, int? HACode, params object[] pars);
    }
}


text:
var Chaplin  = require('chaplin'),
    BaseView = require('./view')

class BaseCollectionView extends Chaplin.CollectionView {}

BaseCollectionView.prototype.animationDuration = 0
BaseCollectionView.prototype.getTemplateFunction = BaseView.prototype.getTemplateFunction
BaseCollectionView.prototype.useCssAnimation = true

module.exports = BaseCollectionView


text:
<?php namespace Danvuquoc\Kraken;

use Illuminate\Support\Facades\Facade;

class KrakenFacade extends Facade
{
    protected static function getFacadeAccessor()
    {
        return 'Kraken';
    }
}