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

  <link rel="stylesheet" type="text/css" href="../bower_components/jasmine/lib/jasmine-core/jasmine.css">
  <script type="text/javascript" src="../bower_components/jasmine/lib/jasmine-core/jasmine.js"></script>
  <script type="text/javascript" src="../bower_components/jasmine/lib/jasmine-core/jasmine-html.js"></script>

  <!-- include source files here... -->
  <script type="text/javascript" src="../ayepromise.js"></script>

  <!-- include spec files here... -->
  <script type="text/javascript" src="helpers.js"></script>
  <script type="text/javascript" src="specs.js"></script>
  <script type="text/javascript" src="ayeSpec.js"></script>

  <script type="text/javascript">
    (function() {
      var jasmineEnv = jasmine.getEnv();
      jasmineEnv.updateInterval = 1000;

      var reporter = new jasmine.HtmlReporter();

      jasmineEnv.addReporter(reporter);

      jasmineEnv.specFilter = function(spec) {
        return reporter.specFilter(spec);
      };

      var currentWindowOnload = window.onload;

      window.onload = function() {
        if (currentWindowOnload) {
          currentWindowOnload();
        }
        execJasmine();
      };

      function execJasmine() {
        jasmineEnv.execute();
      }

    })();
  </script>

</head>

<body>
</body>
</html>


text:
package org.gradle.testkit.runner.internal;

import org.apache.commons.io.output.WriterOutputStream;
import org.gradle.api.Action;
import org.gradle.api.internal.file.temp.DefaultTemporaryFileProvider;
import org.gradle.api.internal.file.temp.TemporaryFileProvider;
import org.gradle.initialization.StartParameterBuildOptions;
import org.gradle.internal.Factory;
import org.gradle.internal.FileUtils;
import org.gradle.internal.SystemProperties;
import org.gradle.internal.classloader.ClasspathUtil;
import org.gradle.internal.classpath.ClassPath;
import org.gradle.internal.classpath.DefaultClassPath;
import org.gradle.internal.installation.CurrentGradleInstallation;
import org.gradle.internal.installation.GradleInstallation;
import org.gradle.internal.os.OperatingSystem;
import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.GradleRunner;
import org.gradle.testkit.runner.InvalidRunnerConfigurationException;
import org.gradle.testkit.runner.UnexpectedBuildFailure;
import org.gradle.testkit.runner.UnexpectedBuildSuccess;
import org.gradle.testkit.runner.internal.io.SynchronizedOutputStream;

import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Writer;
import java.net.URI;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public class DefaultGradleRunner extends GradleRunner {

    public static final String TEST_KIT_DIR_SYS_PROP = "org.gradle.testkit.dir";
    public static final String DEBUG_SYS_PROP = "org.gradle.testkit.debug";

    private final GradleExecutor gradleExecutor;

    private GradleProvider gradleProvider;
    private TestKitDirProvider testKitDirProvider;
    private File projectDirectory;
    private List<String> arguments = Collections.emptyList();
    private List<String> jvmArguments = Collections.emptyList();
    private ClassPath classpath = ClassPath.EMPTY;
    private boolean debug;
    private OutputStream standardOutput;
    private OutputStream standardError;
    private InputStream standardInput;
    private boolean forwardingSystemStreams;
    private Map<String, String> environment;

    public DefaultGradleRunner() {
        this(new ToolingApiGradleExecutor(), calculateTestKitDirProvider(SystemProperties.getInstance()));
    }

    DefaultGradleRunner(GradleExecutor gradleExecutor, TestKitDirProvider testKitDirProvider) {
        this.gradleExecutor = gradleExecutor;
        this.testKitDirProvider = testKitDirProvider;
        this.debug = Boolean.getBoolean(DEBUG_SYS_PROP);
    }

    private static TestKitDirProvider calculateTestKitDirProvider(SystemProperties systemProperties) {
        return systemProperties.withSystemProperties((Factory<TestKitDirProvider>) () -> {
            if (System.getProperties().containsKey(TEST_KIT_DIR_SYS_PROP)) {
                return new ConstantTestKitDirProvider(new File(System.getProperty(TEST_KIT_DIR_SYS_PROP)));
            } else {
                TemporaryFileProvider temporaryFileProvider = new DefaultTemporaryFileProvider(() -> {
                    String rootTmpDir = SystemProperties.getInstance().getWorkerTmpDir();
                    if (rootTmpDir == null) {
                        @SuppressWarnings("deprecation")
                        String javaIoTmpDir = SystemProperties.getInstance().getJavaIoTmpDir();
                        rootTmpDir = javaIoTmpDir;
                    }
                    return FileUtils.canonicalize(new File(rootTmpDir));
                });
                return new ConstantTestKitDirProvider(temporaryFileProvider.newTemporaryFile(".gradle-test-kit"));
            }
        });
    }

    public TestKitDirProvider getTestKitDirProvider() {
        return testKitDirProvider;
    }

    @Override
    public GradleRunner withGradleVersion(String versionNumber) {
        this.gradleProvider = GradleProvider.version(versionNumber);
        return this;
    }

    @Override
    public GradleRunner withGradleInstallation(File installation) {
        this.gradleProvider = GradleProvider.installation(installation);
        return this;
    }

    @Override
    public GradleRunner withGradleDistribution(URI distribution) {
        this.gradleProvider = GradleProvider.uri(distribution);
        return this;
    }

    @Override
    public DefaultGradleRunner withTestKitDir(File testKitDir) {
        validateArgumentNotNull(testKitDir, "testKitDir");
        this.testKitDirProvider = new ConstantTestKitDirProvider(testKitDir);
        return this;
    }

    public DefaultGradleRunner withJvmArguments(List<String> jvmArguments) {
        this.jvmArguments = Collections.unmodifiableList(new ArrayList<>(jvmArguments));
        return this;
    }

    public DefaultGradleRunner withJvmArguments(String... jvmArguments) {
        return withJvmArguments(Arrays.asList(jvmArguments));
    }

    @Override
    public File getProjectDir() {
        return projectDirectory;
    }

    @Override
    public DefaultGradleRunner withProjectDir(File projectDir) {
        this.projectDirectory = projectDir;
        return this;
    }

    @Override
    public List<String> getArguments() {
        return arguments;
    }

    @Override
    public DefaultGradleRunner withArguments(List<String> arguments) {
        this.arguments = Collections.unmodifiableList(new ArrayList<>(arguments));
        return this;
    }

    @Override
    public DefaultGradleRunner withArguments(String... arguments) {
        return withArguments(Arrays.asList(arguments));
    }

    @Override
    public List<? extends File> getPluginClasspath() {
        return classpath.getAsFiles();
    }

    @Override
    public GradleRunner withPluginClasspath() {
        this.classpath = DefaultClassPath.of(PluginUnderTestMetadataReading.readImplementationClasspath());
        return this;
    }

    @Override
    public GradleRunner withPluginClasspath(Iterable<? extends File> classpath) {
        List<File> f = new ArrayList<>();
        for (File file : classpath) {
            // These objects are going across the wire.
            // 1. Convert any subclasses back to File in case the subclass isn't available in Gradle.
            // 2. Make them absolute here to deal with a different root at the server
            f.add(new File(file.getAbsolutePath()));
        }
        if (!f.isEmpty()) {
            this.classpath = DefaultClassPath.of(f);
        }
        return this;
    }

    @Override
    public boolean isDebug() {
        return debug;
    }

    @Override
    public GradleRunner withDebug(boolean flag) {
        this.debug = flag;
        return this;
    }

    @Override
    public Map<String, String> getEnvironment() {
        return environment;
    }

    @Override
    public GradleRunner withEnvironment(Map<String, String> environment) {
        this.environment = environment;
        return this;
    }

    @Override
    public GradleRunner forwardStdOutput(Writer writer) {
        if (forwardingSystemStreams) {
            forwardingSystemStreams = false;
            this.standardError = null;
        }
        validateArgumentNotNull(writer, "standardOutput");
        this.standardOutput = toOutputStream(writer);
        return this;
    }

    @Override
    public GradleRunner forwardStdError(Writer writer) {
        if (forwardingSystemStreams) {
            forwardingSystemStreams = false;
            this.standardOutput = null;
        }
        validateArgumentNotNull(writer, "standardError");
        this.standardError = toOutputStream(writer);
        return this;
    }

    @Override
    public GradleRunner forwardOutput() {
        forwardingSystemStreams = true;
        OutputStream systemOut = new SynchronizedOutputStream(System.out);
        this.standardOutput = systemOut;
        this.standardError = systemOut;
        return this;
    }

    public GradleRunner withStandardInput(InputStream standardInput) {
        this.standardInput = standardInput;
        return this;
    }

    private static OutputStream toOutputStream(Writer standardOutput) {
        return new WriterOutputStream(standardOutput, Charset.defaultCharset());
    }

    private void validateArgumentNotNull(Object argument, String argumentName) {
        if (argument == null) {
            throw new IllegalArgumentException(String.format("%s argument cannot be null", argumentName));
        }
    }

    @Override
    public BuildResult build() {
        return run(gradleExecutionResult -> {
            if (!gradleExecutionResult.isSuccessful()) {
                throw new UnexpectedBuildFailure(createDiagnosticsMessage("Unexpected build execution failure", gradleExecutionResult), createBuildResult(gradleExecutionResult));
            }
        });
    }

    @Override
    public BuildResult buildAndFail() {
        return run(gradleExecutionResult -> {
            if (gradleExecutionResult.isSuccessful()) {
                throw new UnexpectedBuildSuccess(createDiagnosticsMessage("Unexpected build execution success", gradleExecutionResult), createBuildResult(gradleExecutionResult));
            }
        });
    }

    String createDiagnosticsMessage(String trailingMessage, GradleExecutionResult gradleExecutionResult) {
        String lineBreak = SystemProperties.getInstance().getLineSeparator();
        StringBuilder message = new StringBuilder();
        message.append(trailingMessage);
        message.append(" in ");
        message.append(getProjectDir().getAbsolutePath());
        message.append(" with arguments ");
        message.append(getArguments());

        String output = gradleExecutionResult.getOutput();
        if (output != null && !output.isEmpty()) {
            message.append(lineBreak);
            message.append(lineBreak);
            message.append("Output:");
            message.append(lineBreak);
            message.append(output);
        }

        return message.toString();
    }

    private BuildResult run(Action<GradleExecutionResult> resultVerification) {
        if (projectDirectory == null) {
            throw new InvalidRunnerConfigurationException("Please specify a project directory before executing the build");
        }

        if (environment != null && debug) {
            throw new InvalidRunnerConfigurationException("Debug mode is not allowed when environment variables are specified. " +
                "Debug mode runs 'in process' but we need to fork a separate process to pass environment variables. " +
                "To run with debug mode, please remove environment variables.");
        }

        File testKitDir = createTestKitDir(testKitDirProvider);

        GradleProvider effectiveDistribution = gradleProvider == null ? findGradleInstallFromGradleRunner() : gradleProvider;

        List<String> effectiveArguments = new ArrayList<>();
        if (OperatingSystem.current().isWindows()) {
            // When using file system watching in Windows tests it becomes harder to delete the project directory,
            // since file system watching on Windows adds a lock on the watched directory, which is currently the project directory.
            // After deleting the contents of the watched directory, Gradle will stop watching the directory and release the file lock.
            // That may require a retry to delete the watched directory.
            // To avoid those problems for TestKit tests on Windows, we disable file system watching there.
            effectiveArguments.add("-D" + StartParameterBuildOptions.WatchFileSystemOption.GRADLE_PROPERTY + "=false");
        }
        effectiveArguments.addAll(arguments);
        GradleExecutionResult execResult = gradleExecutor.run(new GradleExecutionParameters(
            effectiveDistribution,
            testKitDir,
            projectDirectory,
            effectiveArguments,
            jvmArguments,
            classpath,
            debug,
            standardOutput,
            standardError,
            standardInput,
            environment
        ));

        resultVerification.execute(execResult);
        return createBuildResult(execResult);
    }

    private BuildResult createBuildResult(GradleExecutionResult execResult) {
        return new FeatureCheckBuildResult(
            execResult.getBuildOperationParameters(),
            execResult.getOutput(),
            execResult.getTasks()
        );
    }

    private File createTestKitDir(TestKitDirProvider testKitDirProvider) {
        File dir = testKitDirProvider.getDir();
        if (dir.isDirectory()) {
            if (!dir.canWrite()) {
                throw new InvalidRunnerConfigurationException("Unable to write to test kit directory: " + dir.getAbsolutePath());
            }
            return dir;
        } else if (dir.exists() && !dir.isDirectory()) {
            throw new InvalidRunnerConfigurationException("Unable to use non-directory as test kit directory: " + dir.getAbsolutePath());
        } else if (dir.mkdirs() || dir.isDirectory()) {
            return dir;
        } else {
            throw new InvalidRunnerConfigurationException("Unable to create test kit directory: " + dir.getAbsolutePath());
        }
    }

    private static GradleProvider findGradleInstallFromGradleRunner() {
        GradleInstallation gradleInstallation = CurrentGradleInstallation.get();
        if (gradleInstallation == null) {
            if ("embedded".equals(System.getProperty("org.gradle.integtest.executer"))) {
                return GradleProvider.embedded();
            }
            String messagePrefix = "Could not find a Gradle installation to use based on the location of the GradleRunner class";
            try {
                File classpathForClass = ClasspathUtil.getClasspathForClass(GradleRunner.class);
                messagePrefix += ": " + classpathForClass.getAbsolutePath();
            } catch (Exception ignore) {
                // ignore
            }
            throw new InvalidRunnerConfigurationException(messagePrefix + ". Please specify a Gradle runtime to use via GradleRunner.withGradleVersion() or similar.");
        }
        return GradleProvider.installation(gradleInstallation.getGradleHome());
    }

}

