text:
namespace content {

// Handles the initial registration of a Service Worker and the
// subsequent update of existing registrations.
//
// The control flow includes most or all of the following,
// depending on what is already registered:
//  - creating a ServiceWorkerRegistration instance if there isn't
//    already something registered
//  - creating a ServiceWorkerVersion for the new version.
//  - starting a worker for the ServiceWorkerVersion
//  - firing the 'install' event at the ServiceWorkerVersion
//  - firing the 'activate' event at the ServiceWorkerVersion
//  - waiting for older ServiceWorkerVersions to deactivate
//  - designating the new version to be the 'active' version
//  - updating storage
class ServiceWorkerRegisterJob : public ServiceWorkerRegisterJobBase {
 public:
  typedef base::OnceCallback<void(blink::ServiceWorkerStatusCode status,
                                  const std::string& status_message,
                                  ServiceWorkerRegistration* registration)>
      RegistrationCallback;

  // For registration jobs.
  CONTENT_EXPORT ServiceWorkerRegisterJob(
      ServiceWorkerContextCore* context,
      const GURL& script_url,
      const blink::mojom::ServiceWorkerRegistrationOptions& options,
      blink::mojom::FetchClientSettingsObjectPtr
          outside_fetch_client_settings_object);

  // For update jobs.
  CONTENT_EXPORT ServiceWorkerRegisterJob(
      ServiceWorkerContextCore* context,
      ServiceWorkerRegistration* registration,
      bool force_bypass_cache,
      bool skip_script_comparison,
      blink::mojom::FetchClientSettingsObjectPtr
          outside_fetch_client_settings_object);
  ~ServiceWorkerRegisterJob() override;

  // Registers a callback to be called when the promise would resolve (whether
  // successfully or not). Multiple callbacks may be registered.
  void AddCallback(RegistrationCallback callback);

  // ServiceWorkerRegisterJobBase implementation:
  void Start() override;
  void Abort() override;
  void WillShutDown() override;
  bool Equals(ServiceWorkerRegisterJobBase* job) const override;
  RegistrationJobType GetType() const override;

  void DoomInstallingWorker();

 private:
  enum Phase {
    INITIAL,
    START,
    REGISTER,
    UPDATE,
    INSTALL,
    STORE,
    COMPLETE,
    ABORT,
  };

  // Holds internal state of ServiceWorkerRegistrationJob, to compel use of the
  // getter/setter functions.
  struct Internal {
    Internal();
    ~Internal();
    scoped_refptr<ServiceWorkerRegistration> registration;

    // Holds the version created by this job. It can be the 'installing',
    // 'waiting', or 'active' version depending on the phase.
    scoped_refptr<ServiceWorkerVersion> new_version;
  };

  void set_registration(scoped_refptr<ServiceWorkerRegistration> registration);
  ServiceWorkerRegistration* registration() const;
  void set_new_version(scoped_refptr<ServiceWorkerVersion> version);
  ServiceWorkerVersion* new_version();

  void SetPhase(Phase phase);

  void StartImpl();
  void ContinueWithRegistration(
      blink::ServiceWorkerStatusCode status,
      scoped_refptr<ServiceWorkerRegistration> registration);
  void ContinueWithUpdate(
      blink::ServiceWorkerStatusCode status,
      scoped_refptr<ServiceWorkerRegistration> registration);

  bool IsUpdateCheckNeeded() const;
  void TriggerUpdateCheck(
      scoped_refptr<network::SharedURLLoaderFactory> loader_factory);

  // Refer ServiceWorkerUpdateChecker::UpdateStatusCallback for the meaning of
  // the parameters.
  void OnUpdateCheckFinished(
      ServiceWorkerSingleScriptUpdateChecker::Result result,
      std::unique_ptr<ServiceWorkerSingleScriptUpdateChecker::FailureInfo>
          failure_info);

  void RegisterAndContinue();
  void ContinueWithNewRegistration(
      scoped_refptr<ServiceWorkerRegistration> new_registration);
  void ContinueWithUninstallingRegistration(
      scoped_refptr<ServiceWorkerRegistration> existing_registration,
      blink::ServiceWorkerStatusCode status);
  void ContinueWithRegistrationForSameScriptUrl(
      scoped_refptr<ServiceWorkerRegistration> existing_registration,
      blink::ServiceWorkerStatusCode status);
  void UpdateAndContinue();

  // Creates a new ServiceWorkerVersion for [[Update]].
  void CreateNewVersionForUpdate();
  // Starts a service worker for [[Update]]. The script comparison has finished
  // at this point. It starts install phase.
  void StartWorkerForUpdate(scoped_refptr<ServiceWorkerVersion> version);
  void OnStartWorkerFinished(blink::ServiceWorkerStatusCode status);
  void OnStoreRegistrationComplete(blink::ServiceWorkerStatusCode status);
  void InstallAndContinue();
  void DispatchInstallEvent(blink::ServiceWorkerStatusCode start_worker_status);
  void OnInstallFinished(int request_id,
                         blink::mojom::ServiceWorkerEventStatus event_status);
  void OnInstallFailed(blink::ServiceWorkerStatusCode status);
  void Complete(blink::ServiceWorkerStatusCode status);
  void Complete(blink::ServiceWorkerStatusCode status,
                const std::string& status_message);
  void CompleteInternal(blink::ServiceWorkerStatusCode status,
                        const std::string& status_message);
  void ResolvePromise(blink::ServiceWorkerStatusCode status,
                      const std::string& status_message,
                      ServiceWorkerRegistration* registration);

  void AddRegistrationToMatchingProviderHosts(
      ServiceWorkerRegistration* registration);

  void OnPausedAfterDownload();

  void BumpLastUpdateCheckTimeIfNeeded();

  // The ServiceWorkerContextCore object must outlive this.
  ServiceWorkerContextCore* const context_;

  std::unique_ptr<ServiceWorkerUpdateChecker> update_checker_;

  RegistrationJobType job_type_;
  const GURL scope_;
  GURL script_url_;
  // "A job has a worker type ("classic" or "module")."
  // https://w3c.github.io/ServiceWorker/#dfn-job-worker-type
  blink::mojom::ScriptType worker_script_type_ =
      blink::mojom::ScriptType::kClassic;
  const blink::mojom::ServiceWorkerUpdateViaCache update_via_cache_;
  // "A job has a client (a service worker client). It is initially null."
  // https://w3c.github.io/ServiceWorker/#dfn-job-client
  // This fetch client settings object roughly corresponds to the job's client.
  blink::mojom::FetchClientSettingsObjectPtr
      outside_fetch_client_settings_object_;
  std::vector<RegistrationCallback> callbacks_;
  Phase phase_;
  bool is_shutting_down_;
  Internal internal_;
  bool is_promise_resolved_;
  bool should_uninstall_on_failure_;
  bool force_bypass_cache_;
  bool skip_script_comparison_;
  blink::ServiceWorkerStatusCode promise_resolved_status_;
  std::string promise_resolved_status_message_;
  scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_;

  base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_{this};

  DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob);
};

}  // namespace content

#endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_


text:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

require 'core_ext/xmlrpc_client_patch'
require 'fake_web'

describe XMLRPC::Client do
  describe ".set_debug" do
    context "takes nil for its parameter" do
      pending
    end

    context "takes a Logger for its parameter" do
      pending
    end
  end
end

redpajama_set_name: RedPajamaGithub


text: An Arduino project to program nrf24l01+


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~    Copyright 2016, Joseph B. Ottinger
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~    you may not use this file except in compliance with the License.
  ~    You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~    See the License for the specific language governing permissions and
  ~    limitations under the License.
  ~
  -->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.autumncode</groupId>
    <artifactId>logback-reloader</artifactId>
    <version>1.0-SNAPSHOT</version>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>[6.9.10,)</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>[1.1.5,)</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>[1.7.16,)</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>4.2.4.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>4.2.4.RELEASE</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>1.8</version>
                <configuration>
                    <verbose>false</verbose>
                    <addSvnKeyWords>false</addSvnKeyWords>
                </configuration>
                <executions>
                    <execution>
                        <id>first</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <licenseName>apache_v2</licenseName>
                            <roots>
                                <root>src/main/java</root>
                                <root>src/test</root>
                            </roots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
package com.amazonaws.services.simpleworkflow.model;

import java.io.Serializable;

/**
 *

 * Configuration settings registered with the activity type.
 *

 */
public class ActivityTypeConfiguration implements Serializable, Cloneable {

