text:
package io.druid.query;

import com.google.common.base.Function;
import com.google.common.base.Predicates;
import com.google.common.base.Supplier;
import com.google.common.base.Throwables;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.metamx.common.ISE;
import com.metamx.common.Pair;
import com.metamx.common.guava.Accumulator;
import com.metamx.common.guava.ResourceClosingSequence;
import com.metamx.common.guava.Sequence;
import com.metamx.common.guava.Sequences;
import com.metamx.common.logger.Logger;
import io.druid.collections.StupidPool;
import io.druid.data.input.Row;
import io.druid.query.groupby.GroupByQuery;
import io.druid.query.groupby.GroupByQueryConfig;
import io.druid.query.groupby.GroupByQueryHelper;
import io.druid.segment.incremental.IncrementalIndex;

import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public class GroupByParallelQueryRunner<T> implements QueryRunner<T>
{
  private static final Logger log = new Logger(GroupByParallelQueryRunner.class);
  private final Iterable<QueryRunner<T>> queryables;
  private final ListeningExecutorService exec;
  private final Supplier<GroupByQueryConfig> configSupplier;
  private final QueryWatcher queryWatcher;
  private final StupidPool<ByteBuffer> bufferPool;

  public GroupByParallelQueryRunner(
      ExecutorService exec,
      Supplier<GroupByQueryConfig> configSupplier,
      QueryWatcher queryWatcher,
      StupidPool<ByteBuffer> bufferPool,
      Iterable<QueryRunner<T>> queryables
  )
  {
    this.exec = MoreExecutors.listeningDecorator(exec);
    this.queryWatcher = queryWatcher;
    this.queryables = Iterables.unmodifiableIterable(Iterables.filter(queryables, Predicates.notNull()));
    this.configSupplier = configSupplier;
    this.bufferPool = bufferPool;
  }

  @Override
  public Sequence<T> run(final Query<T> queryParam, final Map<String, Object> responseContext)
  {
    final GroupByQuery query = (GroupByQuery) queryParam;
    final Pair<IncrementalIndex, Accumulator<IncrementalIndex, T>> indexAccumulatorPair = GroupByQueryHelper.createIndexAccumulatorPair(
        query,
        configSupplier.get(),
        bufferPool
    );
    final Pair<Queue, Accumulator<Queue, T>> bySegmentAccumulatorPair = GroupByQueryHelper.createBySegmentAccumulatorPair();
    final boolean bySegment = BaseQuery.getContextBySegment(query, false);
    final int priority = BaseQuery.getContextPriority(query, 0);

    ListenableFuture<List<Void>> futures = Futures.allAsList(
        Lists.newArrayList(
            Iterables.transform(
                queryables,
                new Function<QueryRunner<T>, ListenableFuture<Void>>()
                {
                  @Override
                  public ListenableFuture<Void> apply(final QueryRunner<T> input)
                  {
                    if (input == null) {
                      throw new ISE("Null queryRunner! Looks to be some segment unmapping action happening");
                    }

                    return exec.submit(
                        new AbstractPrioritizedCallable<Void>(priority)
                        {
                          @Override
                          public Void call() throws Exception
                          {
                            try {
                              if (bySegment) {
                                input.run(queryParam, responseContext)
                                     .accumulate(bySegmentAccumulatorPair.lhs, bySegmentAccumulatorPair.rhs);
                              } else {
                                input.run(queryParam, responseContext)
                                     .accumulate(indexAccumulatorPair.lhs, indexAccumulatorPair.rhs);
                              }

                              return null;
                            }
                            catch (QueryInterruptedException e) {
                              throw Throwables.propagate(e);
                            }
                            catch (Exception e) {
                              log.error(e, "Exception with one of the sequences!");
                              throw Throwables.propagate(e);
                            }
                          }
                        }
                    );
                  }
                }
            )
        )
    );

    // Let the runners complete
    try {
      queryWatcher.registerQuery(query, futures);
      final Number timeout = query.getContextValue(QueryContextKeys.TIMEOUT, (Number) null);
      if (timeout == null) {
        futures.get();
      } else {
        futures.get(timeout.longValue(), TimeUnit.MILLISECONDS);
      }
    }
    catch (InterruptedException e) {
      log.warn(e, "Query interrupted, cancelling pending results, query id [%s]", query.getId());
      futures.cancel(true);
      indexAccumulatorPair.lhs.close();
      throw new QueryInterruptedException(e);
    }
    catch (CancellationException e) {
      indexAccumulatorPair.lhs.close();
      throw new QueryInterruptedException(e);
    }
    catch (TimeoutException e) {
      indexAccumulatorPair.lhs.close();
      log.info("Query timeout, cancelling pending results for query id [%s]", query.getId());
      futures.cancel(true);
      throw new QueryInterruptedException(e);
    }
    catch (ExecutionException e) {
      indexAccumulatorPair.lhs.close();
      throw Throwables.propagate(e.getCause());
    }

    if (bySegment) {
      return Sequences.simple(bySegmentAccumulatorPair.lhs);
    }

    return new ResourceClosingSequence<T>(
        Sequences.simple(
            Iterables.transform(
                indexAccumulatorPair.lhs.iterableWithPostAggregations(null, query.isDescending()),
                new Function<Row, T>()
                {
                  @Override
                  public T apply(Row input)
                  {
                    return (T) input;
                  }
                }
            )
        ), indexAccumulatorPair.lhs
    );
  }
}