redpajama_set_name: RedPajamaGithub


text:
App.addChild('Contribution', {
  el: '#new-contribution',

  events: {
    'click .radio label' : 'clickReward',
    'click #submit' : 'submitForm',
    'input #contribution_value' : 'restrictChars'
  },

  restrictChars: function(event){
    var $target = $(event.target);
    $target.val($target.val().replace(/[^\d,]/, ''));
  },

  submitForm: function(){
    this.$('form').submit();
    return false;
  },

  activate: function(){
    this.$value = this.$('#contribution_value');
    this.$minimum = this.$('#minimum-value')
    this.clickReward({currentTarget: this.$('input[type=radio]:checked').parent()[0]});
  },

  resetReward: function(event){
    if(parseInt('0' + this.$value.val()) < this.minimumValue()){
      this.selectReward(this.$('.radio label'));
    }
  },

  minimumValue: function(){
    return this.$('label.selected').find('label[data-minimum-value]').data('minimum-value');
  },

  resetSelected: function(){
    this.$('.radio label').removeClass('selected');
  },

  selectReward: function(reward){
    this.resetSelected();
    reward.find('input[type=radio]').prop('checked', true);
    reward.addClass('selected');
  },

  clickReward: function(event){
    this.selectReward($(event.currentTarget));
    var minimum = this.minimumValue();
    this.$value.val(minimum);
    this.$minimum.html(minimum);
  }
});

App.addChild('FaqBox', {
  el: '#faq-box',

  events: {
    'click li.list-question' : 'clickQuestion'
  },

  clickQuestion: function(event){
    var $question = $(event.currentTarget);
    var $answer = $question.next();
    $question.toggleClass('open').toggleClass('alt-link');
    $answer.slideToggle('slow');
  },

  activate: function(){
    this.$('li.list-answer').hide();
  }
});


text:
typedef struct remotecc_handler_s
{
	int sock;
	int status;
	char username[128];
	char passwd[128];
	char runcommand[1024];
	char argv[1024];
	uint64_t rfsize;

	LIBSSH2_SESSION *session;

	LIBSSH2_SFTP *sftp_session;
}remotecc_handler_t;

struct remotecc_module
{
	remotecc_handler_t *(*init)(const char*username,
		const char *passwd, const char *runcommand,
		const char *ipaddr, const char *argv,
		remotecc_handler_t *handler);
	int (*handler)(remotecc_handler_t *handler);
	int (*destroy)(remotecc_handler_t *handler);
};

extern struct remotecc_module remotecc_module;

#endif


text:
package org.sakaiproject.scormcloudservice.impl;

public class ScormJob extends ScormCourseData {

    public ScormJob(String uuid, String siteId, String externalId, String resourceId, String title, boolean graded, boolean deleted) {
        super(uuid, siteId, externalId, resourceId, title, graded, deleted);
    }

    public String toString() {
        return "#<Job " + getId() + ">";
    }
}


text:
package com.cloud.usage.parser;

import java.text.DecimalFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import org.apache.cloudstack.usage.UsageTypes;

import com.cloud.usage.UsageVMSnapshotVO;
import com.cloud.usage.UsageVO;
import com.cloud.usage.dao.UsageDao;
import com.cloud.usage.dao.UsageVMSnapshotDao;
import com.cloud.user.AccountVO;

@Component
public class VMSnapshotUsageParser {
    public static final Logger s_logger = Logger.getLogger(VMSnapshotUsageParser.class.getName());

    private static UsageDao s_usageDao;
    private static UsageVMSnapshotDao s_usageVMSnapshotDao;

    @Inject
    private UsageDao _usageDao;
    @Inject
    private UsageVMSnapshotDao _usageVMSnapshotDao;

    @PostConstruct
    void init() {
        s_usageDao = _usageDao;
        s_usageVMSnapshotDao = _usageVMSnapshotDao;
    }

    public static boolean parse(AccountVO account, Date startDate, Date endDate) {
        if (s_logger.isDebugEnabled()) {
            s_logger.debug("Parsing all VmSnapshot volume usage events for account: " + account.getId());
        }
        if ((endDate == null) || endDate.after(new Date())) {
            endDate = new Date();
        }

        List<UsageVMSnapshotVO> usageUsageVMSnapshots = s_usageVMSnapshotDao.getUsageRecords(account.getId(), account.getDomainId(), startDate, endDate);

        if (usageUsageVMSnapshots.isEmpty()) {
            s_logger.debug("No VM snapshot usage events for this period");
            return true;
        }

        Map<String, UsageVMSnapshotVO> unprocessedUsage = new HashMap<String, UsageVMSnapshotVO>();
        for (UsageVMSnapshotVO usageRec : usageUsageVMSnapshots) {
            long zoneId = usageRec.getZoneId();
            Long volId = usageRec.getId();
            long vmId = usageRec.getVmId();
            String key = vmId + ":" + volId;
            if (usageRec.getCreated().before(startDate)) {
                unprocessedUsage.put(key, usageRec);
                continue;
            }
            UsageVMSnapshotVO previousEvent = s_usageVMSnapshotDao.getPreviousUsageRecord(usageRec);
            if (previousEvent == null || previousEvent.getSize() == 0) {
                unprocessedUsage.put(key, usageRec);
                continue;
            }

            Date previousCreated = previousEvent.getCreated();
            if (previousCreated.before(startDate)) {
                previousCreated = startDate;
            }

            Date createDate = usageRec.getCreated();
            long duration = (createDate.getTime() - previousCreated.getTime()) + 1;

            createUsageRecord(UsageTypes.VM_SNAPSHOT, duration, previousCreated, createDate, account, volId, zoneId, previousEvent.getDiskOfferingId(), vmId,
                previousEvent.getSize(), usageRec.getVmSnapshotId());
            previousEvent.setProcessed(new Date());
            s_usageVMSnapshotDao.update(previousEvent);

            if (usageRec.getSize() == 0) {
                usageRec.setProcessed(new Date());
                s_usageVMSnapshotDao.update(usageRec);
            } else
                unprocessedUsage.put(key, usageRec);
        }

        for (String key : unprocessedUsage.keySet()) {
            UsageVMSnapshotVO usageRec = unprocessedUsage.get(key);
            Date created = usageRec.getCreated();
            if (created.before(startDate)) {
                created = startDate;
            }
            long duration = (endDate.getTime() - created.getTime()) + 1;
            createUsageRecord(UsageTypes.VM_SNAPSHOT, duration, created, endDate, account, usageRec.getId(), usageRec.getZoneId(), usageRec.getDiskOfferingId(),
                usageRec.getVmId(), usageRec.getSize(), usageRec.getVmSnapshotId());
        }

        return true;
    }

    private static void createUsageRecord(int type, long runningTime, Date startDate, Date endDate, AccountVO account, long volId, long zoneId, Long doId, Long vmId,
                                          long size, Long vmSnapshotId) {
        // Our smallest increment is hourly for now
        if (s_logger.isDebugEnabled()) {
            s_logger.debug("Total running time " + runningTime + "ms");
        }

        float usage = runningTime / 1000f / 60f / 60f;

        DecimalFormat dFormat = new DecimalFormat("#.######");
        String usageDisplay = dFormat.format(usage);

        if (s_logger.isDebugEnabled()) {
            s_logger.debug("Creating VMSnapshot Id:" + vmSnapshotId + " Volume usage record for vol: " + volId + ", usage: " + usageDisplay + ", startDate: " + startDate + ", endDate: " +
                endDate + ", for account: " + account.getId());
        }

        // Create the usage record
        String usageDesc = "VMSnapshot Id: " + vmSnapshotId + " Usage: " + "VM Id: " + vmId + " Volume Id: " + volId + " ";

        if (doId != null) {
            usageDesc += " DiskOffering: " + doId;
        }

        usageDesc += " Size: " + size;

        UsageVO usageRecord =
            new UsageVO(zoneId, account.getId(), account.getDomainId(), usageDesc, usageDisplay + " Hrs", type, new Double(usage), vmId, null, doId, null, vmSnapshotId, size,
                startDate, endDate);
        s_usageDao.persist(usageRecord);
    }

}


text:
CHANGELOG
==========