    /**
     *

     * Optional. The default maximum duration for tasks of an activity
     * type specified when registering the activity type. You can override this
     * default when scheduling a task through the
     * ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     */
    private String defaultTaskStartToCloseTimeout;
    /**
     *

     * Optional. The default maximum time, in seconds, before which a
     * worker processing a task must report progress by calling
     * RecordActivityTaskHeartbeat.
     *

     *

     * You can specify this value only when registering an activity type.
     * The registered default value can be overridden when you schedule a task
     * through the ScheduleActivityTask decision. If the activity
     * worker subsequently attempts to record a heartbeat or returns a result,
     * the activity worker receives an UnknownResource fault. In
     * this case, Amazon SWF no longer considers the activity task to be valid;
     * the activity worker should clean up the activity task.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     */
    private String defaultTaskHeartbeatTimeout;
    /**
     *

     * Optional. The default task list specified for this activity type
     * at registration. This default is used if a task list is not provided when
     * a task is scheduled through the ScheduleActivityTask
     * decision. You can override the default registered task list when
     * scheduling a task through the ScheduleActivityTask decision.
     *

     */
    private TaskList defaultTaskList;
    /**
     *

     * Optional. The default task priority for tasks of this activity
     * type, specified at registration. If not set, then "0" will be used as the
     * default priority. This default can be overridden when scheduling an
     * activity task.
     *

     *

     * Valid values are integers that range from Java's
     * Integer.MIN_VALUE (-2147483648) to
     * Integer.MAX_VALUE (2147483647). Higher numbers indicate
     * higher priority.
     *

     *

     * For more information about setting task priority, see Setting Task Priority in the Amazon Simple Workflow Developer
     * Guide.
     *

     */
    private String defaultTaskPriority;
    /**
     *

     * Optional. The default maximum duration, specified when registering
     * the activity type, that a task of an activity type can wait before being
     * assigned to a worker. You can override this default when scheduling a
     * task through the ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     */
    private String defaultTaskScheduleToStartTimeout;
    /**
     *

     * Optional. The default maximum duration, specified when registering
     * the activity type, for tasks of this activity type. You can override this
     * default when scheduling a task through the
     * ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     */
    private String defaultTaskScheduleToCloseTimeout;

    /**
     *

     * Optional. The default maximum duration for tasks of an activity
     * type specified when registering the activity type. You can override this
     * default when scheduling a task through the
     * ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @param defaultTaskStartToCloseTimeout
     *        Optional. The default maximum duration for tasks of an
     *        activity type specified when registering the activity type. You
     *        can override this default when scheduling a task through the
     *        ScheduleActivityTask decision.

     */

    public void setDefaultTaskStartToCloseTimeout(
            String defaultTaskStartToCloseTimeout) {
        this.defaultTaskStartToCloseTimeout = defaultTaskStartToCloseTimeout;
    }

    /**
     *

     * Optional. The default maximum duration for tasks of an activity
     * type specified when registering the activity type. You can override this
     * default when scheduling a task through the
     * ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @return Optional. The default maximum duration for tasks of an
     *         activity type specified when registering the activity type. You
     *         can override this default when scheduling a task through the
     *         ScheduleActivityTask decision.

     */

    public String getDefaultTaskStartToCloseTimeout() {
        return this.defaultTaskStartToCloseTimeout;
    }

    /**
     *

     * Optional. The default maximum duration for tasks of an activity
     * type specified when registering the activity type. You can override this
     * default when scheduling a task through the
     * ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @param defaultTaskStartToCloseTimeout
     *        Optional. The default maximum duration for tasks of an
     *        activity type specified when registering the activity type. You
     *        can override this default when scheduling a task through the
     *        ScheduleActivityTask decision.

     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ActivityTypeConfiguration withDefaultTaskStartToCloseTimeout(
            String defaultTaskStartToCloseTimeout) {
        setDefaultTaskStartToCloseTimeout(defaultTaskStartToCloseTimeout);
        return this;
    }

    /**
     *

     * Optional. The default maximum time, in seconds, before which a
     * worker processing a task must report progress by calling
     * RecordActivityTaskHeartbeat.
     *

     *

     * You can specify this value only when registering an activity type.
     * The registered default value can be overridden when you schedule a task
     * through the ScheduleActivityTask decision. If the activity
     * worker subsequently attempts to record a heartbeat or returns a result,
     * the activity worker receives an UnknownResource fault. In
     * this case, Amazon SWF no longer considers the activity task to be valid;
     * the activity worker should clean up the activity task.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @param defaultTaskHeartbeatTimeout
     *        Optional. The default maximum time, in seconds, before which a
     *        worker processing a task must report progress by calling
     *        RecordActivityTaskHeartbeat.

     *

     *        You can specify this value only when registering an
     *        activity type. The registered default value can be overridden when
     *        you schedule a task through the ScheduleActivityTask
     *        decision. If the activity worker subsequently attempts to record a
     *        heartbeat or returns a result, the activity worker receives an
     *        UnknownResource fault. In this case, Amazon SWF no
     *        longer considers the activity task to be valid; the activity
     *        worker should clean up the activity task.
     *

     */

    public void setDefaultTaskHeartbeatTimeout(
            String defaultTaskHeartbeatTimeout) {
        this.defaultTaskHeartbeatTimeout = defaultTaskHeartbeatTimeout;
    }

    /**
     *

     * Optional. The default maximum time, in seconds, before which a
     * worker processing a task must report progress by calling
     * RecordActivityTaskHeartbeat.
     *

     *

     * You can specify this value only when registering an activity type.
     * The registered default value can be overridden when you schedule a task
     * through the ScheduleActivityTask decision. If the activity
     * worker subsequently attempts to record a heartbeat or returns a result,
     * the activity worker receives an UnknownResource fault. In
     * this case, Amazon SWF no longer considers the activity task to be valid;
     * the activity worker should clean up the activity task.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @return Optional. The default maximum time, in seconds, before which
     *         a worker processing a task must report progress by calling
     *         RecordActivityTaskHeartbeat.

     *

     *         You can specify this value only when registering an
     *         activity type. The registered default value can be overridden
     *         when you schedule a task through the
     *         ScheduleActivityTask decision. If the activity
     *         worker subsequently attempts to record a heartbeat or returns a
     *         result, the activity worker receives an
     *         UnknownResource fault. In this case, Amazon SWF no
     *         longer considers the activity task to be valid; the activity
     *         worker should clean up the activity task.
     *

     */

    public String getDefaultTaskHeartbeatTimeout() {
        return this.defaultTaskHeartbeatTimeout;
    }

    /**
     *

     * Optional. The default maximum time, in seconds, before which a
     * worker processing a task must report progress by calling
     * RecordActivityTaskHeartbeat.
     *

     *

     * You can specify this value only when registering an activity type.
     * The registered default value can be overridden when you schedule a task
     * through the ScheduleActivityTask decision. If the activity
     * worker subsequently attempts to record a heartbeat or returns a result,
     * the activity worker receives an UnknownResource fault. In
     * this case, Amazon SWF no longer considers the activity task to be valid;
     * the activity worker should clean up the activity task.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @param defaultTaskHeartbeatTimeout
     *        Optional. The default maximum time, in seconds, before which a
     *        worker processing a task must report progress by calling
     *        RecordActivityTaskHeartbeat.

     *

     *        You can specify this value only when registering an
     *        activity type. The registered default value can be overridden when
     *        you schedule a task through the ScheduleActivityTask
     *        decision. If the activity worker subsequently attempts to record a
     *        heartbeat or returns a result, the activity worker receives an
     *        UnknownResource fault. In this case, Amazon SWF no
     *        longer considers the activity task to be valid; the activity
     *        worker should clean up the activity task.
     *

     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ActivityTypeConfiguration withDefaultTaskHeartbeatTimeout(
            String defaultTaskHeartbeatTimeout) {
        setDefaultTaskHeartbeatTimeout(defaultTaskHeartbeatTimeout);
        return this;
    }

    /**
     *

     * Optional. The default task list specified for this activity type
     * at registration. This default is used if a task list is not provided when
     * a task is scheduled through the ScheduleActivityTask
     * decision. You can override the default registered task list when
     * scheduling a task through the ScheduleActivityTask decision.
     *

     *
     * @param defaultTaskList
     *        Optional. The default task list specified for this activity
     *        type at registration. This default is used if a task list is not
     *        provided when a task is scheduled through the
     *        ScheduleActivityTask decision. You can override the
     *        default registered task list when scheduling a task through the
     *        ScheduleActivityTask
     */

    public void setDefaultTaskList(TaskList defaultTaskList) {
        this.defaultTaskList = defaultTaskList;
    }

    /**
     *

     * Optional. The default task list specified for this activity type
     * at registration. This default is used if a task list is not provided when
     * a task is scheduled through the ScheduleActivityTask
     * decision. You can override the default registered task list when
     * scheduling a task through the ScheduleActivityTask decision.
     *

     *
     * @return Optional. The default task list specified for this activity
     *         type at registration. This default is used if a task list is not
     *         provided when a task is scheduled through the
     *         ScheduleActivityTask decision. You can override the
     *         default registered task list when scheduling a task through the
     *         ScheduleActivityTask
     */

    public TaskList getDefaultTaskList() {
        return this.defaultTaskList;
    }