text:
:orphan:

.. _zend.form.view.helper.form-time:

FormTime
^^^^^^^^

The ``FormTime`` view helper can be used to render a ``<input type="time">``
HTML5 form input. It is meant to work with the :ref:`Zend\\Form\\Element\\Time <zend.form.element.time>`
element, which provides a default input specification for validating HTML5 time values.

``FormTime`` extends from :ref:`Zend\\Form\\View\\Helper\\FormDateTime <zend.form.view.helper.form-date-time>`.

.. _zend.form.view.helper.form-time.usage:

Basic usage:

.. code-block:: php
   :linenos:

   use Zend\Form\Element;

   $element = new Element\Time('my-time');

   // Within your view...

   echo $this->formTime($element);
   // <input type="time" name="my-time" value="">

redpajama_set_name: RedPajamaGithub


text:
define(function(require, exports, module) {

"use strict";

var openTrackerName;

/* Exported Functions */
exports.initialize = initialize;
exports.open = open;

function initialize() {
	var addHostnamePatternField = document.getElementById("addHostnamePatternField");
	addHostnamePatternField.addEventListener("keydown", addHostnamePattern);

	var removeAllExceptionsButton = document.getElementById("removeAllExceptionsButton");
	removeAllExceptionsButton.addEventListener("click", removeAllExceptions);

	var closeButton = document.getElementById("closeButton");
	closeButton.addEventListener("click", close);
}

function addHostnamePattern(event) {
	if (event.keyCode === 13) {
		var addHostnamePatternFieldValue = document.getElementById("addHostnamePatternField").value;
		document.getElementById("addHostnamePatternField").value = "";

		if (addHostnamePatternFieldValue.trim() === "")
			return;

		var regex = new RegExp(addHostnamePatternFieldValue);

		var optionsManager = require("../Options%20Manager");
		optionsManager.addException(openTrackerName, regex);

		populateExceptionsList();
	}
}

function populateExceptionsList() {
	var optionsManager = require("../Options%20Manager");
	var exceptions = optionsManager.getExceptions(openTrackerName);

	var exceptionsList = document.getElementById("exceptionsList");
	exceptionsList.innerHTML = "";
	var exceptionsFragment = document.createDocumentFragment();

	exceptions.forEach(function(exception) {
		var exceptionListElement = document.createElement("li");
		exceptionListElement.textContent = exception;
		exceptionsFragment.appendChild(exceptionListElement);
	});

	exceptionsList.appendChild(exceptionsFragment);
}

function open(trackerName) {
	openTrackerName = trackerName;
	var exceptionsManagerContainer = document.getElementById("exceptionsManagerContainer");
	exceptionsManagerContainer.setAttribute("class", "visible");

	// add the tracker name to the appropriate places
	var trackerNameContainers = document.querySelectorAll("#exceptionsManager .trackerName");
	for (var i = 0; i < trackerNameContainers.length; i += 1) {
		var trackerNameContainer = trackerNameContainers[i];
		trackerNameContainer.textContent = trackerName;
	}

	populateExceptionsList();
}

function removeAllExceptions() {
	var optionsManager = require("../Options%20Manager");
	optionsManager.removeAllExceptions(openTrackerName);

	populateExceptionsList();
}

function close() {
	var exceptionsManagerContainer = document.getElementById("exceptionsManagerContainer");
	exceptionsManagerContainer.setAttribute("class", "hidden");

	var exceptionsList = document.getElementById("exceptionsList");
	exceptionsList.innerHTML = "";
}
});