text:
namespace autofill {

AutofillField::AutofillField() = default;

AutofillField::AutofillField(FieldSignature field_signature)
    : field_signature_(field_signature) {}

AutofillField::AutofillField(const FormFieldData& field)
    : FormFieldData(field),
      parseable_name_(field.name),
      parseable_label_(field.label) {
  field_signature_ =
      CalculateFieldSignatureByNameAndType(name, form_control_type);
}

AutofillField::~AutofillField() = default;

std::unique_ptr<AutofillField> AutofillField::CreateForPasswordManagerUpload(
    FieldSignature field_signature) {
  std::unique_ptr<AutofillField> field;
  field.reset(new AutofillField(field_signature));
  return field;
}

ServerFieldType AutofillField::server_type() const {
  return server_predictions_.empty()
             ? NO_SERVER_DATA
             : ToSafeServerFieldType(server_predictions_[0].type(),
                                     NO_SERVER_DATA);
}

bool AutofillField::server_type_prediction_is_override() const {
  return server_predictions_.empty() ? false
                                     : server_predictions_[0].override();
}

void AutofillField::set_heuristic_type(ServerFieldType type) {
  if (type >= 0 && type < MAX_VALID_FIELD_TYPE &&
      type != FIELD_WITH_DEFAULT_VALUE) {
    heuristic_type_ = type;
  } else {
    NOTREACHED();
    // This case should not be reachable; but since this has potential
    // implications on data uploaded to the server, better safe than sorry.
    heuristic_type_ = UNKNOWN_TYPE;
  }
  overall_type_ = AutofillType(NO_SERVER_DATA);
}

void AutofillField::add_possible_types_validities(
    const ServerFieldTypeValidityStateMap& possible_types_validities) {
  for (const auto& possible_type_validity : possible_types_validities) {
    possible_types_validities_[possible_type_validity.first].push_back(
        possible_type_validity.second);
  }
}

void AutofillField::set_server_predictions(
    std::vector<
        AutofillQueryResponse::FormSuggestion::FieldSuggestion::FieldPrediction>
        predictions) {
  server_predictions_ = std::move(predictions);
  overall_type_ = AutofillType(NO_SERVER_DATA);
  // Ensures that AutofillField::server_type() is a valid enum value.
  for (auto& prediction : server_predictions_) {
    prediction.set_type(
        ToSafeServerFieldType(prediction.type(), NO_SERVER_DATA));
  }
}

std::vector<AutofillDataModel::ValidityState>
AutofillField::get_validities_for_possible_type(ServerFieldType type) {
  if (possible_types_validities_.find(type) == possible_types_validities_.end())
    return {AutofillDataModel::UNVALIDATED};
  return possible_types_validities_[type];
}

void AutofillField::SetHtmlType(HtmlFieldType type, HtmlFieldMode mode) {
  html_type_ = type;
  html_mode_ = mode;
  overall_type_ = AutofillType(NO_SERVER_DATA);

  if (type == HTML_TYPE_TEL_LOCAL_PREFIX)
    phone_part_ = PHONE_PREFIX;
  else if (type == HTML_TYPE_TEL_LOCAL_SUFFIX)
    phone_part_ = PHONE_SUFFIX;
  else
    phone_part_ = IGNORED;
}

void AutofillField::SetTypeTo(const AutofillType& type) {
  DCHECK(type.GetStorableType() != NO_SERVER_DATA);
  overall_type_ = type;
}

AutofillType AutofillField::ComputedType() const {
  // If autocomplete=tel/tel-* and server confirms it really is a phone field,
  // we always user the server prediction as html types are not very reliable.
  if ((GroupTypeOfHtmlFieldType(html_type_, html_mode_) ==
           FieldTypeGroup::kPhoneBilling ||
       GroupTypeOfHtmlFieldType(html_type_, html_mode_) ==
           FieldTypeGroup::kPhoneHome) &&
      (GroupTypeOfServerFieldType(server_type()) ==
           FieldTypeGroup::kPhoneBilling ||
       GroupTypeOfServerFieldType(server_type()) ==
           FieldTypeGroup::kPhoneHome)) {
    return AutofillType(server_type());
  }

  // If the explicit type is cc-exp and either the server or heuristics agree on
  // a 2 vs 4 digit specialization of cc-exp, use that specialization.
  if (html_type_ == HTML_TYPE_CREDIT_CARD_EXP) {
    if (server_type() == CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR ||
        server_type() == CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR) {
      return AutofillType(server_type());
    }
    if (heuristic_type_ == CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR ||
        heuristic_type_ == CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR) {
      return AutofillType(heuristic_type_);
    }
  }

  // Use the html type specified by the website unless it is unrecognized and
  // autofill predicts a credit card type.
  if (html_type_ != HTML_TYPE_UNSPECIFIED &&
      !(html_type_ == HTML_TYPE_UNRECOGNIZED && IsCreditCardPrediction())) {
    return AutofillType(html_type_, html_mode_);
  }

  if (server_type() != NO_SERVER_DATA) {
    // Sometimes the server and heuristics disagree on whether a name field
    // should be associated with an address or a credit card. There was a
    // decision to prefer the heuristics in these cases, but it looks like
    // it might be better to fix this server-side.
    // See http://crbug.com/429236 for background.
    bool believe_server = !(server_type() == NAME_FULL &&
                            heuristic_type_ == CREDIT_CARD_NAME_FULL) &&
                          !(server_type() == CREDIT_CARD_NAME_FULL &&
                            heuristic_type_ == NAME_FULL) &&
                          !(server_type() == NAME_FIRST &&
                            heuristic_type_ == CREDIT_CARD_NAME_FIRST) &&
                          !(server_type() == NAME_LAST &&
                            heuristic_type_ == CREDIT_CARD_NAME_LAST);

    // Either way, retain a preference for the the CVC heuristic over the
    // server's password predictions (http://crbug.com/469007)
    believe_server =
        believe_server && !(AutofillType(server_type()).group() ==
                                FieldTypeGroup::kPasswordField &&
                            heuristic_type_ == CREDIT_CARD_VERIFICATION_CODE);

    // For new name tokens the heuristic predictions get precedence over the
    // server predictions.
    // TODO(crbug.com/1098943): Remove feature check once launched.
    believe_server =
        believe_server &&
        !(base::FeatureList::IsEnabled(
              features::kAutofillEnableSupportForMoreStructureInNames) &&
          (heuristic_type_ == NAME_LAST_SECOND ||
           heuristic_type_ == NAME_LAST_FIRST));

    // For new address tokens the heuristic predictions get precedence over the
    // server predictions.
    // TODO(crbug.com/1098943): Remove feature check once launched.
    believe_server =
        believe_server &&
        !(base::FeatureList::IsEnabled(
              features::kAutofillEnableSupportForMoreStructureInAddresses) &&
          (heuristic_type_ == ADDRESS_HOME_STREET_NAME ||
           heuristic_type_ == ADDRESS_HOME_HOUSE_NUMBER));

    believe_server =
        believe_server && !(heuristic_type_ == MERCHANT_PROMO_CODE);

    if (believe_server)
      return AutofillType(server_type());
  }

  return AutofillType(heuristic_type_);
}

AutofillType AutofillField::Type() const {
  // If the corresponding feature is enabled, server predictions that are an
  // override are granted precedence unconditionally.
  if (base::FeatureList::IsEnabled(
          features::kAutofillServerTypeTakesPrecedence) &&
      server_type_prediction_is_override() && server_type() != NO_SERVER_DATA) {
    return AutofillType(server_type());
  }

  if (overall_type_.GetStorableType() != NO_SERVER_DATA) {
    return overall_type_;
  }
  return ComputedType();
}

bool AutofillField::IsEmpty() const {
  return value.empty();
}

FieldSignature AutofillField::GetFieldSignature() const {
  return field_signature_
             ? *field_signature_
             : CalculateFieldSignatureByNameAndType(name, form_control_type);
}

std::string AutofillField::FieldSignatureAsStr() const {
  return base::NumberToString(GetFieldSignature().value());
}

bool AutofillField::IsFieldFillable() const {
  if (!base::FeatureList::IsEnabled(features::kAutofillFixFillableFieldTypes))
    return !Type().IsUnknown();

  ServerFieldType field_type = Type().GetStorableType();
  return IsFillableFieldType(field_type);
}

void AutofillField::SetPasswordRequirements(PasswordRequirementsSpec spec) {
  password_requirements_ = std::move(spec);
}

void AutofillField::NormalizePossibleTypesValidities() {
  for (auto possible_type : possible_types_) {
    if (possible_types_validities_[possible_type].empty()) {
      possible_types_validities_[possible_type].push_back(
          AutofillDataModel::UNVALIDATED);
    }
  }
}

bool AutofillField::IsCreditCardPrediction() const {
  return AutofillType(server_type()).group() == FieldTypeGroup::kCreditCard ||
         AutofillType(heuristic_type_).group() == FieldTypeGroup::kCreditCard;
}

}  // namespace autofill


text:
package com.streamsets.pipeline.stage.executor.jdbc;

import com.streamsets.pipeline.lib.event.EventCreator;

public final class JdbcQueryExecutorEvents {

    public static final String SUCCESSFUL_QUERY_EVENT = "successful-query";
    public static final String FAILED_QUERY_EVENT = "failed-query";

    public static final String QUERY_EVENT_FIELD = "query";
    public static final String QUERY_RESULT_FIELD = "query-result";
    public static final String UNEXECUTED_QUERIES_EVENT_FIELD = "unexecuted-queries";

    /**
     * Issued on every successful query execution
     */
    public static final EventCreator successfulQuery = new EventCreator.Builder(SUCCESSFUL_QUERY_EVENT, 1)
            .withRequiredField(QUERY_EVENT_FIELD)
            .withOptionalField(QUERY_RESULT_FIELD)
            .build();

    /**
     * Issued on every failed query execution
     * with an optional
     */
    public static final  EventCreator failedQuery = new EventCreator.Builder(FAILED_QUERY_EVENT, 1)
            .withRequiredField(QUERY_EVENT_FIELD)
            .withOptionalField(UNEXECUTED_QUERIES_EVENT_FIELD)
            .build();
}

redpajama_set_name: RedPajamaGithub


