text:
using YAF.Lucene.Net.Support;
using System;

namespace YAF.Lucene.Net.Codecs.Lucene3x
{

    using IndexInput = YAF.Lucene.Net.Store.IndexInput;

    [Obsolete("(4.0) this is only used to read indexes created before 4.0.")]
    internal sealed class Lucene3xSkipListReader : MultiLevelSkipListReader
    {
        private bool currentFieldStoresPayloads;
        private long[] freqPointer;
        private long[] proxPointer;
        private int[] payloadLength;

        private long lastFreqPointer;
        private long lastProxPointer;
        private int lastPayloadLength;

        public Lucene3xSkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval)
            : base(skipStream, maxSkipLevels, skipInterval)
        {
            freqPointer = new long[maxSkipLevels];
            proxPointer = new long[maxSkipLevels];
            payloadLength = new int[maxSkipLevels];
        }

        public void Init(long skipPointer, long freqBasePointer, long proxBasePointer, int df, bool storesPayloads)
        {
            base.Init(skipPointer, df);
            this.currentFieldStoresPayloads = storesPayloads;
            lastFreqPointer = freqBasePointer;
            lastProxPointer = proxBasePointer;

            Arrays.Fill(freqPointer, freqBasePointer);
            Arrays.Fill(proxPointer, proxBasePointer);
            Arrays.Fill(payloadLength, 0);
        }

        /// <summary>
        /// Returns the freq pointer of the doc to which the last call of
        /// <see cref="MultiLevelSkipListReader.SkipTo(int)"/> has skipped.
        /// </summary>
        public long FreqPointer
        {
            get
            {
                return lastFreqPointer;
            }
        }

        /// <summary>
        /// Returns the prox pointer of the doc to which the last call of
        /// <see cref="MultiLevelSkipListReader.SkipTo(int)"/> has skipped.
        /// </summary>
        public long ProxPointer
        {
            get
            {
                return lastProxPointer;
            }
        }

        /// <summary>
        /// Returns the payload length of the payload stored just before
        /// the doc to which the last call of <see cref="MultiLevelSkipListReader.SkipTo(int)"/>
        /// has skipped.
        /// </summary>
        public int PayloadLength
        {
            get
            {
                return lastPayloadLength;
            }
        }

        protected override void SeekChild(int level)
        {
            base.SeekChild(level);
            freqPointer[level] = lastFreqPointer;
            proxPointer[level] = lastProxPointer;
            payloadLength[level] = lastPayloadLength;
        }

        protected override void SetLastSkipData(int level)
        {
            base.SetLastSkipData(level);
            lastFreqPointer = freqPointer[level];
            lastProxPointer = proxPointer[level];
            lastPayloadLength = payloadLength[level];
        }

        protected override int ReadSkipData(int level, IndexInput skipStream)
        {
            int delta;
            if (currentFieldStoresPayloads)
            {
                // the current field stores payloads.
                // if the doc delta is odd then we have
                // to read the current payload length
                // because it differs from the length of the
                // previous payload
                delta = skipStream.ReadVInt32();
                if ((delta & 1) != 0)
                {
                    payloadLength[level] = skipStream.ReadVInt32();
                }
                delta = (int)((uint)delta >> 1);
            }
            else
            {
                delta = skipStream.ReadVInt32();
            }

            freqPointer[level] += skipStream.ReadVInt32();
            proxPointer[level] += skipStream.ReadVInt32();

            return delta;
        }
    }
}


text:
package im.actor.core;

import com.google.j2objc.annotations.ObjectiveCName;

import org.jetbrains.annotations.NotNull;

import java.util.HashMap;

import im.actor.core.entity.Contact;
import im.actor.core.entity.Dialog;
import im.actor.core.entity.Message;
import im.actor.core.entity.Peer;
import im.actor.core.entity.SearchEntity;
import im.actor.runtime.generic.mvvm.BindedDisplayList;

public class CocoaMessenger extends Messenger {

    private BindedDisplayList<Dialog> dialogList;
    private HashMap<Peer, BindedDisplayList<Message>> messagesLists = new HashMap<Peer, BindedDisplayList<Message>>();

    /**
     * Construct messenger
     *
     * @param configuration configuration of messenger
     */
    @ObjectiveCName("initWithConfiguration:")
    public CocoaMessenger(@NotNull Configuration configuration) {
        super(configuration);
    }

    @ObjectiveCName("getDialogsDisplayList")
    public BindedDisplayList<Dialog> getDialogsDisplayList() {
        if (dialogList == null) {
            dialogList = (BindedDisplayList<Dialog>) modules.getDisplayListsModule().getDialogsSharedList();
            dialogList.setBindHook(new BindedDisplayList.BindHook<Dialog>() {
                @Override
                public void onScrolledToEnd() {
                    modules.getMessagesModule().loadMoreDialogs();
                }

                @Override
                public void onItemTouched(Dialog item) {

                }
            });
        }

        return dialogList;
    }

    @ObjectiveCName("getMessageDisplayList:")
    public BindedDisplayList<Message> getMessageDisplayList(final Peer peer) {
        if (!messagesLists.containsKey(peer)) {
            BindedDisplayList<Message> list = (BindedDisplayList<Message>) modules.getDisplayListsModule().getMessagesSharedList(peer);
            list.setBindHook(new BindedDisplayList.BindHook<Message>() {
                @Override
                public void onScrolledToEnd() {
                    modules.getMessagesModule().loadMoreHistory(peer);
                }

                @Override
                public void onItemTouched(Message item) {
                    if (item.isOnServer()) {
                        modules.getMessagesModule().onMessageShown(peer, item.getSenderId(), item.getSortDate());
                    }
                }
            });
            messagesLists.put(peer, list);
        }

        return messagesLists.get(peer);
    }

    @ObjectiveCName("buildSearchDisplayList")
    public BindedDisplayList<SearchEntity> buildSearchDisplayList() {
        return (BindedDisplayList<SearchEntity>) modules.getDisplayListsModule().buildSearchList(false);
    }

    @ObjectiveCName("buildContactsDisplayList")
    public BindedDisplayList<Contact> buildContactsDisplayList() {
        return (BindedDisplayList<Contact>) modules.getDisplayListsModule().buildContactList(false);
    }
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef LIGHTGBM_OBJECTIVE_CUDA_CUDA_REGRESSION_OBJECTIVE_HPP_
#define LIGHTGBM_OBJECTIVE_CUDA_CUDA_REGRESSION_OBJECTIVE_HPP_

#ifdef USE_CUDA_EXP

#define GET_GRADIENTS_BLOCK_SIZE_REGRESSION (1024)

#include <LightGBM/cuda/cuda_objective_function.hpp>

#include <string>
#include <vector>

#include "../regression_objective.hpp"

namespace LightGBM {

class CUDARegressionL2loss : public CUDAObjectiveInterface, public RegressionL2loss {
 public:
  explicit CUDARegressionL2loss(const Config& config);

  explicit CUDARegressionL2loss(const std::vector<std::string>& strs);

  ~CUDARegressionL2loss();

  void Init(const Metadata& metadata, data_size_t num_data) override;

  void GetGradients(const double* score, score_t* gradients, score_t* hessians) const override;

  void ConvertOutputCUDA(const data_size_t num_data, const double* input, double* output) const override;

  double BoostFromScore(int) const override;

  std::function<void(data_size_t, const double*, double*)> GetCUDAConvertOutputFunc() const override {
    return [this] (data_size_t num_data, const double* input, double* output) {
      ConvertOutputCUDA(num_data, input, output);
    };
  }

  bool IsConstantHessian() const override {
    if (cuda_weights_ == nullptr) {
      return true;
    } else {
      return false;
    }
  }

  bool IsCUDAObjective() const override { return true; }

 protected:
  virtual double LaunchCalcInitScoreKernel() const;

  virtual void LaunchGetGradientsKernel(const double* score, score_t* gradients, score_t* hessians) const;

  virtual void LaunchConvertOutputCUDAKernel(const data_size_t num_data, const double* input, double* output) const;

  const label_t* cuda_labels_;
  const label_t* cuda_weights_;
  CUDAVector<label_t> cuda_trans_label_;
  CUDAVector<double> cuda_block_buffer_;
  data_size_t num_get_gradients_blocks_;
  data_size_t num_init_score_blocks_;
};

class CUDARegressionL1loss : public CUDARegressionL2loss {
 public:
  explicit CUDARegressionL1loss(const Config& config);

  explicit CUDARegressionL1loss(const std::vector<std::string>& strs);

  ~CUDARegressionL1loss();

  void Init(const Metadata& metadata, data_size_t num_data) override;

  void RenewTreeOutputCUDA(const double* score, const data_size_t* data_indices_in_leaf, const data_size_t* num_data_in_leaf,
    const data_size_t* data_start_in_leaf, const int num_leaves, double* leaf_value) const override;

  bool IsRenewTreeOutput() const override { return true; }

 protected:
  CUDAVector<data_size_t> cuda_data_indices_buffer_;
  CUDAVector<double> cuda_weights_prefix_sum_;
  CUDAVector<double> cuda_weights_prefix_sum_buffer_;
  CUDAVector<double> cuda_residual_buffer_;
  CUDAVector<label_t> cuda_weight_by_leaf_buffer_;
  CUDAVector<label_t> cuda_percentile_result_;

  double LaunchCalcInitScoreKernel() const override;

  void LaunchGetGradientsKernel(const double* score, score_t* gradients, score_t* hessians) const override;

  void LaunchRenewTreeOutputCUDAKernel(
    const double* score, const data_size_t* data_indices_in_leaf, const data_size_t* num_data_in_leaf,
    const data_size_t* data_start_in_leaf, const int num_leaves, double* leaf_value) const;
};

class CUDARegressionHuberLoss : public CUDARegressionL2loss {
 public:
  explicit CUDARegressionHuberLoss(const Config& config);

  explicit CUDARegressionHuberLoss(const std::vector<std::string>& strs);

  ~CUDARegressionHuberLoss();

  bool IsRenewTreeOutput() const override { return true; }

 private:
  void LaunchGetGradientsKernel(const double* score, score_t* gradients, score_t* hessians) const override;

  const double alpha_ = 0.0f;
};

}  // namespace LightGBM

#endif  // USE_CUDA_EXP
#endif  // LIGHTGBM_OBJECTIVE_CUDA_CUDA_REGRESSION_OBJECTIVE_HPP_


text:
Spree.config do |config|
  # Example:
  # Uncomment to stop tracking inventory levels in the application
  # config.track_inventory_levels = false
end

Spree.user_class = "Spree::User"
Spree::Config.products_per_page = 15


text:
% rtcGetDeviceProperty(3) | Embree Ray Tracing Kernels 3

#### NAME

    rtcGetDeviceProperty - queries properties of the device

#### SYNOPSIS

    #include <embree3/rtcore.h>