    /**
     *

     * Optional. The default task list specified for this activity type
     * at registration. This default is used if a task list is not provided when
     * a task is scheduled through the ScheduleActivityTask
     * decision. You can override the default registered task list when
     * scheduling a task through the ScheduleActivityTask decision.
     *

     *
     * @param defaultTaskList
     *        Optional. The default task list specified for this activity
     *        type at registration. This default is used if a task list is not
     *        provided when a task is scheduled through the
     *        ScheduleActivityTask decision. You can override the
     *        default registered task list when scheduling a task through the
     *        ScheduleActivityTask
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ActivityTypeConfiguration withDefaultTaskList(
            TaskList defaultTaskList) {
        setDefaultTaskList(defaultTaskList);
        return this;
    }

    /**
     *

     * Optional. The default task priority for tasks of this activity
     * type, specified at registration. If not set, then "0" will be used as the
     * default priority. This default can be overridden when scheduling an
     * activity task.
     *

     *

     * Valid values are integers that range from Java's
     * Integer.MIN_VALUE (-2147483648) to
     * Integer.MAX_VALUE (2147483647). Higher numbers indicate
     * higher priority.
     *

     *

     * For more information about setting task priority, see Setting Task Priority in the Amazon Simple Workflow Developer
     * Guide.
     *

     *
     * @param defaultTaskPriority
     *        Optional. The default task priority for tasks of this activity
     *        type, specified at registration. If not set, then "0" will be used
     *        as the default priority. This default can be overridden when
     *        scheduling an activity task.

     *

     *        Valid values are integers that range from Java's
     *        Integer.MIN_VALUE (-2147483648) to
     *        Integer.MAX_VALUE (2147483647). Higher numbers
     *        indicate higher priority.
     *

     *

     *        For more information about setting task priority, see Setting Task Priority in the Amazon Simple Workflow
     *        Developer Guide
     */

    public void setDefaultTaskPriority(String defaultTaskPriority) {
        this.defaultTaskPriority = defaultTaskPriority;
    }

    /**
     *

     * Optional. The default task priority for tasks of this activity
     * type, specified at registration. If not set, then "0" will be used as the
     * default priority. This default can be overridden when scheduling an
     * activity task.
     *

     *

     * Valid values are integers that range from Java's
     * Integer.MIN_VALUE (-2147483648) to
     * Integer.MAX_VALUE (2147483647). Higher numbers indicate
     * higher priority.
     *

     *

     * For more information about setting task priority, see Setting Task Priority in the Amazon Simple Workflow Developer
     * Guide.
     *

     *
     * @return Optional. The default task priority for tasks of this
     *         activity type, specified at registration. If not set, then "0"
     *         will be used as the default priority. This default can be
     *         overridden when scheduling an activity task.

     *

     *         Valid values are integers that range from Java's
     *         Integer.MIN_VALUE (-2147483648) to
     *         Integer.MAX_VALUE (2147483647). Higher numbers
     *         indicate higher priority.
     *

     *

     *         For more information about setting task priority, see Setting Task Priority in the Amazon Simple Workflow
     *         Developer Guide
     */

    public String getDefaultTaskPriority() {
        return this.defaultTaskPriority;
    }

    /**
     *

     * Optional. The default task priority for tasks of this activity
     * type, specified at registration. If not set, then "0" will be used as the
     * default priority. This default can be overridden when scheduling an
     * activity task.
     *

     *

     * Valid values are integers that range from Java's
     * Integer.MIN_VALUE (-2147483648) to
     * Integer.MAX_VALUE (2147483647). Higher numbers indicate
     * higher priority.
     *

     *

     * For more information about setting task priority, see Setting Task Priority in the Amazon Simple Workflow Developer
     * Guide.
     *

     *
     * @param defaultTaskPriority
     *        Optional. The default task priority for tasks of this activity
     *        type, specified at registration. If not set, then "0" will be used
     *        as the default priority. This default can be overridden when
     *        scheduling an activity task.

     *

     *        Valid values are integers that range from Java's
     *        Integer.MIN_VALUE (-2147483648) to
     *        Integer.MAX_VALUE (2147483647). Higher numbers
     *        indicate higher priority.
     *

     *

     *        For more information about setting task priority, see Setting Task Priority in the Amazon Simple Workflow
     *        Developer Guide
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ActivityTypeConfiguration withDefaultTaskPriority(
            String defaultTaskPriority) {
        setDefaultTaskPriority(defaultTaskPriority);
        return this;
    }

    /**
     *

     * Optional. The default maximum duration, specified when registering
     * the activity type, that a task of an activity type can wait before being
     * assigned to a worker. You can override this default when scheduling a
     * task through the ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @param defaultTaskScheduleToStartTimeout
     *        Optional. The default maximum duration, specified when
     *        registering the activity type, that a task of an activity type can
     *        wait before being assigned to a worker. You can override this
     *        default when scheduling a task through the
     *        ScheduleActivityTask decision.

     */

    public void setDefaultTaskScheduleToStartTimeout(
            String defaultTaskScheduleToStartTimeout) {
        this.defaultTaskScheduleToStartTimeout = defaultTaskScheduleToStartTimeout;
    }

    /**
     *

     * Optional. The default maximum duration, specified when registering
     * the activity type, that a task of an activity type can wait before being
     * assigned to a worker. You can override this default when scheduling a
     * task through the ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @return Optional. The default maximum duration, specified when
     *         registering the activity type, that a task of an activity type
     *         can wait before being assigned to a worker. You can override this
     *         default when scheduling a task through the
     *         ScheduleActivityTask decision.

     */

    public String getDefaultTaskScheduleToStartTimeout() {
        return this.defaultTaskScheduleToStartTimeout;
    }

    /**
     *

     * Optional. The default maximum duration, specified when registering
     * the activity type, that a task of an activity type can wait before being
     * assigned to a worker. You can override this default when scheduling a
     * task through the ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @param defaultTaskScheduleToStartTimeout
     *        Optional. The default maximum duration, specified when
     *        registering the activity type, that a task of an activity type can
     *        wait before being assigned to a worker. You can override this
     *        default when scheduling a task through the
     *        ScheduleActivityTask decision.

     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ActivityTypeConfiguration withDefaultTaskScheduleToStartTimeout(
            String defaultTaskScheduleToStartTimeout) {
        setDefaultTaskScheduleToStartTimeout(defaultTaskScheduleToStartTimeout);
        return this;
    }

    /**
     *

     * Optional. The default maximum duration, specified when registering
     * the activity type, for tasks of this activity type. You can override this
     * default when scheduling a task through the
     * ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @param defaultTaskScheduleToCloseTimeout
     *        Optional. The default maximum duration, specified when
     *        registering the activity type, for tasks of this activity type.
     *        You can override this default when scheduling a task through the
     *        ScheduleActivityTask decision.

     */

    public void setDefaultTaskScheduleToCloseTimeout(
            String defaultTaskScheduleToCloseTimeout) {
        this.defaultTaskScheduleToCloseTimeout = defaultTaskScheduleToCloseTimeout;
    }

    /**
     *

     * Optional. The default maximum duration, specified when registering
     * the activity type, for tasks of this activity type. You can override this
     * default when scheduling a task through the
     * ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @return Optional. The default maximum duration, specified when
     *         registering the activity type, for tasks of this activity type.
     *         You can override this default when scheduling a task through the
     *         ScheduleActivityTask decision.

     */

    public String getDefaultTaskScheduleToCloseTimeout() {
        return this.defaultTaskScheduleToCloseTimeout;
    }

