text:
taplist
=======

Tap List Project.  HTML5 Tap List with Local and Remote storage.

This is meant to be displayed on a web browser to allow someone to keep track of what beers they have on tap.

redpajama_set_name: RedPajamaGithub


text:
<?php

if (Url::getUriSegment(0) == 'rss') {
    Action::add('before_page_rendered', function () {

        $template = Template::factory(PLUGINS_PATH . '/feed/templates/');

        $template->setOptions(array(
            "strip" => false
        ));

        Response::status(200);
        Request::setHeaders('Content-Type: text/xml; charset=utf-8');
        $template->display('rss.tpl', array('page'  => Pages::getPage(Config::get('plugins.feed.page')),
                                        'pages' => Pages::getPages(Config::get('plugins.feed.page'), 'date', 'DESC', array('404', 'index'))));
        Request::shutdown();

    });
}


text:
package edu.tamu.weaver.auth.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

import edu.tamu.weaver.auth.model.Credentials;
import edu.tamu.weaver.auth.model.repo.AbstractWeaverUserRepo;
import edu.tamu.weaver.user.model.AbstractWeaverUser;

public abstract class UserCredentialsService<U extends AbstractWeaverUser, R extends AbstractWeaverUserRepo<U>> {

    @Autowired
    protected R userRepo;

    @Value("${app.authority.admins}")
    protected String[] admins;

    public Credentials buildAnonymousCredentials() {
        Credentials anonymousCredentials = new Credentials();
        anonymousCredentials.setAffiliation("NA");
        anonymousCredentials.setLastName("Anonymous");
        anonymousCredentials.setFirstName("Role");
        anonymousCredentials.setNetid("anonymous-" + Math.round(Math.random() * 100000));
        anonymousCredentials.setUin("000000000");
        anonymousCredentials.setExp("1436982214754");
        anonymousCredentials.setEmail("helpdesk@library.tamu.edu");
        anonymousCredentials.setRole(getAnonymousRole());
        return anonymousCredentials;
    }

    public abstract U updateUserByCredentials(Credentials credentials);

    public abstract String getAnonymousRole();

}


text:
.class public Landroid/webkit/ConsoleMessage;
.super Ljava/lang/Object;
.source "ConsoleMessage.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/webkit/ConsoleMessage$MessageLevel;
    }
.end annotation

# instance fields
.field private mLevel:Landroid/webkit/ConsoleMessage$MessageLevel;

.field private mLineNumber:I

.field private mMessage:Ljava/lang/String;

.field private mSourceId:Ljava/lang/String;

# direct methods
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;ILandroid/webkit/ConsoleMessage$MessageLevel;)V
    .locals 0
    .parameter "message"
    .parameter "sourceId"
    .parameter "lineNumber"
    .parameter "msgLevel"

    .prologue
    .line 42
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    .line 43
    iput-object p1, p0, Landroid/webkit/ConsoleMessage;->mMessage:Ljava/lang/String;

    .line 44
    iput-object p2, p0, Landroid/webkit/ConsoleMessage;->mSourceId:Ljava/lang/String;

    .line 45
    iput p3, p0, Landroid/webkit/ConsoleMessage;->mLineNumber:I

    .line 46
    iput-object p4, p0, Landroid/webkit/ConsoleMessage;->mLevel:Landroid/webkit/ConsoleMessage$MessageLevel;

    .line 47
    return-void
.end method

# virtual methods
.method public lineNumber()I
    .locals 1

    .prologue
    .line 62
    iget v0, p0, Landroid/webkit/ConsoleMessage;->mLineNumber:I

    return v0
.end method

.method public message()Ljava/lang/String;
    .locals 1

    .prologue
    .line 54
    iget-object v0, p0, Landroid/webkit/ConsoleMessage;->mMessage:Ljava/lang/String;

    return-object v0
.end method

.method public messageLevel()Landroid/webkit/ConsoleMessage$MessageLevel;
    .locals 1

    .prologue
    .line 50
    iget-object v0, p0, Landroid/webkit/ConsoleMessage;->mLevel:Landroid/webkit/ConsoleMessage$MessageLevel;

    return-object v0
.end method

.method public sourceId()Ljava/lang/String;
    .locals 1

    .prologue
    .line 58
    iget-object v0, p0, Landroid/webkit/ConsoleMessage;->mSourceId:Ljava/lang/String;

    return-object v0
.end method


text:
class BranchExistsError(Exception):  # pragma: no cover
    pass

class NoPermissionError(Exception):  # pragma: no cover
    pass

class RepoDoesNotExistError(Exception):  # pragma: no cover
    pass

class UnsupportedScheduleError(Exception):  # pragma: no cover
    pass

class ConfigError(Exception):
    def __init__(self, content, error):
        self.error = error
        self.content = content


text:
/**
 * Provides interfaces and classes for the processor.
 */
package de.tudresden.inf.lat.born.gui.processor;


text:
package com.intellij.openapi.fileEditor.impl;

public interface FileEditorManagerChange {

  void run(EditorsSplitters splitters);

}


text: Ticketing system for luminaries based on location


text:
namespace brightray {

namespace {

std::unique_ptr<base::DictionaryValue> GetConstants() {
  std::unique_ptr<base::DictionaryValue> constants = net::GetNetConstants();

  // Adding client information to constants dictionary.
  auto* client_info = new base::DictionaryValue();
  client_info->SetString(
      "command_line",
      base::CommandLine::ForCurrentProcess()->GetCommandLineString());

  constants->Set("clientInfo", client_info);
  return constants;
}

}  // namespace

NetLog::NetLog() {
}

NetLog::~NetLog() {
}

void NetLog::StartLogging(net::URLRequestContext* url_request_context) {
  auto command_line = base::CommandLine::ForCurrentProcess();
  if (!command_line->HasSwitch(switches::kLogNetLog))
    return;

  base::FilePath log_path =
      command_line->GetSwitchValuePath(switches::kLogNetLog);
#if defined(OS_WIN)
  log_file_.reset(_wfopen(log_path.value().c_str(), L"w"));
#elif defined(OS_POSIX)
  log_file_.reset(fopen(log_path.value().c_str(), "w"));
#endif

  if (!log_file_) {
    LOG(ERROR) << "Could not open file: " << log_path.value()
               << "for net logging";
    return;
  }

  std::unique_ptr<base::Value> constants(GetConstants());
  write_to_file_observer_.StartObserving(this,
                                         std::move(log_file_),
                                         constants.get(),
                                         url_request_context);
}

}  // namespace brightray


text:
package com.dci.intellij.dbn.language.editor.action;

import com.dci.intellij.dbn.common.thread.SimpleLaterInvocator;
import com.dci.intellij.dbn.common.util.ActionUtil;
import com.dci.intellij.dbn.common.util.MessageUtil;
import com.dci.intellij.dbn.connection.ConnectionHandler;
import com.dci.intellij.dbn.connection.mapping.FileConnectionMappingManager;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;

import javax.swing.Icon;

public abstract class TransactionEditorAction extends DumbAwareAction {
    protected TransactionEditorAction(String text, String description, Icon icon) {
        super(text, description, icon);
    }

    public void update(AnActionEvent e) {
        Project project = ActionUtil.getProject(e);
        boolean enabled = false;
        if (project != null) {
            FileConnectionMappingManager connectionMappingManager = FileConnectionMappingManager.getInstance(project);
            ConnectionHandler activeConnection = connectionMappingManager.lookupActiveConnectionForEditor(e.getPlace());
            enabled = activeConnection != null && activeConnection.hasUncommittedChanges();
        }
        e.getPresentation().setEnabled(enabled);
    }

    protected void showErrorDialog(final String message) {
        new SimpleLaterInvocator() {
            public void run() {
                MessageUtil.showErrorDialog(message);
            }
        }.start();
    }

    protected ConnectionHandler getConnectionHandler(Project project, String actionPlace) {
        if (project != null) {
            FileConnectionMappingManager connectionMappingManager = FileConnectionMappingManager.getInstance(project);
            return connectionMappingManager.lookupActiveConnectionForEditor(actionPlace);
        }
        return null;
    }
}


text:
package net.sourceforge.plantuml.cucadiagram;

import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.svek.IEntityImage;

public interface ILeaf extends IEntity {

	public EntityPosition getEntityPosition();

	public void setContainer(IGroup container);

	public boolean isTop();

	public void setTop(boolean top);

	public boolean hasNearDecoration();

	public void setNearDecoration(boolean nearDecoration);

	public int getXposition();

	public void setXposition(int pos);

	public IEntityImage getSvekImage();

	public String getGeneric();

	public void muteToType(LeafType newType, USymbol newSymbol);

	public void setGeneric(String generic);

	public void setSvekImage(IEntityImage svekImage);

	public void setNeighborhood(Neighborhood neighborhood);

	public Neighborhood getNeighborhood();

	public boolean hasPort();

	public void setHasPort(boolean hasPort);

	public void setVisibilityModifier(VisibilityModifier visibility);

	public VisibilityModifier getVisibilityModifier();

}


text:
require 'date'
require 'brainstem/time_classes'
require 'brainstem/preloader'
require 'brainstem/concerns/presenter_dsl'