    ssize_t rtcGetDeviceProperty(
      RTCDevice device,
      enum RTCDeviceProperty prop
    );

#### DESCRIPTION

The `rtcGetDeviceProperty` function can be used to query properties
(`prop` argument) of a device object (`device` argument). The returned
property is an integer of type `ssize_t`.

Possible properties to query are:

+   `RTC_DEVICE_PROPERTY_VERSION`: Queries the combined version number
    (MAJOR.MINOR.PATCH) with two decimal digits per component. E.g. for
    Embree 2.8.3 the integer 208003 is returned.

+   `RTC_DEVICE_PROPERTY_VERSION_MAJOR`: Queries the major version
    number of Embree.

+   `RTC_DEVICE_PROPERTY_VERSION_MINOR`: Queries the minor version
    number of Embree.

+   `RTC_DEVICE_PROPERTY_VERSION_PATCH`: Queries the patch version
    number of Embree.

+   `RTC_DEVICE_PROPERTY_NATIVE_RAY4_SUPPORTED`: Queries whether the
    `rtcIntersect4` and `rtcOccluded4` functions preserve packet size
    and ray order when invoking callback functions. This is only the
    case if Embree is compiled with `EMBREE_RAY_PACKETS` and `SSE2`
    (or `SSE4.2`) enabled, and if the machine it is running on
    supports `SSE2` (or `SSE4.2`).

+   `RTC_DEVICE_PROPERTY_NATIVE_RAY8_SUPPORTED`: Queries whether the
    `rtcIntersect8` and `rtcOccluded8` functions preserve packet size
    and ray order when invoking callback functions. This is only the
    case if Embree is compiled with `EMBREE_RAY_PACKETS` and `AVX`
    (or `AVX2`) enabled, and if the machine it is running on supports
    `AVX` (or `AVX2`).

+   `RTC_DEVICE_PROPERTY_NATIVE_RAY16_SUPPORTED`: Queries whether the
    `rtcIntersect16` and `rtcOccluded16` functions preserve packet
    size and ray order when invoking callback functions. This is only
    the case if Embree is compiled with `EMBREE_RAY_PACKETS` and
    `AVX512` enabled, and if the machine it is
    running on supports `AVX512`.

+   `RTC_DEVICE_PROPERTY_RAY_STREAM_SUPPORTED`: Queries whether
    `rtcIntersect1M`, `rtcIntersect1Mp`, `rtcIntersectNM`,
    `rtcIntersectNp`, `rtcOccluded1M`, `rtcOccluded1Mp`,
    `rtcOccludedNM`, and `rtcOccludedNp` are supported. This is only
    the case if Embree is compiled with `EMBREE_RAY_PACKETS` enabled.

+   `RTC_DEVICE_PROPERTY_RAY_MASK_SUPPORTED`: Queries whether ray masks
    are supported. This is only the case if Embree is compiled with
    `EMBREE_RAY_MASK` enabled.

+   `RTC_DEVICE_PROPERTY_BACKFACE_CULLING_ENABLED`: Queries whether
    back face culling is enabled. This is only the case if Embree is
    compiled with `EMBREE_BACKFACE_CULLING` enabled.

+   `RTC_DEVICE_PROPERTY_COMPACT_POLYS_ENABLED`: Queries whether
    compact polys is enabled. This is only the case if Embree is
    compiled with `EMBREE_COMPACT_POLYS` enabled.

+   `RTC_DEVICE_PROPERTY_FILTER_FUNCTION_SUPPORTED`: Queries whether
    filter functions are supported, which is the case if Embree is
    compiled with `EMBREE_FILTER_FUNCTION` enabled.

+   `RTC_DEVICE_PROPERTY_IGNORE_INVALID_RAYS_ENABLED`: Queries whether
    invalid rays are ignored, which is the case if Embree is compiled
    with `EMBREE_IGNORE_INVALID_RAYS` enabled.

+   `RTC_DEVICE_PROPERTY_TRIANGLE_GEOMETRY_SUPPORTED`: Queries whether
    triangles are supported, which is the case if Embree is compiled
    with `EMBREE_GEOMETRY_TRIANGLE` enabled.

+   `RTC_DEVICE_PROPERTY_QUAD_GEOMETRY_SUPPORTED`: Queries whether
    quads are supported, which is the case if Embree is compiled
    with `EMBREE_GEOMETRY_QUAD` enabled.

+   `RTC_DEVICE_PROPERTY_SUBDIVISION_GEOMETRY_SUPPORTED`: Queries
    whether subdivision meshes are supported, which is the case if
    Embree is compiled with `EMBREE_GEOMETRY_SUBDIVISION` enabled.

+   `RTC_DEVICE_PROPERTY_CURVE_GEOMETRY_SUPPORTED`: Queries whether
    curves are supported, which is the case if Embree is compiled
    with `EMBREE_GEOMETRY_CURVE` enabled.

+   `RTC_DEVICE_PROPERTY_POINT_GEOMETRY_SUPPORTED`: Queries whether
    points are supported, which is the case if Embree is compiled
    with `EMBREE_GEOMETRY_POINT` enabled.

+   `RTC_DEVICE_PROPERTY_USER_GEOMETRY_SUPPORTED`: Queries whether user
    geometries are supported, which is the case if Embree is compiled
    with `EMBREE_GEOMETRY_USER` enabled.

+   `RTC_DEVICE_PROPERTY_TASKING_SYSTEM`: Queries the tasking system
    Embree is compiled with. Possible return values are:

    0. internal tasking system
    1. Intel Threading Building Blocks (TBB)
    2. Parallel Patterns Library (PPL)

+   `RTC_DEVICE_PROPERTY_JOIN_COMMIT_SUPPORTED`: Queries whether
    `rtcJoinCommitScene` is supported. This is not the case when Embree is
    compiled with PPL or older versions of TBB.

+   `RTC_DEVICE_PROPERTY_PARALLEL_COMMIT_SUPPORTED`: Queries whether
    `rtcCommitScene` can get invoked from multiple TBB worker threads
    concurrently. This feature is only supported starting with TBB 2019 Update 9.

#### EXIT STATUS

On success returns the value of the queried property. For properties
returning a boolean value, the return value 0 denotes `false` and 1
denotes `true`.

On failure zero is returned and an error code is set that can be
queried using `rtcGetDeviceError`.


text:
class UIEditField;
class ClassReflectionNode;
class UIBox;
class UILabel;
class UIButton;
class UIPropertyField : public UIWidget
{
public:
	UIPropertyField();
	~UIPropertyField();
	void SetTarget(ClassReflectionNode* Node);