    /**
     *

     * Optional. The default maximum duration, specified when registering
     * the activity type, for tasks of this activity type. You can override this
     * default when scheduling a task through the
     * ScheduleActivityTask decision.
     *

     *

     * The duration is specified in seconds; an integer greater than or equal to
     * 0. The value "NONE" can be used to specify unlimited duration.
     *

     *
     * @param defaultTaskScheduleToCloseTimeout
     *        Optional. The default maximum duration, specified when
     *        registering the activity type, for tasks of this activity type.
     *        You can override this default when scheduling a task through the
     *        ScheduleActivityTask decision.

     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ActivityTypeConfiguration withDefaultTaskScheduleToCloseTimeout(
            String defaultTaskScheduleToCloseTimeout) {
        setDefaultTaskScheduleToCloseTimeout(defaultTaskScheduleToCloseTimeout);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDefaultTaskStartToCloseTimeout() != null)
            sb.append("DefaultTaskStartToCloseTimeout: "
                    + getDefaultTaskStartToCloseTimeout() + ",");
        if (getDefaultTaskHeartbeatTimeout() != null)
            sb.append("DefaultTaskHeartbeatTimeout: "
                    + getDefaultTaskHeartbeatTimeout() + ",");
        if (getDefaultTaskList() != null)
            sb.append("DefaultTaskList: " + getDefaultTaskList() + ",");
        if (getDefaultTaskPriority() != null)
            sb.append("DefaultTaskPriority: " + getDefaultTaskPriority() + ",");
        if (getDefaultTaskScheduleToStartTimeout() != null)
            sb.append("DefaultTaskScheduleToStartTimeout: "
                    + getDefaultTaskScheduleToStartTimeout() + ",");
        if (getDefaultTaskScheduleToCloseTimeout() != null)
            sb.append("DefaultTaskScheduleToCloseTimeout: "
                    + getDefaultTaskScheduleToCloseTimeout());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ActivityTypeConfiguration == false)
            return false;
        ActivityTypeConfiguration other = (ActivityTypeConfiguration) obj;
        if (other.getDefaultTaskStartToCloseTimeout() == null
                ^ this.getDefaultTaskStartToCloseTimeout() == null)
            return false;
        if (other.getDefaultTaskStartToCloseTimeout() != null
                && other.getDefaultTaskStartToCloseTimeout().equals(
                        this.getDefaultTaskStartToCloseTimeout()) == false)
            return false;
        if (other.getDefaultTaskHeartbeatTimeout() == null
                ^ this.getDefaultTaskHeartbeatTimeout() == null)
            return false;
        if (other.getDefaultTaskHeartbeatTimeout() != null
                && other.getDefaultTaskHeartbeatTimeout().equals(
                        this.getDefaultTaskHeartbeatTimeout()) == false)
            return false;
        if (other.getDefaultTaskList() == null
                ^ this.getDefaultTaskList() == null)
            return false;
        if (other.getDefaultTaskList() != null
                && other.getDefaultTaskList().equals(this.getDefaultTaskList()) == false)
            return false;
        if (other.getDefaultTaskPriority() == null
                ^ this.getDefaultTaskPriority() == null)
            return false;
        if (other.getDefaultTaskPriority() != null
                && other.getDefaultTaskPriority().equals(
                        this.getDefaultTaskPriority()) == false)
            return false;
        if (other.getDefaultTaskScheduleToStartTimeout() == null
                ^ this.getDefaultTaskScheduleToStartTimeout() == null)
            return false;
        if (other.getDefaultTaskScheduleToStartTimeout() != null
                && other.getDefaultTaskScheduleToStartTimeout().equals(
                        this.getDefaultTaskScheduleToStartTimeout()) == false)
            return false;
        if (other.getDefaultTaskScheduleToCloseTimeout() == null
                ^ this.getDefaultTaskScheduleToCloseTimeout() == null)
            return false;
        if (other.getDefaultTaskScheduleToCloseTimeout() != null
                && other.getDefaultTaskScheduleToCloseTimeout().equals(
                        this.getDefaultTaskScheduleToCloseTimeout()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime
                * hashCode
                + ((getDefaultTaskStartToCloseTimeout() == null) ? 0
                        : getDefaultTaskStartToCloseTimeout().hashCode());
        hashCode = prime
                * hashCode
                + ((getDefaultTaskHeartbeatTimeout() == null) ? 0
                        : getDefaultTaskHeartbeatTimeout().hashCode());
        hashCode = prime
                * hashCode
                + ((getDefaultTaskList() == null) ? 0 : getDefaultTaskList()
                        .hashCode());
        hashCode = prime
                * hashCode
                + ((getDefaultTaskPriority() == null) ? 0
                        : getDefaultTaskPriority().hashCode());
        hashCode = prime
                * hashCode
                + ((getDefaultTaskScheduleToStartTimeout() == null) ? 0
                        : getDefaultTaskScheduleToStartTimeout().hashCode());
        hashCode = prime
                * hashCode
                + ((getDefaultTaskScheduleToCloseTimeout() == null) ? 0
                        : getDefaultTaskScheduleToCloseTimeout().hashCode());
        return hashCode;
    }

    @Override
    public ActivityTypeConfiguration clone() {
        try {
            return (ActivityTypeConfiguration) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}


text:
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.

Imports System.Composition
Imports System.Diagnostics.CodeAnalysis
Imports System.Threading
Imports Microsoft.CodeAnalysis.CodeRefactorings
Imports Microsoft.CodeAnalysis.GenerateConstructorFromMembers
Imports Microsoft.CodeAnalysis.Host.Mef
Imports Microsoft.CodeAnalysis.Options
Imports Microsoft.CodeAnalysis.PickMembers
Imports Microsoft.CodeAnalysis.Simplification

Namespace Microsoft.CodeAnalysis.VisualBasic.GenerateConstructorFromMembers
    <ExportCodeRefactoringProvider(LanguageNames.VisualBasic, Name:=PredefinedCodeRefactoringProviderNames.GenerateConstructorFromMembers), [Shared]>
    <ExtensionOrder(Before:=PredefinedCodeRefactoringProviderNames.GenerateEqualsAndGetHashCodeFromMembers)>
    Friend NotInheritable Class VisualBasicGenerateConstructorFromMembersCodeRefactoringProvider
        Inherits AbstractGenerateConstructorFromMembersCodeRefactoringProvider

        <ImportingConstructor>
        <Obsolete(MefConstruction.ImportingConstructorMessage, True)>
        Public Sub New()
        End Sub

        ''' <summary>
        ''' For testing purposes only.
        ''' </summary>
        <SuppressMessage("RoslynDiagnosticsReliability", "RS0034:Exported parts should have [ImportingConstructor]", Justification:="Used incorrectly by tests")>
        Friend Sub New(pickMembersService_forTesting As IPickMembersService)
            MyBase.New(pickMembersService_forTesting)
        End Sub

        Protected Overrides Function ContainingTypesOrSelfHasUnsafeKeyword(containingType As INamedTypeSymbol) As Boolean
            Return False
        End Function

        Protected Overrides Function ToDisplayString(parameter As IParameterSymbol, format As SymbolDisplayFormat) As String
            Return SymbolDisplay.ToDisplayString(parameter, format)
        End Function

        Protected Overrides Function PrefersThrowExpressionAsync(document As Document, fallbackOptions As SimplifierOptionsProvider, cancellationToken As CancellationToken) As ValueTask(Of Boolean)
            ' No throw expression preference option is defined for VB because it doesn't support throw expressions.
            Return ValueTaskFactory.FromResult(False)
        End Function
    End Class
End Namespace


text:
var request_help = "// request: \n\
// a synchronous HTTP client library for Tropo, built in the 'request' style \n\
// \n\
// forges an HTTP request towards the specified URL \n\
//      - method: GET, POST, PUT, DELETE or PATCH \n\
//      - url: Http endpoint you wish to hit \n\
//      - options lets you specify HTTP headers, timeouts... and callbacks \n\
//            * headers: set of HTTP key/values pairs \n\
//            * timeout: enforces Connect and Read timeouts, defaults to 10s \n\
//            * onTimeout(): function fired if the timeout expires \n\
//            * onError(err): function fired if an error occured \n\
//            * onResponse(response): function fired if the request is successful, see below for the structure of the response \n\
// \n\
// returns a result object with properties : \n\
//      - type: 'response', 'error' or 'timeout' \n\
//      - response: only if the type is 'response', with object properties: \n\
//            * statusCode: integer \n\
//            * headers: map of key/values pairs, values are either strings or arrays depending on the header \n\
//            * body: string \n\
//"

// request:
//     a synchronous HTTP client library for Tropo, built in the "request" style
//
// forges an HTTP request towards the specified URL
//      - method: GET, POST, PUT, DELETE or PATCH
//      - url: Http endpoint you wish to hit
//      - options lets you specify HTTP headers, timeouts... and callbacks
//            * headers: set of HTTP key/values pairs
//            * timeout: enforces Connect and Read timeouts, defaults to 10s
//            * onTimeout(): function fired if the timeout  expires
//            * onError(err): function fired if an error occured
//            * onResponse(response): function fired if the request is successful, see below for the structure of the response
//
// returns a result object with properties :
//      - type: 'response', 'error' or 'timeout'
//      - response: only if the type is 'response', with object properties:
//            * statusCode: integer
//            * headers: map of key/values pairs, values are either strings or arrays depending on the header
//            * body: string
//
// v0.4.0
//
function request(method, url, options) {
    // Tropo Emulator friendly: inject the trequest function when script is run locally
    if (global.request) {
        return global.request(method, url, options);
    }

    // from now on, we're running on Tropo Scripting platform
    if (!method || !url) {
        throw Error("Invalid arguments, expecting method & url at a minimum");
    }
    if ((method !== "GET") && (method !== "POST") && (method !== "PUT") && (method !== "DELETE") && (method !== "PATCH")) {
        throw Error("Method " + method + " is not supported");
    }

    // TODO: Check URL is not malformed

    // Default timeout
    var timeout = options.timeout ? options.timeout : 10000;

    // Fetch contents
    var result = {};
    var contents = null;
    var connection = null;
    try {
        connection = new java.net.URL(url).openConnection();
        connection.setConnectTimeout(timeout);
        connection.setReadTimeout(timeout);

        connection.setDoInput(true);
        connection.setRequestMethod(method);
        connection.setInstanceFollowRedirects(false);

        if (options.headers) {
            for (var key in options.headers) {
                if (options.headers.hasOwnProperty(key)) {
                    // add header
                    var value = options.headers[key];
                    if (typeof value !== "string") {
                        log("REQUEST: headers key: " + key + " does not contain a string, ignoring...");
                    }
                    else {
                        connection.setRequestProperty(key, value);
                    }
                }
            }
        }
        if (options.json) {
             connection.setRequestProperty("Content-Type", "application/json");
        }

        if (options.body) {
            connection.setDoOutput(true);
            var payload = options.body;
            if (options.json) {
                payload = JSON.stringify(options.body);
            }
            var bodyWriter = connection.getOutputStream();
            org.apache.commons.io.IOUtils.write(payload, bodyWriter, "UTF-8");
            bodyWriter.flush();
            bodyWriter.close();
        }
        else {
            connection.setDoOutput(false);
            connection.connect();
        }

        var statusCode = connection.getResponseCode();
        result.response = { statusCode: statusCode };

        // Read response if exists
        var contents;
        if ((statusCode >= 200) && (statusCode < 300)) {
            var bodyReader = connection.getInputStream();
            contents = new String(org.apache.commons.io.IOUtils.toString(bodyReader, "UTF-8"));
        }
        else if ((statusCode >= 400) && (statusCode < 600)) {
            var bodyReader = connection.getErrorStream();
            if (bodyReader) {
                contents = new String(org.apache.commons.io.IOUtils.toString(bodyReader, "UTF-8"));
            }
        }
        result.response.body = contents;

        // Invoke response callback
        if (options.onResponse) {
            options.onResponse(result.response);
        }

        // Return response
        result.type = "response";
        return result;
    }
    catch (err) {
        log("REQUEST: could not reach url, err: " + err.message);

        // Invoke error callback
        if (options.onError) {
            options.onError(err);
        }

        // Return response
        result.type = "error";
        result.error = err;
        return result;
    }
}
//
///////////////////////////////////////////////////////////////////////////////////////

request.help = request_help;

module.exports = request;


text:
UPGRADE FROM 2.3 to 2.4
=======================

### Dependencies

You will need to follow the dependencies upgrade instructions.

## Datagrid builders

If you have implemented a custom datagrid builder, you must adapt the signature of its `addFilter` method to match the one in `DatagridBuilderInterface` again.

## sonata_type_model_autocomplete
CSS class ``sonata-autocomplete-dropdown-item`` is not automatically added to dropdown autocomplete item in ``sonata_type_model_autocomplete``, use option ``dropdown_item_css_class`` to set the CSS class of dropdown item.

## Standard Layout
``sonata_wrapper`` block was moved and is now inside the ``.wrapper`` div of admin lte theme.

## ErrorElement

The inline validation has been migrating to CoreBundle. Just rename ``Sonata\AdminBundle\Validator\ErrorElement`` to ``Sonata\CoreBundle\Validator\ErrorElement``

## AdminLTE 2

AdminLTE version 2 has been integrated, this should work out of the box if you havn't change templates. If not you can review the upgrade guide here : [http://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#upgrade](http://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#upgrade)


text:
package com.joescii

import org.scalacheck.Gen._

object Generators {
  def substringInput = for {
    s <- alphaStr if s.length > 0
    l <- choose(1, s.length)
  } yield (s, l)

  def twoStrings = for {
    a <- alphaStr if a.length > 0
    b <- alphaStr if b.length > 0
  } yield (a, b)
}


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

<title>Constants</title>
<meta name="date" content="2014-05-02">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.felina.photographer

Class Constants

java.lang.Object

com.felina.photographer.Constants

public final class Constants
extends java.lang.Object

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

static class
Constants.Extra

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
DOMAIN

static java.lang.String
LOG_TAG

static java.lang.String
NULL_TOKEN

static int
REQUEST_IMAGE_CAPTURE

static int
RETRY_LIMIT

static java.lang.String
STORAGE_FOLDER

Constructor Summary

Constructors

Constructor and Description

Constants()

Method Summary

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

LOG_TAG

public static java.lang.String LOG_TAG

DOMAIN

public static java.lang.String DOMAIN

REQUEST_IMAGE_CAPTURE

public static int REQUEST_IMAGE_CAPTURE

RETRY_LIMIT

public static int RETRY_LIMIT

NULL_TOKEN

public static java.lang.String NULL_TOKEN

STORAGE_FOLDER

public static java.lang.String STORAGE_FOLDER

Constructor Detail

Constants

public Constants()

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
<?php

namespace PropertyPrivately\PropertyBundle\Entity\Repository;

use PropertyPrivately\CoreBundle\Entity\Repository\PersistentEntityRepository;

/**
 * Offer Repository
 */
class OfferRepository extends PersistentEntityRepository
{
}


text:
<!DOCTYPE html>