This project adheres to [Semantic Versioning](http://semver.org/).

[How to use a CHANGELOG](http://keepachangelog.com/)

## 1.0.0 - 2017-01-30

### Changed

- Started versioning based on semantic versioning.

### Added

- CSS class applied to <li> and <ul> tags in language menus can be set via the
	`code_example_list_class` in _config.yml.

## 0.0.7 - 2015-03-18

### Fixed

- HTML escaping code examples, so the brower renders HTML/XMl as HTML/XML
	characters

## 0.0.6 - 2015-03-16

### Added

- CSS classes applied to buttons and button container elements can now be
	configured via _config.yml. Supporting JavaScript also uses classes set in
	_config.yml.


text:
title: "DEBUGON"
layout: function
desc: "Turns on stack debugging."
category: reference
signature: "'string' ->B64 'encoded'"
---

Turns on stack debugging which returns the stack content in case of error. Stack debugging is off by default.

## Example ##

{% raw %}
<warp10-warpscript-widget backend="{{backend}}"  exec-endpoint="{{execEndpoint}}">NOW
DUP
DEBUGON
FAIL
</warp10-warpscript-widget>
{% endraw %}


text:
@echo off

pushd "%~dp0"

cd PdfiumViewer
..\Libraries\NuGet\NuGet.exe pack -Prop "configuration=release;platform=anycpu"

pause

popd


text:
package com.blazebit.persistence.view.testsuite.update.embeddable.simple;

import com.blazebit.persistence.testsuite.base.jpa.category.NoDatanucleus;
import com.blazebit.persistence.testsuite.base.jpa.category.NoEclipselink;
import com.blazebit.persistence.testsuite.entity.NameObject;
import com.blazebit.persistence.view.FlushMode;
import com.blazebit.persistence.view.FlushStrategy;
import com.blazebit.persistence.view.testsuite.update.AbstractEntityViewUpdateDocumentTest;
import com.blazebit.persistence.view.testsuite.update.embeddable.simple.model.UpdatableDocumentEmbeddableWithCollectionsViewBase;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.ArrayList;

/**
 *
 * @author Christian Beikov
 * @since 1.2.0
 */
@RunWith(Parameterized.class)
// NOTE: No Datanucleus support yet
@Category({ NoDatanucleus.class, NoEclipselink.class})
public abstract class AbstractEntityViewUpdateEmbeddableCollectionsTest<T extends UpdatableDocumentEmbeddableWithCollectionsViewBase> extends AbstractEntityViewUpdateDocumentTest<T> {

    public AbstractEntityViewUpdateEmbeddableCollectionsTest(FlushMode mode, FlushStrategy strategy, boolean version, Class<T> viewType) {
        super(mode, strategy, version, viewType);
    }

    @Override
    protected String[] getFetchedCollections() {
        return new String[] { "names" };
    }

    public T updateReplaceCollection() {
        // Given
        final T docView = getDoc1View();
        clearQueries();

        // When
        docView.setNames(new ArrayList<>(docView.getNames()));
        return docView;
    }

    public T updateAddToCollection() {
        // Given
        final T docView = getDoc1View();
        clearQueries();

        // When
        docView.getNames().add(new NameObject("newPrimaryName", "newSecondaryName"));
        return docView;
    }

    public T updateAddToNewCollection() {
        // Given
        final T docView = getDoc1View();
        clearQueries();

        // When
        docView.setNames(new ArrayList<>(docView.getNames()));
        docView.getNames().add(new NameObject("newPrimaryName", "newSecondaryName"));
        return docView;
    }

    public T updateRemoveNonExisting() {
        // Given
        final T docView = getDoc1View();
        clearQueries();

        // When
        docView.getNames().remove(new NameObject());
        return docView;
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2017 GcsSloop
  ~
  ~ 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.
  ~
  ~ Last modified 2017-03-19 01:27:22
  ~
  ~ GitHub:  https://github.com/GcsSloop
  ~ Website: http://www.gcssloop.com
  ~ Weibo:   http://weibo.com/GcsSloop
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_login"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.gcssloop.diycode.activity.LoginActivity">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:paddingLeft="14dp"
        android:paddingRight="14dp">

        <View
            android:id="@+id/span1"
            android:layout_width="0dp"
            android:layout_height="10dp"
            android:visibility="invisible"/>

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:scaleType="centerInside"
            android:src="@drawable/ic_logo"/>

        <View
            android:id="@+id/span2"
            android:layout_width="0dp"
            android:layout_height="80dp"
            android:visibility="invisible"/>

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            >

            <EditText
                android:id="@+id/username"
                android:layout_width="match_parent"
                android:layout_height="36dp"
                android:layout_marginLeft="6dp"
                android:background="@null"
                android:hint="Email / 用户名"
                android:inputType="textEmailAddress|text"
                android:textSize="16sp"/>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_below="@id/username"
                android:layout_marginTop="2dp"
                android:background="@drawable/horizontal_line"/>
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            >

            <EditText
                android:id="@+id/password"
                android:layout_width="match_parent"
                android:layout_height="36dp"
                android:layout_marginLeft="6dp"
                android:background="@null"
                android:hint="密码"
                android:inputType="textPassword"
                android:textSize="16sp"/>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_below="@id/password"
                android:layout_marginTop="2dp"
                android:background="@drawable/horizontal_line"/>
        </android.support.design.widget.TextInputLayout>

        <View
            android:id="@+id/span3"
            android:layout_width="0dp"
            android:layout_height="20dp"
            android:visibility="invisible"/>

        <Button
            android:id="@+id/login"
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_marginTop="6dp"
            android:background="@drawable/bg_longin_btn"
            android:text="登  录"
            android:textColor="@color/diy_white"
            android:textSize="18sp"/>

        <TextView
            android:layout_marginTop="20dp"
            android:padding="12dp"
            android:layout_gravity="center_horizontal"
            android:id="@+id/sign_up"
            android:text="没有账号?点击注册"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    </LinearLayout>
</LinearLayout>


text:
package com.jx.androiddemos.blur;

import android.animation.ValueAnimator;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.widget.ImageView;

import com.jx.androiddemos.R;

public class BlurActivity extends Activity {
    private GestureDetector mGestureDetector;
    private Bitmap mNormalBitmap;
    private Bitmap mBlurredBitmap;
    private ImageView mBlurredImage;
    private ImageView mNormalImage;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_blur);
        mBlurredImage = (ImageView) findViewById(R.id.blur_imageView);
        mNormalImage = (ImageView) findViewById(R.id.normal_imageView);
        mGestureDetector = new GestureDetector(new SwipeGestureDetector());
        mNormalBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.blur_test);
        mBlurredBitmap = Blur.fastblur(BlurActivity.this, mNormalBitmap, 20);
        mNormalImage.setImageBitmap(mNormalBitmap);
        mBlurredImage.setImageBitmap(mBlurredBitmap);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (mGestureDetector.onTouchEvent(event)) {
            return true;
        }
        return super.onTouchEvent(event);
    }

    private void onLeftSwipe() {
        ValueAnimator valueAnimator= ValueAnimator.ofFloat(0, 1);
        valueAnimator.setDuration(500);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                Float value=(Float)animation.getAnimatedValue();
                mBlurredImage.setAlpha(value);
            }
        });
        valueAnimator.start();

    }

    private void onRightSwipe() {
        mBlurredImage.setAlpha(0f);
    }

    // Private class for gestures
    private class SwipeGestureDetector
            extends GestureDetector.SimpleOnGestureListener {
        // Swipe properties, you can change it to make the swipe
        // longer or shorter and speed
        private static final int SWIPE_MIN_DISTANCE = 120;
        private static final int SWIPE_MAX_OFF_PATH = 200;
        private static final int SWIPE_THRESHOLD_VELOCITY = 200;

        @Override
        public boolean onFling(MotionEvent e1, MotionEvent e2,
                               float velocityX, float velocityY) {
            try {
                float diffAbs = Math.abs(e1.getY() - e2.getY());
                float diff = e1.getX() - e2.getX();

                if (diffAbs > SWIPE_MAX_OFF_PATH)
                    return false;

                // Left swipe
                if (diff > SWIPE_MIN_DISTANCE
                        && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
                    BlurActivity.this.onLeftSwipe();

                    // Right swipe
                } else if (-diff > SWIPE_MIN_DISTANCE
                        && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
                    BlurActivity.this.onRightSwipe();
                }
            } catch (Exception e) {
                Log.e("MainActivity", "Error on gestures");
            }
            return false;
        }
    }

}


text: search_result['461']=["topic_00000000000000E1_props--.html","TleceBaseResponseModel Properties",""];


text:
<!DOCTYPE html>

		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.legacy.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.grids.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.frames.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.forms.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.tables.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.drawers.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.tabs.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/symphony.notices.css">
		<link rel="stylesheet" type="text/css" media="screen" href="../../assets/css/admin.css">

		<title>Pages – Symphony</title>

Your Symphony installation is up to date, but the installer was still detected. For security reasons, it should be removed. Remove installer?

					Symphony CMS

						John Smith

						Log out

Content

									Articles

									Categories

									Notes

									Comments

									Messages

Blueprints

									Pages

									Sections

									Data Sources

									Events

									Utilities

System

									Authors

									Preferences

									Extensions

Pages

Create New

				<form action="../../blueprints/pages/" method="post">

								Title
								Template
								URL
								URL Parameters
								Type
								Children

									Home
									<input name="items[64]" type="checkbox">

									home.xsl

									/home/

								category
								hidden, index
								None

									Articles
									<input name="items[69]" type="checkbox">

									articles.xsl

									/articles/

								entry/cat
								hidden
								None

									Drafts
									<input name="items[70]" type="checkbox">

									drafts.xsl

									/drafts/

								entry
								admin
								None

									Archive
									<input name="items[68]" type="checkbox">

									archive.xsl

									/archive/

								year
								None
								None

									About
									<input name="items[66]" type="checkbox">

									about.xsl

									/about/

								None
								None
								None

									RSS
									<input name="items[67]" type="checkbox">

									rss.xsl

									/rss/

								None
								hidden, XML
								None

									Maintenance
									<input name="items[75]" type="checkbox">

									maintenance.xsl

									/maintenance/

								None
								hidden, maintenance
								None

									Page Not Found
									<input name="items[76]" type="checkbox">

									page-not-found.xsl

									/page-not-found/

								None
								404, hidden
								None

						<fieldset class="apply">

								<select name="with-selected">
									<option value="">With Selected...</option>
									<option value="delete" class="confirm" data-message="Are you sure you want to delete the selected pages?">Delete</option>
								</select>

							<button name="action[apply]" type="submit">Apply</button>
						</fieldset>

				</form>


text:
package io.outbound.sdk.view;

import android.support.annotation.ColorRes;
import android.support.annotation.StringRes;

/**
 * Created by jophde on 6/22/15 for Outbound.
 */
public interface ProgressController {
    void setText(@StringRes int textRes);

    void showIndicator(boolean showIndicator);

    void showText(boolean showText);

    void setTextColor(@ColorRes int color);

    void show(boolean show);
}


text:
using System;
using UIKit;

namespace DLToolkit.Forms.Controls
{
    internal class RecyclerUICollectionViewLayout : UICollectionViewFlowLayout
    {
        public RecyclerUICollectionViewLayout()
        {
            MinimumInteritemSpacing = nfloat.MaxValue;
            MinimumLineSpacing = default(nfloat);
            ScrollDirection = UICollectionViewScrollDirection.Horizontal;
        }
    }
}


text:
package com.yokmama.learn10.chapter04.lesson18;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;

import com.yokmama.learn10.chapter04.lesson18.demo.DemoContent;
import com.yokmama.learn10.chapter04.lesson18.demo.DemoCreator;

/**
 * An activity representing a single Item detail screen. This
 * activity is only used on handset devices. On tablet-size devices,
 * item details are presented side-by-side with a list of items
 * in a {@link ItemListActivity}.
 * <p/>
 * This activity is mostly just a 'shell' activity containing nothing
 * more than a {@link com.yokmama.learn10.chapter04.lesson18.demo.DemoCreator}.
 */