text:
package client

import (
	"strings"

	"github.com/opensds/opensds/pkg/model"
	"github.com/opensds/opensds/pkg/utils/urls"
)

// ProfileBuilder contains request body of handling a profile request.
// Currently it's assigned as the pointer of ProfileSpec struct, but it
// could be discussed if it's better to define an interface.
type ProfileBuilder *model.ProfileSpec

// CustomBuilder contains request body of handling a profile customized
// properties request.
// Currently it's assigned as the pointer of CustomPropertiesSpec struct, but it
// could be discussed if it's better to define an interface.
type CustomBuilder *model.CustomPropertiesSpec

// NewProfileMgr
func NewProfileMgr(r Receiver, edp string, tenantId string) *ProfileMgr {
	return &ProfileMgr{
		Receiver: r,
		Endpoint: edp,
		TenantId: tenantId,
	}
}

// ProfileMgr
type ProfileMgr struct {
	Receiver
	Endpoint string
	TenantId string
}

// CreateProfile
func (p *ProfileMgr) CreateProfile(body ProfileBuilder) (*model.ProfileSpec, error) {
	var res model.ProfileSpec
	url := strings.Join([]string{
		p.Endpoint,
		urls.GenerateProfileURL(urls.Client, p.TenantId)}, "/")

	if err := p.Recv(url, "POST", body, &res); err != nil {
		return nil, err
	}

	return &res, nil
}

// GetProfile
func (p *ProfileMgr) GetProfile(prfID string) (*model.ProfileSpec, error) {
	var res model.ProfileSpec
	url := strings.Join([]string{
		p.Endpoint,
		urls.GenerateProfileURL(urls.Client, p.TenantId, prfID)}, "/")

	if err := p.Recv(url, "GET", nil, &res); err != nil {
		return nil, err
	}

	return &res, nil
}

// UpdateProfile ...
func (p *ProfileMgr) UpdateProfile(prfID string, body ProfileBuilder) (*model.ProfileSpec, error) {
	var res model.ProfileSpec
	url := strings.Join([]string{
		p.Endpoint,
		urls.GenerateProfileURL(urls.Client, p.TenantId, prfID)}, "/")

	if err := p.Recv(url, "PUT", body, &res); err != nil {
		return nil, err
	}

	return &res, nil
}

// ListProfiles
func (p *ProfileMgr) ListProfiles(args ...interface{}) ([]*model.ProfileSpec, error) {
	var res []*model.ProfileSpec

	url := strings.Join([]string{
		p.Endpoint,
		urls.GenerateProfileURL(urls.Client, p.TenantId)}, "/")

	param, err := processListParam(args)
	if err != nil {
		return nil, err
	}

	if param != "" {
		url += "?" + param
	}
	if err := p.Recv(url, "GET", nil, &res); err != nil {
		return nil, err
	}

	return res, nil
}

// DeleteProfile
func (p *ProfileMgr) DeleteProfile(prfID string) error {
	url := strings.Join([]string{
		p.Endpoint,
		urls.GenerateProfileURL(urls.Client, p.TenantId, prfID)}, "/")

	return p.Recv(url, "DELETE", nil, nil)
}

// AddCustomProperty
func (p *ProfileMgr) AddCustomProperty(prfID string, body CustomBuilder) (*model.CustomPropertiesSpec, error) {
	var res model.CustomPropertiesSpec
	url := strings.Join([]string{
		p.Endpoint,
		urls.GenerateProfileURL(urls.Client, p.TenantId, prfID),
		"customProperties"}, "/")

	if err := p.Recv(url, "POST", body, &res); err != nil {
		return nil, err
	}

	return &res, nil
}

// ListCustomProperties
func (p *ProfileMgr) ListCustomProperties(prfID string) (*model.CustomPropertiesSpec, error) {
	var res model.CustomPropertiesSpec
	url := strings.Join([]string{
		p.Endpoint,
		urls.GenerateProfileURL(urls.Client, p.TenantId, prfID),
		"customProperties"}, "/")

	if err := p.Recv(url, "GET", nil, &res); err != nil {
		return nil, err
	}

	return &res, nil
}

// RemoveCustomProperty
func (p *ProfileMgr) RemoveCustomProperty(prfID, customKey string) error {
	url := strings.Join([]string{
		p.Endpoint,
		urls.GenerateProfileURL(urls.Client, p.TenantId, prfID),
		"customProperties", customKey}, "/")

	return p.Recv(url, "DELETE", nil, nil)
}


text:
require "language/node"

class Chronograf < Formula
  desc "Open source monitoring and visualization UI for the TICK stack."
  homepage "https://docs.influxdata.com/chronograf/latest/"
  url "https://github.com/influxdata/chronograf/archive/1.3.9.0.tar.gz"
  sha256 "9cb0529a0a6ad5230258bb67cc80ada061f98f57e233c465f885b09fef20d3ab"
  head "https://github.com/influxdata/chronograf.git"

  bottle do
    cellar :any_skip_relocation
    sha256 "14a5c66aa65c77e1d03ec63ab79a69a1d24795868722ccff8c109af3ec26d762" => :high_sierra
    sha256 "909a4d1c5ab79f264379d3d3234ba3abc167db6db9b05477373f294d1b8d3369" => :sierra
    sha256 "7d28d1be82154d513472b8cdf2b4055dfd45af1d9aa213c2fdd58499d082270d" => :el_capitan
  end

  depends_on "go" => :build
  depends_on "node" => :build
  depends_on "yarn" => :build
  depends_on "influxdb" => :recommended
  depends_on "kapacitor" => :recommended

  def install
    ENV["GOPATH"] = buildpath
    ENV.prepend_create_path "PATH", buildpath/"bin"
    Language::Node.setup_npm_environment
    chronograf_path = buildpath/"src/github.com/influxdata/chronograf"
    chronograf_path.install buildpath.children

    cd chronograf_path do
      system "make", "dep"
      system "make", ".jssrc"
      system "make", "chronograf"
      bin.install "chronograf"
    end
  end

  plist_options :manual => "chronograf"

  def plist; <<-EOS.undent
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>KeepAlive</key>
        <dict>
          <key>SuccessfulExit</key>
          <false/>
        </dict>
        <key>Label</key>
        <string>#{plist_name}</string>
        <key>ProgramArguments</key>
        <array>
          <string>#{opt_bin}/chronograf</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>WorkingDirectory</key>
        <string>#{var}</string>
        <key>StandardErrorPath</key>
        <string>#{var}/log/chronograf.log</string>
        <key>StandardOutPath</key>
        <string>#{var}/log/chronograf.log</string>
      </dict>
    </plist>
    EOS
  end

  test do
    begin
      pid = fork do
        exec "#{bin}/chronograf"
      end
      sleep 1
      output = shell_output("curl -s 0.0.0.0:8888/chronograf/v1/")
      sleep 1
      assert_match %r{/chronograf/v1/layouts}, output
    ensure
      Process.kill("SIGINT", pid)
      Process.wait(pid)
    end
  end
end


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Form extends Model
{
    //
}


text: * Transfered repository to Probe Dock and initial release


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Linq;
using System.Windows.Data;
using System.Windows.Input;
using Prism.Commands;
using Prism.Interactivity.InteractionRequest;
using Prism.Mvvm;
using Prism.Events;
using Plainion;
using RaynMaker.Entities;
using RaynMaker.Infrastructure;
using RaynMaker.Infrastructure.Events;

namespace RaynMaker.Modules.Browser.ViewModels
{
    [Export]
    class BrowserViewModel : BindableBase
    {
        private IProjectHost myProjectHost;
        private IAssetsContext myContext;
        private IEventAggregator myEventAggregator;
        private Stock mySelectedAsset;
        private ICollectionView myAssetsView;
        private string myAssetsFilter;
        private bool myIsTagFilterOpen;
        private IEnumerable<TagFilter> myTagFilters;
        private IEnumerable<TagFilter> myCommittedTagFilters;

        [ImportingConstructor]
        public BrowserViewModel(IProjectHost host, IEventAggregator eventAggregator)
        {
            myProjectHost = host;
            myEventAggregator = eventAggregator;

            myProjectHost.Changed += OnProjectChanged;
            OnProjectChanged();

            NewCommand = new DelegateCommand(OnNew);
            NewAssetRequest = new InteractionRequest<NewAssetNotification>();
            OpenAssetCommand = new DelegateCommand(OnOpenAsset);
            DeleteCommand = new DelegateCommand<Stock>(OnDelete);
            DeletionConfirmationRequest = new InteractionRequest<IConfirmation>();

            OpenTagFilterCommand = new DelegateCommand(OnOpenTagFilter);
            ApplyTagFilterCommand = new DelegateCommand(OnApplyTagFilter);
            CancelTagFilterCommand = new DelegateCommand(OnCancelTagFilter);
        }

        private void OnProjectChanged()
        {
            if (myProjectHost.Project == null)
            {
                return;
            }

            myContext = myProjectHost.Project.GetAssetsContext();

            myTagFilters = new[] { new TagFilter(TagFilter.Blank) }
                .Concat(myContext.Tags
                    .ToList()
                    .Select(t => new TagFilter(t)))
                .ToList();

            myAssetsView = null;
            Assets.Refresh();

            RaisePropertyChanged(nameof(HasProject));
        }

        public string Header
        {
            get { return "Browser"; }
        }

        public bool HasProject { get { return myProjectHost.Project != null; } }

        public ICommand NewCommand { get; private set; }

        private void OnNew()
        {
            var notification = new NewAssetNotification();
            notification.Title = "New Asset";

            NewAssetRequest.Raise(notification, n =>
           {
               if (n.Confirmed)
               {
                   myAssetsView = null;
                   Assets.Refresh();

                   SelectedAsset = n.Result;
                   OnOpenAsset();
               }
           });
        }

        public InteractionRequest<NewAssetNotification> NewAssetRequest { get; private set; }

        public ICollectionView Assets
        {
            get
            {
                if (myAssetsView == null && myContext != null)
                {
                    myAssetsView = CollectionViewSource.GetDefaultView(myContext.Stocks.ToList());
                    myAssetsView.Filter = x => FilterAssets((Stock)x);
                    myAssetsView.SortDescriptions.Add(new SortDescription("Company.Name", ListSortDirection.Ascending));

                    RaisePropertyChanged(nameof(Assets));
                }
                return myAssetsView;
            }
        }