module Brainstem
  # @abstract Subclass and override {#present} to implement a presenter.
  class Presenter
    include Concerns::PresenterDSL

    # Class methods

    # Accepts a list of classes that this specific presenter knows how to present. These are not inherited.
    # @param [String, [String]] klasses Any number of names of classes this presenter presents.
    def self.presents(*klasses)
      @presents ||= []
      if klasses.length > 0
        if klasses.any? { |klass| klass.is_a?(String) || klass.is_a?(Symbol) }
          raise "Brainstem Presenter#presents now expects a Class instead of a class name"
        end
        @presents += klasses
        Brainstem.add_presenter_class(self, namespace, *klasses)
      end
      @presents
    end

    # Return the second-to-last module in the name of this presenter, which Brainstem considers to be the 'namespace'.
    # E.g., Api::V1::FooPresenter has a namespace of "V1".
    # @return [String] The name of the second-to-last module containing this presenter.
    def self.namespace
      self.to_s.split("::")[-2].try(:downcase)
    end

    def self.merged_helper_class
      @helper_classes ||= {}

      @helper_classes[configuration[:helpers].to_a.map(&:object_id)] ||= begin
        Class.new.tap do |klass|
          (configuration[:helpers] || []).each do |helper|
            klass.send :include, helper
          end
        end
      end
    end

    def self.reset!
      clear_configuration!
      @helper_classes = @presents = nil
    end

    # In Rails 4.2, ActiveRecord::Base#reflections started being keyed by strings instead of symbols.
    def self.reflections(klass)
      klass.reflections.each_with_object({}) { |(key, value), memo| memo[key.to_s] = value }
    end

    # Instance methods

    # @deprecated
    def present(model)
      raise "#present is now deprecated"
    end

    # Calls {#custom_preload} and then presents all models.
    # @params [ActiveRecord::Relation, Array] models
    # @params [Array] requested_associations An array of permitted lower-case string association names, e.g. 'post'
    # @params [Hash] options The options passed to `load_associations!`
    def group_present(models, requested_associations = [], options = {})
      association_objects_by_name = requested_associations.each_with_object({}) do |assoc_name, memo|
        memo[assoc_name.to_s] = configuration[:associations][assoc_name] if configuration[:associations][assoc_name]
      end

      # It's slightly ugly, but more efficient if we pre-load everything we
      # need and pass it through.
      context = {
        conditional_cache:            { request: {} },
        fields:                       configuration[:fields],
        conditionals:                 configuration[:conditionals],
        associations:                 configuration[:associations],
        reflections:                  reflections_for_model(models.first),
        association_objects_by_name:  association_objects_by_name,
        optional_fields:              options[:optional_fields] || []
      }

      sanitized_association_names = association_objects_by_name.values.map(&:method_name)
      preload_associations! models, sanitized_association_names, context[:reflections]

      # Legacy: Overridable for custom preload behavior.
      custom_preload(models, association_objects_by_name.keys)

      models.map do |model|
        context[:conditional_cache][:model] = {}
        context[:helper_instance] = fresh_helper_instance
        result = present_fields(model, context, context[:fields])
        load_associations!(model, result, context, options)
        add_id!(model, result)
        datetimes_to_json(result)
      end
    end

    def present_model(model, requested_associations = [], options = {})
      group_present([model], requested_associations, options).first
    end

    # @api private
    #
    # Returns the reflections for a model's class if the model is not nil.
    def reflections_for_model(model)
      model && Brainstem::Presenter.reflections(model.class)
    end
    private :reflections_for_model

    # @api private
    # Determines which associations are valid for inclusion in the current context.
    # Mostly just removes only-restricted associations when needed.
    # @return [Hash] The associations that can be included.
    def allowed_associations(is_only_query)
      ActiveSupport::HashWithIndifferentAccess.new.tap do |associations|
        configuration[:associations].each do |name, association|
          associations[name] = association unless association.options[:restrict_to_only] && !is_only_query
        end
      end
    end

    # Subclasses can define this if they wish. This method will be called by {#group_present}.
    def custom_preload(models, requested_associations = [])
    end

    # Given user params, build a hash of validated filter names to their unsanitized arguments.
    def extract_filters(user_params, options = {})
      filters_hash = {}

      apply_default_filters = options.fetch(:apply_default_filters) { true }

      configuration[:filters].each do |filter_name, filter|
        user_value = user_params[filter_name]
        user_value = user_value.is_a?(Array) ? user_value : (user_value.present? ? user_value.to_s : nil)
        user_value = user_value == "true" ? true : (user_value == "false" ? false : user_value)

        filter_options = filter[0]
        filter_arg = apply_default_filters && user_value.nil? ? filter_options[:default] : user_value
        filters_hash[filter_name] = filter_arg unless filter_arg.nil?
      end

      filters_hash
    end

    # Given user params, build a hash of validated filter names to their unsanitized arguments.
    def apply_filters_to_scope(scope, user_params, options)
      helper_instance = fresh_helper_instance

      requested_filters = extract_filters(user_params, options)
      requested_filters.each do |filter_name, filter_arg|
        filter_lambda = configuration[:filters][filter_name][1]

        args_for_filter_lambda = [filter_arg]
        args_for_filter_lambda << requested_filters if configuration[:filters][filter_name][0][:include_params]

        if filter_lambda
          scope = helper_instance.instance_exec(scope, *args_for_filter_lambda, &filter_lambda)
        else
          scope = scope.send(filter_name, *args_for_filter_lambda)
        end
      end

      scope
    end

    # Given user params, apply a validated sort order to the given scope.
    def apply_ordering_to_scope(scope, user_params)
      sort_name, direction = calculate_sort_name_and_direction(user_params)
      order = configuration[:sort_orders][sort_name]

      case order
        when Proc
          fresh_helper_instance.instance_exec(scope, direction, &order)
        when nil
          scope
        else
          scope.reorder(order.to_s + " " + direction)
      end
    end

    # Execute the stored search block
    def run_search(query, search_options)
      fresh_helper_instance.instance_exec(query, search_options, &configuration[:search])
    end

    # Clean and validate a sort order and direction from user params.
    def calculate_sort_name_and_direction(user_params = {})
      default_column, default_direction = (configuration[:default_sort_order] || "updated_at:desc").split(":")
      sort_name, direction = (user_params['order'] || "").split(":")
      unless sort_name.present? && configuration[:sort_orders][sort_name]
        sort_name = default_column
        direction = default_direction
      end

      [sort_name, direction == 'desc' ? 'desc' : 'asc']
    end

    protected

    # @api protected
    # Run preloading on the given models, asking Rails to include both any named associations and any preloads declared in the Brainstem DSL..
    def preload_associations!(models, sanitized_association_names, memoized_reflections)
      return unless models.any?

      preloads  = sanitized_association_names + configuration[:preloads].to_a
      Brainstem::Preloader.preload(models, preloads, memoized_reflections)
    end

    # @api protected
    # Instantiate and return a new instance of the merged helper class for this presenter.
    def fresh_helper_instance
      self.class.merged_helper_class.new
    end

    # @api protected
    # Adds :id as a string from the given model.
    def add_id!(model, struct)
      if model.class.respond_to?(:primary_key)
        struct['id'] = model[model.class.primary_key].to_s
      end
    end

    # @api protected
    # Recurses through any nested Hash/Array data structure, converting dates and times to JSON standard values.
    def datetimes_to_json(struct)
      case struct
      when Array
        struct.map { |value| datetimes_to_json(value) }
      when Hash
        processed = {}
        struct.each { |k,v| processed[k] = datetimes_to_json(v) }
        processed
      when Date
        struct.strftime('%F')
      when *TIME_CLASSES # Time, ActiveSupport::TimeWithZone
        struct.iso8601
      else
        struct
      end
    end

    # @api protected
    # Uses the fields DSL to output a presented model.
    # @return [Hash]  A hash representation of the model.
    def present_fields(model, context, fields, result = {})
      fields.each do |name, field|
        case field
          when DSL::Field
            if field.conditionals_match?(model, context[:conditionals], context[:helper_instance], context[:conditional_cache]) && field.optioned?(context[:optional_fields])
              result[name] = field.run_on(model, context[:helper_instance])
            end
          when DSL::Configuration
            result[name] ||= {}
            present_fields(model, context, field, result[name])
          else
            raise "Unknown Brianstem Field type encountered: #{field}"
        end
      end
      result
    end

    # @api protected
    # Makes sure that associations are loaded and converted into ids.
    def load_associations!(model, struct, context, options)
      context[:associations].each do |external_name, association|
        method_name = association.method_name && association.method_name.to_s
        id_attr = method_name && "#{method_name}_id"

        # If this association has been explictly requested, execute the association here.  Additionally, store
        # the loaded models in the :load_associations_into hash for later use.
        if context[:association_objects_by_name][external_name]
          associated_model_or_models = association.run_on(model, context[:helper_instance])

          if options[:load_associations_into]
            Array(associated_model_or_models).flatten.each do |associated_model|
              key = presenter_collection.brainstem_key_for!(associated_model.class)
              options[:load_associations_into][key] ||= {}
              options[:load_associations_into][key][associated_model.id.to_s] = associated_model
            end
          end
        end

        if id_attr && model.class.columns_hash.has_key?(id_attr) && !association.polymorphic?
          # We return *_id keys when they exist in the database, because it's free to do so.
          struct["#{external_name}_id"] = to_s_except_nil(model.send(id_attr))
        elsif association.always_return_ref_with_sti_base?
          # Deprecated support for legacy always-return-ref mode without loading the association.
          struct["#{external_name}_ref"] = legacy_polymorphic_base_ref(model, id_attr, method_name)
        elsif context[:association_objects_by_name][external_name]
          # This association has been explicitly requested.  Add the *_id, *_ids, *_ref, or *_refs keys to the presented data.
          add_ids_or_refs_to_struct!(struct, association, external_name, associated_model_or_models)
        end
      end
    end

    # @api protected
    # Inject 'foo_ids' keys into the presented data if the foos association has been requested.
    def add_ids_or_refs_to_struct!(struct, association, external_name, associated_model_or_models)
      singular_external_name = external_name.to_s.singularize
      if association.polymorphic?
        if associated_model_or_models.is_a?(Array) || associated_model_or_models.is_a?(ActiveRecord::Relation)
          struct["#{singular_external_name}_refs"] = associated_model_or_models.map { |associated_model| make_model_ref(associated_model) }
        else
          struct["#{singular_external_name}_ref"] = make_model_ref(associated_model_or_models)
        end
      else
        if associated_model_or_models.is_a?(Array) || associated_model_or_models.is_a?(ActiveRecord::Relation)
          struct["#{singular_external_name}_ids"] = associated_model_or_models.map { |associated_model| to_s_except_nil(associated_model.try(:id)) }
        else
          struct["#{singular_external_name}_id"] = to_s_except_nil(associated_model_or_models.try(:id))
        end
      end
    end

    # @api protected
    # Deprecated support for legacy always-return-ref mode without loading the association.
    # This tries to find the key based on the *_type value in the DB (which will be the STI base class, and may error if no presenter exists)
    def legacy_polymorphic_base_ref(model, id_attr, method_name)
      if (id = model.send(id_attr)).present?
        {
          'id' => to_s_except_nil(id),
          'key' => presenter_collection.brainstem_key_for!(model.send("#{method_name}_type").try(:constantize))
        }
      end
    end

    # @api protected
    # Call to_s on the input unless the input is nil.
    def to_s_except_nil(thing)
      thing.nil? ? nil : thing.to_s
    end

    # @api protected
    # Return a polymorphic id/key object for a model, or nil if no model was given.
    def make_model_ref(model)
      if model
        {
          'id' => to_s_except_nil(model.id),
          'key' => presenter_collection.brainstem_key_for!(model.class)
        }
      else
        nil
      end
    end

    # @api protected
    # Find the global presenter collection for our namespace.
    def presenter_collection
      Brainstem.presenter_collection(self.class.namespace)
    end
  end
end


text:
class SomeServiceNEWNAME
  def main
    foo='testing'
    puts foo
  end
end


text:
using System;
using System.Threading.Tasks;
using NUnit.Framework;

namespace Common.Testing.NUnit
{
    public static class AssertExtensions
    {
        public static async Task ThrowsAsync<TException>(Func<Task> func) where TException : Exception
        {
            var expected = typeof(TException);
            Type actual = null;

            try
            {
                await func();
            }
            catch (TException exception)
            {
                actual = exception.GetType();
            }

            Assert.AreEqual(expected, actual);
        }
    }
}


text:
package com.doist.jobschedulercompat.job;

import com.doist.jobschedulercompat.JobInfo;

import android.content.ComponentName;
import android.net.Uri;
import android.os.SystemClock;

import java.util.Set;

import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;