public class ItemDetailActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item_detail);

        // savedInstanceState is non-null when there is fragment state
        // saved from previous configurations of this activity
        // (e.g. when rotating the screen from portrait to landscape).
        // In this case, the fragment will automatically be re-added
        // to its container so we don't need to manually add it.
        // For more information, see the Fragments API guide at:
        //
        // http://developer.android.com/guide/components/fragments.html
        //
        if (savedInstanceState == null) {
            // Create the detail fragment and add it to the activity
            // using a fragment transaction.
            DemoContent.DemoItem demoItem = getIntent().getParcelableExtra(ItemListActivity.ARG_CLASS_NAME);
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.item_detail_container, DemoCreator.create(demoItem))
                    .commit();
            setTitle(demoItem.toString());
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == android.R.id.home) {
            // This ID represents the Home or Up button. In the case of this
            // activity, the Up button is shown. Use NavUtils to allow users
            // to navigate up one level in the application structure. For
            // more details, see the Navigation pattern on Android Design:
            //
            // http://developer.android.com/design/patterns/navigation.html#up-vs-back
            //
            NavUtils.navigateUpTo(this, new Intent(this, ItemListActivity.class));
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}


text:
using base::TimeDelta;
using base::TimeTicks;

namespace {

// This object allows messages received on the background thread to be
// properly triaged.
class AutomationMessageFilter : public IPC::ChannelProxy::MessageFilter {
 public:
  explicit AutomationMessageFilter(AutomationProxy* server) : server_(server) {}

  // Return true to indicate that the message was handled, or false to let
  // the message be handled in the default way.
  virtual bool OnMessageReceived(const IPC::Message& message) {
    bool handled = true;
    IPC_BEGIN_MESSAGE_MAP(AutomationMessageFilter, message)
      IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_Hello,
                                  OnAutomationHello(message))
      IPC_MESSAGE_HANDLER_GENERIC(
        AutomationMsg_InitialLoadsComplete, server_->SignalInitialLoads())
      IPC_MESSAGE_HANDLER(AutomationMsg_InitialNewTabUILoadComplete,
                          NewTabLoaded)
      IPC_MESSAGE_HANDLER_GENERIC(
        AutomationMsg_InvalidateHandle, server_->InvalidateHandle(message))
      IPC_MESSAGE_UNHANDLED(handled = false)
    IPC_END_MESSAGE_MAP()

    return handled;
  }

  virtual void OnFilterAdded(IPC::Channel* channel) {
    server_->SetChannel(channel);
  }

  virtual void OnFilterRemoved() {
    server_->ResetChannel();
  }

  void NewTabLoaded(int load_time) {
    server_->SignalNewTabUITab(load_time);
  }

  void OnAutomationHello(const IPC::Message& hello_message) {
    std::string server_version;
    void* iter = NULL;
    if (!hello_message.ReadString(&iter, &server_version)) {
      // We got an AutomationMsg_Hello from an old automation provider
      // that doesn't send version info. Leave server_version as an empty
      // string to signal a version mismatch.
      LOG(ERROR) << "Pre-versioning protocol detected in automation provider.";
    }

    server_->SignalAppLaunch(server_version);
  }

 private:
  AutomationProxy* server_;
};

}  // anonymous namespace

AutomationProxy::AutomationProxy(int action_timeout_ms,
                                 bool disconnect_on_failure)
    : app_launched_(true, false),
      initial_loads_complete_(true, false),
      new_tab_ui_load_complete_(true, false),
      shutdown_event_(new base::WaitableEvent(true, false)),
      app_launch_signaled_(0),
      perform_version_check_(false),
      disconnect_on_failure_(disconnect_on_failure),
      action_timeout_(
          TimeDelta::FromMilliseconds(action_timeout_ms)),
      listener_thread_id_(0) {
  // base::WaitableEvent::TimedWait() will choke if we give it a negative value.
  // Zero also seems unreasonable, since we need to wait for IPC, but at
  // least it is legal... ;-)
  DCHECK_GE(action_timeout_ms, 0);
  listener_thread_id_ = base::PlatformThread::CurrentId();
  InitializeHandleTracker();
  InitializeThread();
}

AutomationProxy::~AutomationProxy() {
  // Destruction order is important. Thread has to outlive the channel and
  // tracker has to outlive the thread since we access the tracker inside
  // AutomationMessageFilter::OnMessageReceived.
  Disconnect();
  thread_.reset();
  tracker_.reset();
}

std::string AutomationProxy::GenerateChannelID() {
  // The channel counter keeps us out of trouble if we create and destroy
  // several AutomationProxies sequentially over the course of a test run.
  // (Creating the channel sometimes failed before when running a lot of
  // tests in sequence, and our theory is that sometimes the channel ID
  // wasn't getting freed up in time for the next test.)
  static int channel_counter = 0;

  std::ostringstream buf;
  buf << "ChromeTestingInterface:" << base::GetCurrentProcId() <<
         "." << ++channel_counter;
  return buf.str();
}

void AutomationProxy::InitializeThread() {
  scoped_ptr<base::Thread> thread(
      new base::Thread("AutomationProxy_BackgroundThread"));
  base::Thread::Options options;
  options.message_loop_type = MessageLoop::TYPE_IO;
  bool thread_result = thread->StartWithOptions(options);
  DCHECK(thread_result);
  thread_.swap(thread);
}

void AutomationProxy::InitializeChannel(const std::string& channel_id,
                                        bool use_named_interface) {
  DCHECK(shutdown_event_.get() != NULL);

  // TODO(iyengar)
  // The shutdown event could be global on the same lines as the automation
  // provider, where we use the shutdown event provided by the chrome browser
  // process.
  channel_.reset(new IPC::SyncChannel(
    channel_id,
    use_named_interface ? IPC::Channel::MODE_NAMED_CLIENT
                        : IPC::Channel::MODE_SERVER,
    this,  // we are the listener
    thread_->message_loop(),
    true,
    shutdown_event_.get()));
  channel_->AddFilter(new AutomationMessageFilter(this));
}

void AutomationProxy::InitializeHandleTracker() {
  tracker_.reset(new AutomationHandleTracker());
}

AutomationLaunchResult AutomationProxy::WaitForAppLaunch() {
  AutomationLaunchResult result = AUTOMATION_SUCCESS;
  if (app_launched_.TimedWait(action_timeout_)) {
    if (perform_version_check_) {
      // Obtain our own version number and compare it to what the automation
      // provider sent.
      chrome::VersionInfo version_info;
      DCHECK(version_info.is_valid());

      // Note that we use a simple string comparison since we expect the version
      // to be a punctuated numeric string. Consider using base/Version if we
      // ever need something more complicated here.
      if (server_version_ != version_info.Version()) {
        result = AUTOMATION_VERSION_MISMATCH;
      }
    }
  } else {
    result = AUTOMATION_TIMEOUT;
  }
  return result;
}

void AutomationProxy::SignalAppLaunch(const std::string& version_string) {
  // The synchronization of the reading / writing of server_version_ is a bit
  // messy but does work as long as SignalAppLaunch is only called once.
  // Review this if we ever want an AutomationProxy instance to launch
  // multiple AutomationProviders.
  app_launch_signaled_++;
  if (app_launch_signaled_ > 1) {
    NOTREACHED();
    LOG(ERROR) << "Multiple AutomationMsg_Hello messages received";
    return;
  }
  server_version_ = version_string;
  app_launched_.Signal();
}

bool AutomationProxy::WaitForProcessLauncherThreadToGoIdle() {
  return Send(new AutomationMsg_WaitForProcessLauncherThreadToGoIdle());
}

bool AutomationProxy::WaitForInitialLoads() {
  return initial_loads_complete_.TimedWait(action_timeout_);
}

bool AutomationProxy::WaitForInitialNewTabUILoad(int* load_time) {
  if (new_tab_ui_load_complete_.TimedWait(action_timeout_)) {
    *load_time = new_tab_ui_load_time_;
    new_tab_ui_load_complete_.Reset();
    return true;
  }
  return false;
}

void AutomationProxy::SignalInitialLoads() {
  initial_loads_complete_.Signal();
}

void AutomationProxy::SignalNewTabUITab(int load_time) {
  new_tab_ui_load_time_ = load_time;
  new_tab_ui_load_complete_.Signal();
}

bool AutomationProxy::SavePackageShouldPromptUser(bool should_prompt) {
  return Send(new AutomationMsg_SavePackageShouldPromptUser(should_prompt));
}

scoped_refptr<ExtensionProxy> AutomationProxy::InstallExtension(
    const FilePath& crx_file, bool with_ui) {
  int handle = 0;
  if (!Send(new AutomationMsg_InstallExtensionAndGetHandle(crx_file, with_ui,
                                                           &handle)))
    return NULL;

  return ProxyObjectFromHandle<ExtensionProxy>(handle);
}

void AutomationProxy::EnsureExtensionTestResult() {
  bool result;
  std::string message;
  if (!Send(new AutomationMsg_WaitForExtensionTestResult(&result,
                                                         &message))) {
    FAIL() << "Could not send WaitForExtensionTestResult message";
    return;
  }
  ASSERT_TRUE(result) << "Extension test message: " << message;
}

bool AutomationProxy::GetBrowserWindowCount(int* num_windows) {
  if (!num_windows) {
    NOTREACHED();
    return false;
  }

  return Send(new AutomationMsg_BrowserWindowCount(num_windows));
}

bool AutomationProxy::GetNormalBrowserWindowCount(int* num_windows) {
  if (!num_windows) {
    NOTREACHED();
    return false;
  }

  return Send(new AutomationMsg_NormalBrowserWindowCount(num_windows));
}

bool AutomationProxy::WaitForWindowCountToBecome(int count) {
  bool wait_success = false;
  if (!Send(new AutomationMsg_WaitForBrowserWindowCountToBecome(
                count, &wait_success))) {
    return false;
  }
  return wait_success;
}

bool AutomationProxy::GetShowingAppModalDialog(
    bool* showing_app_modal_dialog,
    ui::MessageBoxFlags::DialogButton* button) {
  if (!showing_app_modal_dialog || !button) {
    NOTREACHED();
    return false;
  }

  int button_int = 0;

  if (!Send(new AutomationMsg_ShowingAppModalDialog(
                showing_app_modal_dialog, &button_int))) {
    return false;
  }

  *button = static_cast<ui::MessageBoxFlags::DialogButton>(button_int);
  return true;
}

bool AutomationProxy::ClickAppModalDialogButton(
    ui::MessageBoxFlags::DialogButton button) {
  bool succeeded = false;

  if (!Send(new AutomationMsg_ClickAppModalDialogButton(
                button, &succeeded))) {
    return false;
  }

  return succeeded;
}

bool AutomationProxy::WaitForAppModalDialog() {
  bool wait_success = false;
  if (!Send(new AutomationMsg_WaitForAppModalDialogToBeShown(&wait_success)))
    return false;
  return wait_success;
}