        private bool FilterAssets(Stock stock)
        {
            return MatchesNameIsinFilter(stock) && MatchesTagFilter(stock);
        }

        private bool MatchesNameIsinFilter(Stock stock)
        {
            if (string.IsNullOrWhiteSpace(myAssetsFilter))
            {
                return true;
            }

            return stock.Company.Name.Contains(myAssetsFilter, StringComparison.OrdinalIgnoreCase)
                || stock.Isin.Contains(myAssetsFilter, StringComparison.OrdinalIgnoreCase);
        }

        private bool MatchesTagFilter(Stock stock)
        {
            if (!stock.Company.Tags.Any() && Tags.Single(f => f.Name == TagFilter.Blank).IsChecked)
            {
                return true;
            }

            return stock.Company.Tags.Any(t => myTagFilters.Any(f => f.Name == t.Name && f.IsChecked));
        }

        public string AssetsFilter
        {
            get { return myAssetsFilter; }
            set
            {
                if (SetProperty(ref myAssetsFilter, value))
                {
                    Assets.Refresh();
                }
            }
        }

        public Stock SelectedAsset
        {
            get { return mySelectedAsset; }
            set { SetProperty(ref mySelectedAsset, value); }
        }

        public ICommand DeleteCommand { get; private set; }

        private void OnDelete(Stock stock)
        {
            var notification = new Confirmation();
            notification.Title = "Confirmation";
            notification.Content = "Deletion cannot be undone. "
                + Environment.NewLine
                + Environment.NewLine
                + "Do you really want to delete this asset?";

            DeletionConfirmationRequest.Raise(notification, n =>
           {
               if (n.Confirmed)
               {
                   var ctx = myProjectHost.Project.GetAssetsContext();

                   var companyGuid = stock.Company.Guid;

                   if (stock.Company.Stocks.Count == 1)
                   {
                       ctx.Companies.Remove(stock.Company);
                   }
                   else
                   {
                       ctx.Stocks.Remove(stock);
                   }

                   ctx.SaveChanges();

                   myAssetsView = null;
                   Assets.Refresh();

                   myEventAggregator.GetEvent<AssetDeletedEvent>().Publish(stock.Guid);

                   if (stock.Company == null)
                   {
                       myEventAggregator.GetEvent<CompanyDeletedEvent>().Publish(companyGuid);
                   }
               }
           });
        }

        public InteractionRequest<IConfirmation> DeletionConfirmationRequest { get; private set; }

        public ICommand OpenAssetCommand { get; private set; }

        public void OnOpenAsset()
        {
            if (SelectedAsset != null)
            {
                myEventAggregator.GetEvent<AssetSelectedEvent>().Publish(SelectedAsset);
            }
        }

        public IEnumerable<TagFilter> Tags
        {
            get { return myTagFilters; }
        }

        public bool IsTagFilterOpen
        {
            get { return myIsTagFilterOpen; }
            set { SetProperty(ref myIsTagFilterOpen, value); }
        }

        public ICommand OpenTagFilterCommand { get; private set; }

        private void OnOpenTagFilter()
        {
            myCommittedTagFilters = myTagFilters
                .Select(f => new TagFilter(f))
                .ToList();

            RaisePropertyChanged(nameof(Tags));
        }

        public ICommand ApplyTagFilterCommand { get; private set; }

        private void OnApplyTagFilter()
        {
            Assets.Refresh();

            IsTagFilterOpen = false;

            RaisePropertyChanged(nameof(IsFilteredByTags));
        }

        public ICommand CancelTagFilterCommand { get; private set; }

        private void OnCancelTagFilter()
        {
            myTagFilters = myCommittedTagFilters
                .Select(f => new TagFilter(f))
                .ToList();

            IsTagFilterOpen = false;
        }

        public bool IsFilteredByTags
        {
            get { return myTagFilters != null ? myTagFilters.Any(f => !f.IsChecked) : false; }
        }
    }
}


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

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Management.Automation;
using System.Security.Permissions;
using Microsoft.Azure.Commands.Automation.Common;
using Microsoft.Azure.Commands.Automation.Model;
using Microsoft.Azure.Commands.Automation.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;

