text:
[ -d source ] || git clone https://github.com/lede-project/source source
cd source
grep 'src-git onion' feeds.conf.default || \
    echo 'src-git onion https://github.com/OnionIoT/OpenWRT-Packages.git;omega2' >> feeds.conf.default
scripts/feeds update -a
scripts/feeds install -a

make menuconfig

N=`nproc`

make -j$N tools/install
make -j$N toolchain/install

redpajama_set_name: RedPajamaGithub


text:
title: Java concurrency
excerpt: "JaConTeBe: A Benchmark Suite of Real-World Java Concurrency Bugs (T)."
layout: repo-dataset
authors: "Lin, Ziyi, Darko Marinov, Hao Zhong, Yuting Chen, and Jianjun Zhao."
version: 4
---

# URL

* [Data Link (DOI)](https://doi.org/10.5281/zenodo.268479)
* [Paper in IEEE Digital Library](http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=7372007&punumber%3D7371449%26filter%3DAND%28p_IS_Number%3A7371976%29%26pageNumber%3D2)

# Change Log

When | What
---- | ----
January 29th, 2016 | Donated by [Ziyi Lin](mailto:linziyi@sjtu.edu.cn)

# Reference

Studies who have been using the data (in any form) are required to include the following reference:

```
@INPROCEEDINGS{7372007,
author={Lin, Ziyi and Marinov, Darko and Zhong, Hao and Chen, Yuting and Zhao, Jianjun},
booktitle={Automated Software Engineering (ASE), 2015 30th IEEE/ACM International Conference on},
title={JaConTeBe: A Benchmark Suite of Real-World Java Concurrency Bugs (T)},
year={2015},
pages={178-189},
keywords={Benchmark testing;Computer bugs;Concurrent computing;Java;Open source software;System recovery;JaConTeBe;Java concurrency bugs;SIR;benchmark suite;evaluations},
doi={10.1109/ASE.2015.87},
month={Nov},}
```

# About the Data

## Overview of Data

JaConTeBe is a benchmark suite for Java concurrency bugs. The initial version of JaConTeBe contains 47 confirmed, real-world concurrency bugs from 8. open-source projects. JaConTeBe is an ongoing work and the authors plan to collect more bugs in the future.

## Paper Abstract

Researchers have proposed various approaches to detect concurrency bugs and improve multi-threaded programs, but performing evaluations of the effectiveness of these approaches still remains a substantial challenge. We survey the existing evaluations and find out that they often use code or bugs not representative of real world. To improve representativeness, we have prepared JaConTeBe, a benchmark suite of 47 confirmed concurrency bugs from 8 popular open-source projects, supplemented with test cases for reproducing buggy behaviors. Running three approaches on JaConTeBe shows that our benchmark suite confirms some limitations of the three approaches. We submitted JaConTeBe to the SIR repository (a software-artifact repository for rigorous controlled experiments), and it was included as a part of SIR.


text:
import { createReducer } from 'redux-act';

import * as menuModule from './modules/menu.module';
import * as notificationModule from './modules/notifications.module';

export default createReducer(
  {
    ...menuModule.reducer,
    ...notificationModule.reducer,
  }
);


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.vcs.actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;

import static com.intellij.util.containers.ContainerUtil.newHashSet;
import static java.util.Collections.emptySet;

/**
 * @deprecated Use {@link DumbAwareAction} instead.
 */
@ApiStatus.ScheduledForRemoval(inVersion = "2022.1")
@Deprecated
public abstract class AbstractVcsAction extends DumbAwareAction {

  @SuppressWarnings("unused") // Required for compatibility with external plugins.
  public static Collection<AbstractVcs> getActiveVcses(@NotNull VcsContext dataContext) {
    Project project = dataContext.getProject();

    return project != null ? newHashSet(ProjectLevelVcsManager.getInstance(project).getAllActiveVcss()) : emptySet();
  }

  @Override
  public void update(@NotNull AnActionEvent e) {
    //noinspection deprecation - required for compatibility with external plugins.
    performUpdate(e.getPresentation(), VcsContextWrapper.createInstanceOn(e));
  }

  @Override
  public void actionPerformed(@NotNull AnActionEvent e) {
    actionPerformed(VcsContextWrapper.createCachedInstanceOn(e));
  }

  protected abstract void update(@NotNull VcsContext vcsContext, @NotNull Presentation presentation);

  protected abstract void actionPerformed(@NotNull VcsContext e);

  /**
   * @deprecated Only sync update is currently supported by {@link AbstractVcsAction}.
   */
  @SuppressWarnings("unused") // Required for compatibility with external plugins.
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2021.3")
  protected boolean forceSyncUpdate(@NotNull AnActionEvent e) {
    return true;
  }

  /**
   * @deprecated Use {@link AbstractVcsAction#update(VcsContext, Presentation)}.
   */
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2021.3")
  protected void performUpdate(@NotNull Presentation presentation, @NotNull VcsContext vcsContext) {
    update(vcsContext, presentation);
  }
}


text:
package org.economicsl

package object mechanisms {

  /** Type representing a numeraire.
    *
    * When modeling individual agent preferences using a `Preference` ordering,
    * we are not modeling "by how much" an agent prefers one alternative over
    * another. Introducing the concept of "money" provides a yardstick that allows us
    * to model exactly this idea.  A key property of "money" is that it is
    * capable of acting as a store of value that can be transferred amongst
    * groups of agents.
    */
  type Numeraire = Long

}


text: Check if you wish to publish build information to Artifactory.


text:
package io.github.mayunfei.imsdk.ui;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ListView;

import com.tencent.imsdk.TIMConversationType;
import com.tencent.imsdk.TIMMessage;

import java.util.ArrayList;
import java.util.List;

import io.github.mayunfei.imsdk.R;
import io.github.mayunfei.imsdk.presenter.ChatPresenter;
import io.github.mayunfei.imsdk.ui.model.Message;
import io.github.mayunfei.imsdk.ui.model.MessageFactory;
import io.github.mayunfei.imsdk.ui.model.TextMessage;
import io.github.mayunfei.imsdk.viewfeatures.ChatView;

public class ChatFragment extends Fragment implements ChatView {
    private static final String TAG = "ChatFragment";

    private static final String IDENTIFY = "IDENTIFY";
    private OnFragmentInteractionListener mListener;
    private String identify;
    private ChatPresenter mPresenter;

    private ChatAdapter adapter;
    private ListView listView;
    private List<Message> messageList = new ArrayList<>();

    private ChatInput input;

    public ChatFragment() {
        // Required empty public constructor
    }

    public static ChatFragment newInstance(String identify) {
        ChatFragment fragment = new ChatFragment();
        Bundle args = new Bundle();
        args.putString(IDENTIFY, identify);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            identify = getArguments().getString(IDENTIFY);
            mPresenter = new ChatPresenter(this, identify, TIMConversationType.Group);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_chat, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        listView = (ListView) view.findViewById(R.id.list);
        input = view.findViewById(R.id.input_panel);
        input.setChatView(this);
        adapter = new ChatAdapter(getContext(),R.layout.item_message,messageList);
        listView.setAdapter(adapter);
        listView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
        listView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                switch (event.getAction()) {
                    case MotionEvent.ACTION_DOWN:
                        input.setInputMode(ChatInput.InputMode.NONE);
                        break;
                }
                return false;
            }
        });
        listView.setOnScrollListener(new AbsListView.OnScrollListener() {

            private int firstItem;

            @Override
            public void onScrollStateChanged(AbsListView view, int scrollState) {
                if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE && firstItem == 0) {
                    //如果拉到顶端读取更多消息
//                    mPresenter.getMessage(messageList.size() > 0 ? messageList.get(0).getMessage() : null);

                }
            }

            @Override
            public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
                firstItem = firstVisibleItem;
            }
        });
        mPresenter.start();
    }

    public void onButtonPressed(Uri uri) {
        if (mListener != null) {
            mListener.onFragmentInteraction(uri);
        }
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (context instanceof OnFragmentInteractionListener) {
            mListener = (OnFragmentInteractionListener) context;
        } else {
            throw new RuntimeException(context.toString()
                    + " must implement OnFragmentInteractionListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mPresenter.stop();
        mListener = null;
    }

    @Override
    public void showMessage(TIMMessage message) {
        if (message == null) {
            adapter.notifyDataSetChanged();
        } else {
            Message mMessage = MessageFactory.getMessage(message);
            if (mMessage != null) {
                if (!(mMessage instanceof TextMessage)){
//                    CustomMessage.Type messageType = ((CustomMessage) mMessage).getType();
//                    switch (messageType){
//                        case TYPING:
//                            TemplateTitle title = (TemplateTitle) findViewById(R.id.chat_title);
//                            title.setTitleText(getString(R.string.chat_typing));
//                            handler.removeCallbacks(resetTitle);
//                            handler.postDelayed(resetTitle,3000);
//                            break;
//                        default:
//                            break;
//                    }
                }else{
                    if (messageList.size()==0){
                        mMessage.setHasTime(null);
                    }else{
                        mMessage.setHasTime(messageList.get(messageList.size()-1).getMessage());
                    }
                    messageList.add(mMessage);
                    adapter.notifyDataSetChanged();
                    listView.setSelection(adapter.getCount()-1);
                }

            }
        }
    }

    @Override
    public void showMessage(List<TIMMessage> messages) {

    }

    @Override
    public void clearAllMessage() {

    }

    @Override
    public void onSendMessageSuccess(TIMMessage message) {

    }

    @Override
    public void onSendMessageFail(int code, String desc, TIMMessage message) {

    }

    @Override
    public void sendImage() {

    }

    @Override
    public void sendPhoto() {

    }

    @Override
    public void sendText() {
        Message message = new TextMessage(input.getText());
        mPresenter.sendMessage(message.getMessage());
        input.setText("");
    }

    @Override
    public void sendFile() {

    }

    @Override
    public void startSendVoice() {

    }

    @Override
    public void endSendVoice() {

    }

    @Override
    public void sendVideo(String fileName) {

    }

    @Override
    public void cancelSendVoice() {

    }

    @Override
    public void sending() {

    }

    @Override
    public void videoAction() {

    }

    @Override
    public void showToast(String msg) {

    }

    public interface OnFragmentInteractionListener {
        // TODO: Update argument type and name
        void onFragmentInteraction(Uri uri);
    }
}


text:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class MenuButton : MonoBehaviour
{
    private Image button;
    private Image hover;

    void Awake()
    {
        button = transform.GetChild(0).GetComponent<Image>();
        hover = transform.GetChild(1).GetComponent<Image>();

        hover.enabled = false;
    }

    public void OnEnter()
    {
        button.enabled = false;
        hover.enabled = true;
        hover.color = Color.white;
    }

    public void OnExit()
    {
        button.enabled = true;
        hover.enabled = false;
        hover.color = Color.white;
    }

    public void OnDown()
    {
        button.enabled = false;
        hover.enabled = true;
        hover.color = Color.gray;
    }

    public void OnUp()
    {
        button.enabled = true;
        hover.enabled = false;
        hover.color = Color.white;

        if (name == "Start")
        {
            Application.LoadLevel(1);
        }
        else
        {
            Application.Quit();
        }
    }

    void Update()
    {

    }
}


text:
import webob

from heat.api.middleware import ssl
from oslo.config import cfg

from heat.tests.common import HeatTestCase

class SSLMiddlewareTest(HeatTestCase):
    scenarios = [('with_forwarded_proto_default_header',
                  dict(forwarded_protocol='https',
                       secure_proxy_ssl_header=None,
                       headers={'X-Forwarded-Proto': 'https'})),
                 ('with_forwarded_proto_non_default_header',
                  dict(forwarded_protocol='http',
                       secure_proxy_ssl_header='X-My-Forwarded-Proto',
                       headers={})),
                 ('without_forwarded_proto',
                  dict(forwarded_protocol='http',
                       secure_proxy_ssl_header=None,
                       headers={}))]

    def test_ssl_middleware(self):
        if self.secure_proxy_ssl_header:
            cfg.CONF.set_override('secure_proxy_ssl_header',
                                  self.secure_proxy_ssl_header)

        middleware = ssl.SSLMiddleware(None)
        request = webob.Request.blank('/stacks', headers=self.headers)
        self.assertIsNone(middleware.process_request(request))
        self.assertEqual(self.forwarded_protocol,
                         request.environ['wsgi.url_scheme'])


text:
module.exports = exports = {
  baseuri: 'http://localhost:5000'
};


text:
class OrderLineItem < ActiveRecord::Base

  belongs_to :order

  validates_presence_of :sku

  def sku
    SKU.lookup(self.sku_name)
  end

  def sku=(arg)
    if arg
      self.sku_name = arg.name
      self.sku_number = arg.number
    end
  end

end


text:
import {
  BotStateTree, ConfigurationName, McuParamName, SyncStatus, TaggedDevice,
  Alert, Xyz, LocationData, FirmwareHardware,
} from "farmbot";
import { ConnectionState } from "../connectivity/interfaces";
import { IntegerSize } from "../util";
import { TimeSettings } from "../interfaces";

/** Value and consistency of the value between the bot and /api/fbos_config. */
export type SourceFbosConfig = (config: ConfigurationName) =>
  {
    value: boolean | number | string | undefined,
    consistent: boolean
  };

/**
 * Value and consistency of the value between the bot and /api/firmware_config.
 * */
export type SourceFwConfig = (config: McuParamName) =>
  { value: number | undefined, consistent: boolean };

/** Function to determine if a feature should be displayed. */
export type ShouldDisplay = (x: Feature) => boolean;
/** Names of features that use minimum FBOS version checking. */
export enum Feature {
  api_farmware_env = "api_farmware_env",
  api_farmware_installations = "api_farmware_installations",
  api_ota_releases = "api_ota_releases",
  api_pin_bindings = "api_pin_bindings",
  assertion_block = "assertion_block",
  backscheduled_regimens = "backscheduled_regimens",
  boot_sequence = "boot_sequence",
  calibration_retries = "calibration_retries",
  calibration_total_retries = "calibration_total_retries",
  computed_move = "computed_move",
  change_ownership = "change_ownership",
  criteria_groups = "criteria_groups",
  endstop_invert = "endstop_invert",
  express_k10 = "express_k10",
  express_k11 = "express_k11",
  express_stall_detection = "express_stall_detection",
  farmduino_k14 = "farmduino_k14",
  farmduino_k15 = "farmduino_k15",
  farmduino_k16 = "farmduino_k16",
  firmware_restart = "firmware_restart",
  flash_firmware = "flash_firmware",
  groups = "groups",
  home_single_axis = "home_single_axis",
  jest_feature = "jest_feature",
  long_scaling_factor = "long_scaling_factor",
  lua_step = "lua_step",
  mark_as_step = "mark_as_step",
  multiple_variables = "multiple_variables",
  named_pins = "named_pins",
  no_auto_reset = "no_auto_reset",
  no_firmware_logs = "no_firmware_logs",
  none_firmware = "none_firmware",
  ota_update_hour = "ota_update_hour",
  planted_at_now = "planted_at_now",
  quiet_motors = "quiet_motors",
  rpi_led_control = "rpi_led_control",
  safe_height_input = "safe_height_input",
  sensors = "sensors",
  soil_height = "soil_height",
  sort_type_optimized = "sort_type_optimized",
  sort_type_alternating = "sort_type_alternating",
  toggle_peripheral = "toggle_peripheral",
  update_resource = "update_resource",
  use_update_channel = "use_update_channel",
  variables = "variables",
  z2_firmware_params = "z2_firmware_params",
  z2_firmware_params_tmc = "z2_firmware_params_tmc",
  z2_firmware_params_all = "z2_firmware_params_all",
}

/** Object fetched from ExternalUrl.featureMinVersions. */
export type MinOsFeatureLookup = Partial<Record<Feature, string>>;

export interface BotState {
  /** The browser optimistically overwrites FBOS sync status to "syncing..."
   * to reduce UI latency. When AJAX/sync operations fail, we need
   * a mechanism to rollback the update to the previous value. We store the
   * value of the status prior to the update here for safety */
  statusStash?: SyncStatus | undefined;
  /** How many steps to move when the user presses a manual movement arrow */
  stepSize: number;
  /** Version of available FBOS update from releases API. undefined: up to date */
  osUpdateVersion?: string | undefined;
  /** JSON string of minimum required FBOS versions for various features. */
  minOsFeatureData?: MinOsFeatureLookup;
  /** Notes notifying users of changes that may require intervention. */
  osReleaseNotes?: string;
  /** Is the bot in sync with the api */
  dirty: boolean;
  /** The state of the bot, as reported by the bot over MQTT. */
  hardware: HardwareState;
  /** Hardware settings auto update on blur. Tells the UI if it should load a
   * spinner or not. */
  isUpdating?: boolean;
  /** Have all API requests been acknowledged by external services? This flag
   * lets us know if it is safe to do data critical tasks with the bot */
  consistent: boolean;
  connectivity: ConnectionState;
}

/** Status registers for the bot's status */
export type HardwareState = BotStateTree;

export interface OsUpdateInfo {
  version: string | undefined;
}

export interface MoveRelProps {
  x: number;
  y: number;
  z: number;
  speed?: number | undefined;
}

export interface MoveProps {
  x: number;
  y: number;
  z: number;
  safeZ?: boolean;
  speed?: number;
}

export type Axis = Xyz | "all";

export type BotPosition = Record<Xyz, number | undefined>;
export type BotLocationData = LocationData;

export type StepsPerMm = Record<Xyz, number | undefined>;

export type UserEnv = Record<string, string | undefined>;

export interface FarmbotSettingsProps {
  bot: BotState;
  alerts: Alert[];
  device: TaggedDevice;
  dispatch: Function;
  sourceFbosConfig: SourceFbosConfig;
  timeSettings: TimeSettings;
  botOnline: boolean;
  controlPanelState: ControlPanelState;
}

export interface McuInputBoxProps {
  sourceFwConfig: SourceFwConfig;
  setting: McuParamName;
  dispatch: Function;
  intSize?: IntegerSize;
  float?: boolean;
  scale?: number;
  filter?: number;
  gray?: boolean;
  min?: number;
  max?: number;
  disabled?: boolean;
  title?: string;
  firmwareHardware: FirmwareHardware | undefined;
  warnMin?: number;
  warning?: string;
}

export interface EStopButtonProps {
  bot: BotState;
  forceUnlock: boolean;
}

export interface ControlPanelState {
  farmbot_settings: boolean;
  firmware: boolean;
  power_and_reset: boolean;
  axis_settings: boolean;
  motors: boolean;
  encoders_or_stall_detection: boolean;
  limit_switches: boolean;
  error_handling: boolean;
  pin_bindings: boolean;
  pin_guard: boolean;
  parameter_management: boolean;
  farm_designer: boolean;
  account: boolean;
  other_settings: boolean;
}


text:
module GeoCerts
  module Endpoints # :nodoc:

    module Events # :nodoc:

      def self.included(base)
        base.class_eval do
          endpoint GeoCerts::API::ENDPOINT do

            action :events, :url => '/events.xml' do
              parameter :start_at
              parameter :end_at

              parser Parsers::OrderParser do
                element :events do
                  attribute 'start_at',             :as => :start_at,           :type => DateTime
                  attribute 'end_at',               :as => :end_at,             :type => DateTime

                  elements :event do
                    element 'event-id',             :as => :id,                 :type => Integer
                    element 'order-id',             :as => :order_id
                    element :name
                    element 'created-at',           :as => :created_at,         :type => DateTime
                  end
                end
              end
            end

            action :order_events, :url => '/orders/:order_id/events.xml' do
              parameter :start_at
              parameter :end_at

              parser Parsers::OrderParser do
                element :events do
                  attribute 'start_at',             :as => :start_at,           :type => DateTime
                  attribute 'end_at',               :as => :end_at,             :type => DateTime

                  elements :event do
                    element 'event-id',             :as => :id,                 :type => Integer
                    element 'order-id',             :as => :order_id
                    element :name
                    element 'created-at',           :as => :created_at,         :type => DateTime
                  end
                end
              end
            end

          end
        end
      end

    end

  end
end


text:
<?php get_template_part('templates/page', 'header'); ?>

  <?php _e('Sorry, but the page you were trying to view does not exist.', 'example'); ?>

<?php _e('It looks like this was the result of either:', 'example'); ?>

<?php _e('a mistyped address', 'example'); ?>

<?php _e('an out-of-date link', 'example'); ?>

<?php get_search_form(); ?>


text:
<?php

class Zend_Crypt_Rsa_Key implements Countable
{

    protected $_pemString = null;

    protected $_details = array();

    protected $_opensslKeyResource = null;

    public function getOpensslKeyResource()
    {
        return $this->_opensslKeyResource;
    }

    public function toString()
    {
        if (!empty($this->_pemString)) {
            return $this->_pemString;
        } elseif (!empty($this->_certificateString)) {
            return $this->_certificateString;
        }
        require_once 'Zend/Crypt/Exception.php';
        throw new Zend_Crypt_Exception('No public key string representation is available');
    }

    public function __toString()
    {
        return $this->toString();
    }

    public function count()
    {
        return $this->_details['bits'];
    }

    public function getType()
    {
        return $this->_details['type'];
    }
}


text:
angular.module('dotjem.lessons').directive('dxSyntax', [
    'syntax', function (syntax) {
        return {
            restrict: 'ECA',
            terminal: true,
            link: function (scope, element) {
                syntax.Highlight(element);
            }
        };
    }
]);


text:
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;

namespace Highway.Insurance.UI.Windows.Controls.WinForms
{
    /// <summary>
    /// Wrapper class for WinHyperLink
    /// </summary>
    public class EnhancedWinHyperlink : EnhancedWinControl<WinHyperlink>
    {
        public EnhancedWinHyperlink() : base() { }
        public EnhancedWinHyperlink(string searchParameters) : base(searchParameters) { }

        public string DisplayText
        {
            get { return this.UnWrap().DisplayText; }
        }
    }
}


text:
<?php

namespace Lechimp\STG\Gen;

class GPrivateMethod extends GMethod
{
    public function __construct($name, array $arguments, array $statements)
    {
        parent::__construct($name, $arguments, $statements);
        $this->qualifier = "private";
    }
}


text:
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                Toggle navigation

                </button>

                <form class="navbar-form navbar-left" role="search">

                            <input type="text" class="form-control" placeholder="Buscar">
                            <button class="btn btn-default" type="button">Buscar</button>

                </form>

{{$usuario}}

                        Menu

Remisiones

Prospectos

Clientes

                            {{--
Cuentas
                             --}}

Campañas

Oportunidades

Tareas

Eventos

                            @if (Auth::user()->id == 1)

Registrar Usuario

                            @endif

Salir

                <button name="home" type="button" class="btn btn-default">  Remisiones</button>

                <button name="cliente" type="button" class="btn btn-default">  Prospectos</button>

                <button name="contacto" type="button" class="btn btn-default">  Clientes</button>

            {{--

                <button name="cuenta" type="button" class="btn btn-default">  Cuentas</button>

 --}}

                <button name="campaña" type="button" class="btn btn-default"> Campañas</button>

                <button name="oportunidad" type="button" class="btn btn-default">  Oportunidades</button>

                <button name="tarea" type="button" class="btn btn-default">  Tareas</button>

                <button name="evento" type="button" class="btn btn-default">  Eventos</button>

                <button name="evento" type="button" class="btn btn-default">  Informes</button>

            @if (Auth::user()->id == 1)

                    <button name="registro" type="button" class="btn btn-default">  Registro de usuario</button>

            @endif

                <button name="logout" type="button" class="btn btn-default">Salir</button>

<button name="toogle" type="button" value="hide" class="btn btn-default toogleMenu visible-md-block visible-lg-block"></button>


text:
package com.alpi.android.REIM;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;

public class MapaSur extends Activity {

    Button irAlEste;
    Button irAlCentro;
    Button irAlOeste;
    Button cuartelActividad002;
    Button instruccionMiraEstacionBomberos;
    ImageView ticketsMuseo;
    int contadorClickInstrucciones;

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        View decorView = getWindow().getDecorView();
        if (hasFocus) {
            decorView.setSystemUiVisibility(
                    View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                            | View.SYSTEM_UI_FLAG_FULLSCREEN
                            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);}
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_IMMERSIVE);

        setContentView(R.layout.vista_mapa_sur);

        Bundle extras = getIntent().getExtras();
        final int contadorClickMapaIn = extras.getInt("CONTADOR_CLICK_MAPA");
        final int contadorClickInstruccionesIn = extras.getInt("CONTADOR_CLICK_INSTRUCCIONES");
        final int valorGamificacion = extras.getInt("VALOR_GAMIFICACION");
        final int contadorClickMapaOut = contadorClickMapaIn + 1;

        ticketsMuseo = (ImageView) findViewById(R.id.tickets);

        if(valorGamificacion == 0) {
            ticketsMuseo.setImageResource(R.drawable.tickets_0);
        } else if (valorGamificacion == 1) {
            ticketsMuseo.setImageResource(R.drawable.tickets_1);
        } else {
            ticketsMuseo.setImageResource(R.drawable.tickets_2);
        }

        instruccionMiraEstacionBomberos = (Button) findViewById(R.id.botonInstruccion);
        final MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.mira_estacion_bomberos);
        instruccionMiraEstacionBomberos.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mediaPlayer.start();
                contadorClickInstrucciones += 1;
            }
        });

        irAlEste = (Button) findViewById(R.id.botonIrAlOeste);
        irAlEste.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                final int contadorClickInstruccionesOut = contadorClickInstruccionesIn + contadorClickInstrucciones;
                Intent intent = new Intent(MapaSur.this, MapaOeste.class);
                intent.putExtra("CONTADOR_CLICK_MAPA", contadorClickMapaOut);
                intent.putExtra("CONTADOR_CLICK_INSTRUCCIONES", contadorClickInstruccionesOut);
                intent.putExtra("VALOR_GAMIFICACION", valorGamificacion);
                startActivity(intent);
            }
        });

        irAlCentro = (Button) findViewById(R.id.botonIrAlCentro);
        irAlCentro.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                final int contadorClickInstruccionesOut = contadorClickInstruccionesIn + contadorClickInstrucciones;
                Intent intent = new Intent(MapaSur.this, MapaCentro.class);
                intent.putExtra("CONTADOR_CLICK_MAPA", contadorClickMapaOut);
                intent.putExtra("CONTADOR_CLICK_INSTRUCCIONES", contadorClickInstruccionesOut);
                intent.putExtra("VALOR_GAMIFICACION", valorGamificacion);
                startActivity(intent);
            }
        });

        irAlOeste = (Button) findViewById(R.id.botonIrAlEste);
        irAlOeste.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                final int contadorClickInstruccionesOut = contadorClickInstruccionesIn + contadorClickInstrucciones;
                Intent intent = new Intent(MapaSur.this, MapaEste.class);
                intent.putExtra("CONTADOR_CLICK_MAPA", contadorClickMapaOut);
                intent.putExtra("CONTADOR_CLICK_INSTRUCCIONES", contadorClickInstruccionesOut);
                intent.putExtra("VALOR_GAMIFICACION", valorGamificacion);
                startActivity(intent);
            }
        });

        cuartelActividad002 = (Button) findViewById(R.id.botonCuartelActividad002);
        cuartelActividad002.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                final int contadorClickInstruccionesOut = contadorClickInstruccionesIn + contadorClickInstrucciones;
                Intent intent = new Intent(MapaSur.this, Actividad002.class);
                intent.putExtra("CONTADOR_CLICK_MAPA", contadorClickMapaOut);
                intent.putExtra("CONTADOR_CLICK_INSTRUCCIONES", contadorClickInstruccionesOut);
                intent.putExtra("VALOR_GAMIFICACION", valorGamificacion);
                startActivity(intent);
            }
        });

        Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.animacion_boton_instrucciones);
        instruccionMiraEstacionBomberos.setAnimation(animation);

        animation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                instruccionMiraEstacionBomberos.startAnimation(animation);
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }

        });

    }
}