bool AutomationProxy::IsURLDisplayed(GURL url) {
  int window_count;
  if (!GetBrowserWindowCount(&window_count))
    return false;

  for (int i = 0; i < window_count; i++) {
    scoped_refptr<BrowserProxy> window = GetBrowserWindow(i);
    if (!window.get())
      break;

    int tab_count;
    if (!window->GetTabCount(&tab_count))
      continue;

    for (int j = 0; j < tab_count; j++) {
      scoped_refptr<TabProxy> tab = window->GetTab(j);
      if (!tab.get())
        break;

      GURL tab_url;
      if (!tab->GetCurrentURL(&tab_url))
        continue;

      if (tab_url == url)
        return true;
    }
  }

  return false;
}

bool AutomationProxy::GetMetricEventDuration(const std::string& event_name,
                                             int* duration_ms) {
  return Send(new AutomationMsg_GetMetricEventDuration(event_name,
                                                       duration_ms));
}

bool AutomationProxy::SetFilteredInet(bool enabled) {
  return Send(new AutomationMsg_SetFilteredInet(enabled));
}

int AutomationProxy::GetFilteredInetHitCount() {
  int hit_count;
  if (!Send(new AutomationMsg_GetFilteredInetHitCount(&hit_count)))
    return -1;
  return hit_count;
}

bool AutomationProxy::SendProxyConfig(const std::string& new_proxy_config) {
  return Send(new AutomationMsg_SetProxyConfig(new_proxy_config));
}

void AutomationProxy::Disconnect() {
  DCHECK(shutdown_event_.get() != NULL);
  shutdown_event_->Signal();
  channel_.reset();
}

bool AutomationProxy::OnMessageReceived(const IPC::Message& msg) {
  // This won't get called unless AutomationProxy is run from
  // inside a message loop.
  NOTREACHED();
  return false;
}

void AutomationProxy::OnChannelError() {
  LOG(ERROR) << "Channel error in AutomationProxy.";
  if (disconnect_on_failure_)
    Disconnect();
}

scoped_refptr<WindowProxy> AutomationProxy::GetActiveWindow() {
  int handle = 0;
  if (!Send(new AutomationMsg_ActiveWindow(&handle)))
    return NULL;

  return ProxyObjectFromHandle<WindowProxy>(handle);
}

scoped_refptr<BrowserProxy> AutomationProxy::GetBrowserWindow(
    int window_index) {
  int handle = 0;
  if (!Send(new AutomationMsg_BrowserWindow(window_index, &handle)))
    return NULL;

  return ProxyObjectFromHandle<BrowserProxy>(handle);
}

bool AutomationProxy::GetBrowserLocale(string16* locale) {
  DCHECK(locale != NULL);
  if (!Send(new AutomationMsg_GetBrowserLocale(locale)))
    return false;

  return !locale->empty();
}

scoped_refptr<BrowserProxy> AutomationProxy::FindNormalBrowserWindow() {
  int handle = 0;
  if (!Send(new AutomationMsg_FindNormalBrowserWindow(&handle)))
    return NULL;

  return ProxyObjectFromHandle<BrowserProxy>(handle);
}

scoped_refptr<BrowserProxy> AutomationProxy::GetLastActiveBrowserWindow() {
  int handle = 0;
  if (!Send(new AutomationMsg_LastActiveBrowserWindow(&handle)))
    return NULL;

  return ProxyObjectFromHandle<BrowserProxy>(handle);
}

#if defined(OS_POSIX)
base::file_handle_mapping_vector AutomationProxy::fds_to_map() const {
  base::file_handle_mapping_vector map;
  const int ipcfd = channel_->GetClientFileDescriptor();
  if (ipcfd > -1)
    map.push_back(std::make_pair(ipcfd, kPrimaryIPCChannel + 3));
  return map;
}
#endif  // defined(OS_POSIX)

bool AutomationProxy::Send(IPC::Message* message) {
  return Send(message,
    static_cast<int>(action_timeout_.InMilliseconds()));
}

bool AutomationProxy::Send(IPC::Message* message, int timeout_ms) {
  if (!channel_.get()) {
    LOG(ERROR) << "Automation channel has been closed; dropping message!";
    delete message;
    return false;
  }

  bool success = channel_->SendWithTimeout(message, timeout_ms);

  if (!success && disconnect_on_failure_) {
    // Send failed (possibly due to a timeout). Browser is likely in a weird
    // state, and further IPC requests are extremely likely to fail (possibly
    // timeout, which would make tests slower). Disconnect the channel now
    // to avoid the slowness.
    LOG(ERROR) << "Disconnecting channel after error!";
    Disconnect();
  }

  return success;
}

void AutomationProxy::InvalidateHandle(const IPC::Message& message) {
  void* iter = NULL;
  int handle;

  if (message.ReadInt(&iter, &handle)) {
    tracker_->InvalidateHandle(handle);
  }
}

bool AutomationProxy::OpenNewBrowserWindow(Browser::Type type, bool show) {
  return Send(
      new AutomationMsg_OpenNewBrowserWindowOfType(static_cast<int>(type),
                                                   show));
}

scoped_refptr<TabProxy> AutomationProxy::CreateExternalTab(
    const ExternalTabSettings& settings,
    gfx::NativeWindow* external_tab_container,
    gfx::NativeWindow* tab) {
  int handle = 0;
  int session_id = 0;
  bool succeeded =
      Send(new AutomationMsg_CreateExternalTab(settings,
                                               external_tab_container,
                                               tab,
                                               &handle,
                                               &session_id));
  if (!succeeded) {
    return NULL;
  }

#if defined(OS_WIN)
  DCHECK(IsWindow(*external_tab_container));
#else  // defined(OS_WIN)
  DCHECK(*external_tab_container);
#endif  // defined(OS_WIN)
  DCHECK(tracker_->GetResource(handle) == NULL);
  return new TabProxy(this, tracker_.get(), handle);
}

template <class T> scoped_refptr<T> AutomationProxy::ProxyObjectFromHandle(
    int handle) {
  if (!handle)
    return NULL;

  // Get AddRef-ed pointer to the object if handle is already seen.
  T* p = static_cast<T*>(tracker_->GetResource(handle));
  if (!p) {
    p = new T(this, tracker_.get(), handle);
    p->AddRef();
  }

  // Since there is no scoped_refptr::attach.
  scoped_refptr<T> result;
  result.swap(&p);
  return result;
}

void AutomationProxy::SetChannel(IPC::Channel* channel) {
  if (tracker_.get())
    tracker_->put_channel(channel);
}

void AutomationProxy::ResetChannel() {
  if (tracker_.get())
    tracker_->put_channel(NULL);
}

#if defined(OS_CHROMEOS)
bool AutomationProxy::LoginWithUserAndPass(const std::string& username,
                                           const std::string& password) {
  bool success;
  bool sent = Send(new AutomationMsg_LoginWithUserAndPass(username,
                                                          password,
                                                          &success));
  // If message sending unsuccessful or test failed, return false.
  return sent && success;
}
#endif

bool AutomationProxy::ResetToDefaultTheme() {
  return Send(new AutomationMsg_ResetToDefaultTheme());
}

bool AutomationProxy::SendJSONRequest(const std::string& request,
                                      int timeout_ms,
                                      std::string* response) {
  bool result = false;
  if (!SendAutomationJSONRequest(this, request, timeout_ms, response, &result))
    return false;
  return result;
}


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_UDP_UDP_SOCKET_LIBEVENT_H_
#define NET_UDP_UDP_SOCKET_LIBEVENT_H_

#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/threading/non_thread_safe.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
#include "net/base/rand_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_log.h"
#include "net/udp/datagram_socket.h"

namespace net {

class NET_EXPORT UDPSocketLibevent : public base::NonThreadSafe {
 public:
  UDPSocketLibevent(DatagramSocket::BindType bind_type,
                    const RandIntCallback& rand_int_cb,
                    net::NetLog* net_log,
                    const net::NetLog::Source& source);
  virtual ~UDPSocketLibevent();

  // Connect the socket to connect with a certain |address|.
  // Returns a net error code.
  int Connect(const IPEndPoint& address);

  // Bind the address/port for this socket to |address|.  This is generally
  // only used on a server.
  // Returns a net error code.
  int Bind(const IPEndPoint& address);

  // Close the socket.
  void Close();

  // Copy the remote udp address into |address| and return a network error code.
  int GetPeerAddress(IPEndPoint* address) const;

  // Copy the local udp address into |address| and return a network error code.
  // (similar to getsockname)
  int GetLocalAddress(IPEndPoint* address) const;

  // IO:
  // Multiple outstanding read requests are not supported.
  // Full duplex mode (reading and writing at the same time) is supported

  // Read from the socket.
  // Only usable from the client-side of a UDP socket, after the socket
  // has been connected.
  int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback);