namespace Microsoft.Azure.Commands.Automation.Cmdlet
{
    /// <summary>
    /// Removes the dsc node.
    /// </summary>
    [Cmdlet(VerbsLifecycle.Unregister, "AzureRmAutomationDscNode")]
    [OutputType(typeof(DscNode))]
    public class UnregisterAzureAutomationDscNode : AzureAutomationBaseCmdlet
    {
        /// <summary>
        /// Gets or sets the node id.
        /// </summary>
        [Parameter(ParameterSetName = AutomationCmdletParameterSets.ById, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The dsc node id.")]
        [Alias("NodeId")]
        [ValidateNotNullOrEmpty]
        public Guid Id { get; set; }

        /// <summary>
        /// Gets or sets the switch parameter not to confirm on removing the dsc node.
        /// </summary>
        [Parameter(Mandatory = false, HelpMessage = "Forces the command to run without asking for user confirmation.")]
        public SwitchParameter Force { get; set; }

        /// <summary>
        /// Execute this cmdlet.
        /// </summary>
        [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
        protected override void ProcessRecord()
        {
            this.ConfirmAction(
                this.Force.IsPresent,
                string.Format(CultureInfo.CurrentCulture, Resources.RemoveDscNodeWarning),
                string.Format(CultureInfo.CurrentCulture, Resources.RemoveDscNodeDescription, this.Id.ToString()),
                this.Id.ToString(),
                () =>
                {
                    AutomationClient.DeleteDscNode(this.ResourceGroupName, this.AutomationAccountName, this.Id);
                });
        }
    }
}


text:
var Frame = require('./Frame');
var TextureSource = require('./TextureSource');

/**
* A Texture consists of a source, usually an Image from the Cache, or a Canvas, and a collection
* of Frames. The Frames represent the different areas of the Texture. For example a texture atlas
* may have many Frames, one for each element within the atlas. Where-as a single image would have
* just one frame, that encompasses the whole image.
*
* Textures are managed by the global TextureManager. This is a singleton class that is
* responsible for creating and delivering Textures and their corresponding Frames to Game Objects.
*
* Sprites and other Game Objects get the texture data they need from the TextureManager.
*
* @class Phaser.Texture
* @constructor
* @param {object} source
* @param {number} scaleMode
*/
var Texture = function (manager, key, source)
{
    this.manager = manager;

    if (!Array.isArray(source))
    {
        source = [ source ];
    }

    this.key = key;

    /**
    * The source that is used to create the texture.
    * Usually an Image, but can also be a Canvas.
    *
    * @property source
    * @type array
    */
    this.source = [];

    /**
    * @property {object} frames - Frames
    */
    this.frames = {};

    this.frameTotal = 0;

    //  Load the Sources
    for (var i = 0; i < source.length; i++)
    {
        this.source.push(new TextureSource(this, source[i]));
    }
};

Texture.prototype.constructor = Texture;

Texture.prototype = {

    add: function (name, sourceIndex, x, y, width, height)
    {
        var frame = new Frame(this, name, sourceIndex, x, y, width, height);

        this.frames[name] = frame;

        this.frameTotal++;

        return frame;
    },

    get: function (name)
    {
        if (name === undefined || name === null || this.frameTotal === 1)
        {
            name = '__BASE';
        }

        var frame = this.frames[name];

        if (!frame)
        {
            console.warn('No Texture.frame found with name ' + name);

            return this.frames['__BASE'];
        }
        else
        {
            return frame;
        }
    },

    setTextureIndex: function (index)
    {
        for (var i = 0; i < this.source.length; i++)
        {
            this.source[i].glTextureIndex = index;

            console.log(this.source[i].image.currentSrc, 'index = ', index);

            index++;
        }

        return index;
    },

    /**
    * Destroys this base texture
    *
    * @method destroy
    */
    destroy: function ()
    {
        //  Need to iterate though the TextureSources, and unload each one
        //  then clear out the frames

        /*
        if (this.source)
        {
            Phaser.CanvasPool.removeByCanvas(this.source);
        }

        this.source = null;
        */
    }

};

/**
* Helper function that creates a base texture from the given canvas element.
*
* @static
* @method fromCanvas
* @param canvas {Canvas} The canvas element source of the texture
* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}Phaser.scaleModes{{/crossLink}} for possible values
* @return {BaseTexture}
Phaser.Texture.fromCanvas = function (canvas, scaleMode)
{
    if (canvas.width === 0)
    {
        canvas.width = 1;
    }

    if (canvas.height === 0)
    {
        canvas.height = 1;
    }

    return new Phaser.Texture(canvas, scaleMode);
};
*/

module.exports = Texture;


text:
from useintest.executables.builders import CommandsBuilder
from useintest.executables.common import get_all_path_like_arguments_for_mounting
from useintest.executables.controllers import DefinedExecutablesControllerTypeBuilder
from useintest.executables.models import Executable

Samtools1_3_1ExecutablesController = DefinedExecutablesControllerTypeBuilder(
    "Samtools1_3_1ExecutablesController",
    {
        "samtools": Executable(
            CommandsBuilder(
                image="comics/samtools:1.3.1",
                executable="samtools",
                # There are so many ways in which Samtools accepts file paths that the creation of a parser for it would
                # be a massive task. Instead, we'll overzealously bind mount anything that looks like a file path.
                get_path_arguments_to_mount=get_all_path_like_arguments_for_mounting
            ),
            False
        )
    }
).build()

SamtoolsExecutablesController = Samtools1_3_1ExecutablesController

samtools_executable_controllers = {Samtools1_3_1ExecutablesController}


text:
namespace chromeos {

// A fake implementation of ShillThirdPartyVpnDriverClient.
// The client can generate fake DBus signals when
// ShillThirdPartyVpnDriverClient::TestInterface methods are called. The
// DBus methods are nops that only acknowledge the caller.
class CHROMEOS_EXPORT FakeShillThirdPartyVpnDriverClient
    : public ShillThirdPartyVpnDriverClient,
      public ShillThirdPartyVpnDriverClient::TestInterface {
 public:
  FakeShillThirdPartyVpnDriverClient();
  ~FakeShillThirdPartyVpnDriverClient() override;

  // ShillThirdPartyVpnDriverClient overrides
  void Init(dbus::Bus* bus) override;
  void AddShillThirdPartyVpnObserver(
      const std::string& object_path_value,
      ShillThirdPartyVpnObserver* observer) override;
  void RemoveShillThirdPartyVpnObserver(
      const std::string& object_path_value) override;
  void SetParameters(
      const std::string& object_path_value,
      const base::DictionaryValue& parameters,
      const base::Closure& callback,
      const ShillClientHelper::ErrorCallback& error_callback) override;
  void UpdateConnectionState(
      const std::string& object_path_value,
      const uint32_t connection_state,
      const base::Closure& callback,
      const ShillClientHelper::ErrorCallback& error_callback) override;
  void SendPacket(
      const std::string& object_path_value,
      const std::vector<char>& ip_packet,
      const base::Closure& callback,
      const ShillClientHelper::ErrorCallback& error_callback) override;
  ShillThirdPartyVpnDriverClient::TestInterface* GetTestInterface() override;

  // ShillThirdPartyVpnDriverClient::TestInterface overrides
  void OnPacketReceived(const std::string& object_path_value,
                        const std::vector<char>& packet) override;
  void OnPlatformMessage(const std::string& object_path_value,
                         uint32_t message) override;

 private:
  using ObserverMap = std::map<std::string, ShillThirdPartyVpnObserver*>;

  ObserverMap observer_map_;

  DISALLOW_COPY_AND_ASSIGN(FakeShillThirdPartyVpnDriverClient);
};

}  // namespace chromeos

#endif  // CHROMEOS_DBUS_FAKE_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_


text:
@protocol GWPreviewLegendControllerDelegate <NSObject>
- (UIImage*)legendImage;
@end

@interface GWLegendController : UIViewController

@property (strong, nonatomic) NSObject<GWPreviewLegendControllerDelegate>* delegate;
@end


text:
using System.Collections.Generic;

namespace System.Collections.Immutable
{
    /// <content>
    /// Contains the inner HashBucket struct.
    /// </content>
    public partial class ImmutableHashSet<T>
    {
        /// <summary>
        /// The result of a mutation operation.
        /// </summary>
        internal enum OperationResult
        {
            /// <summary>
            /// The change required element(s) to be added or removed from the collection.
            /// </summary>
            SizeChanged,

            /// <summary>
            /// No change was required (the operation ended in a no-op).
            /// </summary>
            NoChangeRequired,
        }

        /// <summary>
        /// Contains all the keys in the collection that hash to the same value.
        /// </summary>
        internal struct HashBucket
        {
            /// <summary>
            /// One of the values in this bucket.
            /// </summary>
            private readonly T _firstValue;

            /// <summary>
            /// Any other elements that hash to the same value.
            /// </summary>
            /// <value>
            /// This is null if and only if the entire bucket is empty (including <see cref="_firstValue"/>).
            /// It's empty if <see cref="_firstValue"/> has an element but no additional elements.
            /// </value>
            private readonly ImmutableList<T>.Node _additionalElements;

            /// <summary>
            /// Initializes a new instance of the <see cref="HashBucket"/> struct.
            /// </summary>
            /// <param name="firstElement">The first element.</param>
            /// <param name="additionalElements">The additional elements.</param>
            private HashBucket(T firstElement, ImmutableList<T>.Node additionalElements = null)
            {
                _firstValue = firstElement;
                _additionalElements = additionalElements ?? ImmutableList<T>.Node.EmptyNode;
            }

            /// <summary>
            /// Gets a value indicating whether this instance is empty.
            /// </summary>
            /// <value>
            ///   <c>true</c> if this instance is empty; otherwise, <c>false</c>.
            /// </value>
            internal bool IsEmpty
            {
                get { return _additionalElements == null; }
            }

            /// <summary>
            /// Returns an enumerator that iterates through the collection.
            /// </summary>
            public Enumerator GetEnumerator()
            {
                return new Enumerator(this);
            }

            /// <summary>
            /// Adds the specified value.
            /// </summary>
            /// <param name="value">The value.</param>
            /// <param name="valueComparer">The value comparer.</param>
            /// <param name="result">A description of the effect was on adding an element to this HashBucket.</param>
            /// <returns>A new HashBucket that contains the added value and any values already held by this hashbucket.</returns>
            internal HashBucket Add(T value, IEqualityComparer<T> valueComparer, out OperationResult result)
            {
                if (this.IsEmpty)
                {
                    result = OperationResult.SizeChanged;
                    return new HashBucket(value);
                }

                if (valueComparer.Equals(value, _firstValue) || _additionalElements.IndexOf(value, valueComparer) >= 0)
                {
                    result = OperationResult.NoChangeRequired;
                    return this;
                }

                result = OperationResult.SizeChanged;
                return new HashBucket(_firstValue, _additionalElements.Add(value));
            }

            /// <summary>
            /// Determines whether the HashBucket contains the specified value.
            /// </summary>
            /// <param name="value">The value.</param>
            /// <param name="valueComparer">The value comparer.</param>
            internal bool Contains(T value, IEqualityComparer<T> valueComparer)
            {
                if (this.IsEmpty)
                {
                    return false;
                }

                return valueComparer.Equals(value, _firstValue) || _additionalElements.IndexOf(value, valueComparer) >= 0;
            }

            /// <summary>
            /// Searches the set for a given value and returns the equal value it finds, if any.
            /// </summary>
            /// <param name="value">The value to search for.</param>
            /// <param name="valueComparer">The value comparer.</param>
            /// <param name="existingValue">The value from the set that the search found, or the original value if the search yielded no match.</param>
            /// <returns>
            /// A value indicating whether the search was successful.
            /// </returns>
            internal bool TryExchange(T value, IEqualityComparer<T> valueComparer, out T existingValue)
            {
                if (!this.IsEmpty)
                {
                    if (valueComparer.Equals(value, _firstValue))
                    {
                        existingValue = _firstValue;
                        return true;
                    }

                    int index = _additionalElements.IndexOf(value, valueComparer);
                    if (index >= 0)
                    {
                        existingValue = _additionalElements[index];
                        return true;
                    }
                }

                existingValue = value;
                return false;
            }

            /// <summary>
            /// Removes the specified value if it exists in the collection.
            /// </summary>
            /// <param name="value">The value.</param>
            /// <param name="equalityComparer">The equality comparer.</param>
            /// <param name="result">A description of the effect was on adding an element to this HashBucket.</param>
            /// <returns>A new HashBucket that does not contain the removed value and any values already held by this hashbucket.</returns>
            internal HashBucket Remove(T value, IEqualityComparer<T> equalityComparer, out OperationResult result)
            {
                if (this.IsEmpty)
                {
                    result = OperationResult.NoChangeRequired;
                    return this;
                }

                if (equalityComparer.Equals(_firstValue, value))
                {
                    if (_additionalElements.IsEmpty)
                    {
                        result = OperationResult.SizeChanged;
                        return new HashBucket();
                    }
                    else
                    {
                        // We can promote any element from the list into the first position, but it's most efficient
                        // to remove the root node in the binary tree that implements the list.
                        int indexOfRootNode = _additionalElements.Left.Count;
                        result = OperationResult.SizeChanged;
                        return new HashBucket(_additionalElements.Key, _additionalElements.RemoveAt(indexOfRootNode));
                    }
                }

                int index = _additionalElements.IndexOf(value, equalityComparer);
                if (index < 0)
                {
                    result = OperationResult.NoChangeRequired;
                    return this;
                }
                else
                {
                    result = OperationResult.SizeChanged;
                    return new HashBucket(_firstValue, _additionalElements.RemoveAt(index));
                }
            }

            /// <summary>
            /// Freezes this instance so that any further mutations require new memory allocations.
            /// </summary>
            internal void Freeze()
            {
                if (_additionalElements != null)
                {
                    _additionalElements.Freeze();
                }
            }

            /// <summary>
            /// Enumerates all the elements in this instance.
            /// </summary>
            internal struct Enumerator : IEnumerator<T>, IDisposable
            {
                /// <summary>
                /// The bucket being enumerated.
                /// </summary>
                private readonly HashBucket _bucket;

                /// <summary>
                /// A value indicating whether this enumerator has been disposed.
                /// </summary>
                private bool _disposed;

                /// <summary>
                /// The current position of this enumerator.
                /// </summary>
                private Position _currentPosition;

                /// <summary>
                /// The enumerator that represents the current position over the additionalValues of the HashBucket.
                /// </summary>
                private ImmutableList<T>.Enumerator _additionalEnumerator;

                /// <summary>
                /// Initializes a new instance of the <see cref="ImmutableHashSet<T>.HashBucket.Enumerator"/> struct.
                /// </summary>
                /// <param name="bucket">The bucket.</param>
                internal Enumerator(HashBucket bucket)
                {
                    _disposed = false;
                    _bucket = bucket;
                    _currentPosition = Position.BeforeFirst;
                    _additionalEnumerator = default(ImmutableList<T>.Enumerator);
                }

                /// <summary>
                /// Describes the positions the enumerator state machine may be in.
                /// </summary>
                private enum Position
                {
                    /// <summary>
                    /// The first element has not yet been moved to.
                    /// </summary>
                    BeforeFirst,

                    /// <summary>
                    /// We're at the firstValue of the containing bucket.
                    /// </summary>
                    First,

                    /// <summary>
                    /// We're enumerating the additionalValues in the bucket.
                    /// </summary>
                    Additional,

                    /// <summary>
                    /// The end of enumeration has been reached.
                    /// </summary>
                    End,
                }

                /// <summary>
                /// Gets the current element.
                /// </summary>
                object IEnumerator.Current
                {
                    get { return this.Current; }
                }

                /// <summary>
                /// Gets the current element.
                /// </summary>
                public T Current
                {
                    get
                    {
                        this.ThrowIfDisposed();
                        switch (_currentPosition)
                        {
                            case Position.First:
                                return _bucket._firstValue;
                            case Position.Additional:
                                return _additionalEnumerator.Current;
                            default:
                                throw new InvalidOperationException();
                        }
                    }
                }

                /// <summary>
                /// Advances the enumerator to the next element of the collection.
                /// </summary>
                /// <returns>
                /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
                /// </returns>
                /// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
                public bool MoveNext()
                {
                    this.ThrowIfDisposed();
                    if (_bucket.IsEmpty)
                    {
                        _currentPosition = Position.End;
                        return false;
                    }

                    switch (_currentPosition)
                    {
                        case Position.BeforeFirst:
                            _currentPosition = Position.First;
                            return true;
                        case Position.First:
                            if (_bucket._additionalElements.IsEmpty)
                            {
                                _currentPosition = Position.End;
                                return false;
                            }

                            _currentPosition = Position.Additional;
                            _additionalEnumerator = new ImmutableList<T>.Enumerator(_bucket._additionalElements);
                            return _additionalEnumerator.MoveNext();
                        case Position.Additional:
                            return _additionalEnumerator.MoveNext();
                        case Position.End:
                            return false;
                        default:
                            throw new InvalidOperationException();
                    }
                }

                /// <summary>
                /// Sets the enumerator to its initial position, which is before the first element in the collection.
                /// </summary>
                /// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
                public void Reset()
                {
                    this.ThrowIfDisposed();
                    _additionalEnumerator.Dispose();
                    _currentPosition = Position.BeforeFirst;
                }

                /// <summary>
                /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
                /// </summary>
                public void Dispose()
                {
                    _disposed = true;
                    _additionalEnumerator.Dispose();
                }

                /// <summary>
                /// Throws an ObjectDisposedException if this enumerator has been disposed.
                /// </summary>
                private void ThrowIfDisposed()
                {
                    if (_disposed)
                    {
                        Validation.Requires.FailObjectDisposed(this);
                    }
                }
            }
        }
    }
}


text:
layout: page
title: Summers Family Reunion
date: 2016-05-24
author: Bobby Frey
tags: weekly links, java
status: published
summary: Quisque pellentesque ex magna, vel ullamcorper sapien posuere.
banner: images/banner/office-01.jpg
booking:
  startDate: 01/31/2018
  endDate: 02/01/2018
  ctyhocn: CHIGUHX
  groupCode: SFR
published: true
---
Duis eget turpis ac risus convallis euismod. Vestibulum dapibus ultricies vulputate. Pellentesque egestas ipsum et dignissim pretium. Quisque ullamcorper vulputate efficitur. Ut blandit molestie odio non ullamcorper. Cras sagittis urna risus, sit amet feugiat velit rutrum vel. Nullam eleifend nibh vel porttitor porttitor. Donec ac vehicula enim, sit amet ultricies purus.

1 Sed porttitor dolor et urna mattis euismod
1 Mauris lobortis metus non risus lobortis, vitae consequat ante consectetur.

Nulla nec fermentum quam. Duis facilisis facilisis arcu vitae tristique. Cras non sapien vitae felis gravida suscipit et ut mauris. Praesent a ante purus. Fusce cursus euismod ornare. Aliquam quam leo, vulputate eget ligula quis, dignissim auctor magna. Suspendisse aliquam neque eu metus ornare, vestibulum tincidunt massa gravida. Proin ut porttitor mauris, at maximus urna. Praesent venenatis rhoncus sagittis. Fusce accumsan ipsum ut massa imperdiet imperdiet. Phasellus et fermentum lectus, id egestas nisl. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam dui nisl, cursus eu nibh sed, eleifend efficitur urna. Etiam porttitor metus aliquet, tristique felis sed, vestibulum turpis. Sed vel orci urna.
Integer in tristique ligula. Ut congue turpis nec nunc posuere sagittis. Cras tristique aliquam laoreet. Ut vel fringilla arcu, id laoreet neque. Curabitur ut varius sem. Fusce suscipit tellus eget nunc efficitur, vitae dapibus nibh mattis. Curabitur aliquam nec nulla feugiat sagittis. Sed condimentum nunc id bibendum sagittis.


text:
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
const webpack = require('webpack')

const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = merge(common, {
  entry: ['webpack-hot-middleware/client?reload=true&quiet=true', './src/front/index.js'],
  output: {
    filename: '[name].[hash].js'
  },
  mode: 'development',
  devtool: 'inline-source-map',
  devServer: {
    contentBase: './dist'
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'style-loader',
          { loader: 'css-loader', options: { importLoaders: 1 } },
          'postcss-loader'
        ]
      }
    ]
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new HtmlWebpackPlugin({
      template: 'src/front/index.html'
    })
  ]
})