	void UpdateScaled() override;
	bool UseBackGround = false;
	bool UseSilder = false;
protected:
	void UpdateType();
	void UpdateSize();
	bool NeedsPicker()const;
	UIEditField* Field = nullptr;
	UIEditField* ExtraFields[3]{};
	ClassReflectionNode* TargetProperty = nullptr;
	UILabel* Namelabel = nullptr;
	UIBox* BackGround = nullptr;
	UIButton* PickerButton = nullptr;
	int ExtraFieldCount = 0;
	int PickerButtonSize = 20;
};


text:
"""Test for checking stats accumulator related ops."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.contrib.boosted_trees.python.ops import stats_accumulator_ops
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import test_util
from tensorflow.python.platform import googletest

class StatsAccumulatorScalarTest(test_util.TensorFlowTestCase):
  """Tests for scalar gradients and hessians accumulator."""

  def testSimpleAcculumator(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([]),
          hessian_shape=tensor_shape.TensorShape([]))
      with ops.control_dependencies([accumulator.initializer]):
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 0], [3, 0]],
            gradients=[0.1, 0.3],
            hessians=[0.2, 0.4])
        op2 = accumulator.add(0, [1], [[2, 0]], [0.1], [0.2])

      with ops.control_dependencies([op1, op2]):
        num_updates, partition, bucket_ids, grads, hessians = accumulator.flush(
            stamp_token=0, next_stamp_token=1)
        num_updates, partition, bucket_ids, grads, hessians = sess.run(
            [num_updates, partition, bucket_ids, grads, hessians])

      result = _AccumulatorResultToDict(partition, bucket_ids, grads, hessians)
      self.assertEqual(num_updates, 2)
      self.assertEqual(len(result), 2)
      # Key is partition, bucket, dimension
      self.assertAllClose(result[(1, 2, 0)], [0.2, 0.4])
      self.assertAllClose(result[(2, 3, 0)], [0.3, 0.4])

  def testMultidimensionalAcculumator(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([]),
          hessian_shape=tensor_shape.TensorShape([]))
      with ops.control_dependencies([accumulator.initializer]):
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2, 1],
            feature_ids=[[2, 2], [3, 0], [2, 2]],
            gradients=[0.1, 0.3, 0.8],
            hessians=[0.2, 0.4, -9])
        op2 = accumulator.add(0, [2, 1], [[3, 1], [2, 2]], [0.1, 1], [0.2, -1])

      with ops.control_dependencies([op1, op2]):
        num_updates, partition, bucket_ids, grads, hessians = accumulator.flush(
            stamp_token=0, next_stamp_token=1)
        num_updates, partition, bucket_ids, grads, hessians = sess.run(
            [num_updates, partition, bucket_ids, grads, hessians])

      result = _AccumulatorResultToDict(partition, bucket_ids, grads, hessians)
      self.assertEqual(num_updates, 2)
      self.assertEqual(len(result), 3)
      # Key is partition, bucket, dimension.
      self.assertAllClose(result[(1, 2, 2)], [1.9, -9.8])
      self.assertAllClose(result[(2, 3, 0)], [0.3, 0.4])
      self.assertAllClose(result[(2, 3, 1)], [0.1, 0.2])

  def testDropStaleUpdate(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([]),
          hessian_shape=tensor_shape.TensorShape([]))
      with ops.control_dependencies([accumulator.initializer]):
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 0], [3, 0]],
            gradients=[0.1, 0.3],
            hessians=[0.2, 0.4])
        op2 = accumulator.add(
            stamp_token=-1,
            partition_ids=[1],
            feature_ids=[[2, 0]],
            gradients=[0.1],
            hessians=[0.2])

      with ops.control_dependencies([op1, op2]):
        num_updates, partition, feature, grads, hessians = accumulator.flush(
            stamp_token=0, next_stamp_token=1)
        num_updates, partition, feature, grads, hessians = sess.run(
            [num_updates, partition, feature, grads, hessians])

      result = _AccumulatorResultToDict(partition, feature, grads, hessians)
      self.assertEqual(num_updates, 1)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result[(1, 2, 0)], [0.1, 0.2])
      self.assertAllClose(result[(2, 3, 0)], [0.3, 0.4])

  def testSerialize(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([]),
          hessian_shape=tensor_shape.TensorShape([]))
      with ops.control_dependencies([accumulator.initializer]):
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 0], [3, 0]],
            gradients=[0.1, 0.3],
            hessians=[0.2, 0.4])

      with ops.control_dependencies([op1]):
        (stamp_token, num_updates, partition_1, feature_1, grads_1,
         hessians_1) = accumulator.saveable.serialize()
      # Make sure that the accumulator hasn't changed during serialization.
      with ops.control_dependencies([stamp_token]):
        num_updates_2, partition_2, feature_2, grads_2, hessians_2 = (
            accumulator.flush(stamp_token=0, next_stamp_token=1))
        (stamp_token, num_updates, partition_1, feature_1, grads_1, hessians_1,
         num_updates_2, partition_2, feature_2, grads_2, hessians_2) = sess.run(
             [
                 stamp_token, num_updates, partition_1, feature_1, grads_1,
                 hessians_1, num_updates_2, partition_2, feature_2, grads_2,
                 hessians_2
             ])

      result_1 = _AccumulatorResultToDict(partition_1, feature_1, grads_1,
                                          hessians_1)
      result_2 = _AccumulatorResultToDict(partition_2, feature_2, grads_2,
                                          hessians_2)
      self.assertEqual(num_updates, 1)
      self.assertEqual(num_updates_2, 1)
      self.assertEqual(len(result_1), 2)
      self.assertAllClose(result_1[(1, 2, 0)], [0.1, 0.2])
      self.assertAllClose(result_1[(2, 3, 0)], [0.3, 0.4])
      self.assertAllEqual(result_1, result_2)
      self.assertEqual(0, stamp_token)

  def testDeserialize(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([]),
          hessian_shape=tensor_shape.TensorShape([]))
      with ops.control_dependencies([accumulator.initializer]):
        # These will be deleted due to deserialize call.
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 0], [3, 1]],
            gradients=[0.1, 0.3],
            hessians=[0.2, 0.4])

      with ops.control_dependencies([op1]):
        deserialize = (
            accumulator.saveable.deserialize(
                stamp_token=2,
                num_updates=3,
                partition_ids=[3, 4],
                feature_ids=[[5, 0], [6, 2]],
                gradients=[0.4, 0.5],
                hessians=[0.6, 0.7]))
      with ops.control_dependencies([deserialize]):
        num_updates, partition, feature, grads, hessians = accumulator.flush(
            stamp_token=2, next_stamp_token=3)
        num_updates, partition, feature, grads, hessians = sess.run(
            [num_updates, partition, feature, grads, hessians])

      result = _AccumulatorResultToDict(partition, feature, grads,
                                        hessians)
      self.assertEqual(num_updates, 3)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result[(3, 5, 0)], [0.4, 0.6])
      self.assertAllClose(result[(4, 6, 2)], [0.5, 0.7])

  def testMakeSummary(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([]),
          hessian_shape=tensor_shape.TensorShape([]))
      partition, feature, grads, hessians = accumulator._make_summary(
          partition_ids=[1, 2, 1],
          feature_ids=[[2, 0], [3, 1], [2, 0]],
          gradients=[0.1, 0.3, 0.1],
          hessians=[0.2, 0.4, 0.2])
      partition, feature, grads, hessians = sess.run(
          [partition, feature, grads, hessians])
      result = _AccumulatorResultToDict(partition, feature, grads, hessians)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result[(1, 2, 0)], [0.2, 0.4])
      self.assertAllClose(result[(2, 3, 1)], [0.3, 0.4])

class StatsAccumulatorTensorTest(test_util.TensorFlowTestCase):
  """Tests for tensor gradients and hessians accumulator."""

  def testSimpleAcculumator(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([2]),
          hessian_shape=tensor_shape.TensorShape([2, 2]))
      with ops.control_dependencies([accumulator.initializer]):
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 0], [3, 0]],
            # Two values for gradients,
            gradients=[[0.1, 0.1], [0.2, 0.2]],
            # A 2x2 matrix for each hessian.
            hessians=[[[0.01, 0.02], [0.03, 0.04]], [[0.05, 0.06], [0.07,
                                                                    0.08]]])
        op2 = accumulator.add(
            stamp_token=0,
            partition_ids=[1],
            feature_ids=[[2, 0]],
            gradients=[[0.10, 0.11]],
            hessians=[[[0.011, 0.022], [0.033, 0.044]]])

      with ops.control_dependencies([op1, op2]):
        num_updates, partition, feature, grads, hessians = accumulator.flush(
            stamp_token=0, next_stamp_token=1)
        num_updates, partition, feature, grads, hessians = sess.run(
            [num_updates, partition, feature, grads, hessians])

      result = _AccumulatorResultToDict(partition, feature, grads, hessians)
      self.assertEqual(num_updates, 2)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result[(1, 2, 0)][0], [0.20, 0.21])
      self.assertAllClose(result[(1, 2, 0)][1],
                          [[0.021, 0.042], [0.063, 0.084]])
      self.assertAllClose(result[(2, 3, 0)][0], [0.2, 0.2])
      self.assertAllClose(result[(2, 3, 0)][1], [[0.05, 0.06], [0.07, 0.08]])

  def testMultidimensionalAcculumator(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([2]),
          hessian_shape=tensor_shape.TensorShape([2, 2]))
      with ops.control_dependencies([accumulator.initializer]):
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 4], [3, 1]],
            # Two values for gradients,
            gradients=[[0.1, 0.1], [0.2, 0.2]],
            # A 2x2 matrix for each hessian.
            hessians=[[[0.01, 0.02], [0.03, 0.04]], [[0.05, 0.06], [0.07,
                                                                    0.08]]])
        op2 = accumulator.add(
            stamp_token=0,
            partition_ids=[1],
            feature_ids=[[2, 4]],
            gradients=[[0.10, 0.11]],
            hessians=[[[0.011, 0.022], [0.033, 0.044]]])

      with ops.control_dependencies([op1, op2]):
        num_updates, partition, feature, grads, hessians = accumulator.flush(
            stamp_token=0, next_stamp_token=1)
        num_updates, partition, feature, grads, hessians = sess.run(
            [num_updates, partition, feature, grads, hessians])

      result = _AccumulatorResultToDict(partition, feature, grads, hessians)
      self.assertEqual(num_updates, 2)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result[(1, 2, 4)][0], [0.20, 0.21])
      self.assertAllClose(result[(1, 2, 4)][1],
                          [[0.021, 0.042], [0.063, 0.084]])
      self.assertAllClose(result[(2, 3, 1)][0], [0.2, 0.2])
      self.assertAllClose(result[(2, 3, 1)][1], [[0.05, 0.06], [0.07, 0.08]])

  def testDropStaleUpdate(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([2]),
          hessian_shape=tensor_shape.TensorShape([2, 2]))
      with ops.control_dependencies([accumulator.initializer]):
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 5], [3, 0]],
            # Two values for gradients,
            gradients=[[0.1, 0.1], [0.2, 0.2]],
            # A 2x2 matrix for each hessian.
            hessians=[[[0.01, 0.02], [0.03, 0.04]], [[0.05, 0.06], [0.07,
                                                                    0.08]]])
        op2 = accumulator.add(
            stamp_token=-1,
            partition_ids=[1],
            feature_ids=[[2, 5]],
            gradients=[[0.10, 0.11]],
            hessians=[[[0.011, 0.022], [0.033, 0.044]]])

      with ops.control_dependencies([op1, op2]):
        num_updates, partition, feature, grads, hessians = accumulator.flush(
            stamp_token=0, next_stamp_token=1)
        num_updates, partition, feature, grads, hessians = sess.run(
            [num_updates, partition, feature, grads, hessians])

      result = _AccumulatorResultToDict(partition, feature, grads, hessians)
      self.assertEqual(num_updates, 1)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result[(1, 2, 5)][0], [0.1, 0.1])
      self.assertAllClose(result[(1, 2, 5)][1], [[0.01, 0.02], [0.03, 0.04]])
      self.assertAllClose(result[(2, 3, 0)][0], [0.2, 0.2])
      self.assertAllClose(result[(2, 3, 0)][1], [[0.05, 0.06], [0.07, 0.08]])

  def testSerialize(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([2]),
          hessian_shape=tensor_shape.TensorShape([2, 2]))
      with ops.control_dependencies([accumulator.initializer]):
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 0], [3, 0]],
            # Two values for gradients,
            gradients=[[0.1, 0.1], [0.2, 0.2]],
            # A 2x2 matrix for each hessian.
            hessians=[[[0.01, 0.02], [0.03, 0.04]], [[0.05, 0.06], [0.07,
                                                                    0.08]]])

      with ops.control_dependencies([op1]):
        (stamp_token, num_updates_1, partition_1, feature_1, grads_1,
         hessians_1) = accumulator.saveable.serialize()
      # Make sure that the accumulator hasn't changed during serialization.
      with ops.control_dependencies([stamp_token]):
        num_updates_2, partition_2, feature_2, grads_2, hessians_2 = (
            accumulator.flush(stamp_token=0, next_stamp_token=1))
        (stamp_token, num_updates_1, partition_1, feature_1, grads_1,
         hessians_1, num_updates_2, partition_2, feature_2, grads_2,
         hessians_2) = sess.run([
             stamp_token, num_updates_1, partition_1, feature_1, grads_1,
             hessians_1, num_updates_2, partition_2, feature_2, grads_2,
             hessians_2
         ])

      result_1 = _AccumulatorResultToDict(partition_1, feature_1, grads_1,
                                          hessians_1)
      result_2 = _AccumulatorResultToDict(partition_2, feature_2, grads_2,
                                          hessians_2)

      self.assertEqual(num_updates_1, 1)
      self.assertEqual(num_updates_2, 1)
      self.assertEqual(len(result_1), 2)
      self.assertAllClose(result_1[(1, 2, 0)][0], [0.1, 0.1])
      self.assertAllClose(result_1[(1, 2, 0)][1], [[0.01, 0.02], [0.03, 0.04]])
      self.assertAllClose(result_1[(2, 3, 0)][0], [0.2, 0.2])
      self.assertAllClose(result_1[(2, 3, 0)][1], [[0.05, 0.06], [0.07, 0.08]])

      self.assertAllEqual(result_1[1, 2, 0][0], result_2[1, 2, 0][0])
      self.assertAllEqual(result_1[1, 2, 0][1], result_2[1, 2, 0][1])
      self.assertAllEqual(result_1[2, 3, 0][0], result_2[2, 3, 0][0])
      self.assertAllEqual(result_1[2, 3, 0][1], result_2[2, 3, 0][1])

  def testDeserialize(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([2]),
          hessian_shape=tensor_shape.TensorShape([2, 2]))
      with ops.control_dependencies([accumulator.initializer]):
        # These will be deleted due to deserialize call.
        op1 = accumulator.add(
            stamp_token=0,
            partition_ids=[1, 2],
            feature_ids=[[2, 0], [3, 0]],
            # Two values for gradients,
            gradients=[[0.1, 0.1], [0.2, 0.2]],
            # A 2x2 matrix for each hessian.
            hessians=[[[0.01, 0.02], [0.03, 0.04]], [[0.05, 0.06], [0.07,
                                                                    0.08]]])

      with ops.control_dependencies([op1]):
        deserialize = accumulator.saveable.deserialize(
            stamp_token=2,
            num_updates=3,
            partition_ids=[3, 4],
            feature_ids=[[4, 0], [5, 0]],
            # Two values for gradients,
            gradients=[[0.3, 0.3], [0.5, 0.5]],
            # A 2x2 matrix for each hessian.
            hessians=[[[0.03, 0.04], [0.05, 0.06]], [[0.07, 0.08], [0.09,
                                                                    0.10]]])
      with ops.control_dependencies([deserialize]):
        num_updates, partition, feature, grads, hessians = accumulator.flush(
            stamp_token=2, next_stamp_token=3)
        num_updates, partition, feature, grads, hessians = sess.run(
            [num_updates, partition, feature, grads, hessians])

      result = _AccumulatorResultToDict(partition, feature, grads,
                                        hessians)
      self.assertEqual(num_updates, 3)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result[(3, 4, 0)][0], [0.3, 0.3])
      self.assertAllClose(result[(3, 4, 0)][1], [[0.03, 0.04], [0.05, 0.06]])
      self.assertAllClose(result[(4, 5, 0)][0], [0.5, 0.5])
      self.assertAllClose(result[(4, 5, 0)][1], [[0.07, 0.08], [0.09, 0.10]])

  def testMakeSummary(self):
    with self.cached_session() as sess:
      accumulator = stats_accumulator_ops.StatsAccumulator(
          stamp_token=0,
          gradient_shape=tensor_shape.TensorShape([2]),
          hessian_shape=tensor_shape.TensorShape([2, 2]))
      partition, feature, grads, hessians = accumulator._make_summary(
          partition_ids=[1, 2, 1],
          feature_ids=[[2, 0], [3, 2], [2, 0]],
          # Two values for gradients,
          gradients=[[0.1, 0.1], [0.2, 0.2], [0.10, 0.11]],
          # A 2x2 matrix for each hessian.
          hessians=[[[0.01, 0.02], [0.03, 0.04]], [[0.05, 0.06], [0.07, 0.08]],
                    [[0.011, 0.022], [0.033, 0.044]]])
      partition, feature, grads, hessians = sess.run(
          [partition, feature, grads, hessians])

      result = _AccumulatorResultToDict(partition, feature, grads, hessians)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result[(1, 2, 0)][0], [0.20, 0.21])
      self.assertAllClose(result[(1, 2, 0)][1],
                          [[0.021, 0.042], [0.063, 0.084]])
      self.assertAllClose(result[(2, 3, 2)][0], [0.2, 0.2])
      self.assertAllClose(result[(2, 3, 2)][1], [[0.05, 0.06], [0.07, 0.08]])

def _AccumulatorResultToDict(partition, feature, grads, hessians):
  """Converts the inputs to a dictionary since the ordering changes."""
  return {(partition[i], feature[i, 0], feature[i, 1]): (grads[i], hessians[i])
          for i in range(len(partition))}

if __name__ == "__main__":
  googletest.main()


text:
<?php $this->breadcrumbs = array(
	'Rights'=>Rights::getBaseUrl(),
	Rights::t('core', 'Permissions'),
); ?>

	<?php Yii::app()->controller->pageTitle = Rights::t('core', 'Permissions'); ?>

		<?php echo Rights::t('core', 'Here you can view and manage the permissions assigned to each role.'); ?>

		<?php echo Rights::t('core', 'Authorization items can be managed under {roleLink}, {taskLink} and {operationLink}.', array(
			'{roleLink}'=>CHtml::link(Rights::t('core', 'Roles'), array('authItem/roles')),
			'{taskLink}'=>CHtml::link(Rights::t('core', 'Tasks'), array('authItem/tasks')),
			'{operationLink}'=>CHtml::link(Rights::t('core', 'Operations'), array('authItem/operations')),
		)); ?>

<?php echo CHtml::link(Rights::t('core', 'Generate items for controller actions'), array('authItem/generate'), array(
	   	'class'=>'generator-link',
	)); ?>

	<?php $this->widget('zii.widgets.grid.CGridView', array(
		'dataProvider'=>$dataProvider,
		'template'=>'{items}',
		'emptyText'=>Rights::t('core', 'No authorization items found.'),
		'htmlOptions'=>array('class'=>'grid-view permission-table'),
		'columns'=>$columns,
	)); ?>

*) <?php echo Rights::t('core', 'Hover to see from where the permission is inherited.'); ?>


text:
package gounexport

import (
	"fmt"
	"regexp"
	"strings"

	"github.com/dooman87/gounexport/fs"
	"github.com/dooman87/gounexport/util"
)

//FindUnusedDefinitions returns list of definitions that could be
//moved to private e.g. renamed. Criteria for renaming:
// - Definition should be exported
// - Definition should be in target package
// - Definition is not implementing external interfaces
// - Definition is not used in external packages
func FindUnusedDefinitions(pkg string, defs map[string]*Definition, excludes []*regexp.Regexp) []*Definition {
	var unused []*Definition
	for _, def := range defs {
		if !def.Exported {
			continue
		}

		if strings.HasPrefix(def.Name, pkg) && !isExcluded(def, excludes) && !isUsed(def) {
			util.Info("adding [%s] to unexport list", def.Name)
			unused = append(unused, def)
		}
	}

	return unused
}

func isExcluded(def *Definition, excludes []*regexp.Regexp) bool {
	if excludes == nil || len(excludes) == 0 {
		return false
	}

	for _, exc := range excludes {
		if exc.MatchString(def.Name) {
			util.Info("definition [%s] excluded, because matched [%s]", def.Name, exc.String())
			return true
		}
	}
	return false
}

func isUsed(def *Definition) bool {
	used := true

	if len(def.Usages) == 0 {
		used = false
	} else {
		//Checking pathes of usages to not count internal
		hasExternalUsages := false
		util.Debug("checking [%s]", def.Name)
		for _, u := range def.Usages {
			pkgPath := ""
			if def.Pkg != nil {
				pkgPath = def.Pkg.Path()
			} else if dotIdx := strings.LastIndex(def.Name, "."); dotIdx >= 0 {
				pkgPath = def.Name[0:dotIdx]
			}
			util.Debug("checking [%v]", u.Pos)
			if u.Pos.IsValid() && fs.GetPackagePath(u.Pos.Filename) != pkgPath {
				hasExternalUsages = true
				break
			}
		}
		used = hasExternalUsages
	}

	if !used {
		//Check all interfaces
		for _, i := range def.Interfaces {
			if isUsed(i) {
				used = true
				break
			}
		}
	}
	return used
}

//Unexport hides definition by changing first letter
//to lower case. It won't rename if there is already existing
//unexported symbol with the same name.
//renameFunc is a func that accepts four arguments: full path to file,
//offset in a file to replace, original string, string to replace. It will
//be called when renaming is possible.
func Unexport(def *Definition, allDefs map[string]*Definition,
	renameFunc func(string, int, string, string) error) error {
	util.Info("unexporting %s in %s:%d:%d", def.SimpleName, def.File, def.Line, def.Col)
	newName := strings.ToLower(def.SimpleName[0:1]) + def.SimpleName[1:]

	//Searching for conflict
	lastIdx := strings.LastIndex(def.Name, def.SimpleName)
	newFullName := def.Name[0:lastIdx] + newName + def.Name[lastIdx+len(newName):]
	if allDefs[newFullName] != nil {
		return fmt.Errorf("can't unexport %s because it conflicts with existing member", def.Name)
	}

	//rename definitions and usages
	err := renameFunc(def.File, def.Offset, def.SimpleName, newName)
	for _, u := range def.Usages {
		if err != nil {
			break
		}
		err = renameFunc(u.Pos.Filename, u.Pos.Offset, def.SimpleName, newName)
	}

	return err
}


text:
<?php

namespace Drupal\Tests\book\Kernel;

use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\NodeType;

/**
 * Test installation of Book module.
 *
 * @group book
 */
class BookInstallTest extends KernelTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'node',
    'system',
  ];

  /**
   * Tests Book install with pre-existing content type.
   *
   * Tests that Book module can be installed if content type with machine name
   * 'book' already exists.
   */
  public function testBookInstallWithPreexistingContentType() {
    // Create a 'book' content type.
    NodeType::create(['type' => 'book'])->save();
    // Install the Book module. Using the module installer service ensures that
    // all the install rituals, including default and optional configuration
    // import, are performed.
    $status = $this->container->get('module_installer')->install(['book']);
    $this->assertTrue($status, 'Book module installed successfully');
  }

}


text:
package com.vmware.vim25.mo;

import com.utility.LoadVcenterProps;
import com.vmware.vim25.ws.CustomSSLTrustContextCreator;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.X509TrustManager;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

public class ServiceInstanceIntTest {

    @Before
    public void setUp() throws Exception {
        if (null == LoadVcenterProps.url || null == LoadVcenterProps.userName
                || null == LoadVcenterProps.password
                || null == LoadVcenterProps.secondUrl
                || null == LoadVcenterProps.badUrl
                || "".equals(LoadVcenterProps.url.trim())
                || "".equals(LoadVcenterProps.secondUrl.trim())
                || "".equals(LoadVcenterProps.badUrl.trim())
                || "".equals(LoadVcenterProps.userName.trim())
                || "".equals(LoadVcenterProps.password.trim())) {
            throw new Exception("Vcenter credentials not loaded");
        }

        // ensure that the ssl context is re-initialized for every test, so behavior for different trust managers can be verified
        CustomSSLTrustContextCreator.setContextAlreadyCreated(false);
    }

    @Test
    public void testCreateServiceInstanceForUsernameAndPasswordAndIgnoreCertsNoTimeouts() {
        try {
            ServiceInstance si = new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, true);
            Assert.assertNotNull("Expected non-null service instance", si.currentTime());
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.fail("An error occurred creating and reading from service instance. " + e.getMessage());
        }
    }

    @Test
    public void testCreateServiceInstanceForUsernameAndPasswordAndIgnoreCertsWithTimeouts() {
        try {
            ServiceInstance si = new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, true, 5000, 5000);
            Assert.assertNotNull("Expected non-null service instance", si.currentTime());
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.fail("An error occurred creating and reading from service instance. " + e.getMessage());
        }
    }

    @Test
    public void testCreateServiceInstanceForUsernameAndPasswordAndIgnoreCertsAndNamespaceNoTimeouts() {
        try {
            ServiceInstance si = new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, true, ServiceInstance.VIM25_NAMESPACE);
            Assert.assertNotNull("Expected non-null service instance", si.currentTime());
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.fail("An error occurred creating and reading from service instance. " + e.getMessage());
        }
    }

    @Test
    public void testCreateServiceInstanceForUsernameAndPasswordAndIgnoreCertsAndNamespaceWithTimeouts() {
        try {
            ServiceInstance si = new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, true, ServiceInstance.VIM25_NAMESPACE, 5000, 5000);
            Assert.assertNotNull("Expected non-null service instance", si.currentTime());
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.fail("An error occurred creating and reading from service instance. " + e.getMessage());
        }
    }

    @Test
    public void testCreateServiceInstanceForSessionStringAndIgnoreCertsAndNamespaceNoTimeouts() {
        try {
            ServiceInstance si = new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, true);
            Assert.assertNotNull("Expected non-null service instance", si.currentTime());

            ServiceInstance siFromSessionString = new ServiceInstance(new URL(LoadVcenterProps.url), si.getServerConnection().getSessionStr(), true);
            Assert.assertNotNull("Expected non-null service instance when creating with session string", siFromSessionString.currentTime());
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.fail("An error occurred creating and reading from service instance. " + e.getMessage());
        }
    }

    /**
     * Tests case when a trust all manager is passed to the service instance. Verifies no exceptions are thrown and that the connection is accepted.
     */
    @Test
    public void testCreateServiceInstanceForUsernameAndPasswordWithTrustAllManager() {
        try {
            ServiceInstance si = new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, new TrustAllManager(), ServiceInstance.VIM25_NAMESPACE, 1000, 1000);
             Assert.assertNotNull("Expected a non-null time from service instance", si.currentTime());
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.fail("An error occurred creating and reading from service instance. " + e.getMessage());
        }
    }

    /**
     * Tests case when no trust manager is provided and certs should not be ignored. Verifies an SSLHandshakeException occurs and the connection is not accepted.
     * This must be run against a vCenter running on ssl and you should not have its cert in your keystore. This is because the default trust manager performs
     * normal certificate verification against the JDK's default CA certs.
     */
    @Test
    public void testCreateServiceInstanceWithNullTrustManager() {
        try {
            new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, null, ServiceInstance.VIM25_NAMESPACE, 1000, 1000);
            Assert.fail("Expected an SSLHandshakeException to have been thrown when no trust manager is provided and certs are not ignored.");
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.assertTrue("Expected an SSLHandshakeException to have been thrown when no trust manager is provided and certs are not ignored.", e.getCause() instanceof SSLHandshakeException);
        }
    }

    /**
     * Tests case when a trust manager is provided but the server is not trusted. Verifies an SSLHandshakeException occurs and the connection is not accepted.
     */
    @Test
    public void testCreateServiceInstanceWithProvidedTrustManagerServerNotTrusted() {
        try {
            X509TrustManager testUntrustedServerTrustManager = new UntrustedServerTrustManager();

            new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, testUntrustedServerTrustManager, ServiceInstance.VIM25_NAMESPACE, 1000, 1000);
            Assert.fail("Expected an SSLHandshakeException to have been thrown when the trust manager provided simulates an untrusted server.");
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            e.printStackTrace();
            Assert.assertTrue("Expected an SSLHandshakeException to have been thrown when the trust manager provided simulates an untrusted server.", e.getCause() instanceof SSLHandshakeException);
        }
    }

    /**
     * Tests case when a trust all manager is passed to the service instance. Then the same trust manager is passed to a new service instance for a session string.
     * Verifies no exceptions are thrown and that the connection is accepted for both service instances.
     */
    @Test
    public void testCreateServiceInstanceForSessionStringWithTrustAllManager() {
        try {
            TrustAllManager trustAllManager = new TrustAllManager();
            ServiceInstance si = new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, trustAllManager);
            Assert.assertNotNull("Expected non-null service instance", si.currentTime());

            ServiceInstance siFromSessionString = new ServiceInstance(new URL(LoadVcenterProps.url), si.getServerConnection().getSessionStr(), trustAllManager);
            Assert.assertNotNull("Expected non-null service instance when creating with session string", siFromSessionString.currentTime());
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.fail("An error occurred creating and reading from service instance. " + e.getMessage());
        }
    }

    /**
     * Tests case when a trust all manager is passed to the service instance. Then a null trust manager is passed to a new service instance for a session string.
     * Verifies an SSLHandshakeException is thrown for the session string service instance.
     */
    @Test
    public void testCreateServiceInstanceForSessionStringWithNullTrustManager() {
        try {
            ServiceInstance si = new ServiceInstance(new URL(LoadVcenterProps.url),
                    LoadVcenterProps.userName, LoadVcenterProps.password, new TrustAllManager(), ServiceInstance.VIM25_NAMESPACE, 1000, 1000);
            Assert.assertNotNull("Expected non-null service instance", si.currentTime());

            X509TrustManager nullTrustManager = null;
            new ServiceInstance(new URL(LoadVcenterProps.url), si.getServerConnection().getSessionStr(), nullTrustManager);
            Assert.fail("Expected an SSLHandshakeException to have been thrown when no trust manager is provided.");
        } catch(MalformedURLException e) {
            Assert.fail("An error occurred creating a service instance due its url being malformed. " + e.getMessage());
        } catch(RemoteException e) {
            Assert.assertTrue("Expected an SSLHandshakeException to have been thrown when no trust manager is provided.", e.getCause() instanceof SSLHandshakeException);
        }
    }

    private static class TrustAllManager implements X509TrustManager {
        @Override
        public X509Certificate[] getAcceptedIssuers() {
            return null;
        }

        @Override
        public void checkServerTrusted(X509Certificate[] certs, String authType) {
        }

        @Override
        public void checkClientTrusted(X509Certificate[] certs, String authType) {
        }
    }

    private static class UntrustedServerTrustManager implements X509TrustManager {
        @Override
        public X509Certificate[] getAcceptedIssuers() {
            return null;
        }

        @Override
        public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateException {
            throw new CertificateException("Intentional CertificateException to simulate an untrusted server.");
        }

        @Override
        public void checkClientTrusted(X509Certificate[] certs, String authType) {
        }
    }
}


text:
@interface FLModel : NSObject

@property (readonly, retain) id<FLStreamsCollectionProtocol> streams;
@property (readonly, retain) id<FLCurrentSimulatorProtocol> simulator;

@end


text:
package spec

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"testing"
)

func TestRetailCalendar(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "Retail-Calendar Suite")
}


text:
frappe.ready(function() {

	if(frappe.utils.get_url_arg('subject')) {
	  $('[name="subject"]').val(frappe.utils.get_url_arg('subject'));
	}

	$('.btn-send').off("click").on("click", function() {
		var email = $('[name="email"]').val();
		var message = $('[name="message"]').val();

		if(!(email && message)) {
			frappe.msgprint("{{ _("Please enter both your email and message so that we \
				can get back to you. Thanks!") }}");
			return false;
		}

		if(!validate_email(email)) {
			frappe.msgprint("{{ _("You seem to have written your name instead of your email. \
				Please enter a valid email address so that we can get back.") }}");
			$('[name="email"]').focus();
			return false;
		}

		$("#contact-alert").toggle(false);
		frappe.send_message({
			subject: $('[name="subject"]').val(),
			sender: email,
			message: message,
			callback: function(r) {
				if(r.message==="okay") {
					frappe.msgprint("{{ _("Thank you for your message") }}");
				} else {
					frappe.msgprint("{{ _("There were errors") }}");
					console.log(r.exc);
				}
				$(':input').val('');
			}
		}, this);
		return false;
	});

});

var msgprint = function(txt) {
	if(txt) $("#contact-alert").html(txt).toggle(true);
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using IronText.Framework;
using IronText.Logging;
using IronText.Runtime;

namespace Samples
{
    [Language]
    [GrammarDocument("DynamicLinq.gram")]
    [Precedence(">", 1)]
    [Precedence(".", 10)]
    public class DynamicLinqCompiler
    {
        private readonly Dictionary<string, Expression> scope = new Dictionary<string, Expression>();

        public static DelegateT Compile<DelegateT>(string expr, params object[] args)
        {
            var c = new DynamicLinqCompiler(args);
            using (var interp = new Interpreter<DynamicLinqCompiler>(c))
            {
                interp.LoggingKind = LoggingKind.ThrowOnError;
                interp.Parse(expr);
                return Expression.Lambda<DelegateT>(c.Result, null).Compile();
            }
        }

        public DynamicLinqCompiler(object[] args)
        {
            for (int i = 0; i != args.Length; ++i)
            {
                var expr = (args[i] as Expression);
                if (expr != null)
                { }
                else if (expr is IQueryable)
                {
                    expr = ((IQueryable)expr).Expression;
                }
                else
                {
                    expr = Expression.Constant(args[i]);
                }

                scope["$" + i] = expr;
            }
        }

        [Outcome]
        public Expression Result { get; set; }

        [Produce("from", null, "in", null)]
        public Pipeline From(string variable, Expression source)
        {
            var elementType = GetElementType(source.Type);

            var result = new Pipeline
                            {
                                Variable = variable,
                                QueryableExpr = source,
                                Parameter = Expression.Parameter(elementType, variable)
                            };

            // TODO: Universal search for an extension method container
            if (typeof(IQueryable<>).MakeGenericType(elementType).IsAssignableFrom(source.Type))
            {
                result.MethodContainerType = typeof(Queryable);
            }
            else if (typeof(IEnumerable<>).MakeGenericType(elementType).IsAssignableFrom(source.Type))
            {
                result.MethodContainerType = typeof(Enumerable);
            }
            else
            {
                throw new InvalidOperationException(
                    "Unable to find extension method container for type '" + source.Type.FullName + "'");
            }

            scope[variable] = result.Parameter;
            return result;
        }

        [Produce(null, "where", null)]
        public Pipeline Where(Pipeline pipeline, Expression condExpr)
        {
            var predicateType = typeof(Func<,>).MakeGenericType(pipeline.ElementType, typeof(bool));

            var predicate = Expression.Lambda(
                                predicateType,
                                condExpr,
                                pipeline.Parameter);

            return new Pipeline
            {
                QueryableExpr =
                    Expression.Call(
                        pipeline.MethodContainerType,
                        "Where",
                        new Type[] { pipeline.ElementType },
                        pipeline.QueryableExpr,
                        predicate),
                Variable = pipeline.Variable,
                Parameter = pipeline.Parameter,
                MethodContainerType = pipeline.MethodContainerType
            };
        }

        [Produce(null, "select", null)]
        public Expression FromSelect(Pipeline pipeline, Expression expression)
        {
            var inElementType = pipeline.ElementType;
            var outElementType = expression.Type;
            var selectorDelegateType = typeof(Func<,>).MakeGenericType(inElementType, outElementType);

            var selectorExpr = Expression.Lambda(
                            selectorDelegateType,
                            expression,
                            pipeline.Parameter);

            return
                Expression.Call(
                    pipeline.MethodContainerType,
                    "Select",
                    new Type[]
                        {
                            inElementType,
                            outElementType
                        },
                    pipeline.QueryableExpr,
                    selectorExpr);
        }

        [Produce(null, ".", null)]
        public Expression FieldExpression(Expression instance, string fieldName)
        {
            return Expression.Field(instance, fieldName);
        }

        [Produce(null, ">", null)]
        public Expression GreaterThan(Expression x, Expression y)
        {
            return Expression.GreaterThan(x, y);
        }

        [Produce]
        public Expression Constant(int value)
        {
            return Expression.Constant(value, typeof(int));
        }

        [Produce]
        public Expression IdentifierExpression(string name) { return scope[name]; }

        [Match("alpha alnum*")]
        [Match("'$' digit+")]
        public string Identifier(string text) { return text; }

        [Match("digit+")]
        public int Integer(string text)
        {
            return int.Parse(text);
        }

        [Match("blank+")]
        public void Blank() { }

        private static Type GetElementType(Type seqType)
        {
            Type ienum = FindIEnumerable(seqType);
            if (ienum == null) return seqType;
            return ienum.GetGenericArguments()[0];
        }

        private static Type FindIEnumerable(Type seqType)
        {
            if (seqType == null || seqType == typeof(string))
            {
                return null;
            }

            if (seqType.IsArray)
            {
                return typeof(IEnumerable<>).MakeGenericType(seqType.GetElementType());
            }

            if (seqType.IsGenericType)
            {
                foreach (Type arg in seqType.GetGenericArguments())
                {
                    Type ienum = typeof(IEnumerable<>).MakeGenericType(arg);
                    if (ienum.IsAssignableFrom(seqType))
                    {
                        return ienum;
                    }
                }
            }

            Type[] ifaces = seqType.GetInterfaces();
            if (ifaces != null && ifaces.Length > 0)
            {
                foreach (Type iface in ifaces)
                {
                    Type ienum = FindIEnumerable(iface);
                    if (ienum != null) return ienum;
                }
            }

            if (seqType.BaseType != null && seqType.BaseType != typeof(object))
            {
                return FindIEnumerable(seqType.BaseType);
            }

            return null;
        }

        public class Pipeline
        {
            public string Variable;
            public Expression QueryableExpr;
            public ParameterExpression Parameter;
            public Type MethodContainerType;

            public Type ElementType { get { return GetElementType(QueryableExpr.Type); } }
        }
    }
}


text:
'use strict';
/**
 * Total Spent Controller
 */
var tripSplitterCloneControllers = angular.module('tripSplitterCloneControllers');

tripSplitterCloneControllers.controller('TotalSpentCtrl',['$scope','$rootScope','QueriesService','TripService',
	function($scope, $rootScope,QueriesService,TripService) {
		$scope.trips = [];
		$scope.selectedTrip={};
		$scope.totalSpentList=[];

		$scope.loadTrips = function(){
			TripService.list({}, function(response) {
				if (response.ok) {
					$scope.trips = JSON.parse(response.data);
					if($scope.trips.length>0){
						$scope.selectedTrip = $scope.trips[0];
						$scope.listTotalSpent();
					}
				}
			}, $rootScope.manageError);
		};

		$scope.listTotalSpent = function(){
			QueriesService.totalSpent($scope.selectedTrip,function(response){
				if(response.ok){
					$scope.totalSpentList = JSON.parse(response.data);
				}
			},$rootScope.manageError)
		};

		$scope.initialize = function() {

			$scope.editing = false;
			$scope.selectedTrip = {};

			//if ($rootScope.canAccess('/configuration/trip:listTrip')) {
			$scope.loadTrips();
			//}

			$rootScope.areErrorMessages = false;
		};
		$scope.initialize();
	}
]);


text:
namespace _11.LogsAggregator
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class LogsAggregator
    {
        public static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            var info = new SortedDictionary<string, Dictionary<string, long>>();

            for (int i = 0; i < n; i++)
            {
                var line = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                var ip = line[0];
                var user = line[1];
                var time = long.Parse(line[2]);

                if(!info.ContainsKey(user))
                {
                    info[user] = new Dictionary<string, long>();
                }

                var ipCollection = info[user];

                if(!ipCollection.ContainsKey(ip))
                {
                    ipCollection[ip] = time;
                }
                else
                {
                    ipCollection[ip] += time;
                }

            }

            foreach (var kvp in info)
            {
                var user = kvp.Key;
                var ipBox = kvp.Value;

                Console.Write($"{user}: {ipBox.Select(x => x.Value).Sum()} [");
                Console.WriteLine($"{string.Join(", ", ipBox.OrderBy(x => x.Key).Select(x => $"{x.Key}"))}]");
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/not_pressed_color" android:state_pressed="false"/>
    <item android:drawable="@drawable/pressed_color" android:state_pressed="true"/>

</selector>


text:
"""Auto-generated file, do not edit by hand. BJ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_BJ = PhoneMetadata(id='BJ', country_code=229, international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern='[2689]\\d{7}|7\\d{3}', possible_number_pattern='\\d{4,8}'),
    fixed_line=PhoneNumberDesc(national_number_pattern='2(?:02|1[037]|2[45]|3[68])\\d{5}', possible_number_pattern='\\d{8}', example_number='20211234'),
    mobile=PhoneNumberDesc(national_number_pattern='(?:6[46-8]|9[03-9])\\d{6}', possible_number_pattern='\\d{8}', example_number='90011234'),
    toll_free=PhoneNumberDesc(national_number_pattern='7[3-5]\\d{2}', possible_number_pattern='\\d{4}', example_number='7312'),
    premium_rate=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='857[58]\\d{4}', possible_number_pattern='\\d{8}', example_number='85751234'),
    pager=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='81\\d{6}', possible_number_pattern='\\d{8}', example_number='81123456'),
    emergency=PhoneNumberDesc(national_number_pattern='11[78]', possible_number_pattern='\\d{3}', example_number='117'),
    voicemail=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    short_code=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    standard_rate=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    number_format=[NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4')])


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="404 page">
    <title>404 / Page Not Found</title>
    <link rel="index" href="/" title="Anthony Craig, DDS">
    <link rel="shortcut icon" href="images/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="images/favicon-square.png" title="Site Favicon">
    <link rel="mask-icon" href="images/tooth.svg" color="rgba(144, 19, 254, 0.3)" title="Safari Pinned Tabs Icon">
    <meta property="og:locale" content="en_US">
    <meta property="og:site_name" content="404 page">
    <meta property="og:type" content="website">
    <meta property="og:title" content="404 page">
    <meta property="article:author" content="https://www.facebook.com/toniwonkanobi">
    <meta property="og:description" content="404 page.">
    <meta property="og:image" content="images/anthonycraig.jpg">
    <meta name="twitter:site" content="@toniwonkanobi">
    <meta name="twitter:creator" content="@toniwonkanobi">
    <meta name="twitter:title" content="Anthony Craig">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:description" content="404 page.">
    <meta name="twitter:image" content="images/anthonycraig.jpg">
    <link rel="stylesheet" type="text/css" href="css/styles-404.css">

anthonycraigdds.com

A fatal exception acdds.com has occurred at SIGH:8675309
the current web request has be terminated.

Pressing any key will do nothing for your current web request

Don't press CTRL+ALT+DELETE unless you use a Windows machine, in which case you're screwed anyways

        Go
        here to return to normalcy


text:
exports.config = {
  specs: ['test/e2e/*Test.js'],

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  seleniumAddress: 'http://localhost:4444/wd/hub',

  baseUrl: 'http://localhost/',

  // Options to be passed to Jasmine-node.
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000
  }
}