    <title>导入</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet"/>
    <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet"/>
    <link href="data/styles.css" type="text/css" rel="stylesheet"/>
    <link href="files/导入/styles.css" type="text/css" rel="stylesheet"/>

        <input id="u528_input" type="text" value="" disabled/>

        <input id="u529_input" type="submit" value="浏览"/>

        <input id="u530_input" type="submit" value="导入"/>

        <input id="u531_input" type="submit" value="取消"/>


text:
import sys
from rq import Connection, Worker
from catalog_harvesting.cli import setup_logging
from catalog_harvesting.api import redis_connection

def main():

    setup_logging()

    with Connection(redis_connection):
        qs = sys.argv[1:] or ['default']

        w = Worker(qs)
        w.work()

if __name__ == '__main__':
    main()


text:
(function(exports, moduleName) {
'use strict';

/**
 * A very simple publisher subscriber system for exposing potential tracking events
*/
function create () {
  var topics = {};

  /**
   * Add a listener to a topic.
   *
   * @public
   * @method subscribe
   *
   * @param {String}  topic name
   * @param {Function}
  */
  function subscribe (topic, listener) {
    if (topic === '' || topic === undefined) return;
    if (!topics.hasOwnProperty(topic)) topics[topic] = [];

    topics[topic].push(listener);
  }

  /**
   * Call all listeners for a given topic with some data.
   *
   * @public
   * @method publish
   *
   * @param {String}  topic name. If topic does not exist, return.
   * @param {Any}  Passes data to listener functions. If data is undefined, pass empty object.
  */
  function publish (topic, data) {
    if (!topics.hasOwnProperty(topic)) return;

    for (var i = 0; i < topics[topic].length; i++) {
      if (typeof topics[topic][i] === 'function') {
        topics[topic][i](data !== undefined ? data : {});
      }
    }
  }

  return {
    subscribe : subscribe,
    publish : publish
  };
}

if (typeof define === 'function' && define.amd) {
  define(moduleName, [], create);

} else if (typeof module === 'object' && module.exports) {
  /*
    Using CommonJS syntax, we have to explicitly require each
    module because browserify uses static module analysis.
  */
  module.exports = create();

} else {
  /*
    Gilt build syntax. 'exports' variable could be window here
    or an empty object, as in Gilt's case
  */
  exports[moduleName] = create();
}

}(typeof exports === 'object' && exports || this, 'ubar_pubsub' /* moduleName */));


text:
@class TJPHotLiveItem;

@interface TJPHotLiveItemCell : UITableViewCell
@property (nonatomic, strong) TJPHotLiveItem *liveItem;

@end


text:
package com.intellij.lang.properties.structureView;

import com.intellij.icons.AllIcons;
import com.intellij.ide.structureView.StructureViewTreeElement;
import com.intellij.ide.util.treeView.smartTree.Group;
import com.intellij.ide.util.treeView.smartTree.TreeElement;
import com.intellij.lang.properties.IProperty;
import com.intellij.lang.properties.editor.PropertiesAnchorizer;
import com.intellij.lang.properties.editor.ResourceBundleEditorViewElement;
import com.intellij.lang.properties.editor.ResourceBundlePropertyStructureViewElement;
import com.intellij.lang.properties.psi.Property;
import com.intellij.navigation.ItemPresentation;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import com.intellij.util.NullableFunction;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * @author cdr
 */
public class PropertiesPrefixGroup implements Group, ResourceBundleEditorViewElement {
  private final Collection<TreeElement> myProperties;
  private final @NotNull String myPrefix;
  private final String myPresentableName;
  private final @NotNull String mySeparator;

  public PropertiesPrefixGroup(final Collection<TreeElement> properties,
                               final @NotNull String prefix,
                               final String presentableName,
                               final @NotNull String separator) {
    myProperties = properties;
    myPrefix = prefix;
    myPresentableName = presentableName;
    mySeparator = separator;
  }

  public String getPresentableName() {
    return myPresentableName;
  }

  @NotNull
  public String getSeparator() {
    return mySeparator;
  }

  @NotNull
  public String getPrefix() {
    return myPrefix;
  }

  @NotNull
  public ItemPresentation getPresentation() {
    return new ItemPresentation() {
      public String getPresentableText() {
        return myPresentableName;
      }

      public String getLocationString() {
        return null;
      }

      public Icon getIcon(boolean open) {
        return AllIcons.Nodes.Advice;
      }
    };
  }