text:
// Stub selenium server to use with several test cases

var express = require("express"),
    clone = require('clone');

function SeleniumServer(port) {

    this.port = port;

}

SeleniumServer.prototype.server = null;
SeleniumServer.prototype.port = null;
SeleniumServer.prototype.sessions = {"status":0,"sessionId":null,"value":[],"class":"org.openqa.selenium.remote.Response","hCode":1561232967};
SeleniumServer.prototype.sessionObj =  {
    "id": "1338337429466",
    "class": "org.openqa.selenium.remote.server.handler.GetAllSessions$SessionInfo",
    "capabilities": {
        "chrome.chromedriverVersion": "18.0.1022.0",
        "platform": "MAC",
        "javascriptEnabled": true,
        "acceptSslCerts": false,
        "browserName": "chrome",
        "rotatable": false,
        "locationContextEnabled": false,
        "version": "19.0.1084.52",
        "databaseEnabled": false,
        "cssSelectorsEnabled": true,
        "handlesAlerts": true,
        "browserConnectionEnabled": false,
        "nativeEvents": true,
        "webStorageEnabled": false,
        "chrome.nativeEvents": false,
        "applicationCacheEnabled": false,
        "takesScreenshot": true
    },
    "hCode": 2123536766
};
SeleniumServer.prototype.sessionsID =  1000000000000;

SeleniumServer.prototype.startServer = function() {

    var self = this;
    this.app = express();

    this.app.get("/wd/hub/sessions", function (req, res) {
        res.send(self.sessions);
        res.end();
    });

    this.appServer = this.app.listen(this.port);
    console.log("Starting Test Selenium Server" );

}

SeleniumServer.prototype.stopServer = function() {

    this.appServer.close();
    console.log("Stopping Test Selenium Server" );
}

SeleniumServer.prototype.setActiveSessionCount = function(sessionCount) {

    var i = 0,
        obj = {};

    //first initializing sessionID's
    this.sessions.value = [];

    for(i = 0 ; i < sessionCount ; i = i + 1) {
        obj = null;
        obj = clone(this.sessionObj);
        obj.id = this.sessionsID;
        this.sessionsID += 1;
        this.sessions.value.push(obj)
    }
}