text:
package com.cloudera.flume.handlers.debug;

/**
 * This class contains the basic data elements of a ChokeDecorator and simple
 * operations to perform on that data.
 */
public class ChokeInfoData {
  private int max = Integer.MAX_VALUE;
  private int bucket = 0;
  private String chokeID;

  /**
   *This constructor sets the limit on the Choke.
   */
  public ChokeInfoData(int limit, String id) {
    max = limit * ChokeManager.timeQuanta;
    chokeID = id;
  }

  synchronized public void setMaxLimit(int limit) {
    max = limit * ChokeManager.timeQuanta;
  }

  synchronized public int getMaxLimit() {
    return max;
  }

  synchronized public void removeTokens(int numTokens) {
    bucket = bucket - numTokens;
  }

  synchronized public Boolean bucketCompare(int numTokens) {
    return (bucket >= numTokens);
  }

  synchronized public void printState() {
    System.out.println("Choke Information of " + chokeID + ": Max =" + max
        + " Bucket=" + bucket + "\n");
  }

  synchronized public void bucketFillup() {
    bucket = max;
  }

}


text:
/* File included in "exdl_wrapper.c" */

#ifdef COMPILE_GLXEXT

/* GLX_VERSION_1_3 */
{ glXGetFBConfigs_ENUM,                    "glXGetFBConfigs",                    eglx_xGetFBConfigs },
{ glXChooseFBConfig_ENUM,                  "glXChooseFBConfig",                  eglx_xChooseFBConfig },
{ glXGetFBConfigAttrib_ENUM,               "glXGetFBConfigAttrib",               eglx_xGetFBConfigAttrib },
{ glXGetVisualFromFBConfig_ENUM,           "glXGetVisualFromFBConfig",           eglx_xGetVisualFromFBConfig },
{ glXCreateWindow_ENUM,                    "glXCreateWindow",                    eglx_xCreateWindow },
{ glXDestroyWindow_ENUM,                   "glXDestroyWindow",                   eglx_xDestroyWindow },
{ glXCreatePixmap_ENUM,                    "glXCreatePixmap",                    eglx_xCreatePixmap },
{ glXDestroyPixmap_ENUM,                   "glXDestroyPixmap",                   eglx_xDestroyPixmap },
{ glXCreatePbuffer_ENUM,                   "glXCreatePbuffer",                   eglx_xCreatePbuffer },
{ glXDestroyPbuffer_ENUM,                  "glXDestroyPbuffer",                  eglx_xDestroyPbuffer },
{ glXQueryDrawable_ENUM,                   "glXQueryDrawable",                   eglx_xQueryDrawable },
{ glXCreateNewContext_ENUM,                "glXCreateNewContext",                eglx_xCreateNewContext },
{ glXMakeContextCurrent_ENUM,              "glXMakeContextCurrent",              eglx_xMakeContextCurrent },
{ glXGetCurrentReadDrawable_ENUM,          "glXGetCurrentReadDrawable",          eglx_xGetCurrentReadDrawable },
{ glXGetCurrentDisplay_ENUM,               "glXGetCurrentDisplay",               eglx_xGetCurrentDisplay },
{ glXQueryContext_ENUM,                    "glXQueryContext",                    eglx_xQueryContext },
{ glXSelectEvent_ENUM,                     "glXSelectEvent",                     eglx_xSelectEvent },
{ glXGetSelectedEvent_ENUM,                "glXGetSelectedEvent",                eglx_xGetSelectedEvent },
/* GLX_VERSION_1_4 */
{ glXGetProcAddress_ENUM,                  "glXGetProcAddress",                  eglx_xGetProcAddress },
/* GLX_ARB_get_proc_address */
{ glXGetProcAddressARB_ENUM,               "glXGetProcAddressARB",               eglx_xGetProcAddressARB },
/* GLX_ARB_multisample */
/* GLX_ARB_fbconfig_float */
/* GLX_ARB_framebuffer_sRGB */
/* GLX_ARB_create_context */
{ glXCreateContextAttribsARB_ENUM,         "glXCreateContextAttribsARB",         eglx_xCreateContextAttribsARB },
/* GLX_ARB_create_context_profile */
/* GLX_ARB_create_context_robustness */
/* GLX_SGIS_multisample */
/* GLX_EXT_visual_info */
/* GLX_SGI_swap_control */
{ glXSwapIntervalSGI_ENUM,                 "glXSwapIntervalSGI",                 eglx_xSwapIntervalSGI },
/* GLX_SGI_video_sync */
{ glXGetVideoSyncSGI_ENUM,                 "glXGetVideoSyncSGI",                 eglx_xGetVideoSyncSGI },
{ glXWaitVideoSyncSGI_ENUM,                "glXWaitVideoSyncSGI",                eglx_xWaitVideoSyncSGI },
/* GLX_SGI_make_current_read */
{ glXMakeCurrentReadSGI_ENUM,              "glXMakeCurrentReadSGI",              eglx_xMakeCurrentReadSGI },
{ glXGetCurrentReadDrawableSGI_ENUM,       "glXGetCurrentReadDrawableSGI",       eglx_xGetCurrentReadDrawableSGI },
/* GLX_SGIX_video_source */
{ glXCreateGLXVideoSourceSGIX_ENUM,        "glXCreateGLXVideoSourceSGIX",        eglx_xCreateGLXVideoSourceSGIX },
{ glXDestroyGLXVideoSourceSGIX_ENUM,       "glXDestroyGLXVideoSourceSGIX",       eglx_xDestroyGLXVideoSourceSGIX },
/* GLX_EXT_import_context */
{ glXGetCurrentDisplayEXT_ENUM,            "glXGetCurrentDisplayEXT",            eglx_xGetCurrentDisplayEXT },
{ glXQueryContextInfoEXT_ENUM,             "glXQueryContextInfoEXT",             eglx_xQueryContextInfoEXT },
{ glXGetContextIDEXT_ENUM,                 "glXGetContextIDEXT",                 eglx_xGetContextIDEXT },
{ glXImportContextEXT_ENUM,                "glXImportContextEXT",                eglx_xImportContextEXT },
{ glXFreeContextEXT_ENUM,                  "glXFreeContextEXT",                  eglx_xFreeContextEXT },
/* GLX_SGIX_fbconfig */
{ glXGetFBConfigAttribSGIX_ENUM,           "glXGetFBConfigAttribSGIX",           eglx_xGetFBConfigAttribSGIX },
{ glXChooseFBConfigSGIX_ENUM,              "glXChooseFBConfigSGIX",              eglx_xChooseFBConfigSGIX },
{ glXCreateGLXPixmapWithConfigSGIX_ENUM,   "glXCreateGLXPixmapWithConfigSGIX",   eglx_xCreateGLXPixmapWithConfigSGIX },
{ glXCreateContextWithConfigSGIX_ENUM,     "glXCreateContextWithConfigSGIX",     eglx_xCreateContextWithConfigSGIX },
{ glXGetVisualFromFBConfigSGIX_ENUM,       "glXGetVisualFromFBConfigSGIX",       eglx_xGetVisualFromFBConfigSGIX },
{ glXGetFBConfigFromVisualSGIX_ENUM,       "glXGetFBConfigFromVisualSGIX",       eglx_xGetFBConfigFromVisualSGIX },
/* GLX_SGIX_pbuffer */
{ glXCreateGLXPbufferSGIX_ENUM,            "glXCreateGLXPbufferSGIX",            eglx_xCreateGLXPbufferSGIX },
{ glXDestroyGLXPbufferSGIX_ENUM,           "glXDestroyGLXPbufferSGIX",           eglx_xDestroyGLXPbufferSGIX },
{ glXQueryGLXPbufferSGIX_ENUM,             "glXQueryGLXPbufferSGIX",             eglx_xQueryGLXPbufferSGIX },
{ glXSelectEventSGIX_ENUM,                 "glXSelectEventSGIX",                 eglx_xSelectEventSGIX },
{ glXGetSelectedEventSGIX_ENUM,            "glXGetSelectedEventSGIX",            eglx_xGetSelectedEventSGIX },
/* GLX_SGI_cushion */
{ glXCushionSGI_ENUM,                      "glXCushionSGI",                      eglx_xCushionSGI },
/* GLX_SGIX_video_resize */
{ glXBindChannelToWindowSGIX_ENUM,         "glXBindChannelToWindowSGIX",         eglx_xBindChannelToWindowSGIX },
{ glXChannelRectSGIX_ENUM,                 "glXChannelRectSGIX",                 eglx_xChannelRectSGIX },
{ glXQueryChannelRectSGIX_ENUM,            "glXQueryChannelRectSGIX",            eglx_xQueryChannelRectSGIX },
{ glXQueryChannelDeltasSGIX_ENUM,          "glXQueryChannelDeltasSGIX",          eglx_xQueryChannelDeltasSGIX },
{ glXChannelRectSyncSGIX_ENUM,             "glXChannelRectSyncSGIX",             eglx_xChannelRectSyncSGIX },
/* GLX_SGIX_dmbuffer */
{ glXAssociateDMPbufferSGIX_ENUM,          "glXAssociateDMPbufferSGIX",          eglx_xAssociateDMPbufferSGIX },
/* GLX_SGIX_swap_group */
{ glXJoinSwapGroupSGIX_ENUM,               "glXJoinSwapGroupSGIX",               eglx_xJoinSwapGroupSGIX },
/* GLX_SGIX_swap_barrier */
{ glXBindSwapBarrierSGIX_ENUM,             "glXBindSwapBarrierSGIX",             eglx_xBindSwapBarrierSGIX },
{ glXQueryMaxSwapBarriersSGIX_ENUM,        "glXQueryMaxSwapBarriersSGIX",        eglx_xQueryMaxSwapBarriersSGIX },
/* GLX_SUN_get_transparent_index */
{ glXGetTransparentIndexSUN_ENUM,          "glXGetTransparentIndexSUN",          eglx_xGetTransparentIndexSUN },
/* GLX_MESA_copy_sub_buffer */
{ glXCopySubBufferMESA_ENUM,               "glXCopySubBufferMESA",               eglx_xCopySubBufferMESA },
/* GLX_MESA_pixmap_colormap */
{ glXCreateGLXPixmapMESA_ENUM,             "glXCreateGLXPixmapMESA",             eglx_xCreateGLXPixmapMESA },
/* GLX_MESA_release_buffers */
{ glXReleaseBuffersMESA_ENUM,              "glXReleaseBuffersMESA",              eglx_xReleaseBuffersMESA },
/* GLX_MESA_set_3dfx_mode */
{ glXSet3DfxModeMESA_ENUM,                 "glXSet3DfxModeMESA",                 eglx_xSet3DfxModeMESA },
/* GLX_OML_sync_control */
{ glXGetSyncValuesOML_ENUM,                "glXGetSyncValuesOML",                eglx_xGetSyncValuesOML },
{ glXGetMscRateOML_ENUM,                   "glXGetMscRateOML",                   eglx_xGetMscRateOML },
{ glXSwapBuffersMscOML_ENUM,               "glXSwapBuffersMscOML",               eglx_xSwapBuffersMscOML },
{ glXWaitForMscOML_ENUM,                   "glXWaitForMscOML",                   eglx_xWaitForMscOML },
{ glXWaitForSbcOML_ENUM,                   "glXWaitForSbcOML",                   eglx_xWaitForSbcOML },
{ glXQueryHyperpipeNetworkSGIX_ENUM,       "glXQueryHyperpipeNetworkSGIX",       eglx_xQueryHyperpipeNetworkSGIX },
{ glXHyperpipeConfigSGIX_ENUM,             "glXHyperpipeConfigSGIX",             eglx_xHyperpipeConfigSGIX },
{ glXQueryHyperpipeConfigSGIX_ENUM,        "glXQueryHyperpipeConfigSGIX",        eglx_xQueryHyperpipeConfigSGIX },
{ glXDestroyHyperpipeConfigSGIX_ENUM,      "glXDestroyHyperpipeConfigSGIX",      eglx_xDestroyHyperpipeConfigSGIX },
{ glXBindHyperpipeSGIX_ENUM,               "glXBindHyperpipeSGIX",               eglx_xBindHyperpipeSGIX },
{ glXQueryHyperpipeBestAttribSGIX_ENUM,    "glXQueryHyperpipeBestAttribSGIX",    eglx_xQueryHyperpipeBestAttribSGIX },
{ glXHyperpipeAttribSGIX_ENUM,             "glXHyperpipeAttribSGIX",             eglx_xHyperpipeAttribSGIX },
{ glXQueryHyperpipeAttribSGIX_ENUM,        "glXQueryHyperpipeAttribSGIX",        eglx_xQueryHyperpipeAttribSGIX },
/* GLX_MESA_agp_offset */
{ glXGetAGPOffsetMESA_ENUM,                "glXGetAGPOffsetMESA",                eglx_xGetAGPOffsetMESA },
/* GLX_EXT_texture_from_pixmap */
{ glXBindTexImageEXT_ENUM,                 "glXBindTexImageEXT",                 eglx_xBindTexImageEXT },
{ glXReleaseTexImageEXT_ENUM,              "glXReleaseTexImageEXT",              eglx_xReleaseTexImageEXT },
/* GLX_NV_present_video */
{ glXEnumerateVideoDevicesNV_ENUM,         "glXEnumerateVideoDevicesNV",         eglx_xEnumerateVideoDevicesNV },
{ glXBindVideoDeviceNV_ENUM,               "glXBindVideoDeviceNV",               eglx_xBindVideoDeviceNV },
/* GLX_NV_video_output */
{ glXGetVideoDeviceNV_ENUM,                "glXGetVideoDeviceNV",                eglx_xGetVideoDeviceNV },
{ glXReleaseVideoDeviceNV_ENUM,            "glXReleaseVideoDeviceNV",            eglx_xReleaseVideoDeviceNV },
{ glXBindVideoImageNV_ENUM,                "glXBindVideoImageNV",                eglx_xBindVideoImageNV },
{ glXReleaseVideoImageNV_ENUM,             "glXReleaseVideoImageNV",             eglx_xReleaseVideoImageNV },
{ glXSendPbufferToVideoNV_ENUM,            "glXSendPbufferToVideoNV",            eglx_xSendPbufferToVideoNV },
{ glXGetVideoInfoNV_ENUM,                  "glXGetVideoInfoNV",                  eglx_xGetVideoInfoNV },
/* GLX_NV_swap_group */
{ glXJoinSwapGroupNV_ENUM,                 "glXJoinSwapGroupNV",                 eglx_xJoinSwapGroupNV },
{ glXBindSwapBarrierNV_ENUM,               "glXBindSwapBarrierNV",               eglx_xBindSwapBarrierNV },
{ glXQuerySwapGroupNV_ENUM,                "glXQuerySwapGroupNV",                eglx_xQuerySwapGroupNV },
{ glXQueryMaxSwapGroupsNV_ENUM,            "glXQueryMaxSwapGroupsNV",            eglx_xQueryMaxSwapGroupsNV },
{ glXQueryFrameCountNV_ENUM,               "glXQueryFrameCountNV",               eglx_xQueryFrameCountNV },
{ glXResetFrameCountNV_ENUM,               "glXResetFrameCountNV",               eglx_xResetFrameCountNV },
/* GLX_NV_video_capture */
{ glXBindVideoCaptureDeviceNV_ENUM,        "glXBindVideoCaptureDeviceNV",        eglx_xBindVideoCaptureDeviceNV },
{ glXEnumerateVideoCaptureDevicesNV_ENUM,  "glXEnumerateVideoCaptureDevicesNV",  eglx_xEnumerateVideoCaptureDevicesNV },
{ glXLockVideoCaptureDeviceNV_ENUM,        "glXLockVideoCaptureDeviceNV",        eglx_xLockVideoCaptureDeviceNV },
{ glXQueryVideoCaptureDeviceNV_ENUM,       "glXQueryVideoCaptureDeviceNV",       eglx_xQueryVideoCaptureDeviceNV },
{ glXReleaseVideoCaptureDeviceNV_ENUM,     "glXReleaseVideoCaptureDeviceNV",     eglx_xReleaseVideoCaptureDeviceNV },
/* GLX_EXT_swap_control */
{ glXSwapIntervalEXT_ENUM,                 "glXSwapIntervalEXT",                 eglx_xSwapIntervalEXT },
/* GLX_NV_copy_image */
{ glXCopyImageSubDataNV_ENUM,              "glXCopyImageSubDataNV",              eglx_xCopyImageSubDataNV },
/* GLX_INTEL_swap_event */
/* GLX_NV_multisample_coverage */
/* GLX_EXT_swap_control_tear */