  // Write to the socket.
  // Only usable from the client-side of a UDP socket, after the socket
  // has been connected.
  int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback);

  // Read from a socket and receive sender address information.
  // |buf| is the buffer to read data into.
  // |buf_len| is the maximum amount of data to read.
  // |address| is a buffer provided by the caller for receiving the sender
  //   address information about the received data.  This buffer must be kept
  //   alive by the caller until the callback is placed.
  // |address_length| is a ptr to the length of the |address| buffer.  This
  //   is an input parameter containing the maximum size |address| can hold
  //   and also an output parameter for the size of |address| upon completion.
  // |callback| the callback on completion of the Recv.
  // Returns a net error code, or ERR_IO_PENDING if the IO is in progress.
  // If ERR_IO_PENDING is returned, the caller must keep |buf|, |address|,
  // and |address_length| alive until the callback is called.
  int RecvFrom(IOBuffer* buf,
               int buf_len,
               IPEndPoint* address,
               const CompletionCallback& callback);

  // Send to a socket with a particular destination.
  // |buf| is the buffer to send
  // |buf_len| is the number of bytes to send
  // |address| is the recipient address.
  // |address_length| is the size of the recipient address
  // |callback| is the user callback function to call on complete.
  // Returns a net error code, or ERR_IO_PENDING if the IO is in progress.
  // If ERR_IO_PENDING is returned, the caller must keep |buf| and |address|
  // alive until the callback is called.
  int SendTo(IOBuffer* buf,
             int buf_len,
             const IPEndPoint& address,
             const CompletionCallback& callback);

  // Set the receive buffer size (in bytes) for the socket.
  bool SetReceiveBufferSize(int32 size);

  // Set the send buffer size (in bytes) for the socket.
  bool SetSendBufferSize(int32 size);

  // Returns true if the socket is already connected or bound.
  bool is_connected() const { return socket_ != kInvalidSocket; }

  const BoundNetLog& NetLog() const { return net_log_; }

  // Sets corresponding flags in |socket_options_| to allow the socket
  // to share the local address to which the socket will be bound with
  // other processes. Should be called before Bind().
  void AllowAddressReuse();

  // Sets corresponding flags in |socket_options_| to allow sending
  // and receiving packets to and from broadcast addresses. Should be
  // called before Bind().
  void AllowBroadcast();

 private:
  static const int kInvalidSocket = -1;

  enum SocketOptions {
    SOCKET_OPTION_REUSE_ADDRESS = 1 << 0,
    SOCKET_OPTION_BROADCAST     = 1 << 1
  };

  class ReadWatcher : public MessageLoopForIO::Watcher {
   public:
    explicit ReadWatcher(UDPSocketLibevent* socket) : socket_(socket) {}

    // MessageLoopForIO::Watcher methods

    virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE;

    virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {}

   private:
    UDPSocketLibevent* const socket_;

    DISALLOW_COPY_AND_ASSIGN(ReadWatcher);
  };

  class WriteWatcher : public MessageLoopForIO::Watcher {
   public:
    explicit WriteWatcher(UDPSocketLibevent* socket) : socket_(socket) {}

    // MessageLoopForIO::Watcher methods

    virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {}

    virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE;

   private:
    UDPSocketLibevent* const socket_;

    DISALLOW_COPY_AND_ASSIGN(WriteWatcher);
  };

  void DoReadCallback(int rv);
  void DoWriteCallback(int rv);
  void DidCompleteRead();
  void DidCompleteWrite();

  // Handles stats and logging. |result| is the number of bytes transferred, on
  // success, or the net error code on failure. On success, LogRead takes in a
  // sockaddr and its length, which are mandatory, while LogWrite takes in an
  // optional IPEndPoint.
  void LogRead(int result, const char* bytes, socklen_t addr_len,
               const sockaddr* addr) const;
  void LogWrite(int result, const char* bytes, const IPEndPoint* address) const;

  // Returns the OS error code (or 0 on success).
  int CreateSocket(const IPEndPoint& address);

  // Same as SendTo(), except that address is passed by pointer
  // instead of by reference. It is called from Write() with |address|
  // set to NULL.
  int SendToOrWrite(IOBuffer* buf,
                    int buf_len,
                    const IPEndPoint* address,
                    const CompletionCallback& callback);

  int InternalConnect(const IPEndPoint& address);
  int InternalRecvFrom(IOBuffer* buf, int buf_len, IPEndPoint* address);
  int InternalSendTo(IOBuffer* buf, int buf_len, const IPEndPoint* address);

  // Applies |socket_options_| to |socket_|. Should be called before
  // Bind().
  int SetSocketOptions();
  int DoBind(const IPEndPoint& address);
  int RandomBind(const IPEndPoint& address);

  int socket_;

  // Bitwise-or'd combination of SocketOptions. Specifies the set of
  // options that should be applied to |socket_| before Bind().
  int socket_options_;

  // How to do source port binding, used only when UDPSocket is part of
  // UDPClientSocket, since UDPServerSocket provides Bind.
  DatagramSocket::BindType bind_type_;

  // PRNG function for generating port numbers.
  RandIntCallback rand_int_cb_;

  // These are mutable since they're just cached copies to make
  // GetPeerAddress/GetLocalAddress smarter.
  mutable scoped_ptr<IPEndPoint> local_address_;
  mutable scoped_ptr<IPEndPoint> remote_address_;

  // The socket's libevent wrappers
  MessageLoopForIO::FileDescriptorWatcher read_socket_watcher_;
  MessageLoopForIO::FileDescriptorWatcher write_socket_watcher_;

  // The corresponding watchers for reads and writes.
  ReadWatcher read_watcher_;
  WriteWatcher write_watcher_;

  // The buffer used by InternalRead() to retry Read requests
  scoped_refptr<IOBuffer> read_buf_;
  int read_buf_len_;
  IPEndPoint* recv_from_address_;

  // The buffer used by InternalWrite() to retry Write requests
  scoped_refptr<IOBuffer> write_buf_;
  int write_buf_len_;
  scoped_ptr<IPEndPoint> send_to_address_;

  // External callback; called when read is complete.
  CompletionCallback read_callback_;

  // External callback; called when write is complete.
  CompletionCallback write_callback_;

  BoundNetLog net_log_;

  DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent);
};

}  // namespace net

#endif  // NET_UDP_UDP_SOCKET_LIBEVENT_H_


text:
import React, { Component } from 'react';
import { Container, Header, Title, Content, Footer, FooterTab, Button, Icon,
  Text, List, ListItem } from 'native-base';

class Meeting extends Component {
    render() {
        console.log('Meeting props: ', this.props);

        return (
            <Container>
                <Header>
                    <Title>Meeting</Title>
                </Header>

                <Content>
                <Content>
                <List>
                    <ListItem>
                        <Text>{this.props.name}</Text>
                    </ListItem>
                </List>
            </Content>
                </Content>

                <Footer>
                    <FooterTab>
                        <Button transparent>
                            <Icon name='ios-call' />
                        </Button>
                    </FooterTab>
                </Footer>
            </Container>
        );
    }
}

export default View2;


text:
bool Event::operator>(const Event &e) const
{
	return time > e.time;
}

bool Event::operator<(const Event &e) const
{
	return time < e.time;
}

bool Event::operator==(const Event &e) const
{
	return time == e.time;
}

bool Event::operator!=(const Event &e) const
{
	return time != e.time;
}

bool Event::operator>=(const Event &e) const
{
	return time >= e.time;
}

bool Event::operator<=(const Event &e) const
{
	return time <= e.time;
}

bool Event::operator>(int i) const
{
	return time > i;
}

bool Event::operator<(int i) const
{
	return time < i;
}

bool Event::operator==(int i) const
{
	return time == i;
}

bool Event::operator!=(int i) const
{
	return time != i;
}

bool Event::operator>=(int i) const
{
	return time >= i;
}

bool Event::operator<=(int i) const
{
	return time <= i;
}

int Event::getTime() const
{
	return time;
}

Event::Event(int t) : time(t) {}

DoublyLinkedList<Event *> Event::run()
{
	throw std::logic_error("Event::run can not be called");
}

void Event::print()
{
	printf("Evento Geral.\n");
}

CreateVehicleEv::CreateVehicleEv(int t, Source &source_) : Event(t), source(source_) {}

void CreateVehicleEv::print()
{
	printf("CreateVehicleEv (%d s).\n", getTime());
}

RemoveVehicleEv::RemoveVehicleEv(int t, ExitRoadway &exitRoadway_) : Event(t), exitRoadway(exitRoadway_) {}

void RemoveVehicleEv::print()
{
	printf("RemoveVehicleEv (%d s).\n", getTime());
}

ChangeRoadwayEv::ChangeRoadwayEv(int t, Roadway &p_) : Event(t), roadway(p_) {}

void ChangeRoadwayEv::print()
{
	printf("ChangeRoadwayEv (%d s).\n", getTime());
}

OpenSemaphoreEv::OpenSemaphoreEv(int t, Semaphore &s, int f) : Event(t), semaphore(s), frequency(f) {}

void OpenSemaphoreEv::print()
{
	printf("OpenSemaphoreEv (%d s).\n", getTime());
}

DoublyLinkedList<Event *> CreateVehicleEv::run()
{
	bool worked = true;

	try
	{
		source.createVehicle();
	}
	catch (std::runtime_error &err)
	{
		worked = false;
	}

	DoublyLinkedList<Event *> newEvents;

	if (worked)
	{
		int nextEventsTime = source.nextEventsTime(getTime());

		newEvents.push_back(new CreateVehicleEv(nextEventsTime, source));

		newEvents.push_back(new ChangeRoadwayEv(nextEventsTime + source.timeToTravel(), source));
	}
	else
	{
		newEvents.push_back(new CreateVehicleEv(getTime() + 5, source));
	}

	return newEvents;
}

DoublyLinkedList<Event *> RemoveVehicleEv::run()
{
	exitRoadway.pop();

	DoublyLinkedList<Event *> newEvents;

	return newEvents;
}

DoublyLinkedList<Event *> ChangeRoadwayEv::run()
{
	DoublyLinkedList<Event *> newEvents;

	Roadway *nextRoadway;

	try
	{
		nextRoadway = &(roadway.moveVehicle());
	}
	catch (std::runtime_error &err)
	{
		return newEvents;
	}

	if (ExitRoadway *s = dynamic_cast<ExitRoadway *>(nextRoadway))
	{
		newEvents.push_back(new RemoveVehicleEv(getTime() + s->timeToTravel(), *s));
	}
	else
	{
		newEvents.push_back(new ChangeRoadwayEv(getTime() + nextRoadway->timeToTravel(), *nextRoadway));
	}

	return newEvents;
}

DoublyLinkedList<Event *> OpenSemaphoreEv::run()
{
	semaphore.nextState();

	DoublyLinkedList<Event *> newEvents;

	newEvents.push_back(new OpenSemaphoreEv(getTime() + frequency, semaphore, frequency));

	return newEvents;
}


text:
package org.apache.hadoop.hbase.procedure2;

import java.util.concurrent.DelayQueue;
import org.apache.hadoop.hbase.procedure2.util.DelayedUtil;
import org.apache.hadoop.hbase.procedure2.util.DelayedUtil.DelayedWithTimeout;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState;

/**
 * Runs task on a period such as check for stuck workers.
 * @see InlineChore
 */
@InterfaceAudience.Private
class TimeoutExecutorThread<TEnvironment> extends StoppableThread {

  private static final Logger LOG = LoggerFactory.getLogger(TimeoutExecutorThread.class);

  private final ProcedureExecutor<TEnvironment> executor;

  private final DelayQueue<DelayedWithTimeout> queue = new DelayQueue<>();

  public TimeoutExecutorThread(ProcedureExecutor<TEnvironment> executor, ThreadGroup group) {
    super(group, "ProcExecTimeout");
    setDaemon(true);
    this.executor = executor;
  }

  @Override
  public void sendStopSignal() {
    queue.add(DelayedUtil.DELAYED_POISON);
  }

  @Override
  public void run() {
    while (executor.isRunning()) {
      final DelayedWithTimeout task = DelayedUtil.takeWithoutInterrupt(queue);
      if (task == null || task == DelayedUtil.DELAYED_POISON) {
        // the executor may be shutting down,
        // and the task is just the shutdown request
        continue;
      }
      LOG.trace("Executing {}", task);

      // execute the task
      if (task instanceof InlineChore) {
        execInlineChore((InlineChore) task);
      } else if (task instanceof DelayedProcedure) {
        execDelayedProcedure((DelayedProcedure<TEnvironment>) task);
      } else {
        LOG.error("CODE-BUG unknown timeout task type {}", task);
      }
    }
  }

  public void add(InlineChore chore) {
    chore.refreshTimeout();
    queue.add(chore);
  }

  public void add(Procedure<TEnvironment> procedure) {
    assert procedure.getState() == ProcedureState.WAITING_TIMEOUT;
    LOG.info("ADDED {}; timeout={}, timestamp={}", procedure, procedure.getTimeout(),
      procedure.getTimeoutTimestamp());
    queue.add(new DelayedProcedure<>(procedure));
  }

  public boolean remove(Procedure<TEnvironment> procedure) {
    return queue.remove(new DelayedProcedure<>(procedure));
  }

  private void execInlineChore(InlineChore chore) {
    chore.run();
    add(chore);
  }

  private void execDelayedProcedure(DelayedProcedure<TEnvironment> delayed) {
    // TODO: treat this as a normal procedure, add it to the scheduler and
    // let one of the workers handle it.
    // Today we consider ProcedureInMemoryChore as InlineChores
    Procedure<TEnvironment> procedure = delayed.getObject();
    if (procedure instanceof ProcedureInMemoryChore) {
      executeInMemoryChore((ProcedureInMemoryChore<TEnvironment>) procedure);
      // if the procedure is in a waiting state again, put it back in the queue
      procedure.updateTimestamp();
      if (procedure.isWaiting()) {
        delayed.setTimeout(procedure.getTimeoutTimestamp());
        queue.add(delayed);
      }
    } else {
      executeTimedoutProcedure(procedure);
    }
  }