  @NotNull
  public Collection<TreeElement> getChildren() {
    Collection<TreeElement> result = new ArrayList<TreeElement>();
    List<String> prefixWords = StringUtil.split(myPrefix, mySeparator);
    for (TreeElement treeElement : myProperties) {
      if (!(treeElement instanceof StructureViewTreeElement)) {
        continue;
      }
      Object value = ((StructureViewTreeElement)treeElement).getValue();
      if (value instanceof PropertiesAnchorizer.PropertyAnchor) {
        value = ((PropertiesAnchorizer.PropertyAnchor)value).getRepresentative();
      }
      if (!(value instanceof IProperty)) {
        continue;
      }
      final String key = ((IProperty) value).getUnescapedKey();
      if (key == null) {
        continue;
      }
      boolean startsWith;
      if (!key.equals(myPrefix)) {
        List<String> keyWords = StringUtil.split(key, mySeparator);
        startsWith = prefixWords.size() < keyWords.size();
        if (startsWith) {
          for (int i = 0; i < prefixWords.size(); i++) {
            String prefixWord = prefixWords.get(i);
            String keyWord = keyWords.get(i);
            if (!Comparing.strEqual(keyWord, prefixWord)) {
              startsWith = false;
              break;
            }
          }
        }
      } else {
        startsWith = true;
      }
      if (startsWith) {
        result.add(treeElement);
        String presentableName = key.substring(myPrefix.length());
        presentableName = StringUtil.trimStart(presentableName, mySeparator);
        if (treeElement instanceof PropertiesStructureViewElement) {
          ((PropertiesStructureViewElement)treeElement).setPresentableName(presentableName);
        }
        if (treeElement instanceof ResourceBundlePropertyStructureViewElement) {
          ((ResourceBundlePropertyStructureViewElement)treeElement).setPresentableName(presentableName);
        }
      }
    }
    return result;
  }

  @Override
  public PsiElement[] getPsiElements() {
    final List<PsiElement> elements = ContainerUtil.mapNotNull(getChildren(), new NullableFunction<TreeElement, PsiElement>() {
      @Nullable
      @Override
      public PsiElement fun(final TreeElement treeElement) {
        if (treeElement instanceof PropertiesStructureViewElement) {
          PropertiesStructureViewElement propertiesElement = (PropertiesStructureViewElement)treeElement;
          IProperty property = propertiesElement.getValue();
          return property.getPsiElement();
        }
        else if (treeElement instanceof ResourceBundlePropertyStructureViewElement) {
          return ((ResourceBundlePropertyStructureViewElement)treeElement).getPsiElements()[0];
        }
        return null;
      }
    });
    return elements.toArray(new PsiElement[elements.size()]);
  }

  public boolean equals(final Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    final PropertiesPrefixGroup group = (PropertiesPrefixGroup)o;

    if (!myPrefix.equals(group.myPrefix)) return false;

    return true;
  }

  public int hashCode() {
    return myPrefix.hashCode();
  }
}


text:
package de.kumpelblase2.remoteentities.api.goals;

import de.kumpelblase2.remoteentities.api.RemoteEntity;
import de.kumpelblase2.remoteentities.api.thinking.DesireBase;
import de.kumpelblase2.remoteentities.api.thinking.DesireType;
import de.kumpelblase2.remoteentities.persistence.ParameterData;
import de.kumpelblase2.remoteentities.persistence.SerializeAs;
import de.kumpelblase2.remoteentities.utilities.NMSUtil;
import de.kumpelblase2.remoteentities.utilities.ReflectionUtil;
import net.minecraft.server.v1_7_R1.*;

/**
 * Using this desire the entity will be tempted by a given item in a players hand.
 * The entity might also run away when the player moves.
 */
public class DesireTempt extends DesireBase
{
	@SerializeAs(pos = 1)
	protected int m_itemID;
	@SerializeAs(pos = 2)
	protected boolean m_scaredByMovement;
	protected double m_x;
	protected double m_y;
	protected double m_z;
	protected double m_pitch;
	protected double m_yaw;
	protected EntityHuman m_nearPlayer;
	protected int m_delayTicks;
	protected boolean m_isTempted;
	protected boolean m_avoidWaterState;
	@SerializeAs(pos = 3)
	protected double m_speed;

	@Deprecated
	public DesireTempt(RemoteEntity inEntity, int inItemID, boolean inScaredByMovement)
	{
		super(inEntity);
		this.m_itemID = inItemID;
		this.m_scaredByMovement = inScaredByMovement;
		this.m_type = DesireType.FULL_CONCENTRATION;
	}

	public DesireTempt(int inItemID, boolean inScaredByMovement)
	{
		this(inItemID, inScaredByMovement, -1);
	}

	public DesireTempt(int inItemID, boolean inScaredByMovement, double inSpeed)
	{
		super();
		this.m_itemID = inItemID;
		this.m_scaredByMovement = inScaredByMovement;
		this.m_type = DesireType.FULL_CONCENTRATION;
		this.m_speed = inSpeed;
	}

	@Override
	public boolean shouldExecute()
	{
		if(this.m_delayTicks > 0)
		{
			this.m_delayTicks--;
			return false;
		}
		else
		{
			if(this.getEntityHandle() == null)
				return false;

			this.m_nearPlayer = this.getEntityHandle().world.findNearbyPlayer(this.getEntityHandle(), 10);
			if(this.m_nearPlayer == null)
				return false;
			else
			{
				ItemStack item = this.m_nearPlayer.bD();
				return item != null && Item.b(item.getItem()) == this.m_itemID;
			}
		}
	}

	@Override
	public boolean canContinue()
	{
		if(this.m_scaredByMovement)
		{
			if(this.getEntityHandle().e(this.m_nearPlayer) < 36)
			{
				if(this.m_nearPlayer.e(this.m_x, this.m_y, this.m_z) > 0.010000000000000002D)
					return false;

				if(Math.abs(this.m_nearPlayer.pitch - this.m_pitch) > 5 || Math.abs(this.m_nearPlayer.yaw - this.m_yaw) > 5)
					return false;
			}
			else
			{
				this.m_x = this.m_nearPlayer.locX;
				this.m_y = this.m_nearPlayer.locY;
				this.m_z = this.m_nearPlayer.locZ;
			}

			this.m_yaw = this.m_nearPlayer.yaw;
			this.m_pitch = this.m_nearPlayer.pitch;
		}

		return this.shouldExecute();
	}

	@Override
	public void startExecuting()
	{
		this.m_x = this.m_nearPlayer.locX;
		this.m_y = this.m_nearPlayer.locY;
		this.m_z = this.m_nearPlayer.locZ;
		this.m_isTempted = true;
		this.m_avoidWaterState = this.getNavigation().a();
		this.getNavigation().a(false);
	}

	@Override
	public void stopExecuting()
	{
		this.m_nearPlayer = null;
		this.getNavigation().h();
		this.m_delayTicks = 100;
		this.m_isTempted = false;
		this.getNavigation().a(this.m_avoidWaterState);
	}

	@Override
	public boolean update()
	{
		NMSUtil.getControllerLook(this.getEntityHandle()).a(this.m_nearPlayer, 30, NMSUtil.getMaxHeadRotation(this.getEntityHandle()));
		if(this.getEntityHandle().e(this.m_nearPlayer) < 6.25)
			this.getNavigation().h();
		else
			this.getRemoteEntity().move(this.m_nearPlayer.getBukkitEntity(), (this.m_speed == -1 ? this.getRemoteEntity().getSpeed() : this.m_speed));

		return false;
	}

	public boolean isTempted()
	{
		return this.m_isTempted;
	}

	@Override
	public ParameterData[] getSerializableData()
	{
		return ReflectionUtil.getParameterDataForClass(this).toArray(new ParameterData[0]);
	}
}


text:
<?php

namespace Emergence\CMS;

use Cache;

class ContentBlock extends \VersionedRecord
{
    // ActiveRecord configuration
    public static $tableName = 'content_blocks';
    public static $singularNoun = 'content block';
    public static $pluralNoun = 'content blocks';
    public static $collectionRoute = '/content-blocks';
    public static $useCache = true;

    public static $fields = array(
        'Handle' => array(
            'unique' => true
        )
        ,'Renderer' => array(
            'type' => 'enum'
            ,'values' => array('text', 'html', 'markdown')
            ,'default' => 'markdown'
        )
        ,'Content' => array(
            'type' => 'clob'
        )
    );

    public static $dynamicFields = array(
        'html' => array(
            'getter' => 'getHtml'
        )
    );

    public static $searchConditions = array(
        'Content' => array(
            'qualifiers' => array('any', 'content')
            ,'points' => 2
            ,'sql' => 'Content Like "%%%s%%"'
        )
        ,'Handle' => array(
            'qualifiers' => array('any', 'handle')
            ,'points' => 2
            ,'sql' => 'Handle Like "%%%s%%"'
        )
    );

    public static function getByHandle($contentHandle)
    {
        return static::getByField('Handle', $contentHandle, true);
    }

    public function validate($deep = true)
    {
        // call parent
        parent::validate($deep);

        $this->_validator->validate(array(
            'field' => 'Handle'
            ,'validator' => 'handle'
            ,'errorMessage' => 'Handle can only contain letters, numbers, hyphens, and underscores'
        ));

        // save results
        return $this->finishValidation();
    }

    public function save($deep = true)
    {
        // call parent
        parent::save($deep);

        if ($this->isFieldDirty('Content')) {
            Cache::delete($this->getHtmlCacheKey());
        }
    }

    protected function getHtmlCacheKey()
    {
        return 'content-block-html/'.$this->Handle;
    }

    public function getHtml()
    {
        $cacheKey = $this->getHtmlCacheKey();

        if (false === ($result = Cache::fetch($cacheKey))) {
            $result = '';

            switch ($this->Renderer) {
                case 'text':
                    $result = htmlspecialchars($this->Content);
                    break;
                case 'html':
                    $result = $this->Content;
                    break;
                case 'markdown':
                    $result =
                        \Michelf\SmartyPantsTypographer::defaultTransform(
                            \Michelf\MarkdownExtra::defaultTransform($this->Content)
                        );
                    break;
            }

            Cache::store($cacheKey, $result);
        }

        return $result;
    }
}


text:
PYTHONIC_NS_BEGIN
namespace numpy
{
  namespace random
  {