#endif // COMPILE_GLXEXT


text:
package com.msopentech.odatajclient.engine.data.metadata.edm.v4;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.msopentech.odatajclient.engine.data.metadata.edm.AbstractEdm;

public class NavigationPropertyBinding extends AbstractEdm {

    private static final long serialVersionUID = -6026065326479176817L;

    @JsonProperty(value = "Path", required = true)
    private String path;

    @JsonProperty(value = "Target", required = true)
    private String target;

    public String getPath() {
        return path;
    }

    public void setPath(final String path) {
        this.path = path;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(final String target) {
        this.target = target;
    }

}


text:
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
    Widget w;
    w.show();

    return a.exec();
}


text:
'*******************************************************************************************'
'                                                                                '
' Download Free Evaluation Version From:     https://bytescout.com/download/web-installer   '
'                                                                                '
' Also available as Web API! Get free API Key https://app.pdf.co/signup                     '
'                                                                                '
' Copyright © 2017-2020 ByteScout, Inc. All rights reserved.                                '
' https://www.bytescout.com                                                                 '
' https://www.pdf.co                                                                        '
'*******************************************************************************************'

Imports System.IO
Imports Bytescout.BarCodeReader
Imports Thought.vCards

Module Module1
    ''' <summary>
    ''' This example demonstrates reading of QR Code encoded vCard.
    ''' It uses vCard library by David Pinch:
    '''
    ''' vCard Class Library for .NET (Version 0.4; LGPL license)
    ''' Copyright (c) 2007-2009 David Pinch
    ''' http://www.thoughtproject.com/Libraries/vCard/
    ''' </summary>
    Sub Main()

        ' Create Bytescout.BarCodeReader.Reader instance
        Using reader As New Reader

            ' Enable QR Code decoding
            reader.BarcodeTypesToFind.QRCode = True

            ' -----------------------------------------------------------------------
            ' NOTE: We can read barcodes from specific page to increase performance .
            ' For sample please refer to "Decoding barcodes from PDF by pages" program.
            ' -----------------------------------------------------------------------

            ' Decode QR Code from image
            Dim barcodes = reader.ReadFrom("sample_vcard.gif")

            If barcodes.Length > 0 Then

                Dim vcardBarcode = barcodes(0)

                ' Decode vCard information from barcode value
                Dim stringReader As New StringReader(vcardBarcode.Value)
                Dim vCard As New vCard(stringReader)

                ' Display some decoded info:
                Console.WriteLine("GivenName: " + vCard.GivenName)
                Console.WriteLine("FamilyName: " + vCard.FamilyName)
                Console.WriteLine("Organization: " + vCard.Organization)
                Console.WriteLine("Title: " + vCard.Title)
                Console.WriteLine("Phone: " & vCard.Phones(0).FullNumber)
                Console.WriteLine("EmailAddresses: " & vCard.EmailAddresses(0).Address)
                Console.WriteLine("DeliveryAddress: " & vCard.DeliveryAddresses(0).Street & " " & vCard.DeliveryAddresses(0).City & " " & _
                    vCard.DeliveryAddresses(0).Region & " " & vCard.DeliveryAddresses(0).PostalCode & " " & vCard.DeliveryAddresses(0).Country)

            End If

        End Using

        Console.WriteLine()
        Console.WriteLine("Press any key...")
        Console.ReadKey()

    End Sub