text:
/* General structure and fonts */

body {
	background-color: white;
	color: black;
}

h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
	color: black;
}
h1.fqn {
	border-bottom-color: #D5D5D5;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
	border-bottom-color: #DDDDDD;
}
.in-band {
	background-color: white;
}

.docblock code, .docblock-short code {
	background-color: #F5F5F5;
}
pre {
	background-color: #F5F5F5;
}

.sidebar {
	background-color: #F1F1F1;
}

.sidebar .current {
	background-color: #fff;
}

.sidebar {
    background-color: #F1F1F1;
}

.sidebar .current {
    background-color: #fff;
}

.source .sidebar {
	background-color: #fff;
}

.sidebar .location {
	border-color: #000;
	background-color: #fff;
	color: #333;
}

.block a:hover {
	background: #F5F5F5;
}

.line-numbers span { color: #c67e2d; }
.line-numbers .line-highlighted {
	background-color: #f6fdb0 !important;
}

:target { background: #FDFFD3; }
.content .highlighted {
	color: #000 !important;
	background-color: #ccc;
}
.content .highlighted a, .content .highlighted span { color: #000 !important; }
.content .highlighted.trait { background-color: #fece7e; }
.content .highlighted.mod { background-color: #afc6e4; }
.content .highlighted.enum { background-color: #b4d1b9; }
.content .highlighted.struct { background-color: #e7b1a0; }
.content .highlighted.fn { background-color: #c6afb3; }
.content .highlighted.method { background-color: #c6afb3; }
.content .highlighted.tymethod { background-color: #c6afb3; }
.content .highlighted.type { background-color: #c6afb3; }

.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
	border-bottom-color: #DDD;
}

.docblock table {
	border-color: #ddd;
}

.docblock table td {
	border-top-color: #ddd;
	border-bottom-color: #ddd;
}

.docblock table th {
	border-top-color: #ddd;
	border-bottom-color: #ddd;
}

.content span.primitive, .content a.primitive, .block a.current.primitive { color: #39a7bf; }
.content span.externcrate,
.content span.mod, .content a.mod, .block a.current.mod { color: #4d76ae; }
.content span.fn, .content a.fn, .block a.current.fn,
.content span.method, .content a.method, .block a.current.method,
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
.content .fnname { color: #8c6067; }

pre.rust .comment { color: #8E908C; }
pre.rust .doccomment { color: #4D4D4C; }

nav {
	border-bottom-color: #e0e0e0;
}
nav.main .current {
	border-top-color: #000;
	border-bottom-color: #000;
}
nav.main .separator {
	border: 1px solid #000;
}
a {
	color: #000;
}

.docblock a, .docblock-short a, .stability a {
	color: #3873AD;
}

a.test-arrow {
	color: #f5f5f5;
}

.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; }

.search-input {
	color: #555;
	box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
	background-color: white;
}

.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }

#help > div {
	background: #e9e9e9;
	border-color: #bfbfbf;;
}

#help dt {
	border-color: #bfbfbf;
	background: #fff;
}

.since {
	color: grey;
}

.line-numbers :target { background-color: transparent; }

/* Code highlighting */
pre.rust .kw { color: #8959A8; }
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
pre.rust .number, pre.rust .string { color: #718C00; }
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
pre.rust .lifetime { color: #B76514; }
pre.rust .question-mark {
	color: #ff9011;
}

a.test-arrow {
	background-color: rgba(78, 139, 202, 0.2);
}

a.test-arrow:hover{
	background-color: #4e8bca;
}

.toggle-label {
	color: #999;
}

:target > code {
	background: #FDFFD3;
}


text:
package conf

import (
	"fmt"
	"regexp"
	"strconv"
	"strings"

	"github.com/alyu/configparser"
)

// Aggregations holds the aggregation definitions
type Aggregations struct {
	Data               []Aggregation
	DefaultAggregation Aggregation
}

type Aggregation struct {
	Name              string
	Pattern           *regexp.Regexp
	XFilesFactor      float64
	AggregationMethod []Method
}

// NewAggregations create instance of Aggregations
func NewAggregations() Aggregations {
	return Aggregations{
		Data: make([]Aggregation, 0),
		DefaultAggregation: Aggregation{
			Name:              "default",
			Pattern:           regexp.MustCompile(".*"),
			XFilesFactor:      0.5,
			AggregationMethod: []Method{Avg},
		},
	}
}

// ReadAggregations returns the defined aggregations from a storage-aggregation.conf file
// and adds the default
func ReadAggregations(file string) (Aggregations, error) {
	config, err := configparser.Read(file)
	if err != nil {
		return Aggregations{}, err
	}
	sections, err := config.AllSections()
	if err != nil {
		return Aggregations{}, err
	}

	result := NewAggregations()

	for _, s := range sections {
		item := Aggregation{}
		item.Name = strings.Trim(strings.SplitN(s.String(), "\n", 2)[0], " []")
		if item.Name == "" || strings.HasPrefix(item.Name, "#") {
			continue
		}

		item.Pattern, err = regexp.Compile(s.ValueOf("pattern"))
		if err != nil {
			return Aggregations{}, fmt.Errorf("[%s]: failed to parse pattern %q: %s", item.Name, s.ValueOf("pattern"), err.Error())
		}

		item.XFilesFactor, err = strconv.ParseFloat(s.ValueOf("xFilesFactor"), 64)
		if err != nil {
			return Aggregations{}, fmt.Errorf("[%s]: failed to parse xFilesFactor %q: %s", item.Name, s.ValueOf("xFilesFactor"), err.Error())
		}

		aggregationMethodStr := s.ValueOf("aggregationMethod")
		methodStrs := strings.Split(aggregationMethodStr, ",")
		for _, methodStr := range methodStrs {
			switch methodStr {
			case "average", "avg":
				item.AggregationMethod = append(item.AggregationMethod, Avg)
			case "sum":
				item.AggregationMethod = append(item.AggregationMethod, Sum)
			case "last":
				item.AggregationMethod = append(item.AggregationMethod, Lst)
			case "max":
				item.AggregationMethod = append(item.AggregationMethod, Max)
			case "min":
				item.AggregationMethod = append(item.AggregationMethod, Min)
			default:
				return result, fmt.Errorf("[%s]: unknown aggregation method %q", item.Name, methodStr)
			}
		}

		result.Data = append(result.Data, item)
	}

	return result, nil
}

// Match returns the correct aggregation setting for the given metric
// it can always find a valid setting, because there's a default catch all
// also returns the index of the setting, to efficiently reference it
func (a Aggregations) Match(metric string) (uint16, Aggregation) {
	for i, s := range a.Data {
		if s.Pattern.MatchString(metric) {
			return uint16(i), s
		}
	}
	return uint16(len(a.Data)), a.DefaultAggregation
}

// Get returns the aggregation setting corresponding to the given index
func (a Aggregations) Get(i uint16) Aggregation {
	if i+1 > uint16(len(a.Data)) {
		return a.DefaultAggregation
	}
	return a.Data[i]
}


text:
/**
 * (c) 2010-2017 Torstein Honsi
 *
 * License: www.highcharts.com/license
 */
'use strict';
import H from './Globals.js';
import './Axis.js';
import './Chart.js';
var addEvent = H.addEvent,
    Axis = H.Axis,
    Chart = H.Chart,
    css = H.css,
    createElement = H.createElement,
    defaultOptions = H.defaultOptions,
    defined = H.defined,
    destroyObjectProperties = H.destroyObjectProperties,
    discardElement = H.discardElement,
    each = H.each,
    extend = H.extend,
    fireEvent = H.fireEvent,
    isNumber = H.isNumber,
    merge = H.merge,
    pick = H.pick,
    pInt = H.pInt,
    splat = H.splat,
    wrap = H.wrap;

/* ****************************************************************************
 * Start Range Selector code                                                  *
 *****************************************************************************/
extend(defaultOptions, {

    /**
     * The range selector is a tool for selecting ranges to display within
     * the chart. It provides buttons to select preconfigured ranges in
     * the chart, like 1 day, 1 week, 1 month etc. It also provides input
     * boxes where min and max dates can be manually input.
     *
     * @product highstock
     * @optionparent rangeSelector
     */
    rangeSelector: {
        // allButtonsEnabled: false,
        // enabled: true,
        // buttons: {Object}
        // buttonSpacing: 0,

        /**
         * The vertical alignment of the rangeselector box. Allowed properties
         * are `top`, `middle`, `bottom`.
         *
         * @since 6.0.0
         * @validvalue ["top", "middle", "bottom"]
         * @sample {highstock} stock/rangeselector/vertical-align-middle/ Middle
         *
         * @sample {highstock} stock/rangeselector/vertical-align-bottom/ Bottom
         */
        verticalAlign: 'top',

        /**
         * A collection of attributes for the buttons. The object takes SVG
         * attributes like `fill`, `stroke`, `stroke-width`, as well as `style`,
         * a collection of CSS properties for the text.
         *
         * The object can also be extended with states, so you can set
         * presentational options for `hover`, `select` or `disabled` button
         * states.
         *
         * CSS styles for the text label.
         *
         * In styled mode, the buttons are styled by the
         * `.highcharts-range-selector-buttons .highcharts-button` rule with its
         * different states.
         *
         * @type {Object}
         * @sample {highstock} stock/rangeselector/styling/
         *         Styling the buttons and inputs
         * @product highstock
         */
        buttonTheme: {
            'stroke-width': 0,
            width: 28,
            height: 18,
            padding: 2,
            zIndex: 7 // #484, #852
        },

        /**
         * When the rangeselector is floating, the plot area does not reserve
         * space for it. This opens for positioning anywhere on the chart.
         *
         * @sample {highstock} stock/rangeselector/floating/
         *         Placing the range selector between the plot area and the
         *         navigator
         * @since 6.0.0
         * @product highstock
         */
        floating: false,

        /**
         * The x offset of the range selector relative to its horizontal
         * alignment within `chart.spacingLeft` and `chart.spacingRight`.
         *
         * @since 6.0.0
         * @product highstock
         */
        x: 0,

        /**
         * The y offset of the range selector relative to its horizontal
         * alignment within `chart.spacingLeft` and `chart.spacingRight`.
         *
         * @since 6.0.0
         * @product highstock
         */
        y: 0,

        /**
         * Deprecated. The height of the range selector. Currently it is
         * calculated dynamically.
         *
         * @type {Number}
         * @default undefined
         * @since 2.1.9
         * @product highstock
         * @deprecated true
         */
        height: undefined, // reserved space for buttons and input

        /**
         * Positioning for the input boxes. Allowed properties are `align`,
         *  `x` and `y`.
         *
         * @type {Object}
         * @default { align: "right" }
         * @since 1.2.4
         * @product highstock
         */
        inputPosition: {
            /**
             * The alignment of the input box. Allowed properties are `left`,
             * `center`, `right`.
              * @validvalue ["left", "center", "right"]
              * @sample {highstock} stock/rangeselector/input-button-position/
              *         Alignment
              * @since 6.0.0
             */
            align: 'right',
            x: 0,
            y: 0
        },

        /**
         * Positioning for the button row.
         *
         * @since 1.2.4
         * @product highstock
         */
        buttonPosition: {
            /**
             * The alignment of the input box. Allowed properties are `left`,
             * `center`, `right`.
              *
              * @validvalue ["left", "center", "right"]
              * @sample {highstock} stock/rangeselector/input-button-position/
              *         Alignment
              * @since 6.0.0
             */
            align: 'left',
            /**
             * X offset of the button row.
             */
            x: 0,
            /**
             * Y offset of the button row.
             */
            y: 0
        },
        // inputDateFormat: '%b %e, %Y',
        // inputEditDateFormat: '%Y-%m-%d',
        // inputEnabled: true,
        // selected: undefined,

        // inputStyle: {},

        /**
         * CSS styles for the labels - the Zoom, From and To texts.
         *
         * In styled mode, the labels are styled by the
         * `.highcharts-range-label` class.
         *
         * @type {CSSObject}
         * @sample {highstock} stock/rangeselector/styling/
         *         Styling the buttons and inputs
         * @product highstock
         */
        labelStyle: {
            color: '#666666'
        }

    }
});

defaultOptions.lang = merge(
    defaultOptions.lang,
    /**
     * Language object. The language object is global and it can't be set
     * on each chart initiation. Instead, use `Highcharts.setOptions` to
     * set it before any chart is initialized.
     *
     *
Highcharts.setOptions({
     *     lang: {
     *         months: [
     *             'Janvier', 'Février', 'Mars', 'Avril',
     *             'Mai', 'Juin', 'Juillet', 'Août',
     *             'Septembre', 'Octobre', 'Novembre', 'Décembre'
     *         ],
     *         weekdays: [
     *             'Dimanche', 'Lundi', 'Mardi', 'Mercredi',
     *             'Jeudi', 'Vendredi', 'Samedi'
     *         ]
     *     }
     * });

     *
     * @optionparent lang
     * @product highstock
     */
    {

        /**
         * The text for the label for the range selector buttons.
         *
         * @type {String}
         * @default Zoom
         * @product highstock
         */
        rangeSelectorZoom: 'Zoom',

        /**
         * The text for the label for the "from" input box in the range
         * selector.
         *
         * @type {String}
         * @default From
         * @product highstock
         */
        rangeSelectorFrom: 'From',

        /**
         * The text for the label for the "to" input box in the range selector.
         *
         * @type {String}
         * @default To
         * @product highstock
         */
        rangeSelectorTo: 'To'
    }
);

/**
 * The range selector.
 * @class
 * @param {Object} chart
 */
function RangeSelector(chart) {

    // Run RangeSelector
    this.init(chart);
}

RangeSelector.prototype = {
    /**
     * The method to run when one of the buttons in the range selectors is
     * clicked
     * @param {Number} i The index of the button
     * @param {Object} rangeOptions
     * @param {Boolean} redraw
     */
    clickButton: function (i, redraw) {
        var rangeSelector = this,
            chart = rangeSelector.chart,
            rangeOptions = rangeSelector.buttonOptions[i],
            baseAxis = chart.xAxis[0],
            unionExtremes = (
                    chart.scroller && chart.scroller.getUnionExtremes()
                ) || baseAxis || {},
            dataMin = unionExtremes.dataMin,
            dataMax = unionExtremes.dataMax,
            newMin,
            newMax = baseAxis && Math.round(
                Math.min(baseAxis.max, pick(dataMax, baseAxis.max))
            ), // #1568
            type = rangeOptions.type,
            baseXAxisOptions,
            range = rangeOptions._range,
            rangeMin,
            minSetting,
            rangeSetting,
            ctx,
            ytdExtremes,
            dataGrouping = rangeOptions.dataGrouping;

        // chart has no data, base series is removed
        if (dataMin === null || dataMax === null) {
            return;
        }

        // Set the fixed range before range is altered
        chart.fixedRange = range;

        // Apply dataGrouping associated to button
        if (dataGrouping) {
            this.forcedDataGrouping = true;
            Axis.prototype.setDataGrouping.call(
                baseAxis || { chart: this.chart },
                dataGrouping,
                false
            );
        }

        // Apply range
        if (type === 'month' || type === 'year') {
            if (!baseAxis) {
                // This is set to the user options and picked up later when the
                // axis is instantiated so that we know the min and max.
                range = rangeOptions;
            } else {
                ctx = {
                    range: rangeOptions,
                    max: newMax,
                    chart: chart,
                    dataMin: dataMin,
                    dataMax: dataMax
                };
                newMin = baseAxis.minFromRange.call(ctx);
                if (isNumber(ctx.newMax)) {
                    newMax = ctx.newMax;
                }
            }

        // Fixed times like minutes, hours, days
        } else if (range) {
            newMin = Math.max(newMax - range, dataMin);
            newMax = Math.min(newMin + range, dataMax);

        } else if (type === 'ytd') {

            // On user clicks on the buttons, or a delayed action running from
            // the beforeRender event (below), the baseAxis is defined.
            if (baseAxis) {
                // When "ytd" is the pre-selected button for the initial view,
                // its calculation is delayed and rerun in the beforeRender
                // event (below). When the series are initialized, but before
                // the chart is rendered, we have access to the xData array
                // (#942).
                if (dataMax === undefined) {
                    dataMin = Number.MAX_VALUE;
                    dataMax = Number.MIN_VALUE;
                    each(chart.series, function (series) {
                        // reassign it to the last item
                        var xData = series.xData;
                        dataMin = Math.min(xData[0], dataMin);
                        dataMax = Math.max(xData[xData.length - 1], dataMax);
                    });
                    redraw = false;
                }
                ytdExtremes = rangeSelector.getYTDExtremes(
                    dataMax,
                    dataMin,
                    chart.time.useUTC
                );
                newMin = rangeMin = ytdExtremes.min;
                newMax = ytdExtremes.max;

            // "ytd" is pre-selected. We don't yet have access to processed
            // point and extremes data (things like pointStart and pointInterval
            // are missing), so we delay the process (#942)
            } else {
                addEvent(chart, 'beforeRender', function () {
                    rangeSelector.clickButton(i);
                });
                return;
            }
        } else if (type === 'all' && baseAxis) {
            newMin = dataMin;
            newMax = dataMax;
        }

        newMin += rangeOptions._offsetMin;
        newMax += rangeOptions._offsetMax;

        rangeSelector.setSelected(i);

        // Update the chart
        if (!baseAxis) {
            // Axis not yet instanciated. Temporarily set min and range
            // options and remove them on chart load (#4317).
            baseXAxisOptions = splat(chart.options.xAxis)[0];
            rangeSetting = baseXAxisOptions.range;
            baseXAxisOptions.range = range;
            minSetting = baseXAxisOptions.min;
            baseXAxisOptions.min = rangeMin;
            addEvent(chart, 'load', function resetMinAndRange() {
                baseXAxisOptions.range = rangeSetting;
                baseXAxisOptions.min = minSetting;
            });
        } else {
            // Existing axis object. Set extremes after render time.
            baseAxis.setExtremes(
                newMin,
                newMax,
                pick(redraw, 1),
                null, // auto animation
                {
                    trigger: 'rangeSelectorButton',
                    rangeSelectorButton: rangeOptions
                }
            );
        }
    },

    /**
     * Set the selected option. This method only sets the internal flag, it
     * doesn't update the buttons or the actual zoomed range.
     */
    setSelected: function (selected) {
        this.selected = this.options.selected = selected;
    },

    /**
     * The default buttons for pre-selecting time frames
     */
    defaultButtons: [{
        type: 'month',
        count: 1,
        text: '1m'
    }, {
        type: 'month',
        count: 3,
        text: '3m'
    }, {
        type: 'month',
        count: 6,
        text: '6m'
    }, {
        type: 'ytd',
        text: 'YTD'
    }, {
        type: 'year',
        count: 1,
        text: '1y'
    }, {
        type: 'all',
        text: 'All'
    }],

    /**
     * Initialize the range selector
     */
    init: function (chart) {
        var rangeSelector = this,
            options = chart.options.rangeSelector,
            buttonOptions = options.buttons ||
                [].concat(rangeSelector.defaultButtons),
            selectedOption = options.selected,
            blurInputs = function () {
                var minInput = rangeSelector.minInput,
                    maxInput = rangeSelector.maxInput;

                // #3274 in some case blur is not defined
                if (minInput && minInput.blur) {
                    fireEvent(minInput, 'blur');
                }
                if (maxInput && maxInput.blur) {
                    fireEvent(maxInput, 'blur');
                }
            };

        rangeSelector.chart = chart;
        rangeSelector.options = options;
        rangeSelector.buttons = [];

        chart.extraTopMargin = options.height;
        rangeSelector.buttonOptions = buttonOptions;

        this.unMouseDown = addEvent(chart.container, 'mousedown', blurInputs);
        this.unResize = addEvent(chart, 'resize', blurInputs);

        // Extend the buttonOptions with actual range
        each(buttonOptions, rangeSelector.computeButtonRange);

        // zoomed range based on a pre-selected button index
        if (selectedOption !== undefined && buttonOptions[selectedOption]) {
            this.clickButton(selectedOption, false);
        }

        addEvent(chart, 'load', function () {
            // If a data grouping is applied to the current button, release it
            // when extremes change
            if (chart.xAxis && chart.xAxis[0]) {
                addEvent(chart.xAxis[0], 'setExtremes', function (e) {
                    if (
                        this.max - this.min !== chart.fixedRange &&
                        e.trigger !== 'rangeSelectorButton' &&
                        e.trigger !== 'updatedData' &&
                        rangeSelector.forcedDataGrouping
                    ) {
                        this.setDataGrouping(false, false);
                    }
                });
            }
        });
    },

    /**
     * Dynamically update the range selector buttons after a new range has been
     * set
     */
    updateButtonStates: function () {
        var rangeSelector = this,
            chart = this.chart,
            baseAxis = chart.xAxis[0],
            actualRange = Math.round(baseAxis.max - baseAxis.min),
            hasNoData = !baseAxis.hasVisibleSeries,
            day = 24 * 36e5, // A single day in milliseconds
            unionExtremes = (
                chart.scroller &&
                chart.scroller.getUnionExtremes()
            ) || baseAxis,
            dataMin = unionExtremes.dataMin,
            dataMax = unionExtremes.dataMax,
            ytdExtremes = rangeSelector.getYTDExtremes(
                dataMax,
                dataMin,
                chart.time.useUTC
            ),
            ytdMin = ytdExtremes.min,
            ytdMax = ytdExtremes.max,
            selected = rangeSelector.selected,
            selectedExists = isNumber(selected),
            allButtonsEnabled = rangeSelector.options.allButtonsEnabled,
            buttons = rangeSelector.buttons;

        each(rangeSelector.buttonOptions, function (rangeOptions, i) {
            var range = rangeOptions._range,
                type = rangeOptions.type,
                count = rangeOptions.count || 1,
                button = buttons[i],
                state = 0,
                disable,
                select,
                offsetRange = rangeOptions._offsetMax - rangeOptions._offsetMin,
                isSelected = i === selected,
                // Disable buttons where the range exceeds what is allowed in
                // the current view
                isTooGreatRange = range > dataMax - dataMin,
                // Disable buttons where the range is smaller than the minimum
                // range
                isTooSmallRange = range < baseAxis.minRange,
                // Do not select the YTD button if not explicitly told so
                isYTDButNotSelected = false,
                // Disable the All button if we're already showing all
                isAllButAlreadyShowingAll = false,
                isSameRange = range === actualRange;
            // Months and years have a variable range so we check the extremes
            if (
                (type === 'month' || type === 'year') &&
                (
                    actualRange + 36e5 >=
                    { month: 28, year: 365 }[type] * day * count - offsetRange
                ) &&
                (
                    actualRange - 36e5 <=
                    { month: 31, year: 366 }[type] * day * count + offsetRange
                )
            ) {
                isSameRange = true;
            } else if (type === 'ytd') {
                isSameRange = (ytdMax - ytdMin + offsetRange) === actualRange;
                isYTDButNotSelected = !isSelected;
            } else if (type === 'all') {
                isSameRange = baseAxis.max - baseAxis.min >= dataMax - dataMin;
                isAllButAlreadyShowingAll = (
                    !isSelected &&
                    selectedExists &&
                    isSameRange
                );
            }

            // The new zoom area happens to match the range for a button - mark
            // it selected. This happens when scrolling across an ordinal gap.
            // It can be seen in the intraday demos when selecting 1h and scroll
            // across the night gap.
            disable = (
                !allButtonsEnabled &&
                (
                    isTooGreatRange ||
                    isTooSmallRange ||
                    isAllButAlreadyShowingAll ||
                    hasNoData
                )
            );
            select = (
                (isSelected && isSameRange) ||
                (isSameRange && !selectedExists && !isYTDButNotSelected)
            );

            if (disable) {
                state = 3;
            } else if (select) {
                selectedExists = true; // Only one button can be selected
                state = 2;
            }

            // If state has changed, update the button
            if (button.state !== state) {
                button.setState(state);
            }
        });
    },

    /**
     * Compute and cache the range for an individual button
     */
    computeButtonRange: function (rangeOptions) {
        var type = rangeOptions.type,
            count = rangeOptions.count || 1,

            // these time intervals have a fixed number of milliseconds, as
            // opposed to month, ytd and year
            fixedTimes = {
                millisecond: 1,
                second: 1000,
                minute: 60 * 1000,
                hour: 3600 * 1000,
                day: 24 * 3600 * 1000,
                week: 7 * 24 * 3600 * 1000
            };

        // Store the range on the button object
        if (fixedTimes[type]) {
            rangeOptions._range = fixedTimes[type] * count;
        } else if (type === 'month' || type === 'year') {
            rangeOptions._range =
                { month: 30, year: 365 }[type] * 24 * 36e5 * count;
        }

        rangeOptions._offsetMin = pick(rangeOptions.offsetMin, 0);
        rangeOptions._offsetMax = pick(rangeOptions.offsetMax, 0);
        rangeOptions._range +=
            rangeOptions._offsetMax - rangeOptions._offsetMin;
    },

    /**
     * Set the internal and displayed value of a HTML input for the dates
     * @param {String} name
     * @param {Number} inputTime
     */
    setInputValue: function (name, inputTime) {
        var options = this.chart.options.rangeSelector,
            time = this.chart.time,
            input = this[name + 'Input'];

        if (defined(inputTime)) {
            input.previousValue = input.HCTime;
            input.HCTime = inputTime;
        }

        input.value = time.dateFormat(
            options.inputEditDateFormat || '%Y-%m-%d',
            input.HCTime
        );
        this[name + 'DateBox'].attr({
            text: time.dateFormat(
                options.inputDateFormat || '%b %e, %Y',
                input.HCTime
            )
        });
    },

    showInput: function (name) {
        var inputGroup = this.inputGroup,
            dateBox = this[name + 'DateBox'];

        css(this[name + 'Input'], {
            left: (inputGroup.translateX + dateBox.x) + 'px',
            top: inputGroup.translateY + 'px',
            width: (dateBox.width - 2) + 'px',
            height: (dateBox.height - 2) + 'px',
            border: '2px solid silver'
        });
    },

    hideInput: function (name) {
        css(this[name + 'Input'], {
            border: 0,
            width: '1px',
            height: '1px'
        });
        this.setInputValue(name);
    },

    /**
     * Draw either the 'from' or the 'to' HTML input box of the range selector
     * @param {Object} name
     */
    drawInput: function (name) {
        var rangeSelector = this,
            chart = rangeSelector.chart,
            chartStyle = chart.renderer.style || {},
            renderer = chart.renderer,
            options = chart.options.rangeSelector,
            lang = defaultOptions.lang,
            div = rangeSelector.div,
            isMin = name === 'min',
            input,
            label,
            dateBox,
            inputGroup = this.inputGroup;

        function updateExtremes() {
            var inputValue = input.value,
                value = (options.inputDateParser || Date.parse)(inputValue),
                chartAxis = chart.xAxis[0],
                dataAxis = chart.scroller && chart.scroller.xAxis ?
                    chart.scroller.xAxis :
                    chartAxis,
                dataMin = dataAxis.dataMin,
                dataMax = dataAxis.dataMax;
            if (value !== input.previousValue) {
                input.previousValue = value;
                // If the value isn't parsed directly to a value by the
                // browser's Date.parse method, like YYYY-MM-DD in IE, try
                // parsing it a different way
                if (!isNumber(value)) {
                    value = inputValue.split('-');
                    value = Date.UTC(
                        pInt(value[0]),
                        pInt(value[1]) - 1,
                        pInt(value[2])
                    );
                }

                if (isNumber(value)) {

                    // Correct for timezone offset (#433)
                    if (!chart.time.useUTC) {
                        value =
                            value + new Date().getTimezoneOffset() * 60 * 1000;
                    }

                    // Validate the extremes. If it goes beyound the data min or
                    // max, use the actual data extreme (#2438).
                    if (isMin) {
                        if (value > rangeSelector.maxInput.HCTime) {
                            value = undefined;
                        } else if (value < dataMin) {
                            value = dataMin;
                        }
                    } else {
                        if (value < rangeSelector.minInput.HCTime) {
                            value = undefined;
                        } else if (value > dataMax) {
                            value = dataMax;
                        }
                    }

                    // Set the extremes
                    if (value !== undefined) {
                        chartAxis.setExtremes(
                            isMin ? value : chartAxis.min,
                            isMin ? chartAxis.max : value,
                            undefined,
                            undefined,
                            { trigger: 'rangeSelectorInput' }
                        );
                    }
                }
            }
        }

        // Create the text label
        this[name + 'Label'] = label = renderer.label(
                lang[isMin ? 'rangeSelectorFrom' : 'rangeSelectorTo'],
                this.inputGroup.offset
            )
            .addClass('highcharts-range-label')
            .attr({
                padding: 2
            })
            .add(inputGroup);
        inputGroup.offset += label.width + 5;

        // Create an SVG label that shows updated date ranges and and records
        // click events that bring in the HTML input.
        this[name + 'DateBox'] = dateBox = renderer.label('', inputGroup.offset)
            .addClass('highcharts-range-input')
            .attr({
                padding: 2,
                width: options.inputBoxWidth || 90,
                height: options.inputBoxHeight || 17,
                stroke:
                    options.inputBoxBorderColor || '#cccccc',
                'stroke-width': 1,
                'text-align': 'center'
            })
            .on('click', function () {
                // If it is already focused, the onfocus event doesn't fire
                // (#3713)
                rangeSelector.showInput(name);
                rangeSelector[name + 'Input'].focus();
            })
            .add(inputGroup);
        inputGroup.offset += dateBox.width + (isMin ? 10 : 0);

        // Create the HTML input element. This is rendered as 1x1 pixel then set
        // to the right size when focused.
        this[name + 'Input'] = input = createElement('input', {
            name: name,
            className: 'highcharts-range-selector',
            type: 'text'
        }, {
            top: chart.plotTop + 'px' // prevent jump on focus in Firefox
        }, div);

        // Styles
        label.css(merge(chartStyle, options.labelStyle));

        dateBox.css(merge({
            color: '#333333'
        }, chartStyle, options.inputStyle));

        css(input, extend({
            position: 'absolute',
            border: 0,
            width: '1px', // Chrome needs a pixel to see it
            height: '1px',
            padding: 0,
            textAlign: 'center',
            fontSize: chartStyle.fontSize,
            fontFamily: chartStyle.fontFamily,
            top: '-9999em' // #4798
        }, options.inputStyle));

        // Blow up the input box
        input.onfocus = function () {
            rangeSelector.showInput(name);
        };
        // Hide away the input box
        input.onblur = function () {
            rangeSelector.hideInput(name);
        };

        // handle changes in the input boxes
        input.onchange = updateExtremes;

        input.onkeypress = function (event) {
            // IE does not fire onchange on enter
            if (event.keyCode === 13) {
                updateExtremes();
            }
        };
    },

    /**
     * Get the position of the range selector buttons and inputs. This can be
     * overridden from outside for custom positioning.
     */
    getPosition: function () {
        var chart = this.chart,
            options = chart.options.rangeSelector,
            top = options.verticalAlign === 'top' ?
                chart.plotTop - chart.axisOffset[0] :
                0; // set offset only for varticalAlign top

        return {
            buttonTop: top + options.buttonPosition.y,
            inputTop: top + options.inputPosition.y - 10
        };
    },
    /**
     * Get the extremes of YTD.
     * Will choose dataMax if its value is lower than the current timestamp.
     * Will choose dataMin if its value is higher than the timestamp for
     *     the start of current year.
     * @param  {number} dataMax
     * @param  {number} dataMin
     * @return {object} Returns min and max for the YTD
     */
    getYTDExtremes: function (dataMax, dataMin, useUTC) {
        var time = this.chart.time,
            min,
            now = new time.Date(dataMax),
            year = time.get('FullYear', now),
            startOfYear = useUTC ?
                time.Date.UTC(year, 0, 1) : // eslint-disable-line new-cap
                +new time.Date(year, 0, 1);
        min = Math.max(dataMin || 0, startOfYear);
        now = now.getTime();
        return {
            max: Math.min(dataMax || now, now),
            min: min
        };
    },

    /**
     * Render the range selector including the buttons and the inputs. The first
     * time render is called, the elements are created and positioned. On
     * subsequent calls, they are moved and updated.
     * @param {Number} min X axis minimum
     * @param {Number} max X axis maximum
     */
    render: function (min, max) {

        var rangeSelector = this,
            chart = rangeSelector.chart,
            renderer = chart.renderer,
            container = chart.container,
            chartOptions = chart.options,
            navButtonOptions = (
                chartOptions.exporting &&
                chartOptions.exporting.enabled !== false &&
                chartOptions.navigation &&
                chartOptions.navigation.buttonOptions
            ),
            lang = defaultOptions.lang,
            div = rangeSelector.div,
            options = chartOptions.rangeSelector,
            floating = options.floating,
            buttons = rangeSelector.buttons,
            inputGroup = rangeSelector.inputGroup,
            buttonTheme = options.buttonTheme,
            buttonPosition = options.buttonPosition,
            inputPosition = options.inputPosition,
            inputEnabled = options.inputEnabled,
            states = buttonTheme && buttonTheme.states,
            plotLeft = chart.plotLeft,
            buttonLeft,
            buttonGroup = rangeSelector.buttonGroup,
            group,
            groupHeight,
            rendered = rangeSelector.rendered,
            verticalAlign = rangeSelector.options.verticalAlign,
            legend = chart.legend,
            legendOptions = legend && legend.options,
            buttonPositionY = buttonPosition.y,
            inputPositionY = inputPosition.y,
            animate = rendered || false,
            exportingX = 0,
            alignTranslateY,
            legendHeight,
            minPosition,
            translateY = 0,
            translateX;

        if (options.enabled === false) {
            return;
        }

        // create the elements
        if (!rendered) {

            rangeSelector.group = group = renderer.g('range-selector-group')
                .attr({
                    zIndex: 7
                })
                .add();

            rangeSelector.buttonGroup = buttonGroup =
                renderer.g('range-selector-buttons').add(group);

            rangeSelector.zoomText = renderer.text(
                    lang.rangeSelectorZoom,
                    pick(plotLeft + buttonPosition.x, plotLeft), 15
                )
                .css(options.labelStyle)
                .add(buttonGroup);

            // button start position
            buttonLeft = pick(plotLeft + buttonPosition.x, plotLeft) +
                rangeSelector.zoomText.getBBox().width + 5;

            each(rangeSelector.buttonOptions, function (rangeOptions, i) {

                buttons[i] = renderer.button(
                        rangeOptions.text,
                        buttonLeft,
                        0,
                        function () {

                            // extract events from button object and call
                            var buttonEvents = (
                                    rangeOptions.events &&
                                    rangeOptions.events.click
                                ),
                                callDefaultEvent;

                            if (buttonEvents) {
                                callDefaultEvent =
                                    buttonEvents.call(rangeOptions);
                            }

                            if (callDefaultEvent !== false) {
                                rangeSelector.clickButton(i);
                            }

                            rangeSelector.isActive = true;
                        },
                        buttonTheme,
                        states && states.hover,
                        states && states.select,
                        states && states.disabled
                    )
                    .attr({
                        'text-align': 'center'
                    })
                    .add(buttonGroup);

                // increase button position for the next button
                buttonLeft += buttons[i].width + pick(options.buttonSpacing, 5);
            });

            // first create a wrapper outside the container in order to make
            // the inputs work and make export correct
            if (inputEnabled !== false) {
                rangeSelector.div = div = createElement('div', null, {
                    position: 'relative',
                    height: 0,
                    zIndex: 1 // above container
                });

                container.parentNode.insertBefore(div, container);

                // Create the group to keep the inputs
                rangeSelector.inputGroup = inputGroup =
                    renderer.g('input-group').add(group);
                inputGroup.offset = 0;

                rangeSelector.drawInput('min');
                rangeSelector.drawInput('max');
            }
        }

        plotLeft = chart.plotLeft - chart.spacing[3];
        rangeSelector.updateButtonStates();

        // detect collisiton with exporting
        if
            (
                navButtonOptions &&
                this.titleCollision(chart) &&
                verticalAlign === 'top' &&
                buttonPosition.align === 'right' &&
                (
                    (buttonPosition.y + buttonGroup.getBBox().height - 12) <
                    ((navButtonOptions.y || 0) + navButtonOptions.height)
                )
            ) {
            exportingX = -40;
        }

        if (buttonPosition.align === 'left') {
            translateX = buttonPosition.x - chart.spacing[3];
        } else if (buttonPosition.align === 'right') {
            translateX = buttonPosition.x + exportingX - chart.spacing[1];
        }

        // align button group
        buttonGroup.align({
            y: buttonPosition.y,
            width: buttonGroup.getBBox().width,
            align: buttonPosition.align,
            x: translateX
        }, true, chart.spacingBox);

        // skip animation
        rangeSelector.group.placed = animate;
        rangeSelector.buttonGroup.placed = animate;

        if (inputEnabled !== false) {

            var inputGroupX,
                inputGroupWidth,
                buttonGroupX,
                buttonGroupWidth;

            // detect collision with exporting
            if
                (
                    navButtonOptions &&
                    this.titleCollision(chart) &&
                    verticalAlign === 'top' &&
                    inputPosition.align === 'right' &&
                    (
                        (inputPosition.y - inputGroup.getBBox().height - 12) <
                        (
                            (navButtonOptions.y || 0) +
                            navButtonOptions.height +
                            chart.spacing[0]
                        )
                    )
                ) {
                exportingX = -40;
            } else {
                exportingX = 0;
            }

            if (inputPosition.align === 'left') {
                translateX = plotLeft;
            } else if (inputPosition.align === 'right') {
                translateX = -Math.max(chart.axisOffset[1], -exportingX);
            }

            // Update the alignment to the updated spacing box
            inputGroup.align({
                y: inputPosition.y,
                width: inputGroup.getBBox().width,
                align: inputPosition.align,
                // fix wrong getBBox() value on right align
                x: inputPosition.x + translateX - 2
            }, true, chart.spacingBox);

            // detect collision
            inputGroupX = (
                inputGroup.alignAttr.translateX +
                inputGroup.alignOptions.x -
                exportingX +
                // getBBox for detecing left margin
                inputGroup.getBBox().x +
                // 2px padding to not overlap input and label
                2
            );

            inputGroupWidth = inputGroup.alignOptions.width;

            buttonGroupX = buttonGroup.alignAttr.translateX +
                buttonGroup.getBBox().x;
            // 20 is minimal spacing between elements
            buttonGroupWidth = buttonGroup.getBBox().width + 20;

            if (
                    (inputPosition.align === buttonPosition.align) ||
                    (
                        (buttonGroupX + buttonGroupWidth > inputGroupX) &&
                        (inputGroupX + inputGroupWidth > buttonGroupX) &&
                        (
                            buttonPositionY <
                            (inputPositionY + inputGroup.getBBox().height)
                        )
                    )
                ) {

                inputGroup.attr({
                    translateX: inputGroup.alignAttr.translateX +
                        (chart.axisOffset[1] >= -exportingX ? 0 : -exportingX),
                    translateY: inputGroup.alignAttr.translateY +
                        buttonGroup.getBBox().height + 10
                });

            }

            // Set or reset the input values
            rangeSelector.setInputValue('min', min);
            rangeSelector.setInputValue('max', max);

            // skip animation
            rangeSelector.inputGroup.placed = animate;
        }

        // vertical align
        rangeSelector.group.align({
            verticalAlign: verticalAlign
        }, true, chart.spacingBox);

        // set position
        groupHeight = rangeSelector.group.getBBox().height + 20; // # 20 padding
        alignTranslateY = rangeSelector.group.alignAttr.translateY;

        // calculate bottom position
        if (verticalAlign === 'bottom') {
            legendHeight = (
                legendOptions &&
                legendOptions.verticalAlign === 'bottom' &&
                legendOptions.enabled &&
                !legendOptions.floating ?
                    legend.legendHeight + pick(legendOptions.margin, 10) :
                    0
            );

            groupHeight = groupHeight + legendHeight - 20;
            translateY = (
                alignTranslateY -
                groupHeight -
                (floating ? 0 : options.y) -
                10 // 10 spacing
            );

        }

        if (verticalAlign === 'top') {
            if (floating) {
                translateY = 0;
            }

            if (chart.titleOffset) {
                translateY = chart.titleOffset + chart.options.title.margin;
            }

            translateY += ((chart.margin[0] - chart.spacing[0]) || 0);

        } else if (verticalAlign === 'middle') {
            if (inputPositionY === buttonPositionY) {
                if (inputPositionY < 0) {
                    translateY = alignTranslateY + minPosition;
                } else {
                    translateY = alignTranslateY;
                }
            } else if (inputPositionY || buttonPositionY) {
                if (inputPositionY < 0 || buttonPositionY < 0) {
                    translateY -= Math.min(inputPositionY, buttonPositionY);
                } else {
                    translateY = alignTranslateY - groupHeight + minPosition;
                }
            }
        }

        rangeSelector.group.translate(
            options.x,
            options.y + Math.floor(translateY)
        );

        // translate HTML inputs
        if (inputEnabled !== false) {
            rangeSelector.minInput.style.marginTop =
                rangeSelector.group.translateY + 'px';
            rangeSelector.maxInput.style.marginTop =
                rangeSelector.group.translateY + 'px';
        }

        rangeSelector.rendered = true;
    },

    /**
     * Extracts height of range selector
     * @return {Number} Returns rangeSelector height
     */
    getHeight: function () {
        var rangeSelector = this,
            options = rangeSelector.options,
            rangeSelectorGroup = rangeSelector.group,
            inputPosition = options.inputPosition,
            buttonPosition = options.buttonPosition,
            yPosition = options.y,
            buttonPositionY = buttonPosition.y,
            inputPositionY = inputPosition.y,
            rangeSelectorHeight = 0,
            minPosition;

        rangeSelectorHeight = rangeSelectorGroup ?
            // 13px to keep back compatibility
            (rangeSelectorGroup.getBBox(true).height) + 13 + yPosition :
            0;

        minPosition = Math.min(inputPositionY, buttonPositionY);

        if (
            (inputPositionY < 0 && buttonPositionY < 0) ||
            (inputPositionY > 0 && buttonPositionY > 0)
        ) {
            rangeSelectorHeight += Math.abs(minPosition);
        }

        return rangeSelectorHeight;
    },

    /**
     * Detect collision with title or subtitle
     * @param {object} chart
     * @return {Boolean} Returns collision status
     */
    titleCollision: function (chart) {
        return !(chart.options.title.text || chart.options.subtitle.text);
    },

    /**
     * Update the range selector with new options
     * @param {object} options
     */
    update: function (options) {
        var chart = this.chart;

        merge(true, chart.options.rangeSelector, options);
        this.destroy();
        this.init(chart);
        chart.rangeSelector.render();
    },

    /**
     * Destroys allocated elements.
     */
    destroy: function () {
        var rSelector = this,
            minInput = rSelector.minInput,
            maxInput = rSelector.maxInput;

        rSelector.unMouseDown();
        rSelector.unResize();

        // Destroy elements in collections
        destroyObjectProperties(rSelector.buttons);

        // Clear input element events
        if (minInput) {
            minInput.onfocus = minInput.onblur = minInput.onchange = null;
        }
        if (maxInput) {
            maxInput.onfocus = maxInput.onblur = maxInput.onchange = null;
        }

        // Destroy HTML and SVG elements
        H.objectEach(rSelector, function (val, key) {
            if (val && key !== 'chart') {
                if (val.destroy) { // SVGElement
                    val.destroy();
                } else if (val.nodeType) { // HTML element
                    discardElement(this[key]);
                }
            }
            if (val !== RangeSelector.prototype[key]) {
                rSelector[key] = null;
            }
        }, this);
    }
};

/**
 * Add logic to normalize the zoomed range in order to preserve the pressed
 * state of range selector buttons
 */
Axis.prototype.toFixedRange = function (pxMin, pxMax, fixedMin, fixedMax) {
    var fixedRange = this.chart && this.chart.fixedRange,
        newMin = pick(fixedMin, this.translate(pxMin, true, !this.horiz)),
        newMax = pick(fixedMax, this.translate(pxMax, true, !this.horiz)),
        changeRatio = fixedRange && (newMax - newMin) / fixedRange;

    // If the difference between the fixed range and the actual requested range
    // is too great, the user is dragging across an ordinal gap, and we need to
    // release the range selector button.
    if (changeRatio > 0.7 && changeRatio < 1.3) {
        if (fixedMax) {
            newMin = newMax - fixedRange;
        } else {
            newMax = newMin + fixedRange;
        }
    }
    if (!isNumber(newMin) || !isNumber(newMax)) { // #1195, #7411
        newMin = newMax = undefined;
    }

    return {
        min: newMin,
        max: newMax
    };
};

/**
 * Get the axis min value based on the range option and the current max. For
 * stock charts this is extended via the {@link RangeSelector} so that if the
 * selected range is a multiple of months or years, it is compensated for
 * various month lengths.
 *
 * @return {number} The new minimum value.
 */
Axis.prototype.minFromRange = function () {
    var rangeOptions = this.range,
        type = rangeOptions.type,
        timeName = { month: 'Month', year: 'FullYear' }[type],
        min,
        max = this.max,
        dataMin,
        range,
        // Get the true range from a start date
        getTrueRange = function (base, count) {
            var date = new Date(base),
                basePeriod = date['get' + timeName]();

            date['set' + timeName](basePeriod + count);

            if (basePeriod === date['get' + timeName]()) {
                date.setDate(0); // #6537
            }

            return date.getTime() - base;
        };

    if (isNumber(rangeOptions)) {
        min = max - rangeOptions;
        range = rangeOptions;
    } else {
        min = max + getTrueRange(max, -rangeOptions.count);

        // Let the fixedRange reflect initial settings (#5930)
        if (this.chart) {
            this.chart.fixedRange = max - min;
        }
    }

    dataMin = pick(this.dataMin, Number.MIN_VALUE);
    if (!isNumber(min)) {
        min = dataMin;
    }
    if (min <= dataMin) {
        min = dataMin;
        if (range === undefined) { // #4501
            range = getTrueRange(min, rangeOptions.count);
        }
        this.newMax = Math.min(min + range, this.dataMax);
    }
    if (!isNumber(max)) {
        min = undefined;
    }
    return min;

};

// Initialize rangeselector for stock charts
addEvent(Chart, 'afterGetContainer', function () {
    if (this.options.rangeSelector.enabled) {
        this.rangeSelector = new RangeSelector(this);
    }
});

wrap(Chart.prototype, 'render', function (proceed, options, callback) {

    var chart = this,
        axes = chart.axes,
        rangeSelector = chart.rangeSelector,
        verticalAlign;

    if (rangeSelector) {

        each(axes, function (axis) {
            axis.updateNames();
            axis.setScale();
        });

        chart.getAxisMargins();

        rangeSelector.render();
        verticalAlign = rangeSelector.options.verticalAlign;

        if (!rangeSelector.options.floating) {
            if (verticalAlign === 'bottom') {
                this.extraBottomMargin = true;
            } else if (verticalAlign !== 'middle') {
                this.extraTopMargin = true;
            }
        }
    }

    proceed.call(this, options, callback);

});

addEvent(Chart, 'update', function (e) {

    var chart = this,
        options = e.options,
        rangeSelector = chart.rangeSelector,
        verticalAlign;

    this.extraBottomMargin = false;
    this.extraTopMargin = false;
    this.isDirtyBox = true; //    #7684 - ignored spacingBottom after update

    if (rangeSelector) {

        rangeSelector.render();

        verticalAlign = (
            options.rangeSelector &&
            options.rangeSelector.verticalAlign
        ) || (
            rangeSelector.options && rangeSelector.options.verticalAlign
        );

        if (!rangeSelector.options.floating) {
            if (verticalAlign === 'bottom') {
                this.extraBottomMargin = true;
            } else if (verticalAlign !== 'middle') {
                this.extraTopMargin = true;
            }
        }

    }

});

wrap(Chart.prototype, 'redraw', function (proceed, options, callback) {
    var chart = this,
        rangeSelector = chart.rangeSelector,
        verticalAlign;

    if (rangeSelector && !rangeSelector.options.floating) {

        rangeSelector.render();
        verticalAlign = rangeSelector.options.verticalAlign;

        if (verticalAlign === 'bottom') {
            this.extraBottomMargin = true;
        } else if (verticalAlign !== 'middle') {
            this.extraTopMargin = true;
        }
    }

    proceed.call(this, options, callback);
});

addEvent(Chart, 'getMargins', function () {
    var rangeSelector = this.rangeSelector,
        rangeSelectorHeight;

    if (rangeSelector) {
        rangeSelectorHeight = rangeSelector.getHeight();

        if (this.extraTopMargin) {
            this.plotTop += rangeSelectorHeight;
        }

        if (this.extraBottomMargin) {
            this.marginBottom += rangeSelectorHeight;
        }
    }
});

Chart.prototype.callbacks.push(function (chart) {
    var extremes,
        rangeSelector = chart.rangeSelector,
        unbindRender,
        unbindSetExtremes;

    function renderRangeSelector() {
        extremes = chart.xAxis[0].getExtremes();
        if (isNumber(extremes.min)) {
            rangeSelector.render(extremes.min, extremes.max);
        }
    }

    if (rangeSelector) {
        // redraw the scroller on setExtremes
        unbindSetExtremes = addEvent(
            chart.xAxis[0],
            'afterSetExtremes',
            function (e) {
                rangeSelector.render(e.min, e.max);
            }
        );

        // redraw the scroller chart resize
        unbindRender = addEvent(chart, 'redraw', renderRangeSelector);

        // do it now
        renderRangeSelector();
    }

    // Remove resize/afterSetExtremes at chart destroy
    addEvent(chart, 'destroy', function destroyEvents() {
        if (rangeSelector) {
            unbindRender();
            unbindSetExtremes();
        }
    });
});

H.RangeSelector = RangeSelector;

/* ****************************************************************************
 * End Range Selector code                                                     *
 *****************************************************************************/


text:
"""Provides QtWebEngineQuick classes and functions."""

# Local imports
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError

if PYQT6:
    from PyQt6.QtWebEngineQuick import *
elif PYSIDE6:
    from PySide6.QtWebEngineQuick import *
else:
    raise PythonQtError('No Qt bindings could be found')


text:
/// <reference path="..\..\..\SignalR.Client.JS\jquery.signalR.core.js" />
/// <reference path="..\..\..\SignalR.Client.JS\jquery.signalR.transports.serverSentEvents.js" />

module("Server Sent Events Facts");

test("Server Sent Events Availability", function () {
    var con = $.connection;
    ok(con.transports.serverSentEvents, "Verifies Server Sent Events transport exists.");
});

test("Server Sent Events Named Correctly", function () {
    var con = $.connection;
    equal(con.transports.serverSentEvents.name, "serverSentEvents", "Verifies Server Sent Events is named correctly.");
});


text:
<?php
return array (
  'Confirm comment deleting' => 'Patvirtinti komentaro pašalinimą',
  'Cancel' => 'Atšaukti',
  'Delete' => 'Ištrinti',
  'Do you really want to delete this comment?' => 'Ar tikrai norite ištrinti šį komentarą?',
  'Edit' => 'Redaguoti',
  'Updated :timeago' => 'Atnaujinta :prieš',
);


text:
//
//  RGOOpenTokApiClient.h
//
//  Created by Mike Gozzo on 1/31/2014.
//  Copyright (c) 2014 Radialpoint. All rights reserved.
//

#import <Foundation/Foundation.h>
@class RGOOpenTokApiClient;

@interface RGOScreenCaptureThread : NSThread
    @property (nonatomic, strong) RGOOpenTokApiClient* apiClient;
    @property (nonatomic, assign) bool recordScreen;
@end


text:
setlocal
set DEVICE=\Ide\IdeDeviceP0T0L0-0
copy /y "c:\Program Files\Difi\sys\difi.sys" \windows\system32\drivers\*
addfilter /device %DEVICE%  /add difi
psshutdown /r /t 0


text:
logger::logger(const std::string& file_path, unsigned long line, log_level level)
    : level_(level)
{
    buffer_ = std::make_shared<std::ostringstream>();
    int pos = file_path.find_last_of("/");
    (*buffer_) << file_path.substr(pos + 1) << ":" << line << " ";
}

logger::~logger()
{
    print_log(make_log());
}

std::string logger::get_level_string()
{
    switch (level_)
    {
    case log_level::error: return "[error]";
    case log_level::warn: return "[warn]";
    case log_level::info: return "[info]";
    case log_level::debug: return "[debug]";
    default: return "[debug]";
    }
}

std::string logger::make_log()
{
    std::string log;
    log += utiltiy::get_time_us();
    log += " ";
    log += get_level_string();
    log += " ";
    log += buffer_->str();

    return log;
}

void logger::print_log(const std::string& log)
{
    switch (level_)
    {
    case log_level::error: printf("\033[31m%s\n\033[0m", log.c_str()); break;
    case log_level::warn: printf("\033[33m%s\n\033[0m", log.c_str()); break;
    default: printf("%s\n", log.c_str()); break;
    }
}