    template <class pS>
    types::ndarray<double, pS> exponential(double scale, pS const &shape)
    {
      types::ndarray<double, pS> result{shape, types::none_type()};
      std::exponential_distribution<double> distribution{1 / scale};
      std::generate(result.fbegin(), result.fend(),
                    [&]() { return distribution(details::generator); });
      return result;
    }

    auto exponential(double scale, long size)
        -> decltype(exponential(scale, types::array<long, 1>{{size}}))
    {

      return exponential(scale, types::array<long, 1>{{size}});
    }

    double exponential(double scale, types::none_type d)
    {
      return std::exponential_distribution<double>{1 /
                                                   scale}(details::generator);
    }
  }
}
PYTHONIC_NS_END

#endif


text:
package com.intel.vmf;

import java.util.Map;

import com.intel.vmf.MetadataStream.VideoSegment;

public class FormatXML extends Format {

	public FormatXML() {
		super( n_FormatXML() );
	}

	@Override
	public String store(
			MetadataSet set,
			MetadataSchema[] schemas,
			VideoSegment[] segments,
	        Stat[] stats,
			Map<String, String> attribs
			) {
		long[] schemasAddrs = null, segmentsAddrs = null, statsAddrs = null;
		String[] attribNames = null, attribVals = null;

		if(schemas != null && schemas.length > 0) {
			schemasAddrs = new long[schemas.length];
			int i=0;
			for(MetadataSchema s : schemas)
				schemasAddrs[i++] = s.nativeObj;
		}
		if(segments != null && segments.length > 0) {
			segmentsAddrs = new long[segments.length];
			int i=0;
			for(MetadataStream.VideoSegment seg : segments)
				segmentsAddrs[i++] = seg.nativeObj;
		}
		if(stats != null && stats.length > 0) {
			statsAddrs = new long[stats.length];
			int i=0;
			for(Stat st : stats)
				statsAddrs[i++] = st.nativeObj;
		}
		if(attribs != null && attribs.size()>0) {
			attribNames = new String[attribs.size()];
			attribVals  = new String[attribs.size()];
			int i=0;
			for (Map.Entry<String, String> entry : attribs.entrySet())
			{
				attribNames[i] = entry.getKey();
				attribVals [i] = entry.getValue();
				i++;
			}
		}

		return n_store(nativeObj, (set==null ? 0 : set.nativeObj), schemasAddrs, segmentsAddrs, statsAddrs, attribNames, attribVals);
	}

	@Override
	public Data parse(String text) {
		final int maxAttribCount = 10;
		String[] attribNames = new String[maxAttribCount], attribVals = new String[maxAttribCount];
		long[] objects = n_parse(nativeObj, text, attribNames, attribVals);
		return new Data(objects, attribNames, attribVals);
	}