End Module


text:
import {seq, tok, Expression, plus, ver, optPrio, alt} from "../combi";
import {WParenLeftW, WParenRightW} from "../../1_lexer/tokens";
import {ComponentName, Source, Field} from ".";
import {Version} from "../../../version";
import {IStatementRunnable} from "../statement_runnable";
import {ComponentChain} from "./component_chain";

export class CorrespondingBody extends Expression {
  public getRunnable(): IStatementRunnable {
    const mapping = seq("MAPPING", plus(seq(ComponentName, "=", ComponentChain)));

    const baseParen = seq("BASE", tok(WParenLeftW), Source, tok(WParenRightW));

    const discarding = ver(Version.v751, "DISCARDING DUPLICATES");

    return seq(
      optPrio("DEEP"),
      optPrio(baseParen),
      Source,
      optPrio(discarding),
      optPrio(mapping),
      optPrio(seq("EXCEPT", alt(plus(Field), "*"))),
    );
  }
}


text:
"""
Admin views for managing volumes.
"""

from django.core.urlresolvers import reverse  # noqa
from django.utils.datastructures import SortedDict  # noqa
from django.utils.translation import ugettext_lazy as _  # noqa

from horizon import exceptions
from horizon import forms
from horizon import tables

from openstack_dashboard.api import cinder
from openstack_dashboard.api import keystone