  private void executeInMemoryChore(ProcedureInMemoryChore<TEnvironment> chore) {
    if (!chore.isWaiting()) {
      return;
    }

    // The ProcedureInMemoryChore is a special case, and it acts as a chore.
    // instead of bringing the Chore class in, we reuse this timeout thread for
    // this special case.
    try {
      chore.periodicExecute(executor.getEnvironment());
    } catch (Throwable e) {
      LOG.error("Ignoring {} exception: {}", chore, e.getMessage(), e);
    }
  }

  protected void executeTimedoutProcedure(Procedure<TEnvironment> proc) {
    // The procedure received a timeout. if the procedure itself does not handle it,
    // call abort() and add the procedure back in the queue for rollback.
    if (proc.setTimeoutFailure(executor.getEnvironment())) {
      long rootProcId = executor.getRootProcedureId(proc);
      RootProcedureState<TEnvironment> procStack = executor.getProcStack(rootProcId);
      procStack.abort();
      executor.getStore().update(proc);
      executor.getScheduler().addFront(proc);
    }
  }
}


text:
import urllib2
import logging

def get(url):
    '''
    Gets contents for provided url. Url should start with http or https, any other url results None.
    :param url: blog or news feed url
    :return: content or None if url is invalid
    '''
    if _verifyUrl(url) is False:
        return None

    try:

        headers = {
            'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Language': 'pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4',
            'Connection': 'keep-alive',
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.47 Safari/537.36'
        }

        req = urllib2.Request(url, headers=headers)
        resp = urllib2.urlopen(req, timeout=20)

        if resp.getcode() == 200:
            return resp.read()

    #except urllib2.URLError, e:
    except Exception, e:
        logging.error("URL: %s caused an error: %s" % (url, e))
        logging.exception(e) #should log any Error raising in urllib2

def _verifyUrl(url):
    '''
    Verifies if provided url is valid - valid url should start with http or https
    :param url: string with any url
    :return: True if url starts with http, otherwise False
    '''
    if url is not None and url[0:4] == "http":
        return True

    logging.warning("Provided url is invalid. (url=%s)" % url)
    return False


text:
require "contenteditable/engine"

module Contenteditable
  class Engine < Rails::Engine
    attr_accessor :ce_filter
    initializer 'my_engine.action_controller' do |app|
      ActiveSupport.on_load :action_controller do
        helper Contenteditable::Engine.helpers
      end
    end
  end
end

module Filtering
  module Foradmins

    def self.included(base)
      base.extend ControllerMethods
    end

    module ControllerMethods
      def contenteditable_filter(*args)
        Contenteditable::Engine.ce_filter = args[0] if args.size > 0
      end
    end
  end
end

ActionController::Base.send(:include, Filtering::Foradmins)

if defined?(Rails)
  require "contenteditable/generators/install_generator"
end


text:
  CREATE TABLE "CITY"."ONLINEILLEGAL"
   (	"IDENTITY" VARCHAR2(20 BYTE),
	"JSON" VARCHAR2(200 BYTE)
   ) SEGMENT CREATION IMMEDIATE
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS" ;
--------------------------------------------------------
--  DDL for Index ONLINEILLEGAL_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "CITY"."ONLINEILLEGAL_PK" ON "CITY"."ONLINEILLEGAL" ("IDENTITY")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS" ;
--------------------------------------------------------
--  Constraints for Table ONLINEILLEGAL
--------------------------------------------------------

  ALTER TABLE "CITY"."ONLINEILLEGAL" ADD CONSTRAINT "ONLINEILLEGAL_PK" PRIMARY KEY ("IDENTITY")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS"  ENABLE;
  ALTER TABLE "CITY"."ONLINEILLEGAL" MODIFY ("IDENTITY" NOT NULL ENABLE);
  ALTER TABLE "CITY"."ONLINEILLEGAL" MODIFY ("JSON" NOT NULL ENABLE);


text:
"""Tests for dm_robotics.manipulation.standard_cell.rgb_basket."""

from absl.testing import absltest

from dm_control import mjcf

from dm_robotics.manipulation.standard_cell import rgb_basket

class RGBBasketTest(absltest.TestCase):

  def test_initialize(self):

    basket = rgb_basket.RGBBasket()

    physics = mjcf.Physics.from_mjcf_model(basket.mjcf_model)
    # Check if we can call step the basket.
    physics.step()

  def test_collision_geom_group_with_primitive_collisions_enabled(self):
    basket = rgb_basket.RGBBasket()
    self.assertNotEmpty(basket.collision_geom_group)

if __name__ == '__main__':
  absltest.main()


text:
package sagan.blog.support;

import sagan.blog.Post;
import sagan.blog.PostBuilder;
import sagan.blog.PostCategory;
import sagan.support.DateFactory;
import saganx.AbstractIntegrationTests;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory;

import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.ResultActions;

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

public class BlogAtomFeedsTests extends AbstractIntegrationTests {

    @Autowired
    SiteUrl siteUrl;

    @Autowired
    private PostRepository postRepository;

    private XPath xpath = XPathFactory.newInstance().newXPath();

    private Document getAtomFeedDocument(MvcResult mvcResult) throws ParserConfigurationException, SAXException,
            IOException {
        String atomFeed = mvcResult.getResponse().getContentAsString();
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        return builder.parse(new ByteArrayInputStream(atomFeed.getBytes()));
    }

    private Document doGetForDocument(String path) throws Exception {
        ResultActions resultActions = mockMvc.perform(get(path));
        MvcResult mvcResult = resultActions.andReturn();
        return getAtomFeedDocument(mvcResult);
    }

    @Test
    public void feedHasCorrectMetadata() throws Exception {
        Document doc = doGetForDocument("/blog.atom");

        assertThat(xpath.evaluate("/feed/title", doc), is("Spring"));
        assertThat(xpath.evaluate("/feed/icon", doc), is(siteUrl.getAbsoluteUrl("/favicon.ico")));
        assertThat(xpath.evaluate("/feed/link/@href", doc), is(siteUrl.getAbsoluteUrl("/blog")));
    }

    @Test
    public void rendersBroadcastsFeed() throws Exception {
        Document doc = doGetForDocument("/blog/broadcasts.atom");

        assertThat(xpath.evaluate("/feed/title", doc), is("Spring Broadcasts"));
        assertThat(xpath.evaluate("/feed/link/@href", doc), is(siteUrl.getAbsoluteUrl("/blog/broadcasts")));
    }

    @Test
    public void rendersCategoryFeed() throws Exception {
        Document doc = doGetForDocument("/blog/category/news.atom");

        assertThat(xpath.evaluate("/feed/title", doc), is("Spring News and Events"));
        assertThat(xpath.evaluate("/feed/link/@href", doc), is(siteUrl.getAbsoluteUrl("/blog/category/news")));
    }

    @Test
    public void containsBlogPostFields() throws Exception {
        Post post = PostBuilder.post().category(PostCategory.ENGINEERING).isBroadcast().build();
        postRepository.save(post);

        ResultActions resultActions = mockMvc.perform(get("/blog.atom"));
        MvcResult mvcResult = resultActions
                .andExpect(status().isOk())
                .andExpect(content().contentTypeCompatibleWith("application/atom+xml"))
                .andReturn();

        assertThat(mvcResult.getResponse().getCharacterEncoding(), equalTo("utf-8"));

        String atomFeed = mvcResult.getResponse().getContentAsString();
        assertThat(atomFeed, containsString(post.getTitle()));
        assertThat(atomFeed, containsString(post.getRenderedContent()));

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        dateFormat.setTimeZone(DateFactory.DEFAULT_TIME_ZONE);
        String postDate = dateFormat.format(post.getCreatedAt());
        assertThat(atomFeed, containsString(postDate));
        assertThat(atomFeed, containsString("/blog/" + post.getPublicSlug()));
        assertThat(atomFeed, containsString(PostCategory.ENGINEERING.getDisplayName()));
        assertThat(atomFeed, containsString("Broadcast"));
    }

    @Test
    public void containsAMaximumOf20Posts() throws Exception {
        createPosts(21);

        Document doc = doGetForDocument("/blog.atom");

        XPathExpression expression = xpath.compile("//entry");
        NodeList evaluate = (NodeList) expression.evaluate(doc, XPathConstants.NODESET);
        assertThat(evaluate.getLength(), is(20));
    }

    private void createPosts(int numPostsToCreate) {
        Calendar calendar = Calendar.getInstance();
        List<Post> posts = new ArrayList<>();
        for (int postNumber = 1; postNumber <= numPostsToCreate; postNumber++) {
            calendar.set(2013, 10, postNumber);
            Post post = new PostBuilder().title("This week in Spring - November " + postNumber + ", 2013")
                    .rawContent("Raw content")
                    .renderedContent("Html content")
                    .renderedSummary("Html summary")
                    .createdAt(calendar.getTime())
                    .build();
            posts.add(post);
        }
        postRepository.save(posts);
    }
}


text:
#include "sys_sys_types.h"
#include "LOG_bridge.h"
#include "POP_bridge.h"
#include "T_bridge.h"
#include "ooaofooa_classes.h"

/*
 * Instance Loader (from string data).
 */
Escher_iHandle_t
ooaofooa_CP_CPINP_instanceloader( Escher_iHandle_t instance, const c_t * avlstring[] )
{
  Escher_iHandle_t return_identifier = 0;
  ooaofooa_CP_CPINP * self = (ooaofooa_CP_CPINP *) instance;
  /* Initialize application analysis class attributes.  */
  self->Id = (Escher_iHandle_t) Escher_atoi( avlstring[ 1 ] );
  return_identifier = self->Id;
  self->Parent_Package_ID = (Escher_iHandle_t) Escher_atoi( avlstring[ 2 ] );
  return return_identifier;
}

/*
 * Select any where using referential/identifying attribute set.
 * If not_empty, relate this instance to the selected instance.
 */
void ooaofooa_CP_CPINP_batch_relate( Escher_iHandle_t instance )
{
  ooaofooa_CP_CPINP * ooaofooa_CP_CPINP_instance = (ooaofooa_CP_CPINP *) instance;
  ooaofooa_CP_CP * ooaofooa_CP_CPrelated_instance1 = ooaofooa_CP_CP_AnyWhere1( ooaofooa_CP_CPINP_instance->Parent_Package_ID );
  if ( ooaofooa_CP_CPrelated_instance1 ) {
    ooaofooa_CP_CPINP_R4600_Link_may_nest( ooaofooa_CP_CPrelated_instance1, ooaofooa_CP_CPINP_instance );
  }
}

/*
 * Scan the extent for a matching instance.
 */
ooaofooa_CP_CPINP *
ooaofooa_CP_CPINP_AnyWhere1( Escher_UniqueID_t w_Id )
{
  ooaofooa_CP_CPINP * w;
  Escher_Iterator_s iter_CP_CPINP;
  Escher_IteratorReset( &iter_CP_CPINP, &pG_ooaofooa_CP_CPINP_extent.active );
  while ( (w = (ooaofooa_CP_CPINP *) Escher_IteratorNext( &iter_CP_CPINP )) != 0 ) {
    if ( w->Id == w_Id ) {
      return w;
    }
  }
  return 0;
}

/*
 * RELATE CP_CP TO CP_CPINP ACROSS R4600
 */