	private native static long n_FormatXML();
	private native static String n_store(long nativeObj, long set, long[] schemas, long[] segments, long[] stats, String[] attribNames, String[] attribVals);
	private native static long[] n_parse(long nativeObj, String text, String[] attribNames, String[] attribVals);

}


text:
package assert

import (
	"fmt"
	"net/http"
	"net/url"
	"testing"
)

func httpOK(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(http.StatusOK)
}

func httpRedirect(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(http.StatusTemporaryRedirect)
}

func httpError(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(http.StatusInternalServerError)
}

func TestHTTPSuccess(t *testing.T) {
	assert := New(t)

	mockT1 := new(testing.T)
	assert.Equal(HTTPSuccess(mockT1, httpOK, "GET", "/", nil), true)
	assert.False(mockT1.Failed())

	mockT2 := new(testing.T)
	assert.Equal(HTTPSuccess(mockT2, httpRedirect, "GET", "/", nil), false)
	assert.True(mockT2.Failed())

	mockT3 := new(testing.T)
	assert.Equal(HTTPSuccess(mockT3, httpError, "GET", "/", nil), false)
	assert.True(mockT3.Failed())
}

func TestHTTPRedirect(t *testing.T) {
	assert := New(t)

	mockT1 := new(testing.T)
	assert.Equal(HTTPRedirect(mockT1, httpOK, "GET", "/", nil), false)
	assert.True(mockT1.Failed())

	mockT2 := new(testing.T)
	assert.Equal(HTTPRedirect(mockT2, httpRedirect, "GET", "/", nil), true)
	assert.False(mockT2.Failed())

	mockT3 := new(testing.T)
	assert.Equal(HTTPRedirect(mockT3, httpError, "GET", "/", nil), false)
	assert.True(mockT3.Failed())
}

func TestHTTPError(t *testing.T) {
	assert := New(t)

	mockT1 := new(testing.T)
	assert.Equal(HTTPError(mockT1, httpOK, "GET", "/", nil), false)
	assert.True(mockT1.Failed())

	mockT2 := new(testing.T)
	assert.Equal(HTTPError(mockT2, httpRedirect, "GET", "/", nil), false)
	assert.True(mockT2.Failed())

	mockT3 := new(testing.T)
	assert.Equal(HTTPError(mockT3, httpError, "GET", "/", nil), true)
	assert.False(mockT3.Failed())
}

func TestHTTPStatusesWrapper(t *testing.T) {
	assert := New(t)
	mockAssert := New(new(testing.T))

	assert.Equal(mockAssert.HTTPSuccess(httpOK, "GET", "/", nil), true)
	assert.Equal(mockAssert.HTTPSuccess(httpRedirect, "GET", "/", nil), false)
	assert.Equal(mockAssert.HTTPSuccess(httpError, "GET", "/", nil), false)

	assert.Equal(mockAssert.HTTPRedirect(httpOK, "GET", "/", nil), false)
	assert.Equal(mockAssert.HTTPRedirect(httpRedirect, "GET", "/", nil), true)
	assert.Equal(mockAssert.HTTPRedirect(httpError, "GET", "/", nil), false)

	assert.Equal(mockAssert.HTTPError(httpOK, "GET", "/", nil), false)
	assert.Equal(mockAssert.HTTPError(httpRedirect, "GET", "/", nil), false)
	assert.Equal(mockAssert.HTTPError(httpError, "GET", "/", nil), true)
}

func httpHelloName(w http.ResponseWriter, r *http.Request) {
	name := r.FormValue("name")
	w.Write([]byte(fmt.Sprintf("Hello, %s!", name)))
}

func TestHttpBody(t *testing.T) {
	assert := New(t)
	mockT := new(testing.T)

	assert.True(HTTPBodyContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!"))
	assert.True(HTTPBodyContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World"))
	assert.False(HTTPBodyContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world"))

	assert.False(HTTPBodyNotContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!"))
	assert.False(HTTPBodyNotContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World"))
	assert.True(HTTPBodyNotContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world"))
}

func TestHttpBodyWrappers(t *testing.T) {
	assert := New(t)
	mockAssert := New(new(testing.T))

	assert.True(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!"))
	assert.True(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World"))
	assert.False(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world"))

	assert.False(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!"))
	assert.False(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World"))
	assert.True(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world"))

}


text:
module.exports = function(RED) {
    'use strict';

    var getPushIdTimestamp = (function getPushIdTimestamp() {
      var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';

      return function getTimestampFromId(id) {
        try {
          var time = 0;
          var data = id.substr(0, 8);

          for (var i = 0; i < 8; i++) {
            time = time * 64 + PUSH_CHARS.indexOf(data[i]);
          }

          return time;
        } catch(ex){}
      }
    })();

    function FirebaseOn(n) {
        RED.nodes.createNode(this,n);

        this.config = RED.nodes.getNode(n.firebaseconfig);
        this.childpath = n.childpath;
        this.atStart = n.atStart;
        this.eventType = n.eventType;
		    this.queries = n.queries

        this.ready = false;
        this.ignoreFirst = this.atStart;
        this.authorized = false;
        this.msg = null;

        // Check credentials
        if (!this.config) {
            this.status({fill:"red", shape:"ring", text:"invalid credentials"})
            this.error('You need to setup Firebase credentials!');
            return
        }

        this.validEventTypes = {
          "value": true,
          "child_added": true,
          "child_changed": true,
          "chiled_removed": true,
          "child_moved": true,
          "shallow_query": true
        }

        this.onFBValue = function(snapshot, prevChildName) {
            //console.log("In onFBValue + " + JSON.stringify(snapshot.val()))

            if(this.ignoreFirst == false){
              this.ignoreFirst = true
              return;
            }

            this.status({fill:"blue",shape:"dot",text:"received data"});

            // if(!snapshot.exists()){
            //   //The code below will simply send a payload of nul if there is no data
            // }

            var msg = {};
            msg.href = snapshot.ref().toString();
            msg.key = snapshot.key();
            msg.payload = snapshot.val();
            if(snapshot.getPriority())
              msg.priority = snapshot.getPriority();
            if(prevChildName)
              msg.previousChildName = prevChildName;
            if(this.eventType.search("child") != -1 && getPushIdTimestamp(msg.key))  //We probably have a pushID that we can decode
              msg.pushIDTimestamp = getPushIdTimestamp(msg.key)

            this.send(msg);
            setTimeout(this.setStatus, 500)  //Reset back to the Firebase status after 0.5 seconds
        }.bind(this);

        this.onFBError = function(error){
          this.error(error, {})
          this.status({fill:"red",shape:"ring",text:error.code || "error"});
          setTimeout(this.setStatus, 5000)  //Reset back to the Firebase status after 5 seconds
        }.bind(this);

        this.registerListeners = function(msg){
          //this.log("Registering Listener for " + this.config.firebaseurl + (this.childpath || ""))

          if(this.ready == true)
            return  //Listeners are already created

          this.ready = true;
          this.ignoreFirst = this.atStart;  //Reset if we are re-registering listeners

          //Create the firebase reference to the path
          var ref
          if(this.childpath){
            ref = this.config.fbConnection.fbRef.child(this.childpath  == "msg.childpath" ? this.msg.childpath : this.childpath)  //Decide if we are using our input msg object or the string we were configured with
          } else {
            ref = this.config.fbConnection.fbRef
          }

          //apply the queries
          for (var i=0; i<this.queries.length; i+=1) {
              var query = this.queries[i];
              var val

              switch(query.name){
                case "orderByKey":
                case "orderByValue":
                case "orderByPriority":
                  ref = ref[query.name]()  //No args //TODO: BUG: Update HTML to hide box for these 3...
                  break;

                case "orderByChild":
                case "startAt":
                case "endAt":
                case "equalTo":
                case "limitToFirst":
                case "limitToLast":
                  //try to convert to native type for bools, ints, etc.
                  try{ val = JSON.parse(query.value.toLowerCase() || query.value) }
                  catch(e){ val = query.value}

                  ref = ref[query.name](val) //TODO: no error checking...
                  break;

                default:
                  //TODO:
                  break;
              }
          }

          ref.on(this.eventType == "msg.eventType" ? this.msg.eventType : this.eventType, this.onFBValue, this.onFBError, this);

        }.bind(this);

        this.destroyListeners = function(){
          if(this.ready == false)
            return;

          // We need to unbind our callback, or we'll get duplicate messages when we redeploy
          if(this.msg == null){ //Not using in input mode - do what we've always done
            if(this.childpath)
              this.config.fbConnection.fbRef.child(this.childpath).off(this.eventType, this.onFBValue, this);
            else
              this.config.fbConnection.fbRef.off(this.eventType, this.onFBValue, this);
          } else {  // We've been set by our input port
            if(this.childpath)
              this.config.fbConnection.fbRef.child(this.childpath  == "msg.childpath" ? this.msg.childpath : this.childpath).off(this.eventType == "msg.eventType" ? this.msg.eventType : this.eventType, this.onFBValue, this);
            else
              this.config.fbConnection.fbRef.off(this.eventType == "msg.eventType" ? this.msg.eventType : this.eventType, this.onFBValue, this);
          }

          this.ready = false;
          this.msg == null;

        }.bind(this);

        this.setStatus = function(error){
          //set = state (depending on the deployment strategy, for newly deployed nodes, some of the events may not be refired...)
          switch(this.config.fbConnection.lastEvent) {
            case "initializing":
              this.status({fill:"grey", shape:"ring", text:"initializing..."})
              break;
            case "connected":
              this.status({fill:"green", shape:"ring", text:"connected"})
              break;
            case "disconnected":
              this.status({fill:"red", shape:"ring", text:"disconnected"})
              break;
            case "authorized":
              this.status({fill:"green", shape:"dot", text:"ready"})
              break;
            case "unauthorized":
              this.status({fill:"red", shape:"dot", text:"unauthorized"})
              break;
            case "error":
              this.status({fill:"red", shape:"ring", text:error || "error"}) //TODO: should we store the last error?
              break;
            case "closed":
              this.status({fill: "gray", shape: "dot", text:"connection closed"})
              break;
            // case "undefined":
            // case "null":
            //   break;  //Config node not yet setup
            default:
              this.error("Bad lastEvent Data from Config Node - " + this.config.fbConnection.lastEvent)
          }

        }.bind(this)

        //this.config.fbConnection EventEmitter Handlers
        this.fbInitializing = function(){  //This isn't being called because its emitted too early...
          // this.log("initializing")
          this.setStatus();
        }.bind(this)

        this.fbConnected = function(){
          // this.log("connected")
          this.setStatus();
        }.bind(this)

        this.fbDisconnected = function(){
          // this.log("disconnected")
          this.setStatus();
        }.bind(this)

        this.fbAuthorized = function(authData){
          // this.log("authorized")
          this.authorized = true;
          this.setStatus();

          if((this.eventType != "msg.eventType" && this.childpath != "msg.childpath") || this.msg != null)
            this.registerListeners();

        }.bind(this)

        this.fbUnauthorized = function(){
          // this.log("unauthorized")
          this.authorized = false;
          this.setStatus();
          this.destroyListeners();
        }.bind(this)

        this.fbError = function(error){
          // this.log("error - " + error)
          this.setStatus(error);
          this.error(error, {})
        }.bind(this)

        this.fbClosed = function(){
          // this.log("closed")
          this.setStatus();
          this.destroyListeners();  //TODO: this is being called in too many places but better safe than sorry?  Really need to figure out execution flow of Node-Red and decide if we can only have it here instead of also in this.on("close")
        }.bind(this)

        //Register Handlers
        this.config.fbConnection.on("initializing", this.fbInitializing)
        this.config.fbConnection.on("connected", this.fbConnected)
        this.config.fbConnection.on("disconnected", this.fbDisconnected)
        this.config.fbConnection.on("authorized", this.fbAuthorized)
        this.config.fbConnection.on("unauthorized", this.fbUnauthorized)
        this.config.fbConnection.on("error", this.fbError)
        this.config.fbConnection.on("closed", this.fbClosed)

        // this.log("setting initial state to [fb" + this.config.fbConnection.lastEvent.capitalize()+ "]("+this.config.fbConnection.lastEventData+")" )

        //set initial state (depending on the deployment strategy, for newly deployed nodes, some of the events may not be refired...)
        this["fb" + this.config.fbConnection.lastEvent.capitalize()](this.config.fbConnection.lastEventData)  //Javascript is really friendly about sending arguments to functions...

        this.on('input', function(msg) {
          var eventType
          if(this.eventType == "msg.eventType"){
            if("eventType" in msg){
              eventType = msg.eventType
            } else {
              this.error("Expected \"eventType\" property in msg object", msg)
              return;
            }
          } else {
            eventType = this.eventType
          }

          if(!(eventType in this.validEventTypes)){
            this.error("Invalid msg.eventType property \"" + eventType + "\".  Expected one of the following: [\"" + Object.keys(this.validEventTypes).join("\", \"") + "\"].", msg)
            return;
          }

          //Parse out msg.childpath
          var childpath
          if(this.childpath == "msg.childpath"){
            if("childpath" in msg){
              childpath = msg.childpath
            }
          }
          childpath = childpath || "/"

          msg.eventType = eventType;
          msg.childpath = childpath || "/";

          this.msg = msg;
          console.log(msg.childpath)

          //if we are authorized
          //if we have listerners
          if(this.authorized == true){
            if(this.ready == true){ //We have listeners
              this.destroyListeners();
              this.registerListeners();
            } else { // We don't have listeners
              this.registerListeners();
            }
          }

        }.bind(this));

        this.on('close', function() {
          this.destroyListeners();
        }.bind(this));

    }
    RED.nodes.registerType('firebase.on', FirebaseOn);
};


text:
<?php

include('inc/config.php');
session_start();

if($_SERVER["REQUEST_METHOD"] == "POST")
{
	// username and password sent from form
	$myusername=addslashes($_POST['username']);
	$mypassword=addslashes($_POST['password']);

	$sql="SELECT id FROM admin WHERE username='$myusername' and password=md5('$mypassword')";
	$result=mysql_query($sql);
	$row=mysql_fetch_array($result);
	$active=$row['active'];

	$count=mysql_num_rows($result);

	// If result matched $myusername and $mypassword, table row must be 1 row
	if($count==1) {
		$_SESSION['login_user']=$myusername;
		header('location:index.php?mod=home');
    exit();
    ## set last login
	}
	else {
		$error="Your Login Name or Password is invalid";
	}
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>Administrator Login Form</title>
<link type="text/css" rel="stylesheet" href="css/style.css">

Badan Pelayanan Perizinan Terpadu dan Penanaman Modal
KOTA BOGOR

    <form action="" method="post">

Username
 <input name="username" id="username" type="text">

Password
 <input name="password" id="password" type="password">

<button type="submit">Log In</button>

		</form>

Copyright | 2014 Aplikasi Pelayanan Perizinan Terpadu


text:
package org.n52.iceland.statistics.basetests;

import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
        locations = { "classpath:statistics-test-context.xml" })
public abstract class SpringBaseTest {
    protected final static Logger logger = LoggerFactory.getLogger(SpringBaseTest.class);
}