from openstack_dashboard.dashboards.admin.volumes \
    import forms as project_forms
from openstack_dashboard.dashboards.admin.volumes \
    import tables as project_tables

from openstack_dashboard.dashboards.project.volumes import views

class IndexView(tables.MultiTableView, views.VolumeTableMixIn):
    table_classes = (project_tables.VolumesTable,
                     project_tables.VolumeTypesTable)
    template_name = "admin/volumes/index.html"

    def get_volumes_data(self):
        volumes = self._get_volumes(search_opts={'all_tenants': True})
        instances = self._get_instances(search_opts={'all_tenants': True})
        self._set_id_if_nameless(volumes, instances)
        self._set_attachments_string(volumes, instances)

        # Gather our tenants to correlate against IDs
        try:
            tenants, has_more = keystone.tenant_list(self.request)
        except Exception:
            tenants = []
            msg = _('Unable to retrieve volume project information.')
            exceptions.handle(self.request, msg)

        tenant_dict = SortedDict([(t.id, t) for t in tenants])
        for volume in volumes:
            tenant_id = getattr(volume, "os-vol-tenant-attr:tenant_id", None)
            tenant = tenant_dict.get(tenant_id, None)
            volume.tenant_name = getattr(tenant, "name", None)

        return volumes

    def get_volume_types_data(self):
        try:
            volume_types = cinder.volume_type_list(self.request)
        except Exception:
            volume_types = []
            exceptions.handle(self.request,
                              _("Unable to retrieve volume types"))
        return volume_types