/**
 * Same as com.android.server.job.controllers.JobStatus, with minor modifications and unused code removed.
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
public class JobStatus {
    public static final long NO_LATEST_RUNTIME = Long.MAX_VALUE;
    public static final long NO_EARLIEST_RUNTIME = 0L;

    public static final int CONSTRAINT_CHARGING = JobInfo.CONSTRAINT_FLAG_CHARGING;
    public static final int CONSTRAINT_IDLE = JobInfo.CONSTRAINT_FLAG_DEVICE_IDLE;
    public static final int CONSTRAINT_BATTERY_NOT_LOW = JobInfo.CONSTRAINT_FLAG_BATTERY_NOT_LOW;
    public static final int CONSTRAINT_STORAGE_NOT_LOW = JobInfo.CONSTRAINT_FLAG_STORAGE_NOT_LOW;
    public static final int CONSTRAINT_TIMING_DELAY = 1 << 31;
    public static final int CONSTRAINT_DEADLINE = 1 << 30;
    public static final int CONSTRAINT_UNMETERED = 1 << 29;
    public static final int CONSTRAINT_CONNECTIVITY = 1 << 28;
    //    public static final int CONSTRAINT_APP_NOT_IDLE = 1 << 27;
    public static final int CONSTRAINT_CONTENT_TRIGGER = 1 << 26;
    //    public static final int CONSTRAINT_DEVICE_NOT_DOZING = 1 << 25;
    public static final int CONSTRAINT_NOT_ROAMING = 1 << 24;
    public static final int CONSTRAINT_METERED = 1 << 23;

    static final int CONNECTIVITY_MASK =
            CONSTRAINT_UNMETERED | CONSTRAINT_CONNECTIVITY |
                    CONSTRAINT_NOT_ROAMING | CONSTRAINT_METERED;

    /** If not specified, trigger update delay is 10 seconds. */
    public static final long DEFAULT_TRIGGER_UPDATE_DELAY = 10 * 1000;

    /** The minimum possible update delay is 1/2 second. */
    public static final long MIN_TRIGGER_UPDATE_DELAY = 500;

    /** If not specified, trigger maximum delay is 2 minutes. */
    public static final long DEFAULT_TRIGGER_MAX_DELAY = 2 * 60 * 1000;

    /** The minimum possible update delay is 1 second. */
    public static final long MIN_TRIGGER_MAX_DELAY = 1000;

    private static final int CONSTRAINTS_OF_INTEREST =
            CONSTRAINT_CHARGING | CONSTRAINT_BATTERY_NOT_LOW | CONSTRAINT_STORAGE_NOT_LOW |
                    CONSTRAINT_TIMING_DELAY |
                    CONSTRAINT_CONNECTIVITY | CONSTRAINT_UNMETERED |
                    CONSTRAINT_NOT_ROAMING | CONSTRAINT_METERED |
                    CONSTRAINT_IDLE | CONSTRAINT_CONTENT_TRIGGER;

    private final JobInfo job;
    private final String scheduler;

    /**
     * Earliest point in the future at which this job will be eligible to run. A value of 0
     * indicates there is no delay constraint. See {@link #hasTimingDelayConstraint()}.
     */
    private final long earliestRunTimeElapsedMillis;

    /**
     * Latest point in the future at which this job must be run. A value of {@link Long#MAX_VALUE}
     * indicates there is no deadline constraint. See {@link #hasDeadlineConstraint()}.
     */
    private final long latestRunTimeElapsedMillis;

    /** How many times this job has failed, used to compute back-off. */
    private final int numFailures;

    // Constraints.
    private final int requiredConstraints;
    private int satisfiedConstraints = 0;

    public Set<Uri> changedUris;
    public Set<String> changedAuthorities;

    public JobStatus(@NonNull JobInfo job, @NonNull String scheduler, int numFailures,
                     long earliestRunTimeElapsedMillis, long latestRunTimeElapsedMillis) {
        this.job = job;
        this.scheduler = scheduler;

        this.earliestRunTimeElapsedMillis = earliestRunTimeElapsedMillis;
        this.latestRunTimeElapsedMillis = latestRunTimeElapsedMillis;
        this.numFailures = numFailures;

        int requiredConstraints = job.getConstraintFlags();

        switch (job.getNetworkType()) {
            case JobInfo.NETWORK_TYPE_NONE:
                // No constraint.
                break;
            case JobInfo.NETWORK_TYPE_ANY:
                requiredConstraints |= CONSTRAINT_CONNECTIVITY;
                break;
            case JobInfo.NETWORK_TYPE_UNMETERED:
                requiredConstraints |= CONSTRAINT_UNMETERED;
                break;
            case JobInfo.NETWORK_TYPE_NOT_ROAMING:
                requiredConstraints |= CONSTRAINT_NOT_ROAMING;
                break;
            case JobInfo.NETWORK_TYPE_CELLULAR:
                requiredConstraints |= CONSTRAINT_METERED;
                break;
        }

        if (earliestRunTimeElapsedMillis != NO_EARLIEST_RUNTIME) {
            requiredConstraints |= CONSTRAINT_TIMING_DELAY;
        }
        if (latestRunTimeElapsedMillis != NO_LATEST_RUNTIME) {
            requiredConstraints |= CONSTRAINT_DEADLINE;
        }
        if (job.getTriggerContentUris() != null) {
            requiredConstraints |= CONSTRAINT_CONTENT_TRIGGER;
        }
        this.requiredConstraints = requiredConstraints;
    }

    /**
     * Create a new JobStatus that was loaded from disk. We ignore the provided {@link JobInfo} time criteria
     * because we can load a persisted periodic job from the {@link JobStore} and still want to respect its
     * wallclock runtime rather than resetting it on every boot. We consider a freshly loaded job to no longer
     * be in back-off.
     */
    public JobStatus(@NonNull JobInfo job, @NonNull String scheduler,
                     long earliestRunTimeElapsedMillis, long latestRunTimeElapsedMillis) {
        this(job, scheduler, 0, earliestRunTimeElapsedMillis, latestRunTimeElapsedMillis);
    }

    /**
     * Create a newly scheduled job.
     */
    public static JobStatus createFromJobInfo(@NonNull JobInfo job, @NonNull String scheduler) {
        long elapsedNow = SystemClock.elapsedRealtime();
        long earliestRunTimeElapsedMillis, latestRunTimeElapsedMillis;
        if (job.isPeriodic()) {
            latestRunTimeElapsedMillis = elapsedNow + job.getIntervalMillis();
            earliestRunTimeElapsedMillis = latestRunTimeElapsedMillis - job.getFlexMillis();
        } else {
            earliestRunTimeElapsedMillis =
                    job.hasEarlyConstraint() ? elapsedNow + job.getMinLatencyMillis() : NO_EARLIEST_RUNTIME;
            latestRunTimeElapsedMillis =
                    job.hasLateConstraint() ? elapsedNow + job.getMaxExecutionDelayMillis() : NO_LATEST_RUNTIME;
        }
        return new JobStatus(job, scheduler, 0, earliestRunTimeElapsedMillis, latestRunTimeElapsedMillis);
    }

    @NonNull
    public JobInfo getJob() {
        return job;
    }

    public int getJobId() {
        return job.getId();
    }

    public int getNumFailures() {
        return numFailures;
    }

    @NonNull
    public ComponentName getServiceComponent() {
        return job.getService();
    }

    @NonNull
    public String getSchedulerTag() {
        return scheduler;
    }

    public boolean hasConnectivityConstraint() {
        return (requiredConstraints & CONNECTIVITY_MASK) != 0;
    }

    public boolean needsAnyConnectivity() {
        return (requiredConstraints & CONSTRAINT_CONNECTIVITY) != 0;
    }

    public boolean needsUnmeteredConnectivity() {
        return (requiredConstraints & CONSTRAINT_UNMETERED) != 0;
    }

    public boolean needsMeteredConnectivity() {
        return (requiredConstraints & CONSTRAINT_METERED) != 0;
    }

    public boolean needsNonRoamingConnectivity() {
        return (requiredConstraints & CONSTRAINT_NOT_ROAMING) != 0;
    }

    public boolean hasChargingConstraint() {
        return (requiredConstraints & CONSTRAINT_CHARGING) != 0;
    }

    public boolean hasBatteryNotLowConstraint() {
        return (requiredConstraints & CONSTRAINT_BATTERY_NOT_LOW) != 0;
    }

    public boolean hasPowerConstraint() {
        return (requiredConstraints & (CONSTRAINT_CHARGING | CONSTRAINT_BATTERY_NOT_LOW)) != 0;
    }

    public boolean hasStorageNotLowConstraint() {
        return (requiredConstraints & CONSTRAINT_STORAGE_NOT_LOW) != 0;
    }

    public boolean hasTimingDelayConstraint() {
        return (requiredConstraints & CONSTRAINT_TIMING_DELAY) != 0;
    }

    public boolean hasDeadlineConstraint() {
        return (requiredConstraints & CONSTRAINT_DEADLINE) != 0;
    }

    public boolean hasIdleConstraint() {
        return (requiredConstraints & CONSTRAINT_IDLE) != 0;
    }

    public boolean hasContentTriggerConstraint() {
        return (requiredConstraints & CONSTRAINT_CONTENT_TRIGGER) != 0;
    }

    public long getTriggerContentUpdateDelay() {
        long time = job.getTriggerContentUpdateDelay();
        if (time < 0) {
            return DEFAULT_TRIGGER_UPDATE_DELAY;
        }
        return Math.max(time, MIN_TRIGGER_UPDATE_DELAY);
    }

    public long getTriggerContentMaxDelay() {
        long time = job.getTriggerContentMaxDelay();
        if (time < 0) {
            return DEFAULT_TRIGGER_MAX_DELAY;
        }
        return Math.max(time, MIN_TRIGGER_MAX_DELAY);
    }

    public boolean isPeriodic() {
        return job.isPeriodic();
    }

    public boolean isPersisted() {
        return job.isPersisted();
    }

    public long getEarliestRunTimeElapsed() {
        return earliestRunTimeElapsedMillis;
    }

    public long getLatestRunTimeElapsed() {
        return latestRunTimeElapsedMillis;
    }

    public boolean setConstraintSatisfied(int constraint, boolean state) {
        boolean old = (satisfiedConstraints & constraint) != 0;
        if (old == state) {
            return false;
        }
        satisfiedConstraints = (satisfiedConstraints & ~constraint) | (state ? constraint : 0);
        return true;
    }

    boolean isConstraintSatisfied(int constraint) {
        return (satisfiedConstraints & constraint) != 0;
    }

    /**
     * @return Whether or not this JobStatus's deadline constraint is satisfied, meaning it is ready to run regardless
     * of other constraints.
     */
    public boolean isDeadlineSatisfied() {
        return !job.isPeriodic() && hasDeadlineConstraint() && (satisfiedConstraints & CONSTRAINT_DEADLINE) != 0;
    }

    /**
     * @return Whether the constraints set on this job are satisfied.
     */
    private boolean isConstraintsSatisfied() {
        final int req = requiredConstraints & CONSTRAINTS_OF_INTEREST;
        final int sat = satisfiedConstraints & CONSTRAINTS_OF_INTEREST;
        return (sat & req) == req;
    }

    /**
     * @return Whether or not this job is ready to run, based on its requirements. This is true if
     * the constraints are satisfied or the deadline on the job has expired.
     */
    public boolean isReady() {
        // Deadline constraint trumps other constraints (except for periodic jobs where deadline is an
        // implementation detail. A periodic job should only run if its constraints are satisfied).
        return isConstraintsSatisfied() || isDeadlineSatisfied();
    }
}


text:
var controllers = require('../controllers'),
	passport = require('passport');

module.exports = function(app) {
	app.get('/login', controllers.authCtrl.login);
	app.post('/login', passport.authenticate('local-login', {
        successRedirect : '/main',
        failureRedirect : '/login',
        failureFlash : true
    }));
	app.get('/logout', controllers.authCtrl.logout);

	app.get('/signup', controllers.authCtrl.signup);
	app.post('/signup', passport.authenticate('local-signup', {
		successRedirect: '/main',
		failureRedirect: '/signup',
		failureFlash: true
	}))

	app.get('/main', controllers.authCtrl.isLoggedIn, controllers.userCtrl.getMain);

	app.get('/', function(req, res) {
		res.render('index.ejs');
	})
}


text:
function ui.sectionRow ( arg1, arg2 )

  local class = "sectionRow"
  local content

  if arg2 then
    class = class .. " " .. arg1
    content = arg2
  else
    content = arg1
  end

  ui.container { attr = { class = class }, content = content }

end


text:
package biz.enef.angulate.impl

import scala.reflect.macros.blackbox.Context

protected[angulate] class AnnotationMacros(val c: Context) extends MacroBase {
  import c.universe._

  // print generated code to console during compilation
  private lazy val logCode = c.settings.exists( _ == "biz.enef.angulate.AnnotationMacros.debug" )

  def functionDIArray(f: c.Tree) = {
    val diArray = createFunctionDIArray(f)

    val tree =
    q"""{import scalajs.js
         import biz.enef.angulate.AnnotatedFunction
         new AnnotatedFunction($diArray)
         }"""

    if(logCode) printCode( tree )
    tree
  }

}


text:
import socket
import struct
import sys
import time

try:
    from urlparse import urlparse
except ImportError:
    from urllib.parse import urlparse

if len(sys.argv) < 3:
    print('Usage: ' + sys.argv[0] + ' <target ip> <url>...')
    sys.exit(1)

target_ip = sys.argv[1]
file_list_payload = ''

for url in sys.argv[2:]:
    parsed = urlparse(url);
    if not parsed.scheme in ('http', 'https') or parsed.netloc == '':
        print(url + ': Invalid URL')
        sys.exit(1)

    file_list_payload += url + '\n'

file_list_payloadBytes = file_list_payload.encode('ascii')

print('URLs:')
print(file_list_payload)

try:
    print('Sending URL(s) to '+ target_ip + ' on port 5000...')
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect((target_ip, 5000))
    sock.sendall(struct.pack('!L', len(file_list_payloadBytes)) + file_list_payloadBytes)
    while len(sock.recv(1)) < 1:
        time.sleep(0.05)
    sock.close()
except Exception as e:
    print('An error occurred: ' + str(e))
    sys.exit(1)