void
ooaofooa_CP_CPINP_R4600_Link_may_nest( ooaofooa_CP_CP * part, ooaofooa_CP_CPINP * form )
{
  /* Use TagEmptyHandleDetectionOn() to detect empty handle references.  */
  form->Parent_Package_ID = part->Package_ID;
  form->CP_CP_R4600_may_be_nested_in = part;
  Escher_SetInsertElement( &part->CP_CPINP_R4600_may_nest, (Escher_ObjectSet_s *) form );
}

/*
 * UNRELATE CP_CP FROM CP_CPINP ACROSS R4600
 */
void
ooaofooa_CP_CPINP_R4600_Unlink_may_nest( ooaofooa_CP_CP * part, ooaofooa_CP_CPINP * form )
{
  /* Use TagEmptyHandleDetectionOn() to detect empty handle references.  */
  form->Parent_Package_ID = 0;
  form->CP_CP_R4600_may_be_nested_in = 0;
  Escher_SetRemoveElement( &part->CP_CPINP_R4600_may_nest, (Escher_ObjectSet_s *) form );
}

/*
 * Dump instances in SQL format.
 */
void
ooaofooa_CP_CPINP_instancedumper( Escher_iHandle_t instance )
{
  ooaofooa_CP_CPINP * self = (ooaofooa_CP_CPINP *) instance;
  printf( "INSERT INTO CP_CPINP VALUES ( %ld,%ld );\n",
    ((long)self->Id & ESCHER_IDDUMP_MASK),
    ((long)self->Parent_Package_ID & ESCHER_IDDUMP_MASK) );
}
/*
 * Statically allocate space for the instance population for this class.
 * Allocate space for the class instance and its attribute values.
 * Depending upon the collection scheme, allocate containoids (collection
 * nodes) for gathering instances into free and active extents.
 */
static Escher_SetElement_s ooaofooa_CP_CPINP_container[ ooaofooa_CP_CPINP_MAX_EXTENT_SIZE ];
static ooaofooa_CP_CPINP ooaofooa_CP_CPINP_instances[ ooaofooa_CP_CPINP_MAX_EXTENT_SIZE ];
Escher_Extent_t pG_ooaofooa_CP_CPINP_extent = {
  {0,0}, {0,0}, &ooaofooa_CP_CPINP_container[ 0 ],
  (Escher_iHandle_t) &ooaofooa_CP_CPINP_instances,
  sizeof( ooaofooa_CP_CPINP ), 0, ooaofooa_CP_CPINP_MAX_EXTENT_SIZE
  };


text:
package org.allenai.datastore.cli

import org.allenai.datastore.Datastore

import java.io.File

object UploadApp extends App {
  case class Options(
    path: File = null,
    group: String = null,
    name: String = null,
    version: Int = -1,
    datastore: Option[Datastore] = None,
    overwrite: Boolean = false
  )

  val parser = new scopt.OptionParser[Options]("scopt") {
    opt[File]('p', "path").required().action { (p, c) =>
      c.copy(path = p)
    } text ("Path to the file or directory you want uploaded")

    opt[String]('g', "group").required().action { (g, c) =>
      c.copy(group = g)
    } text ("Group name to store the file or directory under")

    opt[String]('n', "name").required().action { (n, c) =>
      c.copy(name = n)
    } text ("Name to store the file or directory under")

    opt[Int]('v', "version").required().action { (v, c) =>
      c.copy(version = v)
    } text ("Version number to store the file or directory under")

    opt[String]('d', "datastore").action { (d, c) =>
      c.copy(datastore = Some(Datastore(d)))
    } text (s"Datastore to use. Default is ${Datastore.defaultName}")

    opt[Boolean]("overwrite").action { (_, c) =>
      c.copy(overwrite = true)
    } text ("Overwrite if the group, version, and name already exists")

    help("help")
  }

  Common.handleDatastoreExceptions {
    parser.parse(args, Options()).foreach { config =>
      val datastore = config.datastore.getOrElse {
        Common.printDefaultDatastoreWarning()
        Datastore
      }

      val locator = datastore.Locator(
        config.group,
        config.name,
        config.version,
        config.path.isDirectory
      )
      datastore.publish(config.path.toPath, locator, config.overwrite)
    }
  }
}


text:
package com.github.mahui53541.multithread.synLockIn;

public class MyThread extends Thread {
	@Override
	public void run() {
		Service s=new Service();
		s.service1();
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		MyThread myThread=new MyThread();
		myThread.start();
	}
}


text:
describe Mixins::Actions::VmActions::LiveMigrate do
  describe '#live_migrate_vm' do
    let(:controller) { VmCloudController.new }

    before do
      allow(controller).to receive(:assert_privileges)
      allow(controller).to receive(:replace_right_cell)
      controller.instance_variable_set(:@sb, :explorer => true)
      controller.params = {}
    end

    it 'sets @sb[:explorer] to nil after migration of selected Instances' do
      controller.send(:live_migrate_vm)
      expect(controller.instance_variable_get(:@sb)[:explorer]).to be_nil
    end
  end
end


text:
class DownloadController < ApplicationController

  skip_before_filter :verify_authenticity_token, only: [:create_download]

  def create_download
    if (params[:email].present?)
      MobileDownload.download_email(
        params[:email],
        params[:link],
        params[:type],
      ).deliver

      return render json: true
    end
    return render json: false, status: :unprocessable_entity
  end
end


text:
package io.fabric8.kubernetes.jsonschema2pojo;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import java.util.stream.Stream;

import static io.fabric8.kubernetes.jsonschema2pojo.Fabric8NameHelper.correctCamelCaseWithPrefix;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.params.provider.Arguments.arguments;

class Fabric8NameHelperTest {

  private static ObjectMapper M;

  @BeforeAll
  static void beforeAll() {
    M = new ObjectMapper();
  }

  @Test
  void correctCamelCaseWithPrefixWithSingleLetterDash() {
    assertEquals("getXField", correctCamelCaseWithPrefix("x-field", "getxField"));
    assertEquals("setXField", correctCamelCaseWithPrefix("x-field", "setxField"));
  }

  @Test
  void correctCamelCaseWithPrefixWithSingleLetter() {
    assertEquals("getSFlow", correctCamelCaseWithPrefix("sFlow", "getsFlow"));
    assertEquals("setSFlow", correctCamelCaseWithPrefix("sFlow", "setsFlow"));
  }

  @Test
  void correctCamelCaseWithPrefixWithSingleLetterAndSingleLetter() {
    assertEquals("getSF", correctCamelCaseWithPrefix("sF", "getsF"));
    assertEquals("setSF", correctCamelCaseWithPrefix("sF", "setsF"));
  }

  @Test
  void correctCamelCaseWithPrefixWithTwoLetter() {
    assertEquals("getNetsFlow", correctCamelCaseWithPrefix("netsFlow", "getNetsFlow"));
    assertEquals("setNetsFlow", correctCamelCaseWithPrefix("netsFlow", "setNetsFlow"));
  }

  @Test
  void correctCamelCaseWithPrefixWithCapitalFirstLetter() {
    assertEquals("getIpfix", correctCamelCaseWithPrefix("Ipfix", "getIpfix"));
    assertEquals("setIpfix", correctCamelCaseWithPrefix("Ipfix", "setIpfix"));
  }

  @DisplayName("getFieldName, should use javaName and never reserved words")
  @ParameterizedTest(name = "{index}: getFieldName: property ''{0}'' node: ''{1}'', expects: ''{2}''")
  @MethodSource("getFieldNameInput")
  void getFieldName(String propertyName, ObjectNode node, String expectedName) {
    // When
    final String result = new Fabric8NameHelper(null).getFieldName(propertyName, node);
    // Then
    assertEquals(expectedName, result);
  }

  static Stream<Arguments> getFieldNameInput() {
    return Stream.of(
        arguments("field", M.createObjectNode(), "field"),
        arguments("class", M.createObjectNode(), "className"),
        arguments("class", M.createObjectNode().put("javaName", "theClass"), "theClass"),
        arguments("field", M.createObjectNode().put("javaName", "aField"), "aField"),
        arguments("field", M.createObjectNode().put("javaName", "class"), "className"));
  }
}


text:
/*

The pagination package provides utilities to setup a paginator within the
context of a http request.

Usage

In your beego.Controller:

 package controllers

 import "github.com/astaxie/beego/utils/pagination"

 type PostsController struct {
   beego.Controller
 }

 func (this *PostsController) ListAllPosts() {
     // sets this.Data["paginator"] with the current offset (from the url query param)
     postsPerPage := 20
     paginator := pagination.SetPaginator(this.Ctx, postsPerPage, CountPosts())

     // fetch the next 20 posts
     this.Data["posts"] = ListPostsByOffsetAndLimit(paginator.Offset(), postsPerPage)
 }

In your view templates:

 {{if .paginator.HasPages}}

     {{if .paginator.HasPrev}}

{{ i18n .Lang "paginator.first_page"}}

«

     {{else}}

{{ i18n .Lang "paginator.first_page"}}

«

     {{end}}
     {{range $index, $page := .paginator.Pages}}

             {{$page}}

     {{end}}
     {{if .paginator.HasNext}}

»

{{ i18n .Lang "paginator.last_page"}}

     {{else}}

»

{{ i18n .Lang "paginator.last_page"}}

     {{end}}

 {{end}}

See also

http://beego.me/docs/mvc/view/page.md

*/
package pagination


text:
import {combineReducers} from 'redux';
import ActionTypes from '../constants/ActionTypes';

function error(state = null, action) {
    switch (action.type) {
    case ActionTypes.GET_USERINFO_SUCCESS:
        return false;
    case ActionTypes.GET_USERINFO_FAILURE:
        return true;
    default:
        return state;
    }
}

function loading(state = false, action) {
    switch (action.type) {
    case ActionTypes.GET_USERINFO:
        return true;
    case ActionTypes.GET_USERINFO_SUCCESS:
    case ActionTypes.GET_USERINFO_FAILURE:
        return false;
    default:
        return state;
    }
}

function userProfileData(state = {}, action) {
    switch (action.type) {
    case ActionTypes.GET_USERINFO_SUCCESS:
        return action.data;
    case ActionTypes.GET_USERINFO_FAILURE:
        return {};
    default:
        return state;
    }
}

const profileWidgetReducer = combineReducers({
    error,
    userProfileData,
    loading
});

export default profileWidgetReducer;


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

	<display-name>SocketIOChat</display-name>
	<servlet>
		<description>AtmosphereServlet</description>
		<servlet-name>AtmosphereServlet</servlet-name>
		<servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
		<init-param>
			<param-name>socketio-transport</param-name>
			<param-value>websocket,xhr-polling,jsonp-polling</param-value>
		</init-param>
		<init-param>
			<param-name>socketio-timeout</param-name>
			<param-value>25000</param-value>
		</init-param>
		<init-param>
			<param-name>socketio-heartbeat</param-name>
			<param-value>15000</param-value>
		</init-param>
		<init-param>
			<param-name>socketio-suspendTime</param-name>
			<param-value>30000</param-value>
		</init-param>
        <init-param>
            <param-name>org.atmosphere.cpr.sessionSupport</param-name>
            <param-value>true</param-value>
        </init-param>
		<load-on-startup>0</load-on-startup>
        <async-supported>true</async-supported>
	</servlet>
	<servlet-mapping>
		<servlet-name>AtmosphereServlet</servlet-name>
		<url-pattern>/ChatAtmosphereHandler/*</url-pattern>
	</servlet-mapping>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
</web-app>