class DetailView(views.DetailView):
    template_name = "admin/volumes/detail.html"

class CreateVolumeTypeView(forms.ModalFormView):
    form_class = project_forms.CreateVolumeType
    template_name = 'admin/volumes/create_volume_type.html'
    success_url = 'horizon:admin:volumes:index'

    def get_success_url(self):
        return reverse(self.success_url)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Amazon.Route53;
using Amazon.Route53.Model;

using log4net;

using Route53DDNSLib.type;

namespace Route53DDNSLib.client
{
    // Shall be recreated on each timed run
    class DefaultRoute53Client : Route53Client
    {
        private sealed class Action
        {

            private readonly String value;

            public static readonly Action CREATE = new Action("CREATE");
            public static readonly Action DELETE = new Action("DELETE");

            private Action(String value)
            {
                this.value = value;
            }
            public override String ToString()
            {
                return value;
            }

        }

        private static readonly ILog logger = LogManager.GetLogger(typeof(Route53Client).FullName);
        private AmazonRoute53Client client;

        public DefaultRoute53Client(string awsAccessKey, string awsSecretKey, string region)
        {
            logger.Info("Creating Route53 client");
            client = new AmazonRoute53Client(awsAccessKey, awsSecretKey, Amazon.RegionEndpoint.GetBySystemName(region));
        }

        public ListResourceRecordSetsResponse listRecordSets(string hostedZoneId,
            string startRecordIdentifier, string startRecordName, string startRecordType)
        {
            logger.Info("Calling ListResourceRecordSets");
            ListResourceRecordSetsRequest request = new ListResourceRecordSetsRequest() {
                HostedZoneId = hostedZoneId,
                StartRecordIdentifier = startRecordIdentifier,
                StartRecordName = startRecordName,
                StartRecordType = startRecordType
            };
            return client.ListResourceRecordSets(request);
        }

        public ChangeResourceRecordSetsResponse updateRRSet(
            string hostedZoneId, ResourceRecordSet oldRRset, ResourceRecordSet newRRset)
        {
            logger.Info("Calling ChangeResourceRecordSets");
            Change delete = new Change()
            {
                Action = Action.DELETE.ToString(),
                ResourceRecordSet = oldRRset
            };
            Change create = new Change() {
                Action = Action.CREATE.ToString(),
                ResourceRecordSet = newRRset
            };
            List<Change> changes = new List<Change>() { delete, create };

            ChangeBatch batch = new ChangeBatch() { Changes = changes };

            return client.ChangeResourceRecordSets(new ChangeResourceRecordSetsRequest(){
                HostedZoneId = hostedZoneId,
                ChangeBatch = batch
            });
        }
    }
}


text:
require 'spec_helper'

describe Number do

  before {
    200.times do |i|
      Number.create :value => i
    end
  }

  describe "a rearrangement with keyword column name" do

    before {
      @first = Number.first
      @second = Number.offset(1).first
      @ordered = Number.rank(:order).where(Number.arel_table[:id].not_in([@first.id, @second.id])).collect {|d| d.id }
      @first.update :order => RankedModel::MAX_RANK_VALUE
      @second.update :order => RankedModel::MAX_RANK_VALUE
    }

    context {

      subject { Number.rank(:order).collect {|d| d.id } }

      it { should == (@ordered[0..-2] + [@ordered[-1], @first.id, @second.id]) }

    }

  end

  describe "getting a position with keyword column name" do

    subject { Number.first }

    its(:order_rank) { should == 0 }

  end

end


text:
import json

import devmine
from devmine.app.controllers.application_controller import (
    ApplicationController
)

class IndexController(ApplicationController):
    """Class for handling index page."""

    def index(self):
        """Render index page."""
        data = {
            "devmine-version:": devmine.Devmine.get_version(),
            "api-version:": devmine.Devmine.get_api_version()
        }
        return json.dumps(data)


text:
:deconsttitle: Hummingbird Cluster Health

==========================
Hummingbird Cluster Health
==========================

The andrewd service as well as the recon tool monitor the overall cluster health. Andrewd is more of a background, automated process that should be run on one server (often called the admin server) whereas the recon tool is more interactive, often also run on the admin server since it can read information from the andrewd database.

Andrewd will initially populate "dispersion objects" and containers into the clusters within a hidden .admin account. These dispersion objects land, one each, on all ring partitions throughout the cluster. After these dispersion objects are in place, andrewd can check for their presence on a recurring schedule and make note of when they are out of place, missing replicas, etc. For example, 1 of 3 replicas being out of place is a common occurrence as a cluster rebalances itself, but 2 of 3 or worse all 3 replicas being out of place can cause temporary errors until rebalancing is performed. Andrewd can prioritize replication based on this information.

.. toctree::
   :maxdepth: 2

   rings.md
   monitoring.md
   progress.md
   drivestatus.md
   async.md
   dispersion.md
   ringmd5.md
   quarantine.md
   stalledreplicators.md
   replicationstats.md
   replicationduration.md
   timesync.md
   replication-tools.md
   debug-single.md
   tuning.md


text:
A base application built using React, Flux, JWT and browserify. Provides *authentication* using jwt, and a React policy element to verify role-based *authorization*. Includes the standard Bootstrap and Jquery. Actions for Bootstrap components need some adjustments to integrate with React, but nothing out of this world.

## Authentication
Done at the application level by src/components/auth/AuthenticatedApp.jsx
Done at the component level by src/components/auth/AuthenticatedComponent.jsx

## Authorization
Done by src/components/auth/Authorized.jsx using a policy defined by src/services/policies/ . Check src/components/shared/BTopNavbar.jsx for an example of element only shown for 'admin' users.

## Installation
Clone this repository as well as [the server](https://github.com/auth0/nodejs-jwt-authentication-sample) for this example.

First, run the server app in the port `3001`.

Then, run `npm install` on this project and run `npm run watch` to start the app. Then just navigate to [http://localhost:3000](http://localhost:3000)

** Attention -> if you are on a MAC OSX using a node version that is not 0.12.7 you might run into problems while installing a few of the dev-dependencies. If so please follow these steps to completly remove your node installation:
http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x

And then install node from here:
https://nodejs.org/en/blog/release/v0.12.7/

Problematic packages are mocha-babel and node-jsdom, which require contextify, which in turn doesnt work with node 4.*.*.

## Contributions
This application is a work in progress, and currently borrows heavily from the following projects:

Login/ Authentication form from
https://github.com/mikepro4/react-signup-form

React + Flux + JWT
https://github.com/auth0/react-flux-jwt-authentication-sample

Toastr Alert by
https://alertifyjs.org/

Bootstrap Theme
http://www.bootply.com/qK5buXCUzs
http://bootsnipp.com/snippets/featured/fancy-sidebar-navigation

## Questions
If you have any questions or comments, feel free to open an issue.

##TODO
- replace Bootstrap CDN call with local imports - require download Bootstrap source code and compile less files using browserify/webpack.
- consolidate all js to ES6
- write tests
- Migrate to webpack from browserify, so can require css directly in component