text:
package com.facebook;

public enum AccessTokenSource
{
  private final boolean canExtendToken;

  static
  {
    FACEBOOK_APPLICATION_WEB = new AccessTokenSource("FACEBOOK_APPLICATION_WEB", 1, true);
    FACEBOOK_APPLICATION_NATIVE = new AccessTokenSource("FACEBOOK_APPLICATION_NATIVE", 2, true);
    FACEBOOK_APPLICATION_SERVICE = new AccessTokenSource("FACEBOOK_APPLICATION_SERVICE", 3, true);
    WEB_VIEW = new AccessTokenSource("WEB_VIEW", 4, false);
    TEST_USER = new AccessTokenSource("TEST_USER", 5, true);
    CLIENT_TOKEN = new AccessTokenSource("CLIENT_TOKEN", 6, true);
    AccessTokenSource[] arrayOfAccessTokenSource = new AccessTokenSource[7];
    arrayOfAccessTokenSource[0] = NONE;
    arrayOfAccessTokenSource[1] = FACEBOOK_APPLICATION_WEB;
    arrayOfAccessTokenSource[2] = FACEBOOK_APPLICATION_NATIVE;
    arrayOfAccessTokenSource[3] = FACEBOOK_APPLICATION_SERVICE;
    arrayOfAccessTokenSource[4] = WEB_VIEW;
    arrayOfAccessTokenSource[5] = TEST_USER;
    arrayOfAccessTokenSource[6] = CLIENT_TOKEN;
  }

  private AccessTokenSource(boolean paramBoolean)
  {
    this.canExtendToken = paramBoolean;
  }

  final boolean canExtendToken()
  {
    return this.canExtendToken;
  }
}

/* Location:           /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar
 * Qualified Name:     com.facebook.AccessTokenSource
 * JD-Core Version:    0.6.2
 */


text:
HTTP_URL=http://localhost:8080
HTTPS_URL=https://localhost:8443

# defaults
USER="admin"
PASS="admin123"
login() {
   echo `curl -k ${HTTPS_URL}/login -X POST \
        -H 'Content-Type:application/json' \
        -d '{"username": "'"${USER}"'", "password":"'"${PASS}"'"}'`
}

#Load library func, it was loaded by packer to /tmp/ in previous steps
source /tmp/get_nic_name_by_index.sh

# Include the on-* services in case we're installing from .deb packages
SERVICES="isc-dhcp-server rabbitmq-server mongodb postgresql \
    on-http on-taskgraph on-dhcp-proxy on-syslog on-tftp"
RACKHD_SERVICES="on-http on-taskgraph on-dhcp-proxy on-syslog on-tftp"

cleanServicesPIDs() {
    for srv in ${RACKHD_SERVICES}; do
        sudo rm /var/run/${srv}.pid -f
    done
    echo "PIDs cleaned"
}

startServices() {

  secondary_nic=$(get_secondary_nic_name)
  # Config the Secondary NIC IP to align with the default /opt/monorail/config.json IP setting
  sudo ifconfig $secondary_nic 172.31.128.1 netmask 255.255.255.0

  for srv in ${SERVICES}; do
    sudo service ${srv} start
  done
  # if installed from src code, assuming the code are in ~/src directory.then use PM2 to start RackHD
  if [ -d ~/src ]; then
    cd ~
    pids=`pidof node`
    if [ `expr length "$pids"` -eq "0" ]; then
       echo "starting rackhd ./src services..."
       sudo pm2 start rackhd-pm2-config.yml
    fi
  fi
}

stopServices() {
    cd ~
    for srv in ${SERVICES}; do
        sudo service ${srv} stop
    done
    echo "services terminated"
}

waitForServices() {
  local attempt=0
  local maxto=20
  local url=${HTTP_URL}/swagger-ui
  echo "waiting for rackhd services.. "
  while [ ${attempt} != ${maxto} ]; do
    echo -ne "waited `expr $attempt \* 10` seconds\r"
    sleep 10
    wget -nv --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 1 --continue ${url}
    if [ $? = 0 ]; then
      echo "rackhd services are ready"
      break
    fi
    attempt=`expr ${attempt} + 1`
  done

  if [ ${attempt} == ${maxto} ]; then
    echo "timed out waiting for rackhd services (duration=`expr $maxto \* 10`sec)."
    exit 1
  fi
  rm -f nodes > /dev/null
}

createFirstUser() {
    local status=`curl -k -X POST -w '%{http_code}' \
        -H 'Content-Type: application/json' \
        -d '{"username": "'"${USER}"'", "password": "'"${PASS}"'", "role": "Administrator"}' \
        ${HTTPS_URL}/api/2.0/users`
    if [[ "${status}" == *"201"* ]]; then
      echo "user created"
    else
      echo "error creating user: ${status}"
      exit 1
   fi
}

checkFirstUser() {
   local status=$(login)
   if [[ "${status}" == *"Unauthorized"* ]]; then
       createFirstUser
       status=$(login)
   fi
   echo "${status}"
}

stopServices
cleanServicesPIDs
startServices
if [ $? -eq "0" ]; then
  waitForServices
fi
if [ $? -eq "0" ]; then
  checkFirstUser
fi
stopServices


text:
using System.Collections.Generic;

namespace OverflowStack.GenericData.SharedDomains.Models
{
    public class DataList
    {
        public List<string> Columns { get; set; }
        public List<DataRecord> Records { get; set; }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beitr. Kryptfl. Schweiz 5(4): 209 (1923)

#### Original name
Peronospora tetragonolobi Gäum.

### Remarks
null


text:
<?php

class Google_Service_Dns_ResourceRecordSetsListResponse extends Google_Collection
{
  protected $collection_key = 'rrsets';
  protected $headerType = 'Google_Service_Dns_ResponseHeader';
  protected $headerDataType = '';
  public $kind;
  public $nextPageToken;
  protected $rrsetsType = 'Google_Service_Dns_ResourceRecordSet';
  protected $rrsetsDataType = 'array';