module.exports = SeleniumServer;


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 * @author Ed Spencer
 *
 * AbstractStore is a superclass of {@link Ext.data.Store} and {@link Ext.data.TreeStore}. It's never used directly,
 * but offers a set of methods used by both of those subclasses.
 *
 * We've left it here in the docs for reference purposes, but unless you need to make a whole new type of Store, what
 * you're probably looking for is {@link Ext.data.Store}. If you're still interested, here's a brief description of what
 * AbstractStore is and is not.
 *
 * AbstractStore provides the basic configuration for anything that can be considered a Store. It expects to be
 * given a {@link Ext.data.Model Model} that represents the type of data in the Store. It also expects to be given a
 * {@link Ext.data.proxy.Proxy Proxy} that handles the loading of data into the Store.
 *
 * AbstractStore provides a few helpful methods such as {@link #method-load} and {@link #sync}, which load and save data
 * respectively, passing the requests through the configured {@link #proxy}. Both built-in Store subclasses add extra
 * behavior to each of these functions. Note also that each AbstractStore subclass has its own way of storing data -
 * in {@link Ext.data.Store} the data is saved as a flat {@link Ext.util.MixedCollection MixedCollection}, whereas in
 * {@link Ext.data.TreeStore TreeStore} we use a {@link Ext.data.Tree} to maintain the data's hierarchy.
 *
 * The store provides filtering and sorting support. This sorting/filtering can happen on the client side
 * or can be completed on the server. This is controlled by the {@link Ext.data.Store#remoteSort remoteSort} and
 * {@link Ext.data.Store#remoteFilter remoteFilter} config options. For more information see the {@link #sort} and
 * {@link Ext.data.Store#filter filter} methods.
 */
Ext.define('Ext.data.AbstractStore', {
    requires: [
        'Ext.util.MixedCollection',
        'Ext.data.proxy.Proxy',
        'Ext.data.Operation',
        'Ext.util.Filter'
    ],

    mixins: {
        observable: 'Ext.util.Observable',
        sortable: 'Ext.util.Sortable'
    },

    statics: {
        /**
         * Creates a store from config object.
         *
         * @param {Object/Ext.data.AbstractStore} store A config for
         * the store to be created.  It may contain a `type` field
         * which defines the particular type of store to create.
         *
         * Alteratively passing an actual store to this method will
         * just return it, no changes made.
         *
         * @return {Ext.data.AbstractStore} The created store.
         * @static
         */
        create: function(store) {
            if (!store.isStore) {
                if (!store.type) {
                    store.type = 'store';
                }
                store = Ext.createByAlias('store.' + store.type, store);
            }
            return store;
        }
    },

    onClassExtended: function(cls, data, hooks) {
        var model = data.model,
            onBeforeClassCreated;

        if (typeof model == 'string') {
            onBeforeClassCreated = hooks.onBeforeCreated;

            hooks.onBeforeCreated = function() {
                var me = this,
                    args = arguments;

                Ext.require(model, function() {
                    onBeforeClassCreated.apply(me, args);
                });
            };
        }
    },

    /**
     * @cfg {Boolean} remoteSort
     * True to defer any sorting operation to the server. If false, sorting is done locally on the client.
     */
    remoteSort  : false,

    /**
     * @cfg {Boolean} remoteFilter
     * True to defer any filtering operation to the server. If false, filtering is done locally on the client.
     */
    remoteFilter: false,

    /**
     * @cfg {String/Ext.data.proxy.Proxy/Object} proxy
     * The Proxy to use for this Store. This can be either a string, a config object or a Proxy instance -
     * see {@link #setProxy} for details.
     * @since 1.1.0
     */

    /**
     * @cfg {Boolean/Object} autoLoad
     * If data is not specified, and if autoLoad is true or an Object, this store's load method is automatically called
     * after creation. If the value of autoLoad is an Object, this Object will be passed to the store's load method.
     * @since 2.3.0
     */
    autoLoad: undefined,

    /**
     * @cfg {Boolean} autoSync
     * True to automatically sync the Store with its Proxy after every edit to one of its Records. Defaults to false.
     */
    autoSync: false,

    /**
     * @cfg {String} batchUpdateMode
     * Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's
     * internal representation of the data after each operation of the batch has completed, 'complete' will wait until
     * the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local
     * storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.
     */
    batchUpdateMode: 'operation',

    /**
     * @cfg {Boolean} filterOnLoad
     * If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired.
     * Defaults to true, ignored if {@link Ext.data.Store#remoteFilter remoteFilter} is true
     */
    filterOnLoad: true,

    /**
     * @cfg {Boolean} sortOnLoad
     * If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired.
     * Defaults to true, igored if {@link Ext.data.Store#remoteSort remoteSort} is true
     */
    sortOnLoad: true,

    /**
     * @property {Boolean} implicitModel
     * True if a model was created implicitly for this Store. This happens if a fields array is passed to the Store's
     * constructor instead of a model constructor or name.
     * @private
     */
    implicitModel: false,

    /**
     * @property {String} defaultProxyType
     * The string type of the Proxy to create if none is specified. This defaults to creating a
     * {@link Ext.data.proxy.Memory memory proxy}.
     */
    defaultProxyType: 'memory',

    /**
     * @property {Boolean} isDestroyed
     * True if the Store has already been destroyed. If this is true, the reference to Store should be deleted
     * as it will not function correctly any more.
     * @since 3.4.0
     */
    isDestroyed: false,

    /**
     * @property {Boolean} isStore
     * `true` in this class to identify an object as an instantiated Store, or subclass thereof.
     */
    isStore: true,

    /**
     * @cfg {String} storeId
     * Unique identifier for this store. If present, this Store will be registered with the {@link Ext.data.StoreManager},
     * making it easy to reuse elsewhere.
     *
     * Note that when store is instatiated by Controller, the storeId will be overridden by the name of the store.
     */

    /**
     * @cfg {Object[]} fields
     * This may be used in place of specifying a {@link #model} configuration. The fields should be a
     * set of {@link Ext.data.Field} configuration objects. The store will automatically create a {@link Ext.data.Model}
     * with these fields. In general this configuration option should only be used for simple stores like
     * a two-field store of ComboBox. For anything more complicated, such as specifying a particular id property or
     * associations, a {@link Ext.data.Model} should be defined and specified for the {@link #model}
     * config.
     * @since 2.3.0
     */

    /**
     * @cfg {String} model
     * Name of the {@link Ext.data.Model Model} associated with this store.
     * The string is used as an argument for {@link Ext.ModelManager#getModel}.
     */

    /**
     * @cfg {Object[]/Function[]} filters
     * Array of {@link Ext.util.Filter Filters} for this store. Can also be passed array of
     * functions which will be used as the {@link Ext.util.Filter#filterFn filterFn} config
     * for filters:
     *
     *     filters: [
     *         function(item) {
     *             return item.weight > 0;
     *         }
     *     ]
     *
     * To filter after the grid is loaded use the {@link Ext.data.Store#filterBy filterBy} function.
     */

    /**
     * @cfg {Boolean} [statefulFilters=false]
     * Configure as `true` to have the filters saved when a client {@link Ext.grid.Panel grid} saves its state.
     */

    sortRoot: 'data',

    //documented above
    constructor: function(config) {
        var me = this,
            filters;

        /**
         * @event add
         * Fired when a Model instance has been added to this Store.
         * @param {Ext.data.Store} store The store
         * @param {Ext.data.Model[]} records The Model instances that were added
         * @param {Number} index The index at which the instances were inserted
         * @since 1.1.0
         */

        /**
         * @event remove
         * Fired when a Model instance has been removed from this Store.
         *
         * **If many records may be removed in one go, then it is more efficient to listen for the {@link #event-bulkremove} event
         * and perform any processing for a bulk remove than to listen for this {@link #event-remove} event.**
         * @param {Ext.data.Store} store The Store object
         * @param {Ext.data.Model} record The record that was removed
         * @param {Number} index The index of the record that was removed
         * @param {Boolean} isMove `true` if the child node is being removed so it can be moved to another position in this Store.
         * @since 1.1.0
         */

        /**
         * @event bulkremove
         * Fired at the *end* of the {@link Ext.data.Store#method-remove remove} method when all records in the passed array have been removed.
         *
         * If many records may be removed in one go, then it is more efficient to listen for this event
         * and perform any processing for a bulk remove than to listen for many {@link #event-remove} events.
         * @param {Ext.data.Store} store The Store object
         * @param {Ext.data.Model[]} records The array of records that were removed (In the order they appear in the Store)
         * @param {Number[]} indexes The indexes of the records that were removed
         * @param {Boolean} isMove `true` if the child nodes are being removed so they can be moved to another position in this Store.
         */

        /**
         * @event update
         * Fires when a Model instance has been updated.
         * @param {Ext.data.Store} this
         * @param {Ext.data.Model} record The Model instance that was updated
         * @param {String} operation The update operation being performed. Value may be one of:
         *
         *     Ext.data.Model.EDIT
         *     Ext.data.Model.REJECT
         *     Ext.data.Model.COMMIT
         * @param {String[]} modifiedFieldNames Array of field names changed during edit.
         * @since 1.1.0
         */

        /**
         * @event datachanged
         * Fires whenever the records in the Store have changed in some way - this could include adding or removing
         * records, or updating the data in existing records
         * @param {Ext.data.Store} this The data store
         * @since 1.1.0
         */

        /**
         * @event refresh
         * Fires when the data cache has changed in a bulk manner (e.g., it has been sorted, filtered, etc.) and a
         * widget that is using this Store as a Record cache should refresh its view.
         * @param {Ext.data.Store} this The data store
         */

        /**
         * @event beforeload
         * Fires before a request is made for a new data object. If the beforeload handler returns false the load
         * action will be canceled.
         * @param {Ext.data.Store} store This Store
         * @param {Ext.data.Operation} operation The Ext.data.Operation object that will be passed to the Proxy to
         * load the Store
         * @since 1.1.0
         */

        /**
         * @event load
         * Fires whenever the store reads data from a remote data source.
         * @param {Ext.data.Store} this
         * @param {Ext.data.Model[]} records An array of records
         * @param {Boolean} successful True if the operation was successful.
         * @since 1.1.0
         */

        /**
         * @event write
         * Fires whenever a successful write has been made via the configured {@link #proxy Proxy}
         * @param {Ext.data.Store} store This Store
         * @param {Ext.data.Operation} operation The {@link Ext.data.Operation Operation} object that was used in
         * the write
         * @since 3.4.0
         */

        /**
         * @event beforesync
         * Fired before a call to {@link #sync} is executed. Return false from any listener to cancel the sync
         * @param {Object} options Hash of all records to be synchronized, broken down into create, update and destroy
         */
        /**
         * @event clear
         * Fired after the {@link #removeAll} method is called.
         * @param {Ext.data.Store} this
         * @since 1.1.0
         */
        /**
         * @event metachange
         * Fires when this store's underlying reader (available via the proxy) provides new metadata.
         * Metadata usually consists of new field definitions, but can include any configuration data
         * required by an application, and can be processed as needed in the event handler.
         * This event is currently only fired for JsonReaders.
         * @param {Ext.data.Store} this
         * @param {Object} meta The JSON metadata
         * @since 1.1.0
         */

        Ext.apply(me, config);
        // don't use *config* anymore from here on... use *me* instead...

        /**
         * Temporary cache in which removed model instances are kept until successfully synchronised with a Proxy,
         * at which point this is cleared.
         * @protected
         * @property {Ext.data.Model[]} removed
         */
        me.removed = [];

        me.mixins.observable.constructor.apply(me, arguments);

        // <debug>
        var configModel = me.model;
        // </debug>

        me.model = Ext.ModelManager.getModel(me.model);

        /**
         * @property {Object} modelDefaults
         * @private
         * A set of default values to be applied to every model instance added via {@link Ext.data.Store#insert insert} or created
         * via {@link Ext.data.Store#createModel createModel}. This is used internally by associations to set foreign keys and
         * other fields. See the Association classes source code for examples. This should not need to be used by application developers.
         */
        Ext.applyIf(me, {
            modelDefaults: null
        });

        //Supports the 3.x style of simply passing an array of fields to the store, implicitly creating a model
        if (!me.model && me.fields) {
            me.model = Ext.define('Ext.data.Store.ImplicitModel-' + (me.storeId || Ext.id()), {
                extend: 'Ext.data.Model',
                fields: me.fields,
                proxy: me.proxy || me.defaultProxyType
            });

            delete me.fields;

            me.implicitModel = true;
        }

        // <debug>
        if (!me.model && me.useModelWarning !== false) {
            // There are a number of ways things could have gone wrong, try to give as much information as possible
            var logMsg = [
                Ext.getClassName(me) || 'Store',
                ' created with no model.'
            ];

            if (typeof configModel === 'string') {
                logMsg.push(" The name '", configModel, "'", ' does not correspond to a valid model.');
            }

            Ext.log.warn(logMsg.join(''));
        }
        // </debug>

        //ensures that the Proxy is instantiated correctly
        me.setProxy(me.proxy || me.model.getProxy());

        if (me.id && !me.storeId) {
            me.storeId = me.id;
            delete me.id;
        }

        if (me.storeId) {
            Ext.data.StoreManager.register(me);
        }

        me.mixins.sortable.initSortable.call(me);

        /**
         * @property {Ext.util.MixedCollection} filters
         * The collection of {@link Ext.util.Filter Filters} currently applied to this Store
         */
        filters = me.decodeFilters(me.filters);
        me.filters = new Ext.util.MixedCollection();
        me.filters.addAll(filters);
    },

    /**
     * Sets the Store's Proxy by string, config object or Proxy instance
     * @param {String/Object/Ext.data.proxy.Proxy} proxy The new Proxy, which can be either a type string, a configuration object
     * or an Ext.data.proxy.Proxy instance
     * @return {Ext.data.proxy.Proxy} The attached Proxy object
     */
    setProxy: function(proxy) {
        var me = this,
            model = me.model;

        if (proxy instanceof Ext.data.proxy.Proxy) {
            proxy.setModel(model);
        } else {
            if (Ext.isString(proxy)) {
                proxy = {
                    type: proxy,
                    model: model
                };
            } else if (!proxy.model) {
                proxy = Ext.apply({
                    model: model
                }, proxy)
            }

            proxy = Ext.createByAlias('proxy.' + proxy.type, proxy);
        }

        if (!me.disableMetaChangeEvent) {
            proxy.on('metachange', me.onMetaChange, me);
        }

        me.proxy = proxy;

        return me.proxy;
    },

    /**
     * Returns the proxy currently attached to this proxy instance
     * @return {Ext.data.proxy.Proxy} The Proxy instance
     */
    getProxy: function() {
        return this.proxy;
    },

    // private
    onMetaChange: function(proxy, meta) {
        this.fireEvent('metachange', this, meta);
    },

    //saves any phantom records
    create: function(data, options) {
        var me = this,
            instance = Ext.ModelManager.create(Ext.applyIf(data, me.modelDefaults), me.model.modelName),
            operation;

        options = options || {};

        Ext.applyIf(options, {
            action : 'create',
            records: [instance]
        });

        operation = new Ext.data.Operation(options);

        me.proxy.create(operation, me.onProxyWrite, me);

        return instance;
    },

    read: function() {
        return this.load.apply(this, arguments);
    },

    update: function(options) {
        var me = this,
            operation;
        options = options || {};

        Ext.applyIf(options, {
            action : 'update',
            records: me.getUpdatedRecords()
        });

        operation = new Ext.data.Operation(options);

        return me.proxy.update(operation, me.onProxyWrite, me);
    },

    /**
     * @private
     * Callback for any write Operation over the Proxy. Updates the Store's MixedCollection to reflect
     * the updates provided by the Proxy
     */
    onProxyWrite: function(operation) {
        var me = this,
            success = operation.wasSuccessful(),
            records = operation.getRecords();

        switch (operation.action) {
            case 'create':
                me.onCreateRecords(records, operation, success);
                break;
            case 'update':
                me.onUpdateRecords(records, operation, success);
                break;
            case 'destroy':
                me.onDestroyRecords(records, operation, success);
                break;
        }

        if (success) {
            me.fireEvent('write', me, operation);
            me.fireEvent('datachanged', me);
            me.fireEvent('refresh', me);
        }
        //this is a callback that would have been passed to the 'create', 'update' or 'destroy' function and is optional
        Ext.callback(operation.callback, operation.scope || me, [records, operation, success]);
    },

    // may be implemented by store subclasses
    onCreateRecords: Ext.emptyFn,

    // may be implemented by store subclasses
    onUpdateRecords: Ext.emptyFn,

    /**
     * Removes any records when a write is returned from the server.
     * @private
     * @param {Ext.data.Model[]} records The array of removed records
     * @param {Ext.data.Operation} operation The operation that just completed
     * @param {Boolean} success True if the operation was successful
     */
    onDestroyRecords: function(records, operation, success) {
        if (success) {
            this.removed = [];
        }
    },

    // tells the attached proxy to destroy the given records
    // @since 3.4.0
    destroy: function(options) {
        var me = this,
            operation;

        options = options || {};

        Ext.applyIf(options, {
            action : 'destroy',
            records: me.getRemovedRecords()
        });

        operation = new Ext.data.Operation(options);

        return me.proxy.destroy(operation, me.onProxyWrite, me);
    },

    /**
     * @private
     * Attached as the 'operationcomplete' event listener to a proxy's Batch object. By default just calls through
     * to onProxyWrite.
     */
    onBatchOperationComplete: function(batch, operation) {
        return this.onProxyWrite(operation);
    },

    /**
     * @private
     * Attached as the 'complete' event listener to a proxy's Batch object. Iterates over the batch operations
     * and updates the Store's internal data MixedCollection.
     */
    onBatchComplete: function(batch, operation) {
        var me = this,
            operations = batch.operations,
            length = operations.length,
            i;

        me.suspendEvents();

        for (i = 0; i < length; i++) {
            me.onProxyWrite(operations[i]);
        }

        me.resumeEvents();

        me.fireEvent('datachanged', me);
        me.fireEvent('refresh', me);
    },

    /**
     * @private
     */
    onBatchException: function(batch, operation) {
        // //decide what to do... could continue with the next operation
        // batch.start();
        //
        // //or retry the last operation
        // batch.retry();
    },

    /**
     * @private
     * Filter function for new records.
     */
    filterNew: function(item) {
        // only want phantom records that are valid
        return item.phantom === true && item.isValid();
    },

    /**
     * Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not
     * yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)
     * @return {Ext.data.Model[]} The Model instances
     */
    getNewRecords: function() {
        return [];
    },

    /**
     * Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy
     * @return {Ext.data.Model[]} The updated Model instances
     */
    getUpdatedRecords: function() {
        return [];
    },

    /**
     * Gets all {@link Ext.data.Model records} added or updated since the last commit. Note that the order of records
     * returned is not deterministic and does not indicate the order in which records were modified. Note also that
     * removed records are not included (use {@link #getRemovedRecords} for that).
     * @return {Ext.data.Model[]} The added and updated Model instances
     */
    getModifiedRecords : function(){
        return [].concat(this.getNewRecords(), this.getUpdatedRecords());
    },

    /**
     * @private
     * Filter function for updated records.
     */
    filterUpdated: function(item) {
        // only want dirty records, not phantoms that are valid
        return item.dirty === true && item.phantom !== true && item.isValid();
    },

    /**
     * Returns any records that have been removed from the store but not yet destroyed on the proxy.
     * @return {Ext.data.Model[]} The removed Model instances
     */
    getRemovedRecords: function() {
        return this.removed;
    },

    filter: function(filters, value) {

    },

    /**
     * @private
     * Normalizes an array of filter objects, ensuring that they are all Ext.util.Filter instances
     * @param {Object[]} filters The filters array
     * @return {Ext.util.Filter[]} Array of Ext.util.Filter objects
     */
    decodeFilters: function(filters) {
        if (!Ext.isArray(filters)) {
            if (filters === undefined) {
                filters = [];
            } else {
                filters = [filters];
            }
        }

        var length = filters.length,
            Filter = Ext.util.Filter,
            config, i;

        for (i = 0; i < length; i++) {
            config = filters[i];

            if (!(config instanceof Filter)) {
                Ext.apply(config, {
                    root: 'data'
                });

                //support for 3.x style filters where a function can be defined as 'fn'
                if (config.fn) {
                    config.filterFn = config.fn;
                }

                //support a function to be passed as a filter definition
                if (typeof config == 'function') {
                    config = {
                        filterFn: config
                    };
                }

                filters[i] = new Filter(config);
            }
        }

        return filters;
    },

    clearFilter: function(supressEvent) {

    },

    isFiltered: function() {

    },

    filterBy: function(fn, scope) {

    },

    /**
     * Synchronizes the store with its {@link #proxy}. This asks the proxy to batch together any new, updated
     * and deleted records in the store, updating the store's internal representation of the records
     * as each operation completes.
     *
     * @param {Object} [options] Object containing one or more properties supported by the sync method (these get
     * passed along to the underlying proxy's {@link Ext.data.Proxy#batch batch} method):
     *
     * @param {Ext.data.Batch/Object} [options.batch] A {@link Ext.data.Batch} object (or batch config to apply
     * to the created batch). If unspecified a default batch will be auto-created as needed.
     *
     * @param {Function} [options.callback] The function to be called upon completion of the sync.
     * The callback is called regardless of success or failure and is passed the following parameters:
     * @param {Ext.data.Batch} options.callback.batch The {@link Ext.data.Batch batch} that was processed,
     * containing all operations in their current state after processing
     * @param {Object} options.callback.options The options argument that was originally passed into sync
     *
     * @param {Function} [options.success] The function to be called upon successful completion of the sync. The
     * success function is called only if no exceptions were reported in any operations. If one or more exceptions
     * occurred then the failure function will be called instead. The success function is called
     * with the following parameters:
     * @param {Ext.data.Batch} options.success.batch The {@link Ext.data.Batch batch} that was processed,
     * containing all operations in their current state after processing
     * @param {Object} options.success.options The options argument that was originally passed into sync
     *
     * @param {Function} [options.failure] The function to be called upon unsuccessful completion of the sync. The
     * failure function is called when one or more operations returns an exception during processing (even if some
     * operations were also successful). In this case you can check the batch's {@link Ext.data.Batch#exceptions
     * exceptions} array to see exactly which operations had exceptions. The failure function is called with the
     * following parameters:
     * @param {Ext.data.Batch} options.failure.batch The {@link Ext.data.Batch} that was processed, containing all
     * operations in their current state after processing
     * @param {Object} options.failure.options The options argument that was originally passed into sync
     *
     * @param {Object} [options.scope] The scope in which to execute any callbacks (i.e. the `this` object inside
     * the callback, success and/or failure functions). Defaults to the store's proxy.
     *
     * @return {Ext.data.Store} this
     */
    sync: function(options) {
        var me = this,
            operations = {},
            toCreate = me.getNewRecords(),
            toUpdate = me.getUpdatedRecords(),
            toDestroy = me.getRemovedRecords(),
            needsSync = false;

        if (toCreate.length > 0) {
            operations.create = toCreate;
            needsSync = true;
        }

        if (toUpdate.length > 0) {
            operations.update = toUpdate;
            needsSync = true;
        }

        if (toDestroy.length > 0) {
            operations.destroy = toDestroy;
            needsSync = true;
        }

        if (needsSync && me.fireEvent('beforesync', operations) !== false) {
            options = options || {};

            me.proxy.batch(Ext.apply(options, {
                operations: operations,
                listeners: me.getBatchListeners()
            }));
        }

        return me;
    },

    /**
     * @private
     * Returns an object which is passed in as the listeners argument to proxy.batch inside this.sync.
     * This is broken out into a separate function to allow for customisation of the listeners
     * @return {Object} The listeners object
     */
    getBatchListeners: function() {
        var me = this,
            listeners = {
                scope: me,
                exception: me.onBatchException
            };

        if (me.batchUpdateMode == 'operation') {
            listeners.operationcomplete = me.onBatchOperationComplete;
        } else {
            listeners.complete = me.onBatchComplete;
        }

        return listeners;
    },

    /**
     * Saves all pending changes via the configured {@link #proxy}. Use {@link #sync} instead.
     * @deprecated 4.0.0 Will be removed in the next major version
     */
    save: function() {
        return this.sync.apply(this, arguments);
    },

    /**
     * Loads the Store using its configured {@link #proxy}.
     * @param {Object} options (optional) config object. This is passed into the {@link Ext.data.Operation Operation}
     * object that is created and then sent to the proxy's {@link Ext.data.proxy.Proxy#read} function
     *
     * @return {Ext.data.Store} this
     * @since 1.1.0
     */
    load: function(options) {
        var me = this,
            operation = {
                action: 'read'
            };

        // Only add filtering and sorting options if those options are remote
        if (me.remoteFilter) {
            operation.filters = me.filters.items;
        }
        if (me.remoteSort) {
            operation.sorters = me.getSorters();
        }
        Ext.apply(operation, options);
        me.lastOptions = operation;

        operation = new Ext.data.Operation(operation);

        if (me.fireEvent('beforeload', me, operation) !== false) {
            me.loading = true;
            me.proxy.read(operation, me.onProxyLoad, me);
        }

        return me;
    },

    /**
     * Reloads the store using the last options passed to the {@link #method-load} method.
     * @param {Object} options A config object which contains options which may override the options passed to the previous load call.
     */
    reload: function(options) {
        var o = Ext.apply({}, options, this.lastOptions);
        return this.load(o);
    },

    /**
     * @private
     * A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to.
     * @param {Ext.data.Model} record The model instance that was edited
     * @param {String[]} modifiedFieldNames Array of field names changed during edit.
     * @since 3.4.0
     */
    afterEdit : function(record, modifiedFieldNames) {
        var me = this,
            i, shouldSync;

        if (me.autoSync && !me.autoSyncSuspended) {
            for (i = modifiedFieldNames.length; i--;) {
                // only sync if persistent fields were modified
                if (record.fields.get(modifiedFieldNames[i]).persist) {
                    shouldSync = true;
                    break;
                }
            }
            if (shouldSync) {
                me.sync();
            }
        }
        me.onUpdate(record, Ext.data.Model.EDIT, modifiedFieldNames);
        me.fireEvent('update', me, record, Ext.data.Model.EDIT, modifiedFieldNames);
    },

    /**
     * @private
     * A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to..
     * @param {Ext.data.Model} record The model instance that was edited
     * @since 3.4.0
     */
    afterReject : function(record) {
        // Must pass the 5th param (modifiedFieldNames) as null, otherwise the
        // event firing machinery appends the listeners "options" object to the arg list
        // which may get used as the modified fields array by a handler.
        // This array is used for selective grid cell updating by Grid View.
        // Null will be treated as though all cells need updating.
        this.onUpdate(record, Ext.data.Model.REJECT, null);
        this.fireEvent('update', this, record, Ext.data.Model.REJECT, null);
    },

    /**
     * @private
     * A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to.
     * @param {Ext.data.Model} record The model instance that was edited
     * @since 3.4.0
     */
    afterCommit : function(record, modifiedFieldNames) {
        if (!modifiedFieldNames) {
            modifiedFieldNames = null;
        }
        this.onUpdate(record, Ext.data.Model.COMMIT, modifiedFieldNames);
        this.fireEvent('update', this, record, Ext.data.Model.COMMIT, modifiedFieldNames);
    },

    onUpdate: Ext.emptyFn,

    onIdChanged: function(model, oldId, newId, oldInternalId){
        this.fireEvent('idchanged', this, model, oldId, newId, oldInternalId);
    },

    // private
    destroyStore: function() {
        var implicitModelName,
            me = this;

        if (!me.isDestroyed) {
            me.clearListeners();
            if (me.storeId) {
                Ext.data.StoreManager.unregister(me);
            }
            me.clearData();
            me.data = me.tree = me.sorters = me.filters = me.groupers = null;
            if (me.reader) {
                me.reader.destroyReader();
            }
            me.proxy = me.reader = me.writer = null;
            me.isDestroyed = true;

            if (me.implicitModel) {
                implicitModelName = Ext.getClassName(me.model);
                Ext.undefine(implicitModelName);
                Ext.ModelManager.unregisterType(implicitModelName);
            } else {
                me.model = null;
            }
        }
    },

    /**
     * @private
     * Returns the grouping, sorting and filtered state of this Store.
     */
    getState: function() {
        var me = this,
            hasState,
            result,
            hasGroupers = !!me.groupers,
            groupers = [],
            sorters = [],
            filters = [];

        if (hasGroupers) {
            me.groupers.each(function(g) {
                groupers[groupers.length] = g.serialize();
                hasState = true;
            });
        }

        if (me.sorters) {
            // Create sorters config array.
            me.sorters.each(function(s) {
                // Sorters collection gets groupers prepended to it, so do not duplicate
                if (hasGroupers && !me.groupers.contains(s)) {
                    sorters[sorters.length] = s.serialize();
                    hasState = true;
                }
            });
        }

        // Because we do not provide a filter changing mechanism, only statify the filters if they opt in.
        // Otherwise filters would get "stuck".
        if (me.filters && me.statefulFilters) {
            me.filters.each(function(f) {
                filters[filters.length] = f.serialize();
                hasState = true;
            });
        }

        // If there is any state to save, return it as an object
        if (hasState) {
            result = {};
            if (groupers.length) {
                result.groupers = groupers;
            }
            if (sorters.length) {
                result.sorters = sorters;
            }
            if (filters.length) {
                result.filters = filters;
            }
            return result;
        }
    },

    /**
     * @private
     * Restores state to the passed state
     */
    applyState: function(state) {
        var me = this,
            hasSorters = !!me.sorters,
            hasGroupers = !!me.groupers,
            hasFilters = !!me.filters,
            locallySorted;

        if (hasGroupers && state.groupers) {
            me.groupers.clear();
            me.groupers.addAll(me.decodeGroupers(state.groupers));
        }

        if (hasSorters && state.sorters) {
            me.sorters.clear();
            me.sorters.addAll(me.decodeSorters(state.sorters));
        }

        if (hasFilters && state.filters) {
            me.filters.clear();
            me.filters.addAll(me.decodeFilters(state.filters));
        }

        if (hasSorters && hasGroupers) {
            // Sorters collection gets groupers prepended to it
            me.sorters.insert(0, me.groupers.getRange());
        }

        // Data manipulated by the server - reload
        if (me.autoLoad && (me.remoteSort || me.remoteGroup || me.remoteFilter)) {
            if (me.autoLoad === true) {
                me.reload();
            } else {
                me.reload(me.autoLoad);
            }
        }

        // If we have local filters, filter the data
        if (hasFilters && me.filters.length && !me.remoteFilter) {
            me.filter();
            locallySorted = me.sortOnFilter;
        }

        // If we have local sorters, and the data is not already sorted by a sortOnFilter operation, then sort.
        if (hasSorters && me.sorters.length && !me.remoteSort && !locallySorted) {
            me.sort();
        }
    },

    // private
    doSort: function(sorterFn) {
        var me = this;
        if (me.remoteSort) {
            //the load function will pick up the new sorters and request the sorted data from the proxy
            me.load();
        } else {
            me.data.sortBy(sorterFn);
            me.fireEvent('datachanged', me);
            me.fireEvent('refresh', me);
        }
        me.fireEvent('sort', me, me.sorters.getRange());
    },

    // to be implemented by subclasses
    clearData: Ext.emptyFn,

    // to be implemented by subclasses
    getCount: Ext.emptyFn,

    // to be implemented by subclasses
    getById: Ext.emptyFn,

    /**
     * Removes all records from the store. This method does a "fast remove",
     * individual remove events are not called. The {@link #clear} event is
     * fired upon completion.
     * @method
     * @since 1.1.0
     */
    removeAll: Ext.emptyFn,
    // individual store subclasses should implement a "fast" remove
    // and fire a clear event afterwards

    /**
     * Returns true if the Store is currently performing a load operation
     * @return {Boolean} True if the Store is currently loading
     */
    isLoading: function() {
        return !!this.loading;
    },

    /**
     * Suspends automatically syncing the Store with its Proxy.  Only applicable if {@link #autoSync} is `true`
     */
    suspendAutoSync: function() {
        this.autoSyncSuspended = true;
    },

    /**
     * Resumes automatically syncing the Store with its Proxy.  Only applicable if {@link #autoSync} is `true`
     */
    resumeAutoSync: function() {
        this.autoSyncSuspended = false;
    }

});


text: Bilder


text:
html, body {
  height: 100%; margin: 0; padding: 0;
}

#githubLink{
  float: right;
  text-align: center;
  color: inherit;
  text-decoration: none
}

#caltrainTitle{
  margin-left: 32%;
}

#mapContainer {
  top:5%;
  height: 80%;
  background: url("/img/trainbackground.png") no-repeat center center;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

#map {
  top: 10%;
  height: 70%;
  width: 35%;
  left: 32%;
  border-radius: 50%;
}

.buttonWrap{
  text-align: center;
}
#mapButton {
  width: 11%;
   margin: 0 auto;
   display:block;
   border-top: 1px solid #96d1f8;
   background: #65a9d7;
   padding: 14px 28px;
   border-radius: 21px;
   color: white;
   font-size: 15px;
   font-family: 'Lucida Grande', Helvetica, Arial, Sans-Serif;
   text-decoration: none;
   vertical-align: middle;
   }
#mapButton:hover {
   background: #000000;
   color: #7a8cff;
   cursor: pointer;
   }
#mapButton:active {
   background: #1b435e;
   }

table{
  border: 1px solid black;
  width:100%
}

td{
  text-align: center;
}