  /**
   * @param Google_Service_Dns_ResponseHeader
   */
  public function setHeader(Google_Service_Dns_ResponseHeader $header)
  {
    $this->header = $header;
  }
  /**
   * @return Google_Service_Dns_ResponseHeader
   */
  public function getHeader()
  {
    return $this->header;
  }
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  public function getKind()
  {
    return $this->kind;
  }
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
  /**
   * @param Google_Service_Dns_ResourceRecordSet[]
   */
  public function setRrsets($rrsets)
  {
    $this->rrsets = $rrsets;
  }
  /**
   * @return Google_Service_Dns_ResourceRecordSet[]
   */
  public function getRrsets()
  {
    return $this->rrsets;
  }
}


text:
(function (env){
    "use strict";
    env.ddg_spice_transit_njt = function(api_result) {
        if (!api_result || api_result.failed){
            return Spice.failed('transit_njt');
        }

        var now = timeInMins(api_result.now);

        Spice.add({
            id: 'transit_njt',
            name: 'NJ Transit',
            signal: 'high',
            data: api_result.routes,
            meta: {
                primaryText: api_result.origin + " to " + api_result.destination,
                sourceUrl: api_result.url,
                sourceName: "NJ Transit"
            },
            templates: {
                group: 'base',
                detail: false,
                item_detail: false,
                options: {
                    content: Spice.transit_njt.train_item
                }
            },
            normalize: function(item) {
                var classes = {
                        "Cancelled": "transit_njt__cancelled",
                        "Delayed": "transit_njt__delayed",
                        "All Aboard": "transit_njt__boarding",
                        "Boarding": "transit_njt__boarding",
                        "Stand By": "transit_njt__boarding",
                        "On Time": "transit_njt__boarding"
                    };

                if (!item.status) item.status = "On Time";
                return {
                    departure_time: format_time(actualDepartureTime(item, now)),
                    arrival_time: format_time(actualArrivalTime(item, now)),
                    status: actualStatus(item, now),
                    line: item.line.replace('Line', ''),
                    cancelled: item.status === "Cancelled",
                    status_class: delayedMins(item, now) > 0 ? "transit_njt__delayed" : classes[item.status],
                    bold_status_text: item.status === "Boarding" || item.status === "All Aboard",
                    url: 'http://dv.njtransit.com/mobile/train_stops.aspx?train=' + item.train
                };
            },
            sort_fields: {
                time: function(a, b) {
                    var c = actualDepartureTime(a, now),
                        d = actualDepartureTime(b, now),
                        boarding_statuses = ['All Aboard', 'Boarding', 'Stand By'];
                    c = (c + 5 < now) ? c + 24*60 : c; //push times from the next day to the end of the list
                    d = (d + 5 < now) ? d + 24*60 : d;
                    //when a delayed train gets to the station, the scheduled time is displayed,
                    //so normally it would go at the end of the list (because it looks like it is from the next day).
                    //of course, we want boarding trains to go to the front.
                    if (boarding_statuses.indexOf(a.status) > -1){
                        return -1;
                    } else if (boarding_statuses.indexOf(b.status) > -1){
                        return 1;
                    }
                    return c - d;
                }
            },
            sort_default: 'time',
            onShow: function(){
                $('.transit_njt__cancelled').parents('.tile__body').addClass('transit_njt__cancelled-tile');
            }
        });
    };

    var delayed_regex = new RegExp(/In (\d+) Min/);

    function padZeros(n, len) {
        var s = n.toString();
        while (s.length < len) {
            s = '0' + s;
        }
        return s;
    }

    //takes a time in minutes (integer) and converts it to human-readable (string like 2:05 PM)
    function format_time(t) {
        var hour = Math.floor(t / 60),
            minute = t % 60,
            ampm = (hour >= 24) ? 'AM' : (hour >= 12) ? 'PM' : 'AM';
        if (hour > 24) {
            hour -= 24;
        } else if (hour > 12) {
            hour -= 12;
        }
        if (hour === 0){
            hour = 12;
        }
        return hour + ':' + padZeros(minute, 2) + ' ' + ampm;
    }

    //converts a time string (like 14:05 or 2:05 PM) to integer minutes
    function timeInMins(t) {
        var hour = parseInt(t.split(':')[0]),
            minute = parseInt(t.split(':')[1]),
            ampm = 0;
        if (t.indexOf('PM') > -1 && hour !== 12) {
            ampm = 60*12;
        } else if (t.indexOf('AM') > -1 && hour === 12) {
            ampm = -60*12;
        }
        return hour*60 + minute + ampm;
    }

    //find how many minutes the train is delayed
    function delayedMins(item, now) {
        var match = delayed_regex.exec(item.status);
        if (match && match.length > 1){
            var mins = parseInt(match[1]);
            return (now + mins) - timeInMins(item.departure_time);
        }
        return 0;
    }

    //departure time adjusted for delay
    function actualDepartureTime(item, now) {
        return timeInMins(item.departure_time) + delayedMins(item, now);
    }

    //arrival time adjusted for delay
    function actualArrivalTime(item, now) {
        return timeInMins(item.arrival_time) + delayedMins(item, now);
    }

    //status adjusted for delay
    function actualStatus(item, now) {
        if (delayedMins(item, now) > 0) { //if it's delayed, tell the user the scheduled departure time
            return 'Delayed from ' + format_time(timeInMins(item.departure_time));
        }
        if (item.status === "Boarding") {
            return 'Now Boarding';
        }
        var match = delayed_regex.exec(item.status);
        if (match && match.length > 1) { //if we know when it departs, tell the user how many minutes
            return 'Departs in ' + match[1] + 'm';
        }
        return item.status;
    }
}(this));


text:
#pragma once

#include <Param.hpp>
#include <common/dispatch.hpp>
#include <common/kernel_cache.hpp>
#include <debug_opencl.hpp>
#include <kernel/names.hpp>
#include <kernel_headers/convolve.hpp>
#include <kernel_headers/ops.hpp>
#include <memory.hpp>
#include <traits.hpp>
#include <types.hpp>
#include <af/defines.h>

#include <string>
#include <vector>

namespace opencl {
namespace kernel {

constexpr int THREADS   = 256;
constexpr int THREADS_X = 16;
constexpr int THREADS_Y = 16;
constexpr int CUBE_X    = 8;
constexpr int CUBE_Y    = 8;
constexpr int CUBE_Z    = 4;

struct conv_kparam_t {
    cl::NDRange global;
    cl::NDRange local;
    size_t loc_size;
    int nBBS0;
    int nBBS1;
    bool outHasNoOffset;
    bool inHasNoOffset;
    bool launchMoreBlocks;
    int o[3];
    int s[3];
    cl::Buffer* impulse;
};

template<typename T>
void prepareKernelArgs(conv_kparam_t& param, dim_t* oDims, const dim_t* fDims,
                       const int rank) {
    using cl::NDRange;

    int batchDims[4] = {1, 1, 1, 1};
    for (int i = rank; i < 4; ++i) {
        batchDims[i] = (param.launchMoreBlocks ? 1 : oDims[i]);
    }

    if (rank == 1) {
        param.local    = NDRange(THREADS, 1);
        param.nBBS0    = divup(oDims[0], THREADS);
        param.nBBS1    = batchDims[2];
        param.global   = NDRange(param.nBBS0 * THREADS * batchDims[1],
                               param.nBBS1 * batchDims[3]);
        param.loc_size = (THREADS + 2 * (fDims[0] - 1)) * sizeof(T);
    } else if (rank == 2) {
        param.local  = NDRange(THREADS_X, THREADS_Y);
        param.nBBS0  = divup(oDims[0], THREADS_X);
        param.nBBS1  = divup(oDims[1], THREADS_Y);
        param.global = NDRange(param.nBBS0 * THREADS_X * batchDims[2],
                               param.nBBS1 * THREADS_Y * batchDims[3]);
    } else if (rank == 3) {
        param.local    = NDRange(CUBE_X, CUBE_Y, CUBE_Z);
        param.nBBS0    = divup(oDims[0], CUBE_X);
        param.nBBS1    = divup(oDims[1], CUBE_Y);
        int blk_z      = divup(oDims[2], CUBE_Z);
        param.global   = NDRange(param.nBBS0 * CUBE_X * batchDims[3],
                               param.nBBS1 * CUBE_Y, blk_z * CUBE_Z);
        param.loc_size = (CUBE_X + 2 * (fDims[0] - 1)) *
                         (CUBE_Y + 2 * (fDims[1] - 1)) *
                         (CUBE_Z + 2 * (fDims[2] - 1)) * sizeof(T);
    }
}

template<typename T, typename aT>
void convNHelper(const conv_kparam_t& param, Param& out, const Param& signal,
                 const Param& filter, const int rank, const bool expand) {
    using cl::EnqueueArgs;
    using cl::NDRange;
    using std::string;
    using std::vector;

    constexpr bool IsComplex =
        std::is_same<T, cfloat>::value || std::is_same<T, cdouble>::value;

    vector<TemplateArg> tmpltArgs = {
        TemplateTypename<T>(),
        TemplateTypename<aT>(),
        TemplateArg(rank),
        TemplateArg(expand),
    };
    vector<string> compileOpts = {
        DefineKeyValue(T, dtype_traits<T>::getName()),
        DefineKeyValue(Ti, dtype_traits<T>::getName()),
        DefineKeyValue(To, dtype_traits<aT>::getName()),
        DefineKeyValue(accType, dtype_traits<aT>::getName()),
        DefineKeyValue(RANK, rank),
        DefineKeyValue(EXPAND, (expand ? 1 : 0)),
        DefineKeyFromStr(binOpName<af_mul_t>()),
        DefineKeyValue(CPLX, (IsComplex ? 1 : 0)),
    };
    compileOpts.emplace_back(getTypeBuildDefinition<T>());

    auto convolve = common::getKernel("convolve", {ops_cl_src, convolve_cl_src},
                                      tmpltArgs, compileOpts);

    convolve(EnqueueArgs(getQueue(), param.global, param.local), *out.data,
             out.info, *signal.data, signal.info, cl::Local(param.loc_size),
             *param.impulse, filter.info, param.nBBS0, param.nBBS1, param.o[0],
             param.o[1], param.o[2], param.s[0], param.s[1], param.s[2]);
}

template<typename T, typename aT>
void conv1(conv_kparam_t& p, Param& out, const Param& sig, const Param& filt,
           const bool expand);

template<typename T, typename aT>
void conv2(conv_kparam_t& p, Param& out, const Param& sig, const Param& filt,
           const bool expand);

template<typename T, typename aT>
void conv3(conv_kparam_t& p, Param& out, const Param& sig, const Param& filt,
           const bool expand);
}  // namespace kernel
}  // namespace opencl


text:
package io.cloudslang.content.mail.constants;

public final class Constants {
    public static final String FILE = "file:";
    public static final String HTTP = "http";
    public static final int ONE_SECOND = 1000;
    public static final String SUBJECT_HEADER = "Subject";
    public static final String CONTENT_TYPE = "Content-Type";
    public static final String MAIL_WAS_SENT = "SentMailSuccessfully";
    public static final String IMAP = "imap";
    public static final String IMAP4 = "imap4";
    public static final String IMAP_PORT = "143";
    public static final String POP3 = "pop3";
    public static final String POP3_PORT = "110";
    public static final String MAIL_POP3 = "mail.pop3.";
    public static final String SMTP = "smtp";
}


text:
<?php

/*
 * This file is part of the "qBittorrent API Wrapper" package.
 *
 * https://github.com/Divi/qbittorrent-api-wrapper
 *
 * For the full license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Divi\qBittorrent\Api\Wrapper\Authentication\Response;

use Divi\qBittorrent\Api\Wrapper\Authentication\Response\Exception\BadCredentialsException;
use Divi\qBittorrent\Api\Wrapper\Authentication\Session\Session;
use Divi\qBittorrent\Api\Wrapper\Authentication\Session\SessionSubscriber;
use Guzzle\Service\Command\OperationCommand;
use Guzzle\Service\Command\ResponseClassInterface;

/**
 * @author Sylvain Lorinet <sylvain.lorinet@gmail.com>
 */
class LoginResponse implements ResponseClassInterface
{
    /**
     * @inheritdoc
     */
    public static function fromCommand(OperationCommand $command)
    {
        $response = $command->getResponse();

        if ($response->isSuccessful() && 'Fail.' === $response->getBody(true)) {
            throw new BadCredentialsException('Cannot login, bad credentials');
        }

        if (!$response->hasHeader('Set-Cookie')) {
            throw new \RuntimeException(
                'The cookie SID is not found'
            );
        }

        $params = $response->getHeader('Set-Cookie')->parseParams();

        if (!isset($params[0]) || !isset($params[0]['SID'])) {
            throw new \RuntimeException(
                'The cookie SID is malformed, see header details :' . $response->getRawHeaders()
            );
        }

        $session = new Session($params[0]['SID']);

        self::saveSession($command, $session);

        return $session;
    }

    /**
     * @param OperationCommand $command
     * @param Session          $session
     */
    protected static function saveSession(OperationCommand $command, Session $session)
    {
        $listeners = $command->getClient()->getEventDispatcher()->getListeners('request.before_send');

        foreach ($listeners as $listener) {
            if ($listener[0] instanceof SessionSubscriber) {
                $listener[0]->setSession($session);

                break;
            }
        }
    }
}


text:
class Reports::MyWorkController < Reports::BaseController

  load_and_authorize_resource :user

  def show
    if @year.nil?
      redirect_to action: :show, year: Time.current.year, month: Time.current.month
      return
    end

    if @month
      @range = UberZeit.month_as_range(@year, @month)
      @buckets = UberZeit.range_to_buckets(@range, 1.week, @range.min.beginning_of_week)
    else
      @range = UberZeit.year_as_range(@year)
      @buckets = UberZeit.range_to_buckets(@range, 1.month, @range.min)
    end

    render :table
  end

end


text:
/* nc_inst_iter_inl.c - Holds inline routines for commonly used (simple)
 * functions in nc_inst_iter.h. Used to speed up code. Inline routines
 * correspond to the following functions in nc_inst_iter.h, but with
 * an 'Inline' suffix:
 *
 *    NaClInstIterGetState
 *    NaClInstIterGetLookbackState
 *    NaClInstIterHasLookbackState
 *    NaClInstIterHasNext
 *    NaClInstIterAdvance
 *    NaClInstIterGetInstMemory
 */

#ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NC_INST_ITER_INL_h_
#define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NC_INST_ITER_INL_h_

#include <assert.h>

#include "native_client/src/trusted/validator/x86/decoder/nc_inst_iter.h"
#include "native_client/src/trusted/validator/x86/decoder/nc_inst_state.h"
#include "native_client/src/trusted/validator/x86/decoder/nc_inst_state_internal.h"
#include "native_client/src/trusted/validator/x86/nc_segment.h"

/* Default handler for errors while running instruction iterator.
 * Should only be called when caller has incorrectly called a
 * method.
 */
void NaClInstIterFatal(const char* error_message);

static INLINE NaClInstState* NaClInstIterGetUndecodedStateInline(
    NaClInstIter* iter) {
  return &iter->buffer[iter->buffer_index];
}

static INLINE NaClInstState* NaClInstIterGetStateInline(NaClInstIter* iter) {
  NaClInstState* state = NaClInstIterGetUndecodedStateInline(iter);
  if (NULL == state->inst) {
    NaClDecodeInst(iter, state);
  }
  return state;
}

static INLINE NaClInstState* NaClInstIterGetLookbackStateInline(
    NaClInstIter* iter, size_t distance) {
  NaClInstState* state;
  assert(distance < iter->buffer_size);
  assert(distance <= iter->inst_count);
  state = &iter->buffer[((iter->buffer_index + iter->buffer_size) - distance)
                        % iter->buffer_size];
  if (NULL == state->inst) {
    NaClDecodeInst(iter, state);
  }
  return state;
}

static INLINE Bool NaClInstIterHasLookbackStateInline(
    NaClInstIter* iter, size_t distance) {
  return distance < iter->buffer_size && distance <= iter->inst_count;
}

static INLINE Bool NaClInstIterHasNextInline(NaClInstIter* iter) {
  /*
  DEBUG(NaClLog(LOG_INFO, "iter has next index %"NACL_PRIxNaClMemorySize
                " < %"NACL_PRIxNaClMemorySize"\n",
                iter->index, iter->segment->size));
  */
  return iter->index < iter->segment->size;
}

static INLINE void NaClInstIterAdvanceInline(NaClInstIter* iter) {
  if (iter->index >= iter->segment->size) {
    NaClInstIterFatal("NaClInstIterAdvance with no next element.");
  }
  NaClInstIterGetStateInline(iter);
  iter->index += iter->memory.read_length;
  ++iter->inst_count;
  iter->buffer_index = (iter->buffer_index + 1) % iter->buffer_size;
  /*
  DEBUG(
      NaClLog(LOG_INFO,
              "iter advance: index %"NACL_PRIxNaClMemorySize", "
              "buffer index %"NACL_PRIuS"\n",
              iter->index, iter->buffer_index));
  */
  iter->buffer[iter->buffer_index].inst = NULL;
}

static INLINE uint8_t* NaClInstIterGetInstMemoryInline(NaClInstIter* iter) {
  if (iter->index >= iter->segment->size) {
    NaClInstIterFatal("NaClInstIterGetInstMemory with no next element.");
  }
  return iter->segment->mbase + iter->index;
}

#endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NC_INST_ITER_INL_h_ */


text:
#ifndef CONSTANTS_H
#define	CONSTANTS_H

#define TRUE 1
#define FALSE 0
#define DEBUG_OUTPUT TRUE
#define DEBUG_FLATTEN FALSE
#define DEBUG_BALANCE FALSE
#define DEBUG_INUEVAR FALSE

typedef int bool;

#endif	/* CONSTANTS_H */


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

<title>ConfigurationWrapper</title>
<meta name="date" content="2017-11-07">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.manaldush.telnet.protocol

Class ConfigurationWrapper

java.lang.Object

com.manaldush.telnet.protocol.ConfigurationWrapper

All Implemented Interfaces:

java.lang.Cloneable

public final class ConfigurationWrapper
extends java.lang.Object
implements java.lang.Cloneable

Created by Maxim.Melnikov on 29.06.2017.

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

static ConfigurationWrapper
build(Configuration _conf,
     IServerSocketChannelFactory _ssChannelFactory)

Config file wrapper build method.

java.lang.Object
clone()

Configuration
getConf()

Get configuration.

IServerSocketChannelFactory
getSsChannelFactory()

Get server socket factory object.

Methods inherited from class java.lang.Object

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

Method Detail

build

public static ConfigurationWrapper build(Configuration _conf,
                                         IServerSocketChannelFactory _ssChannelFactory)

Config file wrapper build method.

Parameters:

_conf - - configuration

_ssChannelFactory - - socket factory

Returns:

wrapper

Throws:

java.lang.NullPointerException - - configuration is null

getConf

public Configuration getConf()

Get configuration.

Returns:

configuration object

getSsChannelFactory

public IServerSocketChannelFactory getSsChannelFactory()

Get server socket factory object.

Returns:

factory

clone

public java.lang.Object clone()

Overrides:

clone in class java.lang.Object

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
layout: page
title: "MATH 3135: Introduction to Linear Algebra for Mathematics Majors Statistics"
comments: true
description: "blanks"
keywords: "MATH,3135,CU,Boulder"
---

#### GRADE AND WORKLOAD STATISTICS

**Percent withdrawn**: 14.24%

**Percent incomplete**: 2.38%

**Average grade** (4.0 scale): 3.21

**Standard deviation in grades** (4.0 scale): 0.14

**Average workload** (raw): 2.6

**Standard deviation in workload** (raw): 0.21

#### COURSE AND INSTRUCTOR RATINGS/INFORMATION

**Average course rating** (6 point scale): 4.75

**Standard deviation in course rating** (6 point scale): 0.29

**Average instructor rating** (6 point scale): 4.74

**Standard deviation in instructor rating** (6 point scale): 0.46

**Instructors**: Alexander Gorokhovsky, Richard Mutegeki Green, Jonathan Wise

#### GENERAL CLASS INFORMATION

**Years provided**: Fall 2015, Fall 2016, Spring 2017

**Credits**: 3

**RAP/Honors class?** Neither

**Number of Sections**: 3

**Department**: MATH

**College**: College of Arts and Sciences

**A&S Division**: Natural Sciences

**Level**: Upper

**Activity**: LEC - Lecture


text:
"""
Copyright 2015 Ericsson AB

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.

"""
import sys
sys.path.append('../OpenStreetMap')
from routeGenerator import coordinates_to_nearest_stops, get_route
from dbConnection import DB
from datetime import datetime
import datetime
from datetime import timedelta
from datetime import date

class Fitness():

    # Main [class] variables
    diffMinutes = 0
    formatString = '%d-%m-%Y %H:%M'
    formatTime = '%H:%M'
    secondMinute = 60.0
    firstMinute = "00:00"
    lastMinute = "23:59"
    requests = []
    routes = []
    request = []
    requestIndex = []
    requestOut = []
    requestIndexOut = []
    totalRequestsBusline = {}
    # yesterday = date.today() - timedelta(13)

    yesterdayDate = datetime.datetime.now() - timedelta(1)
    yesterday = datetime.datetime(yesterdayDate.year, yesterdayDate.month, yesterdayDate.day)

# A decorator is a function that can accept another function as
# a parameter to be able to modify or extend it
    def __init__(self):
        self.runOnce()

    def decorator(afunction):
        # A wrapper function is used to wrap functionalites you want around the original function
        def wrapper(*args):
            # Checks whether or not the original function as been executed once
            if not wrapper.has_run:
                wrapper.has_run = True
                return afunction(*args)
            else:
                pass
        wrapper.has_run = False
        return wrapper

    @decorator
    def runOnce(self):
        db = DB()
        # Setting the start time boundary of request that we want
        startTime = datetime.datetime.combine(Fitness.yesterday, datetime.datetime.strptime(Fitness.firstMinute, Fitness.formatTime).time())
        endTime = datetime.datetime.combine(Fitness.yesterday, datetime.datetime.strptime(Fitness.lastMinute, Fitness.formatTime).time())
        # Create index for the people going on the bus
        Fitness.request = db.grpReqByBusstopAndTime(startTime, endTime)
        self.createRequestIndex(Fitness.request)
        # Create index for the people going down the bus
        Fitness.requestOut = db.getReqCountByEndBusStop(startTime, endTime)
        self.createRequestIndexOut(Fitness.requestOut)
        '''
        # Functions for new encoding including multiple line
        busLines = set(db.busLine)
        for line in busLines:
            for x in db.timeSliceArray:
                start = datetime.datetime.combine(Fitness.yesterday,datetime.time(x[0], 0, 0))
                end = datetime.datetime.combine(Fitness.yesterday, datetime.time(x[1], 59, 59))
                requestBetweenTimeSlices = db.getTravelRequestBetween(start, end, line)
                for count in enumerate(requestBetweenTimeSlices, start=1):
                    countingNoOfRequest = (count[0])
                finalNoReqBetweenTimeSlice = countingNoOfRequest
                Fitness.totalRequestsBusline[(line, start, end)] = finalNoReqBetweenTimeSlice
        print Fitness.totalRequestsBusline
        '''

    def search(self, initialTime, NextTime, BusStop, Line):
        res = []
        counting = 0
        for match in Fitness.request:
            if initialTime <= match["_id"]["RequestTime"] <= NextTime and match["_id"]["line"]==Line and match["_id"]["BusStop"] == BusStop:
                counting+=1
                res.append(match)
                if match["total"] > 1:
                    counting += match["total"]-1
        return res, counting

    def search(self, initialTime, NextTime, BusStop, Line):
        ''' what does it do?
        '''
        res = []
        for match in Fitness.request:
            if (initialTime <= match["_id"]["RequestTime"] <= NextTime) and (match["_id"]["line"] == Line and
                match["_id"]["BusStop"] == BusStop):
                    res.append(match)
        return res

    def timeDiff(self, time1, time2):
        ''' Evaluates the difference between two times.

        Args: time1 and time2 in datetime format, time1 > time2
        Returns: the timedelta between time1 and time2.
        '''
        return datetime.strptime(time1, Fitness.formatTime) - datetime.strptime(time2, Fitness.formatTime)

    def getMinutes(self, td):
        return (td.seconds//Fitness.secondMinute) % Fitness.secondMinute

    def getMinutesFromTimedelta(td):
        return (td.seconds//60) % 60

    def createRequestIndex(self, request):
        ''' Creates a structure that stores the hour, the minute and the position on the request array for this particular time

        @param: request (array): Structure that stores the requests grouped by bus stop, hour and minute. It also includes a COUNT column
        '''
        # requestTime = 0
        Fitness.requestIndex.append([request[0]["_id"]["RequestTime"], 0])
        requestTime = request[0]["_id"]["RequestTime"]
        for i in range(1, len(request)):
            if request[i]["_id"]["RequestTime"] != requestTime:
                # Fitness.requestIndex.append([request[i]["_id"]["RequestTime"].day, request[i]["_id"]["RequestTime"].hour, request[i]["_id"]["RequestTime"].minute, i])
                Fitness.requestIndex.append([request[i]["_id"]["RequestTime"], i])
                requestTime = request[i]["_id"]["RequestTime"]

    def searchRequest(self, initialTime, finalTime, busStop, line):
        ''' Search on the request array based on an inital time, a final time and a particular bus stop

        @param: initialTime (datetime): Initial time to perform the request's search
        @param: finalTime (datetime): Final time to perform the request's search
        @param: busStop (string): Bus stop name used on the request's search
        '''
        result = []
        index = self.searchRequestIndex(Fitness.requestIndex, initialTime, finalTime)
        if index != False:
            request = Fitness.request[index[0]:index[1]]
            for i in range(len(request)):
                if request[i]["_id"]["BusStop"] == busStop and request[i]["_id"]["line"] == line:
                    result.append(request[i])
        return result

    def searchRequestIndex(self, index, initialDate, finalDate):
        ''' Search the index to get the position on the request array for a specific time frame

        @param: index (array): Structure that stores hour, minute and the request's array position for this time
        @param: initialHour (int): Initial hour to perform the search over the index
        @param: initialMinute (int): Final minute to perform the search over the index
        @param: finalHour (int): Final hour to perform the search over the index
        @param: finalMinute (int): Final minute to perform the search over the index
        '''
        result = []
        position = 0
        test = True
        # Look for the first index on the search
        for i in range(len(index)):
            if index[i][0] >= initialDate and index[i][0] < finalDate:
                result.append(index[i][1])
                indexDate = index[i][0]
                position = i
                break
            if index[i][0] >= finalDate:
                break
        if len(result) == 0:
            test = False
        # Evaluate if the first index was found
        if test:
            # If found, look for the second index, however the index has to go backwards
            for j in reversed(range(position, len(index))):
                if index[j][0] > indexDate and index[j][0] <= finalDate:
                    result.append(index[j][1])
                    break
                if index[j][0] <= indexDate:
                    break
            if len(result) == 1:
                test = False
        # Check if both values were generated, if not return an array with false values
        if test:
            return result

        else:
            return False

    def createRequestIndexOut(self, request):
        ''' Creates a structure that stores the hour, the minute and the position on the request array for this particular time

        @param: request (array): Structure that stores the requests grouped by bus stop, hour and minute. It also includes a COUNT column
        '''
        Fitness.requestIndexOut.append([request[0]["_id"]["endTime"], 0])
        requestTime = request[0]["_id"]["endTime"]
        for i in range(1, len(request)):
            if request[i]["_id"]["endTime"] != requestTime:
                Fitness.requestIndexOut.append([request[i]["_id"]["endTime"], i])
                requestTime = request[i]["_id"]["endTime"]

    def searchRequestOut(self, initialTime, finalTime, busStop, line):
        ''' Search on the request array based on an inital time, a final time and a particular bus stop

        @param: initialTime (datetime): Initial time to perform the request's search
        @param: finalTime (datetime): Final time to perform the request's search
        @param: busStop (string): Bus stop name used on the request's search
        '''
        result = []
        index = self.searchRequestIndex(Fitness.requestIndexOut, initialTime, finalTime)
        if index != False:
            request = Fitness.requestOut[index[0]:index[1]]
            for i in range(len(request)):
                if request[i]["_id"]["busStop"] == busStop and request[i]["_id"]["line"] == line:
                    result.append(request[i])
        return result

    def calculateCost(self, individual, totalWaitingTime, penaltyOverCapacity):
        ''' Calculate cost for an individual in the population.

        @param  individual: individual in the population;
                totalWaitingTime: total waiting time for that individual
                penaltyOverCapacity: a positive integer to represent a large cost to individual if capacity cannot handle all request of that trip
        @return cost: positive integer for this individual, if input param is out of range, cost will be -1

        Less cost, better individual
        Assume one minute's waiting per person equals to 1kr
        '''
        cost = 0
        costOfBus = [[20, 1000], [60, 1200], [120, 1400]]
        waitingCostPerMin = 1
        busCost = 0
        if penaltyOverCapacity < 0 or individual is None or totalWaitingTime < 0:
            cost = -1
        else:
            for i in range(len(individual)):
                busCapacity = individual[i][1]
                for j in range(len(costOfBus)):
                    if busCapacity == costOfBus[j][0]:
                        busCost = busCost + costOfBus[j][1]
                        break
            waitingCost = totalWaitingTime * waitingCostPerMin
            cost = busCost + waitingCost + penaltyOverCapacity
        # return cost
        return waitingCost

    def generateStartTimeBasedOnFreq(self, busLine, capacity, frequency, startTime):
        """ Generate all the trips within a time slice given a single starting time

        Args:
             busLine: an integer representing the bus line ID
             frequency: the headway in minutes between successive buses
             startTime: a datetime object representing the start time within the time slice

        Return:
             an array containing all the starting times for the bus trips within the corresponding time slice.
        """
        # we make sure the starting time is in between the upper and lower bound of our time slices
        startTimeArray = []
        lineTimes = {}
        for x in DB.timeSliceArray:
            start = datetime.datetime.combine(Fitness.yesterday, datetime.time(x[0], 0, 0))
            end = datetime.datetime.combine(Fitness.yesterday, datetime.time(x[1], 59, 59))
            if start <= startTime <= end:
                nextStartTime = startTime + datetime.timedelta(minutes=frequency)
                nextStartTime2 = startTime - datetime.timedelta(minutes=frequency)
                startTimeArray.append([startTime, capacity])
                if nextStartTime <= end:
                    startTimeArray.append([nextStartTime, capacity])
                if nextStartTime2 >= start:
                    startTimeArray.append([nextStartTime2, capacity])
                while nextStartTime <= end:
                    nextStartTime = nextStartTime + datetime.timedelta(minutes=frequency)
                    if nextStartTime <= end:
                        startTimeArray.append([nextStartTime, capacity])
                while nextStartTime2 >= start:
                    nextStartTime2 = nextStartTime2 - datetime.timedelta(minutes=frequency)
                    if nextStartTime2 >= start:
                        startTimeArray.append([nextStartTime2, capacity])
        return sorted(startTimeArray)

    def genTimetable(self, individual):
        """ Generate a timetable for the whole day, for all the bus lines."""

        timetable = {}
        counter = 0
        busLines = set([x[0] for x in individual])
        for line in busLines:
            ind = [y for y in individual if y[0] == line]
            for i, val in enumerate(ind):
                counter+=1
                generate = self.generateStartTimeBasedOnFreq(line, val[1], val[2], val[3])

                if line not in timetable:
                    timetable[line] = generate
                else:
                    timetable[line] = timetable[line] + generate

        timetable = sorted(timetable.items(), key = lambda e: e[0])
        ttLines = []
        for i, item in enumerate(timetable):
            for trip in item[1]:
                ttLines.append([item[0], trip[1], trip[0]])
                    #print trip
        #print sorted(timetable.items(), key = lambda e: e[0])

        return ttLines

    def getTimeSlice(self, startTime):
        ''' Evaluates the time slice a given starting time in a gene belongs to.
        @ param startTime datetime
        @ return (start, end) datetime.datetime objects
        '''
        startTimeArray = []
        for x in DB.timeSliceArray:
            start = datetime.datetime.combine(Fitness.yesterday, datetime.time(x[0], 0, 0))
            end = datetime.datetime.combine(Fitness.yesterday, datetime.time(x[1], 59, 59))
            if start <= startTime <= end:
                return start


text: from .rarity import RarityStrategy


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MonkeyOthello.Core;

namespace MonkeyOthello.Engines
{
    public class EndGameEvaluation : IEvaluation
    {
        public int Eval(BitBoard board)
        {
            return board.EndDiffCount();
        }
    }
}


text:
Aikidesk Instance PHP SDK
============================

Supported HTTP Clients: Guzzle 6.x

Frameworks: Vanilla PHP

___

## Installation

Begin by installing this package through Composer.

```js
{
    "require": {
        "aikidesk/instance-php-sdk": "dev-master"
    }
}
```

You should have at least one HTTP Client installed. Supported out of box is Guzzle v6.

### Documentation

n/a

## License

[View the license](https://github.com/Aikidesk/instance-php-sdk/blob/master/LICENSE) for this repo.


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/privacy/dlp/v2/dlp.proto

package com.google.privacy.dlp.v2;

public interface ActionOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.Action)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Save resulting findings in a provided location.
   *

   *
   * .google.privacy.dlp.v2.Action.SaveFindings save_findings = 1;
   *
   * @return Whether the saveFindings field is set.
   */
  boolean hasSaveFindings();
  /**
   *
   *
   *

   * Save resulting findings in a provided location.
   *

   *
   * .google.privacy.dlp.v2.Action.SaveFindings save_findings = 1;
   *
   * @return The saveFindings.
   */
  com.google.privacy.dlp.v2.Action.SaveFindings getSaveFindings();
  /**
   *
   *
   *

   * Save resulting findings in a provided location.
   *

   *
   * .google.privacy.dlp.v2.Action.SaveFindings save_findings = 1;
   */
  com.google.privacy.dlp.v2.Action.SaveFindingsOrBuilder getSaveFindingsOrBuilder();

  /**
   *
   *
   *

   * Publish a notification to a Pub/Sub topic.
   *

   *
   * .google.privacy.dlp.v2.Action.PublishToPubSub pub_sub = 2;
   *
   * @return Whether the pubSub field is set.
   */
  boolean hasPubSub();
  /**
   *
   *
   *

   * Publish a notification to a Pub/Sub topic.
   *

   *
   * .google.privacy.dlp.v2.Action.PublishToPubSub pub_sub = 2;
   *
   * @return The pubSub.
   */
  com.google.privacy.dlp.v2.Action.PublishToPubSub getPubSub();
  /**
   *
   *
   *

   * Publish a notification to a Pub/Sub topic.
   *

   *
   * .google.privacy.dlp.v2.Action.PublishToPubSub pub_sub = 2;
   */
  com.google.privacy.dlp.v2.Action.PublishToPubSubOrBuilder getPubSubOrBuilder();

  /**
   *
   *
   *

   * Publish summary to Cloud Security Command Center (Alpha).
   *

   *
   * .google.privacy.dlp.v2.Action.PublishSummaryToCscc publish_summary_to_cscc = 3;
   *
   * @return Whether the publishSummaryToCscc field is set.
   */
  boolean hasPublishSummaryToCscc();
  /**
   *
   *
   *

   * Publish summary to Cloud Security Command Center (Alpha).
   *

   *
   * .google.privacy.dlp.v2.Action.PublishSummaryToCscc publish_summary_to_cscc = 3;
   *
   * @return The publishSummaryToCscc.
   */
  com.google.privacy.dlp.v2.Action.PublishSummaryToCscc getPublishSummaryToCscc();
  /**
   *
   *
   *

   * Publish summary to Cloud Security Command Center (Alpha).
   *

   *
   * .google.privacy.dlp.v2.Action.PublishSummaryToCscc publish_summary_to_cscc = 3;
   */
  com.google.privacy.dlp.v2.Action.PublishSummaryToCsccOrBuilder getPublishSummaryToCsccOrBuilder();

  /**
   *
   *
   *

   * Publish findings to Cloud Datahub.
   *

   *
   *
   * .google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5;
   *
   *
   * @return Whether the publishFindingsToCloudDataCatalog field is set.
   */
  boolean hasPublishFindingsToCloudDataCatalog();
  /**
   *
   *
   *

   * Publish findings to Cloud Datahub.
   *

   *
   *
   * .google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5;
   *
   *
   * @return The publishFindingsToCloudDataCatalog.
   */
  com.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog
      getPublishFindingsToCloudDataCatalog();
  /**
   *
   *
   *

   * Publish findings to Cloud Datahub.
   *

   *
   *
   * .google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5;
   *
   */
  com.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalogOrBuilder
      getPublishFindingsToCloudDataCatalogOrBuilder();

  /**
   *
   *
   *

   * Create a de-identified copy of the input data.
   *

   *
   * .google.privacy.dlp.v2.Action.Deidentify deidentify = 7;
   *
   * @return Whether the deidentify field is set.
   */
  boolean hasDeidentify();
  /**
   *
   *
   *

   * Create a de-identified copy of the input data.
   *

   *
   * .google.privacy.dlp.v2.Action.Deidentify deidentify = 7;
   *
   * @return The deidentify.
   */
  com.google.privacy.dlp.v2.Action.Deidentify getDeidentify();
  /**
   *
   *
   *

   * Create a de-identified copy of the input data.
   *

   *
   * .google.privacy.dlp.v2.Action.Deidentify deidentify = 7;
   */
  com.google.privacy.dlp.v2.Action.DeidentifyOrBuilder getDeidentifyOrBuilder();

  /**
   *
   *
   *

   * Sends an email when the job completes. The email goes to IAM project
   * owners and technical [Essential
   * Contacts](https://cloud.google.com/resource-manager/docs/managing-notification-contacts).
   *

   *
   * .google.privacy.dlp.v2.Action.JobNotificationEmails job_notification_emails = 8;
   *
   * @return Whether the jobNotificationEmails field is set.
   */
  boolean hasJobNotificationEmails();
  /**
   *
   *
   *

   * Sends an email when the job completes. The email goes to IAM project
   * owners and technical [Essential
   * Contacts](https://cloud.google.com/resource-manager/docs/managing-notification-contacts).
   *

   *
   * .google.privacy.dlp.v2.Action.JobNotificationEmails job_notification_emails = 8;
   *
   * @return The jobNotificationEmails.
   */
  com.google.privacy.dlp.v2.Action.JobNotificationEmails getJobNotificationEmails();
  /**
   *
   *
   *

   * Sends an email when the job completes. The email goes to IAM project
   * owners and technical [Essential
   * Contacts](https://cloud.google.com/resource-manager/docs/managing-notification-contacts).
   *

   *
   * .google.privacy.dlp.v2.Action.JobNotificationEmails job_notification_emails = 8;
   */
  com.google.privacy.dlp.v2.Action.JobNotificationEmailsOrBuilder
      getJobNotificationEmailsOrBuilder();

  /**
   *
   *
   *

   * Enable Stackdriver metric dlp.googleapis.com/finding_count.
   *

   *
   * .google.privacy.dlp.v2.Action.PublishToStackdriver publish_to_stackdriver = 9;
   *
   * @return Whether the publishToStackdriver field is set.
   */
  boolean hasPublishToStackdriver();
  /**
   *
   *
   *

   * Enable Stackdriver metric dlp.googleapis.com/finding_count.
   *

   *
   * .google.privacy.dlp.v2.Action.PublishToStackdriver publish_to_stackdriver = 9;
   *
   * @return The publishToStackdriver.
   */
  com.google.privacy.dlp.v2.Action.PublishToStackdriver getPublishToStackdriver();
  /**
   *
   *
   *

   * Enable Stackdriver metric dlp.googleapis.com/finding_count.
   *

   *
   * .google.privacy.dlp.v2.Action.PublishToStackdriver publish_to_stackdriver = 9;
   */
  com.google.privacy.dlp.v2.Action.PublishToStackdriverOrBuilder getPublishToStackdriverOrBuilder();

  public com.google.privacy.dlp.v2.Action.ActionCase getActionCase();
}


text:
CREATE TABLE alf_tenant (
  tenant_domain VARCHAR(75) NOT NULL,
  version INT8 NOT NULL,
  enabled BOOL NOT NULL,
  tenant_name VARCHAR(75),
  content_root VARCHAR(255),
  db_url VARCHAR(255),
  PRIMARY KEY (tenant_domain)
);

--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.0-TenantTables';
INSERT INTO alf_applied_patch
  (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
  VALUES
  (
    'patch.db-V4.0-TenantTables', 'Manually executed script upgrade V4.0: Tenant Tables',
    0, 6004, -1, 6005, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
  );


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

  <parent>
    <groupId>org.ah.java.remotevmlauncher</groupId>
    <artifactId>remotevmlauncher</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>

  <artifactId>remotevmlauncher-common</artifactId>

  <packaging>jar</packaging>

  <name>Remote VM Lanucher - Common</name>

  <description>
  </description>

  <dependencies>

    <!-- Test deps -->

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
    </dependency>
  </dependencies>
</project>


text:
package org.jboss.weld.tests.event.async.stage;

import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.event.ObservesAsync;

@Dependent
public class ObservingBean {

    public static void observe(@ObservesAsync Payload payload) throws InterruptedException {
        payload.setThreadName(Thread.currentThread().getName());
    }
}


text:
package rt;

public class Man1 extends Man {

	@Override
	public void doString(String dd) throws Exception{
		System.out.println("java invoke:	Man.doString():" + Name);
	}
}


text:
define(['dojo/_base/declare', 'jimu/BaseWidget'],
  function(declare, BaseWidget) {
    //To create a widget, you need to derive from BaseWidget.
    return declare([BaseWidget], {

      // Custom widget code goes here
      baseClass: 'jimu-widget-demo',

      postCreate: function() {
        console.log('postCreate');
      },

      startup: function() {
       console.log('startup');
      },

      onOpen: function(){
        console.log('onOpen');
      },

      onClose: function(){
        console.log('onClose');
      },

      onMinimize: function(){
        console.log('onMinimize');
      },

      onMaximize: function(){
        console.log('onMaximize');
      },

      onSignIn: function(credential){
        /* jshint unused:false*/
        console.log('onSignIn');
      },

      onSignOut: function(){
        console.log('onSignOut');
      },

      onPositionChange: function(){
        console.log('onPositionChange');
      },

      resize: function(){
        console.log('resize');
      }

      //methods to communication between widgets:

    });
  });


text:
laser-control
=============

Diode laser control circuits and code


text:
package ebsvolume

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/mitchellh/multistep"
	"github.com/mitchellh/packer/packer"
)

type stepTagEBSVolumes struct {
	VolumeMapping []BlockDevice
	VolumeIDs     **[]string
}

func (s *stepTagEBSVolumes) Run(state multistep.StateBag) multistep.StepAction {
	ec2conn := state.Get("ec2").(*ec2.EC2)
	instance := state.Get("instance").(*ec2.Instance)
	ui := state.Get("ui").(packer.Ui)

	volumeIds := make([]string, 0, len(s.VolumeMapping))
	for _, instanceBlockDevices := range instance.BlockDeviceMappings {
		for _, configVolumeMapping := range s.VolumeMapping {
			if configVolumeMapping.DeviceName == *instanceBlockDevices.DeviceName {
				volumeIds = append(volumeIds, *instanceBlockDevices.Ebs.VolumeId)
			}
		}
	}
	*s.VolumeIDs = &volumeIds

	if len(s.VolumeMapping) > 0 {
		ui.Say("Tagging EBS volumes...")

		toTag := map[string][]*ec2.Tag{}
		for _, mapping := range s.VolumeMapping {
			if len(mapping.Tags) == 0 {
				ui.Say(fmt.Sprintf("No tags specified for volume on %s...", mapping.DeviceName))
				continue
			}

			tags := make([]*ec2.Tag, 0, len(mapping.Tags))
			for key, value := range mapping.Tags {
				tags = append(tags, &ec2.Tag{
					Key:   aws.String(fmt.Sprintf("%s", key)),
					Value: aws.String(fmt.Sprintf("%s", value)),
				})
			}

			for _, v := range instance.BlockDeviceMappings {
				if *v.DeviceName == mapping.DeviceName {
					toTag[*v.Ebs.VolumeId] = tags
				}
			}
		}

		for volumeId, tags := range toTag {
			_, err := ec2conn.CreateTags(&ec2.CreateTagsInput{
				Resources: []*string{&volumeId},
				Tags:      tags,
			})
			if err != nil {
				err := fmt.Errorf("Error tagging EBS Volume %s on %s: %s", volumeId, *instance.InstanceId, err)
				state.Put("error", err)
				ui.Error(err.Error())
				return multistep.ActionHalt
			}

		}
	}

	return multistep.ActionContinue
}

func (s *stepTagEBSVolumes) Cleanup(state multistep.StateBag) {
	// No cleanup...
}


text:
package com.adobe

// Scala.
import scala.collection.mutable.ArrayBuffer

// Akka and Spray
import akka.actor.{ActorSystem, Props}
import akka.io.IO
import spray.can.Http

object QueryApp {
	def main(args: Array[String]) {
    implicit val system = ActorSystem.create("query")
    val handler = system.actorOf(
      Props(classOf[QueryServiceActor]),
      name = "handler"
    )

    IO(Http) ! Http.Bind(handler, interface="0.0.0.0", port=8585)
  }
}


text:
<#
.SYNOPSIS
WPF4PS PowerShell Library

.DESCRIPTION
Windows Presentation Framework for PowerShell Module Library
    Support routines for Common Dialog Boxes

.NOTES
Copyright Keith Garner (KeithGa@DeploymentLive.com), All rights reserved.

.LINK
https://github.com/keithga/WPF4PS

#>

function script:Get-WindowOwner
{
<#
 .SYNOPSIS
Get the Window Owner

.DESCRIPTION
Get the Window handle of the parent $host process
Otherwise a DialogBox can appear in the background.

.LINK
http://poshcode.org/2002

#>

Add-Type -TypeDefinition @"
using System;
using System.Windows.Forms;

public class Win32Window : IWin32Window
{
    private IntPtr _hWnd;

    public Win32Window(IntPtr handle)
    {
        _hWnd = handle;
    }

    public IntPtr Handle
    {
        get { return _hWnd; }
    }
}
"@ -ReferencedAssemblies "System.Windows.Forms.dll"

New-Object Win32Window -ArgumentList ([System.Diagnostics.Process]::GetCurrentProcess().MainWindowHandle) | write-output

}

function Select-SaveFileDialog
{
<#
 .SYNOPSIS
Display a SaveFileDialog()

.DESCRIPTION
Display a File Save Dialog

.PARAMETER Title
    Caption of File Dialog

.PARAMETER Filter
    Gets or sets a filter string that specifies the files types and descriptions to display in the SaveFileDialog.

    Examples:
        Image Files (*.bmp, *.jpg)|*.bmp;*.jpg
        Text Files (*.txt)|*.txt|All Files (*.*)|*.*

.PARAMETER DefaultExt
    Gets or sets the default file name extension applied to files that are saved with the SaveFileDialog.

.OUTPUTS
    Returns the path to the saved file.

.EXAMPLE
    $OutFile = Select-SaveFileDialog

.EXAMPLE
    $OutFile = Select-SaveFileDialog -Title "Save Log File" -Filter "Text Files (*.log)|*.log|All Files (*.*)|*.*" -DefaultExt "log"

#>
    param(
        [String] $Title  = $null,
        [string] $Filter = 'All files (*.*)|*.*',
        [string] $DefaultExt = ''

    )

    $SaveFileDialog = New-Object System.Windows.Forms.SaveFileDialog
    #$SaveFileDialog.OverwritePrompt = $true
    $SaveFileDialog.Title = $Title
    $SaveFileDialog.Filter = $Filter
    $SaveFileDialog.DefaultExt = $DefaultExt
    if ( $SaveFileDialog.ShowDialog((Get-WindowOwner)) -eq [System.Windows.Forms.DialogResult]::OK )
    {
        $SaveFileDialog.FileName | Write-Output
    }

}

function Select-OpenFileDialog
{
<#
 .SYNOPSIS
Display a OpenFileDialog()

.DESCRIPTION
Display a File Open Dialog

.PARAMETER Title
    Caption of File Dialog

.PARAMETER MultiSelect
    More than one file can be opened

.PARAMETER Filter
    Gets or sets a filter string that specifies the files types and descriptions to display in the SaveFileDialog.

    Examples:
        Image Files (*.bmp, *.jpg)|*.bmp;*.jpg
        Text Files (*.txt)|*.txt|All Files (*.*)|*.*

.PARAMETER DefaultExt
    Gets or sets the default file name extension applied to files that are saved with the SaveFileDialog.

.OUTPUTS
    Returns the path to the saved file.

.EXAMPLE
    $OpenFile = Select-OpenFileDialog

.EXAMPLE
    $OpenFile = Select-OpenFileDialog -Title "Open Log File" -Filter "Text Files (*.log)|*.log|All Files (*.*)|*.*"

#>
    param(
        [String] $Title  = $null,
        [string] $Filter = 'All files (*.*)|*.*',
        [switch] $MultiSelect

    )

    $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
    $OpenFileDialog.Title = $Title
    $OpenFileDialog.Filter = $Filter
    $OpenFileDialog.Multiselect = $MultiSelect
    if ( $OpenFileDialog.ShowDialog((Get-WindowOwner)) -eq [System.Windows.Forms.DialogResult]::OK )
    {
        $OpenFileDialog.FileName | Write-Output
    }

}

function Show-MessageBox
{
<#
 .SYNOPSIS
Display a MessageBox()

.DESCRIPTION
Display a message box with various parameters

.PARAMETER Message
    Body of Messagebox text

.PARAMETER Title
    Caption of Messagebox

.PARAMETER Buttons
    Type of buttons

    0 OK button only
    1 OK and Cancel buttons
    2 Abort, Retry, and Ignore buttons
    3 Yes, No, and Cancel buttons
    4 Yes and No buttons
    5 Retry and Cancel buttons

.PARAMETER Icon
    Type of Icon, one of:

    16 Stop sign
    32 Question mark
    48 Exclamation point
    64 Information (i) icon

.OUTPUTS
    Returns a [System.Windows.Forms.DialogResult] object, can be one of:

    1 OK
    2 Cancel
    3 Abort
    4 Retry
    5 Ignore
    6 Yes
    7 No

.EXAMPLE
    Show-MessageBox "Hello World"

.EXAMPLE
    (Show-MessageBox "Do you like Ice Cream?" -Buttons 4) -eq 6

.NOTES
Copyright Keith Garner, All rights reserved.

#>

    Param(
        [parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
        [String] $Message,
        [String] $Title,
        [ValidateRange(0,5)]
        [int] $Buttons = 0,
        [ValidateRange(16,64)]
        [int] $Icons = 0
    )

    Write-verbose "MessageBox('$Message','$Title')"
    [System.Windows.Forms.MessageBox]::Show((Get-WindowOwner),$Message,$Title,$Buttons,$Icons) | Write-Output

}


text:
<?php

	$GLOBALS['timings']['smarty_comp_count']	= 0;
	$GLOBALS['timings']['smarty_comp_time']	= 0;

	define('FLAMEWORK_SMARTY_DIR', FLAMEWORK_INCLUDE_DIR.'/smarty_2.6.30/');
	require(FLAMEWORK_SMARTY_DIR . 'Smarty.class.php');

	$GLOBALS['smarty'] = new Smarty();

	$GLOBALS['smarty']->template_dir = $GLOBALS['cfg']['smarty_template_dir'];
	$GLOBALS['smarty']->compile_dir  = $GLOBALS['cfg']['smarty_compile_dir'];
	$GLOBALS['smarty']->compile_check = $GLOBALS['cfg']['smarty_compile'];
	$GLOBALS['smarty']->force_compile = $GLOBALS['cfg']['smarty_force_compile'];

	$GLOBALS['smarty']->assign_by_ref('cfg', $GLOBALS['cfg']);

	#######################################################################################

	function smarty_timings(){

		$GLOBALS['timings']['smarty_timings_out'] = microtime_ms();

		echo "
\n";
		echo "
\n";

		# we add this one last so it goes at the bottom of the list
		$GLOBALS['timing_keys']['smarty_comp'] = 'Templates Compiled';

		foreach ($GLOBALS['timing_keys'] as $k => $v){
			$c = intval($GLOBALS['timings']["{$k}_count"]);
			$t = intval($GLOBALS['timings']["{$k}_time"]);
			echo "
$v	$c	$t ms
\n";
		}

		$map2 = array(
			array("Startup & Libraries", $GLOBALS['timings']['init_end'] - $GLOBALS['timings']['execution_start']),
			array("Page Execution", $GLOBALS['timings']['smarty_start_output'] - $GLOBALS['timings']['init_end']),
			array("Smarty Output", $GLOBALS['timings']['smarty_timings_out'] - $GLOBALS['timings']['smarty_start_output']),
			array("Total", $GLOBALS['timings']['smarty_timings_out'] - $GLOBALS['timings']['execution_start']),
		);

		foreach ($map2 as $a){
			echo "
$a[0]	$a[1] ms
\n";
		}

		echo "
\n";
		echo "
\n";
	}

	$GLOBALS['smarty']->register_function('timings', 'smarty_timings');

	#######################################################################################


text:
<!DOCTYPE html>

Test passes if all the T are green, as well as punctuation elements when they are adjacent to a letter (without spaces)

Test

 Test

(T)est

 (T)est

“T”est

&Test

 &Test

𐄀T𐄀est

၎̀T̀၎̀est

T&S

T & S

T & S

« S »

« S »

•

 •