text:
export { OwnerArray };

import * as Pool from "../Pool.js";
import { Base } from "./Recyclable_Base.js";
import { Array as Recyclable_Array } from "./Recyclable_Array.js";

/**
 * Similar to Recyclable_Array but it owns its contents (which are instances of Recyclable.Base). It will release its contents
 * (by calling their .disposeResources_and_recycleToPool()) in .disposeResources().
 *
 *
 * Note: The behavior of this class's constructor (and .setAsConstructor()) is different from original Array (and Recyclable.Array).
 *
 *   - Original Array (and Recyclable.Array):
 *
 *     - If there is only one argument, it is viewed as the length of the newly created array.
 *
 *   - This Recyclable.OwnerArray:
 *
 *     - Even if there is only one argument, all arguments always are viewed as the contents the newly created array.
 *         The reason is for convenient and for avoiding un-initialized element object.
 *
 *
 */
class OwnerArray extends Recyclable_Array {

  /**
   * Used as default Recyclable.OwnerArray provider for conforming to Recyclable interface.
   */
  static Pool = new Pool.Root( "Recyclable.OwnerArray.Pool", OwnerArray, OwnerArray.setAsConstructor );

  /**
   * Every element of restArgs should be instance of Recyclable.Base (even if restArgs has only one element).
   *
   * Note: This behavior is different from original Array which will views the argement is length (not element) if only one argument
   *       is given.
   */
  constructor( ...restArgs ) {
    super( restArgs.length );
    OwnerArray.setAsConstructor_self.call( this, restArgs );
  }

  /**
   * Every element of restArgs should be Recyclable.Base object (even if restArgs has only one element).
   *
   * Note: This behavior is different from original Array which will views the argement is length (not element)
   *       if only one argument is given.
   *
   * @override
   */
  static setAsConstructor( ...restArgs ) {
    super.setAsConstructor( restArgs.length );
    OwnerArray.setAsConstructor_self.call( this, restArgs );
    return this;
  }

  /** @override */
  static setAsConstructor_self( objectArray ) {
    for ( let i = 0; i < objectArray.length; ++i ) {
      this[ i ] = objectArray[ i ];
    }
  }

  /** @override */
  disposeResources() {
    // Release all contents because they are owned by this OwnerArray.
    OwnerArray.sub_objects_disposeResources_fromIndex.call( this, 0 );
    super.disposeResources();
  }

  //!!! (2022/07/21 Remarked) Not work. It seems Array.length can not be overrided.
  // /**
  //  * All contents after this[ newLength ] will also be released (by calling their .disposeResources_and_recycleToPool()).
  //  */
  // set length( newLength ) {
  //   OwnerArray.sub_objects_disposeResources_fromIndex.call( this, newLength );
  //   super.length = newLength;
  // }

  /**
   * Release all contents (by calling their .disposeResources_and_recycleToPool() and set this container's length to zero).
   *
   * Note: Set OwnerArray.length = 0 directly will cause memory leak because the contents are not released.
   */
  clear() {
    OwnerArray.sub_objects_disposeResources_fromIndex.call( this, 0 );
    this.length = 0;
  }

  /**
   * Call all contents' .disposeResources(). Set them to null. But does NOT change this container's length.
   *
   * Note: Contents are disposed in reverse order because they are usually created in forward order.
   *
   * @param {number} fromIndex
   *   Dispose all owned objects between this[ fromIndex ] to this [ this.length - 1 ].
   */
  static sub_objects_disposeResources_fromIndex( fromIndex = 0 ) {
    for ( let i = ( this.length - 1 ); i >= fromIndex; --i ) {
      let object = this[ i ];
      if ( !object )
        continue;

      // Note: ( object instanceof Base ) does not work here because Recyclable.Base is not a class definition (in fact, it
      //       is a function return a class definition). So check whether .disposeResources_and_recycleToPool() exists instead.
      //
      if ( object.disposeResources_and_recycleToPool instanceof Function ) {
        object.disposeResources_and_recycleToPool();
        this[ i ] = null; // So that it will not become dangling object (since it has already been recycled).
      }
    }
  }

}

redpajama_set_name: RedPajamaGithub


text:
namespace base {
class SingleThreadTaskRunner;
class TimeDelta;
}

namespace media {

class Clock;
class FilterCollection;
class MediaLog;
class TextRenderer;
class TextTrackConfig;
class VideoRenderer;

// Pipeline runs the media pipeline.  Filters are created and called on the
// task runner injected into this object. Pipeline works like a state
// machine to perform asynchronous initialization, pausing, seeking and playing.
//
// Here's a state diagram that describes the lifetime of this object.
//
//   [ *Created ]                       [ Any State ]
//         | Start()                         | Stop() / SetError()
//         V                                 V
//   [ InitXXX (for each filter) ]      [ Stopping ]
//         |                                 |
//         V                                 V
//   [ InitPreroll ]                    [ Stopped ]
//         |
//         V
//   [ Starting ] <-- [ Seeking ]
//         |               ^
//         V               |
//   [ Started ] ----------'
//                 Seek()
//
// Initialization is a series of state transitions from "Created" through each
// filter initialization state.  When all filter initialization states have
// completed, we are implicitly in a "Paused" state.  At that point we simulate
// a Seek() to the beginning of the media to give filters a chance to preroll.
// From then on the normal Seek() transitions are carried out and we start
// playing the media.
//
// If any error ever happens, this object will transition to the "Error" state
// from any state. If Stop() is ever called, this object will transition to
// "Stopped" state.
class MEDIA_EXPORT Pipeline : public DemuxerHost {
 public:
  // Buffering states the pipeline transitions between during playback.
  // kHaveMetadata:
  //   Indicates that the following things are known:
  //   content duration, container video size, start time, and whether the
  //   content has audio and/or video in supported formats.
  // kPrerollCompleted:
  //   All renderers have buffered enough data to satisfy preroll and are ready
  //   to start playback.
  enum BufferingState {
    kHaveMetadata,
    kPrerollCompleted,
  };

  typedef base::Callback<void(BufferingState)> BufferingStateCB;

  // Constructs a media pipeline that will execute on |task_runner|.
  Pipeline(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
           MediaLog* media_log);
  virtual ~Pipeline();

  // Build a pipeline to using the given filter collection to construct a filter
  // chain, executing |seek_cb| when the initial seek/preroll has completed.
  //
  // |filter_collection| must be a complete collection containing a demuxer,
  // audio/video decoders, and audio/video renderers. Failing to do so will
  // result in a crash.
  //
  // The following permanent callbacks will be executed as follows up until
  // Stop() has completed:
  //   |ended_cb| will be executed whenever the media reaches the end.
  //   |error_cb| will be executed whenever an error occurs but hasn't
  //              been reported already through another callback.
  //   |buffering_state_cb| Optional callback that will be executed whenever the
  //                    pipeline's buffering state changes.
  //   |duration_change_cb| Optional callback that will be executed whenever the
  //                        presentation duration changes.
  // It is an error to call this method after the pipeline has already started.
  void Start(scoped_ptr<FilterCollection> filter_collection,
             const base::Closure& ended_cb,
             const PipelineStatusCB& error_cb,
             const PipelineStatusCB& seek_cb,
             const BufferingStateCB& buffering_state_cb,
             const base::Closure& duration_change_cb);

  // Asynchronously stops the pipeline, executing |stop_cb| when the pipeline
  // teardown has completed.
  //
  // Stop() must complete before destroying the pipeline. It it permissible to
  // call Stop() at any point during the lifetime of the pipeline.
  //
  // It is safe to delete the pipeline during the execution of |stop_cb|.
  void Stop(const base::Closure& stop_cb);

  // Attempt to seek to the position specified by time.  |seek_cb| will be
  // executed when the all filters in the pipeline have processed the seek.
  //
  // Clients are expected to call GetMediaTime() to check whether the seek
  // succeeded.
  //
  // It is an error to call this method if the pipeline has not started.
  void Seek(base::TimeDelta time, const PipelineStatusCB& seek_cb);

  // Returns true if the pipeline has been started via Start().  If IsRunning()
  // returns true, it is expected that Stop() will be called before destroying
  // the pipeline.
  bool IsRunning() const;

  // Returns true if the media has audio.
  bool HasAudio() const;

  // Returns true if the media has video.
  bool HasVideo() const;

  // Gets the current playback rate of the pipeline.  When the pipeline is
  // started, the playback rate will be 0.0f.  A rate of 1.0f indicates
  // that the pipeline is rendering the media at the standard rate.  Valid
  // values for playback rate are >= 0.0f.
  float GetPlaybackRate() const;

  // Attempt to adjust the playback rate. Setting a playback rate of 0.0f pauses
  // all rendering of the media.  A rate of 1.0f indicates a normal playback
  // rate.  Values for the playback rate must be greater than or equal to 0.0f.
  //
  // TODO(scherkus): What about maximum rate?  Does HTML5 specify a max?
  void SetPlaybackRate(float playback_rate);

  // Gets the current volume setting being used by the audio renderer.  When
  // the pipeline is started, this value will be 1.0f.  Valid values range
  // from 0.0f to 1.0f.
  float GetVolume() const;

  // Attempt to set the volume of the audio renderer.  Valid values for volume
  // range from 0.0f (muted) to 1.0f (full volume).  This value affects all
  // channels proportionately for multi-channel audio streams.
  void SetVolume(float volume);

  // Returns the current media playback time, which progresses from 0 until
  // GetMediaDuration().
  base::TimeDelta GetMediaTime() const;

  // Get approximate time ranges of buffered media.
  Ranges<base::TimeDelta> GetBufferedTimeRanges();

  // Get the duration of the media in microseconds.  If the duration has not
  // been determined yet, then returns 0.
  base::TimeDelta GetMediaDuration() const;

  // Get the total size of the media file.  If the size has not yet been
  // determined or can not be determined, this value is 0.
  int64 GetTotalBytes() const;

  // Get the video's initial natural size as reported by the container. Note
  // that the natural size can change during playback.
  gfx::Size GetInitialNaturalSize() const;

  // Return true if loading progress has been made since the last time this
  // method was called.
  bool DidLoadingProgress() const;

  // Gets the current pipeline statistics.
  PipelineStatistics GetStatistics() const;

  void SetClockForTesting(Clock* clock);
  void SetErrorForTesting(PipelineStatus status);

 private:
  FRIEND_TEST_ALL_PREFIXES(PipelineTest, GetBufferedTimeRanges);
  FRIEND_TEST_ALL_PREFIXES(PipelineTest, DisableAudioRenderer);
  FRIEND_TEST_ALL_PREFIXES(PipelineTest, DisableAudioRendererDuringInit);
  FRIEND_TEST_ALL_PREFIXES(PipelineTest, EndedCallback);
  FRIEND_TEST_ALL_PREFIXES(PipelineTest, AudioStreamShorterThanVideo);
  friend class MediaLog;

  // Pipeline states, as described above.
  enum State {
    kCreated,
    kInitDemuxer,
    kInitAudioRenderer,
    kInitVideoRenderer,
    kInitPrerolling,
    kSeeking,
    kStarting,
    kStarted,
    kStopping,
    kStopped,
  };

  // Updates |state_|. All state transitions should use this call.
  void SetState(State next_state);

  static const char* GetStateString(State state);
  State GetNextState() const;

  // Helper method that runs & resets |seek_cb_| and resets |seek_timestamp_|
  // and |seek_pending_|.
  void FinishSeek();

  // DataSourceHost (by way of DemuxerHost) implementation.
  virtual void SetTotalBytes(int64 total_bytes) OVERRIDE;
  virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE;
  virtual void AddBufferedTimeRange(base::TimeDelta start,
                                    base::TimeDelta end) OVERRIDE;

  // DemuxerHost implementaion.
  virtual void SetDuration(base::TimeDelta duration) OVERRIDE;
  virtual void OnDemuxerError(PipelineStatus error) OVERRIDE;
  virtual void AddTextStream(DemuxerStream* text_stream,
                             const TextTrackConfig& config) OVERRIDE;
  virtual void RemoveTextStream(DemuxerStream* text_stream) OVERRIDE;

  // Initiates teardown sequence in response to a runtime error.
  //
  // Safe to call from any thread.
  void SetError(PipelineStatus error);

  // Callbacks executed when a renderer has ended.
  void OnAudioRendererEnded();
  void OnVideoRendererEnded();
  void OnTextRendererEnded();

  // Callback executed by filters to update statistics.
  void OnUpdateStatistics(const PipelineStatistics& stats);

  // Callback executed by audio renderer when it has been disabled.
  void OnAudioDisabled();

  // Callback executed by audio renderer to update clock time.
  void OnAudioTimeUpdate(base::TimeDelta time, base::TimeDelta max_time);

  // Callback executed by video renderer to update clock time.
  void OnVideoTimeUpdate(base::TimeDelta max_time);

  // The following "task" methods correspond to the public methods, but these
  // methods are run as the result of posting a task to the Pipeline's
  // task runner.
  void StartTask(scoped_ptr<FilterCollection> filter_collection,
                 const base::Closure& ended_cb,
                 const PipelineStatusCB& error_cb,
                 const PipelineStatusCB& seek_cb,
                 const BufferingStateCB& buffering_state_cb,
                 const base::Closure& duration_change_cb);

  // Stops and destroys all filters, placing the pipeline in the kStopped state.
  void StopTask(const base::Closure& stop_cb);

  // Carries out stopping and destroying all filters, placing the pipeline in
  // the kStopped state.
  void ErrorChangedTask(PipelineStatus error);

  // Carries out notifying filters that the playback rate has changed.
  void PlaybackRateChangedTask(float playback_rate);

  // Carries out notifying filters that the volume has changed.
  void VolumeChangedTask(float volume);

  // Carries out notifying filters that we are seeking to a new timestamp.
  void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb);

  // Handles audio/video/text ended logic and running |ended_cb_|.
  void DoAudioRendererEnded();
  void DoVideoRendererEnded();
  void DoTextRendererEnded();
  void RunEndedCallbackIfNeeded();

  // Carries out disabling the audio renderer.
  void AudioDisabledTask();

  // Carries out adding a new text stream to the text renderer.
  void AddTextStreamTask(DemuxerStream* text_stream,
                         const TextTrackConfig& config);

  // Carries out removing a text stream from the text renderer.
  void RemoveTextStreamTask(DemuxerStream* text_stream);

  // Kicks off initialization for each media object, executing |done_cb| with
  // the result when completed.
  void InitializeDemuxer(const PipelineStatusCB& done_cb);
  void InitializeAudioRenderer(const PipelineStatusCB& done_cb);
  void InitializeVideoRenderer(const PipelineStatusCB& done_cb);

  // Kicks off destroying filters. Called by StopTask() and ErrorChangedTask().
  // When we start to tear down the pipeline, we will consider two cases:
  // 1. when pipeline has not been initialized, we will transit to stopping
  // state first.
  // 2. when pipeline has been initialized, we will first transit to pausing
  // => flushing => stopping => stopped state.
  // This will remove the race condition during stop between filters.
  void TearDownPipeline();

  // Compute the time corresponding to a byte offset.
  base::TimeDelta TimeForByteOffset_Locked(int64 byte_offset) const;

  void OnStateTransition(PipelineStatus status);
  void StateTransitionTask(PipelineStatus status);

  // Initiates an asynchronous preroll call sequence executing |done_cb|
  // with the final status when completed.
  void DoInitialPreroll(const PipelineStatusCB& done_cb);

  // Initiates an asynchronous pause-flush-seek-preroll call sequence
  // executing |done_cb| with the final status when completed.
  //
  // TODO(scherkus): Prerolling should be separate from seeking so we can report
  // finer grained ready states (HAVE_CURRENT_DATA vs. HAVE_FUTURE_DATA)
  // indepentent from seeking.
  void DoSeek(base::TimeDelta seek_timestamp, const PipelineStatusCB& done_cb);

  // Updates playback rate and volume and initiates an asynchronous play call
  // sequence executing |done_cb| with the final status when completed.
  void DoPlay(const PipelineStatusCB& done_cb);

  // Initiates an asynchronous pause-flush-stop call sequence executing
  // |done_cb| when completed.
  void DoStop(const PipelineStatusCB& done_cb);
  void OnStopCompleted(PipelineStatus status);

  void OnAudioUnderflow();

  void StartClockIfWaitingForTimeUpdate_Locked();

  // Task runner used to execute pipeline tasks.
  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;

  // MediaLog to which to log events.
  scoped_refptr<MediaLog> media_log_;

  // Lock used to serialize access for the following data members.
  mutable base::Lock lock_;

  // Whether or not the pipeline is running.
  bool running_;

  // Amount of available buffered data.  Set by filters.
  Ranges<int64> buffered_byte_ranges_;
  Ranges<base::TimeDelta> buffered_time_ranges_;

  // True when AddBufferedByteRange() has been called more recently than
  // DidLoadingProgress().
  mutable bool did_loading_progress_;

  // Total size of the media.  Set by filters.
  int64 total_bytes_;

  // The initial natural size of the video as reported by the container.
  gfx::Size initial_natural_size_;

  // Current volume level (from 0.0f to 1.0f).  This value is set immediately
  // via SetVolume() and a task is dispatched on the task runner to notify the
  // filters.
  float volume_;

  // Current playback rate (>= 0.0f).  This value is set immediately via
  // SetPlaybackRate() and a task is dispatched on the task runner to notify
  // the filters.
  float playback_rate_;

  // base::TickClock used by |clock_|.
  base::DefaultTickClock default_tick_clock_;

  // Reference clock.  Keeps track of current playback time.  Uses system
  // clock and linear interpolation, but can have its time manually set
  // by filters.
  scoped_ptr<Clock> clock_;

  // If this value is set to true, then |clock_| is paused and we are waiting
  // for an update of the clock greater than or equal to the elapsed time to
  // start the clock.
  bool waiting_for_clock_update_;

  // Status of the pipeline.  Initialized to PIPELINE_OK which indicates that
  // the pipeline is operating correctly. Any other value indicates that the
  // pipeline is stopped or is stopping.  Clients can call the Stop() method to
  // reset the pipeline state, and restore this to PIPELINE_OK.
  PipelineStatus status_;

  // Whether the media contains rendered audio or video streams.
  // TODO(fischman,scherkus): replace these with checks for
  // {audio,video}_decoder_ once extraction of {Audio,Video}Decoder from the
  // Filter heirarchy is done.
  bool has_audio_;
  bool has_video_;

  // The following data members are only accessed by tasks posted to
  // |task_runner_|.

  // Member that tracks the current state.
  State state_;

  // Whether we've received the audio/video/text ended events.
  bool audio_ended_;
  bool video_ended_;
  bool text_ended_;

  // Set to true in DisableAudioRendererTask().
  bool audio_disabled_;

  // Temporary callback used for Start() and Seek().
  PipelineStatusCB seek_cb_;

  // Temporary callback used for Stop().
  base::Closure stop_cb_;

  // Permanent callbacks passed in via Start().
  base::Closure ended_cb_;
  PipelineStatusCB error_cb_;
  BufferingStateCB buffering_state_cb_;
  base::Closure duration_change_cb_;

  // Contains the demuxer and renderers to use when initializing.
  scoped_ptr<FilterCollection> filter_collection_;

  // Holds the initialized demuxer. Used for seeking. Owned by client.
  Demuxer* demuxer_;

  // Holds the initialized renderers. Used for setting the volume,
  // playback rate, and determining when playback has finished.
  scoped_ptr<AudioRenderer> audio_renderer_;
  scoped_ptr<VideoRenderer> video_renderer_;
  scoped_ptr<TextRenderer> text_renderer_;

  PipelineStatistics statistics_;

  // Time of pipeline creation; is non-zero only until the pipeline first
  // reaches "kStarted", at which point it is used & zeroed out.
  base::TimeTicks creation_time_;

  scoped_ptr<SerialRunner> pending_callbacks_;

  base::ThreadChecker thread_checker_;

  DISALLOW_COPY_AND_ASSIGN(Pipeline);
};

}  // namespace media

#endif  // MEDIA_BASE_PIPELINE_H_


text:
<?php namespace FintechFab\MPSP\Validator;

class SenderValidator extends Validator
{

	/**
	 * @return array
	 */
	public function rules()
	{
		return [
			'phone' => [
				'required',
			],
		];
	}

	/**
	 * @return array
	 */
	public function messages()
	{
		return [];
	}
}


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

using System;
using System.Web;
using Serilog.Core;
using Serilog.Events;

namespace SerilogWeb.Classic.Enrichers
{
    /// <summary>
    /// Enrich log events with a HttpRequestId GUID.
    /// </summary>
    public class HttpRequestIdEnricher : ILogEventEnricher
    {
        /// <summary>
        /// The property name added to enriched log events.
        /// </summary>
        public const string HttpRequestIdPropertyName = "HttpRequestId";

        static readonly string RequestIdItemName = typeof(HttpRequestIdEnricher).Name + "+RequestId";

        /// <summary>
        /// Enrich the log event with an id assigned to the currently-executing HTTP request, if any.
        /// </summary>
        /// <param name="logEvent">The log event to enrich.</param>
        /// <param name="propertyFactory">Factory for creating new properties to add to the event.</param>
        public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
        {
            if (logEvent == null) throw new ArgumentNullException("logEvent");

            if (HttpContext.Current == null)
                return;

            Guid requestId;
            var requestIdItem = HttpContext.Current.Items[RequestIdItemName];
            if (requestIdItem == null)
                HttpContext.Current.Items[RequestIdItemName] = requestId = Guid.NewGuid();
            else
                requestId = (Guid)requestIdItem;

            var requestIdProperty = new LogEventProperty(HttpRequestIdPropertyName, new ScalarValue(requestId));
            logEvent.AddPropertyIfAbsent(requestIdProperty);
        }
    }
}


text:
void ArticleManager::initialize() {
    this->article_parser = NULL;
}

PageInfo ArticleManager::page_articles(int current_page, int articles_per_page,
                                       std::string tag) {
    using namespace mongo;
    Dustbin* dustbin = Dustbin::instance();
    PageInfo info;
    int articles_count;
    if (tag != "") {
        articles_count =
            dustbin->get_db_conn()->count(dustbin->get_db_name() + ".article",
                                         BSON("tag" << tag));
    } else {
        articles_count =
            dustbin->get_db_conn()->count(dustbin->get_db_name() + ".article",
                                          BSONObj());
    }
    if (articles_count == 0) {
        info.limit = 0;
        info.skip = 0;
        int number_of_pages = 0;
    }
    if (articles_per_page != 0) {
        info.limit = articles_per_page;
        info.skip = articles_per_page * (current_page - 1);
        info.number_of_pages = ceil(double(articles_count) / articles_per_page);
    } else {
        info.limit = articles_count;
        info.skip = 0;
        info.number_of_pages = 1;
    }
    return info;
}

std::vector<Article> ArticleManager::get_articles(int limit, int skip,
                                                  std::string tag) {
    using namespace std;
    using namespace mongo;
    Dustbin* dustbin = Dustbin::instance();
    auto_ptr<DBClientCursor> cursor;
    vector<Article> articles;
    if (tag == "") {
        Query qu = Query();
        cursor =
            dustbin->get_db_conn()->query(dustbin->get_db_name() + ".article",
                                          qu.sort("time", -1), limit, skip);
    } else {
        Query qu = QUERY("tag" << tag);
        cursor =
            dustbin->get_db_conn()->query(dustbin->get_db_name() + ".article",
                                          qu.sort("time", -1), limit, skip);
    }
    while (cursor->more()) {
        BSONObj p = cursor->next();
        string id = p.getStringField("id");
        string title = p.getStringField("title");
        string content = p.getStringField("content");
        time_t timestamp = p.getIntField("time");
        if (id == "" || title == "" || content == "") {
            continue;
        }
        Article article;
        article.id = id;
        article.title = title;
        article.content = content;
        article.timestamp = timestamp;
        BSONForEach(e, p.getObjectField("tag")) {
            string tag = e.String();
            if (tag == "") {
                continue;
            }
            article.tags.push_back(tag);
        }
        articles.push_back(article);
    }
    return articles;
}

bool ArticleManager::get_one_article(std::string id, Article* article) {
    using namespace std;
    using namespace mongo;
    Dustbin* dustbin = Dustbin::instance();
    if (!article) {
        return false;
    }
    BSONObj p =
        dustbin->get_db_conn()->findOne(dustbin->get_db_name() + ".article",
                                        QUERY("id" << id));
    if (p.isEmpty()) {
        return false;
    }
    string title = p.getStringField("title");
    string content = p.getStringField("content");
    time_t timestamp = p.getIntField("time");
    if (id == "" || title == "" || content == "") {
        return false;
    }
    article->id = id;
    article->title = title;
    article->content = content;
    article->timestamp = timestamp;
    BSONForEach(e, p.getObjectField("tag")) {
        string tag = e.String();
        if (tag == "") {
            continue;
        }
        article->tags.push_back(tag);
    }
    return true;
}

void ArticleManager::set_article_dict(ctemplate::TemplateDictionary* dict,
                      const Article* article) {
    using namespace std;
    using namespace ctemplate;
    if (!article || !dict) {
        return;
    }
    dict->SetValue("id", article->id);
    dict->SetValue("content", article->content);
    dict->SetValue("title", article->title);
    dict->SetIntValue("date", article->timestamp);
    for (vector<string>::const_iterator it = article->tags.begin();
         it != article->tags.end(); ++it) {
        TemplateDictionary* tag_dict = dict->AddSectionDictionary("tags");
        tag_dict->SetValue("name", *it);
    }
    dict->ShowSection("tags");
}

bool ArticleManager::parse_article(Article* article, bool is_short) {
    using namespace std;
    if (!article || !this->article_parser) {
        return false;
    }
    this->article_parser(article, is_short);
    return true;
}

bool ArticleManager::article_to_json(const Article* article,
                                     Json::Value* json) {
    if (json == NULL || article == NULL) {
        return false;
    }
    if (article->id == "" || article->title == "" || article->content == "") {
        return false;
    }
    (*json)["id"] = article->id;
    (*json)["title"] = article->title;
    (*json)["contnet"] = article->content;
    Json::Value tags;
    for (std::vector<std::string>::const_iterator it = article->tags.begin();
         it != article->tags.end(); ++it) {
        std::string tag = *it;
        tags.append(tag);
    }
    (*json)["tags"] = tags;
    return true;
}

bool ArticleManager::articles_to_json(const std::vector<Article>* articles,
                                      Json::Value* json) {
    if (articles == NULL || json == NULL) {
        return false;
    }
    for (std::vector<Article>::const_iterator it = articles->begin();
         it != articles->end(); ++it) {
        Article article = *it;
        Json::Value article_json;
        this->article_to_json(&article, &article_json);
        json->append(article_json);
    }
    return false;
}

bool ArticleManager::set_article_parser(ArticleParser parser) {
    if (parser == NULL || this->article_parser != NULL) {
        return false;
    }
    this->article_parser = parser;
    return true;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">

<form-validation>

    <formset>
		<form name="satisfaction">
			<field property="wrterNm" depends="required, maxlength">
        		<arg0 key="cop.satisfaction.wrterNm" />
        		<arg1 key="20" resource="true"/>
				<var>
					<var-name>maxlength</var-name>
					<var-value>20</var-value>
				</var>
			</field>
			<field property="stsfdgCn" depends="maxlength">
        		<arg0 key="cop.satisfaction.stsfdgCn" />
        		<arg1 key="200" resource="true"/>
				<var>
					<var-name>maxlength</var-name>
					<var-value>200</var-value>
				</var>
			</field>
			<field property="stsfdg" depends="required">
        		<arg0 key="cop.satisfaction.stsfdg" />
			</field>
			<field property="stsfdgPassword" depends="required">
        		<arg0 key="cop.satisfaction.stsfdgPassword" />
			</field>
		</form>
    </formset>
</form-validation>


text:
class Set
  def not_subset?(set)
    set.is_a?(Set) or raise ArgumentError, "value must be a set"
    return true if set.size > size
    any? { |o| !set.include?(o) }
  end
end


text:
@interface ListViewController ()

@end

@implementation ListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    // Set Collection delegate and data source to self
    myCollectionView.delegate = self;
    myCollectionView.dataSource = self;

    // Set Collection view's background color
    myCollectionView.backgroundColor = [UIColor whiteColor];

    // Register UiCollection cell for reuse
    UINib *cellNib = [UINib nibWithNibName:@"CollectionCell" bundle:nil];
    [myCollectionView registerNib:cellNib forCellWithReuseIdentifier:@"sampleCell"];

    // Setup UICollection view layout
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
    [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
    [myCollectionView setCollectionViewLayout:flowLayout];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - UiCollectionView delegate methods

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 128;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIdentifier = @"sampleCell";

    UICollectionViewCell *cell = [cv dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];

    // Set cell label
    UILabel *cellTitle = (UILabel *)[cell.contentView viewWithTag:100];
    cellTitle.text = @"blah";

    return cell;
}

#pragma mark - UICollectionViewLayout delegate methods

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    CGSize cellSize = CGSizeMake(100.0, 100.0);

    return cellSize;
}

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Gay, Fl. Chil. 8: 116 (1854)

#### Original name
Sticta argyracea var. verrucosa Mont.

### Remarks
null


text:
using System;
using System.IO;

namespace Client
{
    class Program
    {
        static void Main()
        {
            using (var client = new Learning_WCF.ServiceClient())
            using (var reader = new StreamReader(client.Send(@"D:\OneDrive\Video\В.Г. Жданов - Верни себе зрение\disk1.avi")))
            {
                while(!reader.EndOfStream)
                    Console.WriteLine(reader.ReadLine());
            }

            Console.ReadKey();
        }
    }
}


text:
FROM java:8

# Install maven
RUN apt-get update \
 && apt-get install -y maven \
 && apt-get autoremove \
 && rm -rf /var/lib/apt/lists/* /var/cache/apt/*

WORKDIR /code
ARG RELEASE
RUN git clone -b ${RELEASE} https://github.com/rkhozinov/cuckoodo.git ./
RUN mvn package
ENTRYPOINT ["/usr/lib/jvm/java-8-openjdk-amd64/bin/java", "-jar", "/code/target/cuckoodobot-jar-with-dependencies.jar"]


text:
<?php

declare (strict_types = 1);

namespace BinSoul\Net\Http\Response\Type;

use BinSoul\Net\Http\Message\Collection\HeaderCollection;
use BinSoul\Net\Http\Message\Response;
use BinSoul\Net\Http\Response\Body;

/**
 * Represents responses in the HTTP status code range 500 to 599.
 */
class ServerErrorResponse extends Response
{
    use ResponseHelper;

    /**
     * Constructs an instance of this class.
     *
     * @param int                   $status
     * @param Body|null             $body
     * @param HeaderCollection|null $headers
     */
    public function __construct(int $status, Body $body = null, HeaderCollection $headers = null)
    {
        parent::__construct($this->buildBody($body), $status, $this->buildHeaders($headers));
    }

    public function withStatus($code, $reasonPhrase = '')
    {
        $result = parent::withStatus($code, $reasonPhrase);

        $this->assertRange($result->getStatusCode(), 500, 599, 'server error');

        return $result;
    }
}


text:
#include "berryLog.h"

#include "berryIMemento.h"

#include "berryTabbedStackPresentation.h"
#include "berryAbstractTabItem.h"
#include "berryLeftToRightTabOrder.h"
#include "berryReplaceDragHandler.h"
#include "berryShell.h"

#include <berryConstants.h>

namespace berry
{

int TabbedStackPresentation::ComputePreferredMinimumSize(bool width,
    int availablePerpendicular)
{
  int minSize;
  int hint =
          availablePerpendicular == INF ? Constants::DEFAULT
              : availablePerpendicular;
  if (width)
  {
    minSize = folder->GetTabFolder()->ComputeSize(Constants::DEFAULT, hint).width();
  }
  else
  {
    minSize = folder->GetTabFolder()->ComputeSize(hint, Constants::DEFAULT).height();
  }
  return minSize;
}

void TabbedStackPresentation::HandleTabFolderEvent(TabFolderEvent::Pointer e)
{
  int type = e->type;
  if (type == TabFolderEvent::EVENT_MINIMIZE)
  {
    this->GetSite()->SetState(IStackPresentationSite::STATE_MINIMIZED);
  }
  else if (type == TabFolderEvent::EVENT_MAXIMIZE)
  {
    this->GetSite()->SetState(IStackPresentationSite::STATE_MAXIMIZED);
  }
  else if (type == TabFolderEvent::EVENT_RESTORE)
  {
    this->GetSite()->SetState(IStackPresentationSite::STATE_RESTORED);
  }
  else if (type == TabFolderEvent::EVENT_CLOSE)
  {
    IPresentablePart::Pointer part = folder->GetPartForTab(e->tab);
    if (part != 0)
    {
      QList<IPresentablePart::Pointer> parts;
      parts.push_back(part);
      this->GetSite()->Close(parts);
    }
  }
  else if (type == TabFolderEvent::EVENT_SHOW_LIST)
  {
    this->ShowPartList();
  }
  else if (type == TabFolderEvent::EVENT_GIVE_FOCUS_TO_PART)
  {
    IPresentablePart::Pointer part = this->GetSite()->GetSelectedPart();
    if (part != 0)
    {
      part->SetFocus();
    }
  }
  else if (type == TabFolderEvent::EVENT_PANE_MENU)
  {
    IPresentablePart::Pointer part = this->GetSite()->GetSelectedPart();
    if (part != 0)
    {
      part->SetFocus();
    }
    //this->ShowPaneMenu(folder->GetPartForTab(e->tab), QPoint(e->x, e->y));
  }
  else if (type == TabFolderEvent::EVENT_DRAG_START)
  {
    AbstractTabItem* beingDragged = e->tab;
    QPoint initialLocation(e->x, e->y);

    if (beingDragged == nullptr)
    {
      this->GetSite()->DragStart(initialLocation, false);
    }
    else
    {
      IPresentablePart::Pointer part = folder->GetPartForTab(beingDragged);

      try
      {
        dragStart = folder->IndexOf(part);
        // hold on to this TabbedStackPresentation instance, because
        // in this->GetSite()->DragStart() all reference may be deleted
        // and this instance is destroyed, leading to a seg fault when
        // trying to write to dragStart
        StackPresentation::Pointer tabbedStackPresentation(this);
        this->GetSite()->DragStart(part, initialLocation, false);
        dragStart = -1;
      }
      catch(const std::exception& exc)
      {
        dragStart = -1;
        throw exc;
      }
    }
  }
  else if (type == TabFolderEvent::EVENT_TAB_SELECTED)
  {
    if (ignoreSelectionChanges > 0)
    {
      return;
    }

    IPresentablePart::Pointer part = folder->GetPartForTab(e->tab);

    if (part != 0)
    {
      this->GetSite()->SelectPart(part);
    }
  }
  else if (type == TabFolderEvent::EVENT_SYSTEM_MENU)
  {
    IPresentablePart::Pointer part = folder->GetPartForTab(e->tab);

    if (part == 0)
    {
      part = this->GetSite()->GetSelectedPart();
    }

    if (part != 0)
    {
      //this->ShowSystemMenu(QPoint(e->x, e->y), part);
    }
  }
  else if (type == TabFolderEvent::EVENT_PREFERRED_SIZE)
  {
    IPresentablePart::Pointer part = folder->GetPartForTab(e->tab);
    if (part == 0)
    {
      // Standalone views with no title have no tab, so just get the part.
      QList<IPresentablePart::Pointer> parts = this->GetSite()->GetPartList();
      if (parts.size() > 0)
        part = parts.front();
    }
    if (part == this->GetSite()->GetSelectedPart())
    {
      this->GetSite()->FlushLayout();
    }
  }

}

TabbedStackPresentation::TabbedStackPresentation(
    IStackPresentationSite::Pointer site, AbstractTabFolder* widget/*, ISystemMenu systemMenu*/)
 : StackPresentation(site)
{
  auto   folder = new PresentablePartFolder(widget);
  this->Init(site, folder, new LeftToRightTabOrder(folder),
      new ReplaceDragHandler(widget)); // systemMenu);
}

TabbedStackPresentation::TabbedStackPresentation(
    IStackPresentationSite::Pointer site, PresentablePartFolder* folder/*, ISystemMenu systemMenu*/)
 : StackPresentation(site)
{
  this->Init(site, folder, new LeftToRightTabOrder(folder),
      new ReplaceDragHandler(folder->GetTabFolder())); //, systemMenu);
}

TabbedStackPresentation::TabbedStackPresentation(
    IStackPresentationSite::Pointer site, PresentablePartFolder* newFolder,
    TabOrder* tabs, TabDragHandler* dragBehavior /*, ISystemMenu systemMenu*/)
 : StackPresentation(site)
{
  this->Init(site, newFolder, tabs, dragBehavior);
}

void TabbedStackPresentation::Init(IStackPresentationSite::Pointer,
            PresentablePartFolder* newFolder, TabOrder* tabs, TabDragHandler* dragBehavior /*, ISystemMenu systemMenu*/)
{
  //this->systemMenu = systemMenu;

  initializing = true;
  ignoreSelectionChanges = 0;
  dragStart = -1;

  this->folder = newFolder;
  this->tabs = tabs;
  this->dragBehavior = dragBehavior;

  //        // Add a dispose listener. This will call the presentationDisposed()
  //        // method when the widget is destroyed.
  //        folder.getTabFolder().getControl().addDisposeListener(new DisposeListener() {
  //            public void widgetDisposed(DisposeEvent e) {
  //                presentationDisposed();
  //            }
  //        });

  folder->GetTabFolder()->tabFolderEvent += TabFolderEventDelegate(this, &TabbedStackPresentation::HandleTabFolderEvent);

  //this->partList = new DefaultPartList(site, newFolder);
}

void TabbedStackPresentation::RestoreState(IPresentationSerializer* serializer,
    IMemento::Pointer savedState)
{
  tabs->RestoreState(serializer, savedState);
}

void TabbedStackPresentation::SaveState(IPresentationSerializer* context,
    IMemento::Pointer memento)
{
  StackPresentation::SaveState(context, memento);

  tabs->SaveState(context, memento);
}

void TabbedStackPresentation::SetBounds(const QRect& bounds)
{
  folder->SetBounds(bounds);
}

QSize TabbedStackPresentation::ComputeMinimumSize()
{
  return folder->GetTabFolder()->ComputeSize(Constants::DEFAULT, Constants::DEFAULT);
}

int TabbedStackPresentation::ComputePreferredSize(bool width,
    int availableParallel, int availablePerpendicular, int preferredResult)
{

  // If there is exactly one part in the stack, this just returns the
  // preferred size of the part as the preferred size of the stack.
  QList<IPresentablePart::Pointer> parts = this->GetSite()->GetPartList();
  if (parts.size() == 1 && parts.front() != 0 && !(this->GetSite()->GetState()
      == IStackPresentationSite::STATE_MINIMIZED))
  {
    int partSize = parts.front()->ComputePreferredSize(width, availableParallel,
        availablePerpendicular, preferredResult);

    if (partSize == INF)
      return partSize;

    // Adjust preferred size to take into account tab and border trim.
    int minSize = this->ComputePreferredMinimumSize(width, availablePerpendicular);
    if (width)
    {
      // PaneFolder adds some bogus tab spacing, so just find the maximum width.
      partSize = std::max<int>(minSize, partSize);
    }
    else
    {
      // Add them (but only if there's enough room)
      if (INF - minSize > partSize)
        partSize += minSize;
    }

    return partSize;
  }

  if (preferredResult != INF || this->GetSite()->GetState()
      == IStackPresentationSite::STATE_MINIMIZED)
  {
    int minSize = this->ComputePreferredMinimumSize(width, availablePerpendicular);

    if (this->GetSite()->GetState() == IStackPresentationSite::STATE_MINIMIZED)
    {
      return minSize;
    }

    return std::max<int>(minSize, preferredResult);
  }

  return INF;
}

int TabbedStackPresentation::GetSizeFlags(bool width)
{
  int flags = 0;
  // If there is exactly one part in the stack,
  // then take into account the size flags of the part.
  QList<IPresentablePart::Pointer> parts = this->GetSite()->GetPartList();
  if (parts.size() == 1 && parts.front() != 0)
  {
    flags |= parts.front()->GetSizeFlags(width);
  }

  return flags | StackPresentation::GetSizeFlags(width);
}

void TabbedStackPresentation::ShowPartList()
{
//  if (partList != 0)
//  {
//    int numberOfParts = folder->GetTabFolder()->GetItemCount();
//    if (numberOfParts > 0)
//    {
//      partList.show(getControl(), folder.getTabFolder() .getPartListLocation(),
//          getSite().getSelectedPart());
//    }
//  }
}

TabbedStackPresentation::~TabbedStackPresentation()
{
//  // Dispose the tab folder's widgetry
//  folder.getTabFolder().getControl().dispose();

  BERRY_DEBUG << "DELETING TabbedStackPresentation\n";

  delete tabs;
  delete dragBehavior;
  delete folder;
}

void TabbedStackPresentation::SetActive(int newState)
{
  folder->GetTabFolder()->SetActive(newState);
}

void TabbedStackPresentation::SetVisible(bool isVisible)
{
  IPresentablePart::Pointer current = this->GetSite()->GetSelectedPart();
  if (current != 0)
  {
    current->SetVisible(isVisible);
  }

  folder->SetVisible(isVisible);
}

void TabbedStackPresentation::SetState(int state)
{
  folder->GetTabFolder()->SetState(state);
}

QWidget* TabbedStackPresentation::GetControl()
{
  return folder->GetTabFolder()->GetControl();
}

AbstractTabFolder* TabbedStackPresentation::GetTabFolder()
{
  return folder->GetTabFolder();
}

void TabbedStackPresentation::AddPart(IPresentablePart::Pointer newPart,
    Object::Pointer cookie)
{
  ++ignoreSelectionChanges;
  try
  {
    if (initializing)
    {
      tabs->AddInitial(newPart);
    }
    else
    {
      if (cookie == 0)
      {
        tabs->Add(newPart);
      }
      else
      {
        int insertionPoint = dragBehavior->GetInsertionPosition(cookie);
        tabs->Insert(newPart, insertionPoint);
      }
    }

    --ignoreSelectionChanges;
  } catch (std::exception& e)
  {
    --ignoreSelectionChanges;
    throw e;
  }

  if (tabs->GetPartList().size() == 1)
  {
    if (newPart->GetSizeFlags(true) != 0 || newPart->GetSizeFlags(false) != 0)
    {
      this->GetSite()->FlushLayout();
    }
  }
}

void TabbedStackPresentation::MovePart(IPresentablePart::Pointer toMove,
    Object::Pointer cookie)
{
  ++ignoreSelectionChanges;
  try
  {
    int insertionPoint = dragBehavior->GetInsertionPosition(cookie);

    if (insertionPoint == folder->IndexOf(toMove))
    {
      --ignoreSelectionChanges;
      return;
    }

    tabs->Move(toMove, insertionPoint);

    --ignoreSelectionChanges;
  } catch (std::exception& e)
  {
    --ignoreSelectionChanges;
    throw e;
  }
}

void TabbedStackPresentation::RemovePart(IPresentablePart::Pointer oldPart)
{
  ++ignoreSelectionChanges;
  try
  {
    tabs->Remove(oldPart);

    --ignoreSelectionChanges;
  } catch (std::exception& e)
  {
    --ignoreSelectionChanges;
    throw e;
  }
}

void TabbedStackPresentation::SelectPart(IPresentablePart::Pointer toSelect)
{
  initializing = false;

  tabs->Select(toSelect);
}

StackDropResult::Pointer TabbedStackPresentation::DragOver(QWidget* currentControl, const QPoint& location)
{
  QWidget* currentWidget = static_cast<QWidget*>(currentControl);
  return dragBehavior->DragOver(currentWidget, location, dragStart);
}

QList<QWidget*> TabbedStackPresentation::GetTabList(
    IPresentablePart::Pointer part)
{
  QList<QWidget*> list;
  if (folder->GetTabFolder()->GetTabPosition() == Constants::BOTTOM)
  {
    if (part->GetControl() != nullptr)
    {
      list.push_back(part->GetControl());
    }
  }

  list.push_back(folder->GetTabFolder()->GetControl());

//  if (part->GetToolBar() != 0)
//  {
//    list.push_back(part->GetToolBar());
//  }

  if (folder->GetTabFolder()->GetTabPosition() == Constants::TOP)
  {
    if (part->GetControl() != nullptr)
    {
      list.push_back(part->GetControl());
    }
  }

  return list;
}

void TabbedStackPresentation::MoveTab(IPresentablePart::Pointer part, int index)
{
  tabs->Move(part, index);
  folder->Layout(true);
}

QList<IPresentablePart::Pointer> TabbedStackPresentation::GetPartList()
{
  return tabs->GetPartList();
}

}


text:
void foo() {
}

bool foobool(int argc) {
  return argc;
}

struct S1; // expected-note {{declared here}}

int main(int argc, char **argv) {
  int i, z;
  #pragma omp target enter data map(to: i) device // expected-error {{expected '(' after 'device'}}
  #pragma omp target enter data map(to: i) device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  #pragma omp target enter data map(to: i) device () // expected-error {{expected expression}}
  #pragma omp target enter data map(to: i) device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  #pragma omp target enter data map(to: i) device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
#pragma omp target enter data map(to: i) device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
  #pragma omp target enter data map(to: i) device (argc +z +  argc )
  #pragma omp target enter data map(to: i) device (argc), device (argc+1) // expected-error {{directive '#pragma omp target enter data' cannot contain more than one 'device' clause}}
  #pragma omp target enter data map(to: i) device (S1) // expected-error {{'S1' does not refer to a value}}
  #pragma omp target enter data map(to: i) device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}}
  #pragma omp target enter data map(to: i) device (-10u)
  #pragma omp target enter data map(to: i) device (device_num: -10u) // expected-error {{use of undeclared identifier 'device_num'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  #pragma omp target enter data map(to: i) device (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}}
  foo();

  return 0;
}


text:
package com.zeus.eclipsePlugin.swt.dialogs;

import com.zeus.eclipsePlugin.swt.dialogs.ZDialog.DialogOption;

/**
 * Class that stores the results from a password dialog.
 */
public class PasswordResult
{
   private String user, password;
   private boolean store;
   private DialogOption option;

   /**
    * Create password result object.
    * @param user The user-name entered.
    * @param password The password entered.
    * @param store Should the password be stored on disk?
    * @param option The option selected in the dialog.
    */
   public PasswordResult( String user, String password, boolean store, DialogOption option )
   {
      super();
      this.user = user;
      this.password = password;
      this.store = store;
      this.option = option;
   }

   public String getUserName()
   {
      return user;
   }

   public String getPassword()
   {
      return password;
   }

   public boolean getStorePassword()
   {
      return store;
   }

   public DialogOption getOption()
   {
      return option;
   }

}


text:
id: esy
title: Esy Support (beta)
sidebar_label: Esy Support (beta)
slug: /build-tools/esy
---

# Overview

Support for Esy is ongoing. The initial goal is to support Esy project detection, and an esy tool window that allows you to run basic esy tasks.

Please tag any Esy feature requests with the `esy` tag.

# Setup

## Find the Esy Executable
To set up Esy, you'll first need to figure out where Esy is installed on your machine.

This can be done by running the `whereis` command (unix only):

```shell script
$ whereis esy
/home/john/.n/bin/esy # take note of this location
```
> Note: your location will probably be `/usr/local/bin/esy` if you installed npm with `sudo`

If you haven't installed Esy yet, please see the [installation instructions](https://esy.sh/docs/en/getting-started.html#install-esy).

## Configure the Plugin

Next you'll need to configure the plugin with this path to the Esy executable.

To do this, open **File > Settings > Languages & Frameworks > OCaml / Reason > Esy**
and provide the path to the Esy executable:

![](../../static/img/esy-setup-0.png)

Click *Save* and attempt to run Esy by clicking on the Esy tool window.

> Note: you must be viewing an esy project for the Esy tool window to appear.

You should now be able to run Esy actions without issue:

![](../../static/img/esy-setup-1.png)


text:
package com.tremolosecurity.provisioning.jms;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

import javax.jms.ConnectionFactory;
import javax.jms.JMSException;

import org.apache.logging.log4j.Logger;

import com.tremolosecurity.config.util.ConfigManager;
import com.tremolosecurity.config.xml.ParamType;
import com.tremolosecurity.provisioning.core.ProvisioningException;
import com.tremolosecurity.server.GlobalEntries;

public class JMSConnectionFactory {

	static JMSConnectionFactory jmsFactory;
	static Logger logger = org.apache.logging.log4j.LogManager.getLogger(JMSConnectionFactory.class);

	synchronized public static JMSConnectionFactory getConnectionFactory() throws ProvisioningException {
		if (jmsFactory == null) {
			jmsFactory = new JMSConnectionFactory();
		}

		return jmsFactory;
	}

	private ConfigManager cfgMgr;
	private List<JMSConnection> cons;
	private ConnectionFactory cf;

	private boolean isInternalQueue() {
		if (GlobalEntries.getGlobalEntries().getConfigManager().getCfg().getProvisioning() != null && GlobalEntries.getGlobalEntries().getConfigManager().getCfg().getProvisioning().getQueueConfig() != null && ! GlobalEntries.getGlobalEntries().getConfigManager().getCfg().getProvisioning().getQueueConfig().isIsUseInternalQueue()) {
			return false;
		} else {
			return true;
		}
	}

	public JMSConnectionFactory() throws ProvisioningException {
		this.cfgMgr = GlobalEntries.getGlobalEntries().getConfigManager();

		try {
			if (this.isInternalQueue()) {

				Class<ConnectionFactory> factoryClass = (Class<ConnectionFactory>) Class.forName("org.apache.activemq.ActiveMQConnectionFactory");
				Constructor<ConnectionFactory> cfInit = factoryClass.getConstructor(String.class);
				cf = (ConnectionFactory) cfInit.newInstance("vm://localhost/localhost");

			} else {
				cf = (ConnectionFactory) Class.forName(this.cfgMgr.getCfg().getProvisioning().getQueueConfig().getConnectionFactory()).newInstance();
				for (ParamType pt : this.cfgMgr.getCfg().getProvisioning().getQueueConfig().getParam()) {
					String methodName = "set" + pt.getName().toUpperCase().charAt(0) + pt.getName().substring(1);

					try {
						Method m = Class.forName(this.cfgMgr.getCfg().getProvisioning().getQueueConfig().getConnectionFactory()).getMethod(methodName, String.class);
						m.invoke(cf, pt.getValue());
					} catch (NoSuchMethodException e) {
						try {
						//lets try int
						Method m = Class.forName(this.cfgMgr.getCfg().getProvisioning().getQueueConfig().getConnectionFactory()).getMethod(methodName, int.class);
						m.invoke(cf, Integer.parseInt(pt.getValue()));
						} catch (NoSuchMethodException e1) {
							//lets try long
							Method m = Class.forName(this.cfgMgr.getCfg().getProvisioning().getQueueConfig().getConnectionFactory()).getMethod(methodName, long.class);
							m.invoke(cf, Long.parseLong(pt.getValue()));
						}
					}
				}
			}
		} catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException | ClassNotFoundException e2) {
			throw new ProvisioningException("Could not initialize jms",e2);
		} finally {

		}

		this.cons = new ArrayList<JMSConnection>();
	}

	public synchronized JMSSessionHolder getSession(String queueName) throws ProvisioningException {
		if (logger.isDebugEnabled()) {
			logger.debug("Getting session for '" + queueName + "'");
		}

		try {
			if (cons.size() == 0) {
				if (logger.isDebugEnabled()) {
					logger.debug("No connections - '" + queueName + "'");
				}
				int maxSessions = 10;

				if (this.cfgMgr.getCfg().getProvisioning() != null && this.cfgMgr.getCfg().getProvisioning().getQueueConfig() != null) {
					maxSessions = this.cfgMgr.getCfg().getProvisioning().getQueueConfig().getMaxSessionsPerConnection();
				}

				if (logger.isDebugEnabled()) {
					logger.debug("Creating JMS Connection for '" + queueName + "' with " + maxSessions + " sessions");
				}

				JMSConnection con = new JMSConnection(cf,maxSessions);
				this.cons.add(con);

			}

			if (logger.isDebugEnabled()) {
				logger.debug("Retrieving session for '" + queueName + "'");
			}

			JMSSessionHolder session = cons.get(cons.size() - 1).createSession(queueName);

			if (logger.isDebugEnabled()) {
				logger.debug("Session for '" + queueName + "' - '" + session + "'");
			}

			if (session == null) {
				if (logger.isDebugEnabled()) {
					logger.debug("Creating new connection '" + queueName + "'");
				}

				JMSConnection con = new JMSConnection(cf,this.cfgMgr.getCfg().getProvisioning().getQueueConfig().getMaxSessionsPerConnection());
				this.cons.add(con);
				session = cons.get(cons.size() - 1).createSession(queueName);

				if (logger.isDebugEnabled()) {
					logger.debug("Session 2 for '" + queueName + "' - '" + session + "'");
				}
			}

			return session;
		} catch (JMSException e) {
			throw new ProvisioningException("Could not initialize session",e);
		}
	}
}


text:
package bytelang.compiler.annotations.general;

import bytelang.CompilationErrorException;
import bytelang.parser.container.elements.ElementAnnotation;

public abstract class NonParametricAnnotation extends BasicAnnotation {
	@Override
	public void fromElementAnnotation(ElementAnnotation elementAnnotation) {
		if (elementAnnotation.getParameters().size() > 0) {
			throw new CompilationErrorException("Annotation @" + getType().getName() + " doesn't take any parameter.");
		}
	}
}


text:
class Tr8n::Api::V1::OauthController < Tr8n::Api::V1::BaseController

  # http://tools.ietf.org/html/draft-ietf-oauth-v2-16#section-4.2
  # supported grant_type = authorization_code, password, refresh_token, client_credentials
  def request_token
    if request_param(:client_id).blank?
      return render_response(:error_description => "client_id must be provided", :error => :invalid_request)
    end

    unless application
      return render_response(:error_description => "Invalid client application id", :error => :unauthorized_client)
    end

    unless ["authorization_code", "password", "client_credentials"].include?(grant_type)
      return render_response(:error_description => "Only authorization_code, password and client_credentials grant types are currently supported", :error => :unsupported_grant_type)
    end

    send("oauth2_request_token_#{grant_type}")
  end

  def validate_token
    token = Tr8n::Oauth::AccessToken.find_by_token(request_param(:access_token))
    if token && token.valid_token?
      render_response(:result => "OK")
    else
      render_response(:error => :invalid_token, :error_description => "invalid token")
    end
  end

  # add jsonp support
  def invalidate_token
    token = Tr8n::Oauth::AccessToken.find_by_token(request_param(:access_token))
    token.destroy if token
    render_response(:result => "OK")
  end

private

  def request_param(key)
    params[key].to_s.strip.blank? ? nil : params[key].to_s.strip
  end

  def grant_type
    @grant_type ||= request_param(:grant_type) || "authorization_code"
  end

  def response_type
    @response_type ||= request_param(:response_type) || "code"
  end

  # needs to be configured through Tr8n::Config
  def authenticate_user(username, password)
    Tr8n::Config.user_class_name.constantize.authenticate(username, password)
  end

  # request token with grant_type = authorization_code
  def oauth2_request_token_authorization_code
    if request_param(:code).blank?
      return render_response(:error_description => "Code must be provided", :error => :invalid_request)
    end

    request_token = Tr8n::Oauth::RequestToken.where("application_id = ? and token = ? and expires_at > ?", application.id, request_param(:code), Time.now).first
    unless request_token
      return render_response(:error_description => "Invalid authorization code", :error => :invalid_request)
    end

    unless request_token.valid_token?
      return render_response(:error_description => "Authorization code expired", :error => :invalid_request)
    end

    access_token = application.find_or_create_access_token(request_token.translator, request_token.scope)
    refresh_token = application.create_refresh_token(access_token.translator, access_token.scope)
    request_token.destroy

    render_response(:access_token => access_token.token, :refresh_token => refresh_token.token, :expires_in => (access_token.expires_at.to_i - Time.now.to_i))
  end

  # request token with grant_type = password
  def oauth2_request_token_password
    if request_param(:username).blank?
      return render_response(:error_description => "Username must be provided", :error => :invalid_request)
    end

    if request_param(:password).nil?
      return render_response(:error_description => "Password must be provided", :error => :invalid_request)
    end

    user = authenticate_user(request_param(:username), request_param(:password))
    unless user and user.translator
      return render_response(:error_description => "Invalid username and/or password combination", :error => :invalid_request)
    end

    access_token = application.find_or_create_access_token(user.translator)
    refresh_token = application.create_refresh_token(access_token.translator, access_token.scope)
    render_response(:access_token => access_token.token, :refresh_token => refresh_token.token, :expires_in => (access_token.expires_at.to_i - Time.now.to_i))
  end

  # request token with grant_type = client_credentials
  def oauth2_request_token_client_credentials
    if request_param(:client_secret).blank?
      return render_response(:error_description => "Application secret must be provided", :error => :invalid_request)
    end

    if request_param(:client_secret) != application.secret
      return render_response(:error_description => "Invalid application secret", :error => :invalid_request)
    end

    client_token = application.create_client_token
    refresh_token = application.create_refresh_token(nil, client_token.scope)
    render_response(:access_token => client_token.token, :refresh_token => refresh_token.token, :expires_in => (client_token.expires_at.to_i - Time.now.to_i))
  end

  # request token with grant_type = refresh_token
  def oauth2_request_token_refresh_token
    if request_param(:refresh_token).blank?
      return render_response(:error_description => "Refresh token must be provided", :error => :invalid_request)
    end

    refresh_token = Tr8n::Oauth::RefreshToken.where("application_id = ? and token = ?", application.id, request_param(:refresh_token)).first
    unless refresh_token
      return render_response(:error_description => "Invalid refresh token", :error => :invalid_request)
    end

    unless refresh_token.valid_token?
      return render_response(:error_description => "Refresh token expired", :error => :invalid_request)
    end

    if refresh_token.translator
      access_token = refresh_token.application.create_access_token(refresh_token.translator, refresh_token.scope)
    else
      access_token = refresh_token.application.create_client_token(refresh_token.scope)
    end
    refresh_token.destroy

    refresh_token = application.create_refresh_token(access_token.translator, access_token.scope)
    render_response(:access_token => access_token.token, :refresh_token => refresh_token.token, :expires_in => (access_token.expires_at.to_i - Time.now.to_i))
  end

  # used by the request token process
  def render_response(response_params, opts = {})
    response_params = HashWithIndifferentAccess.new(response_params)

    # preserve state
    response_params[:state] = request_param(:state) if request_param(:state)

    # more scope validation must be done
    response_params[:scope] = request_param(:scope) if request_param(:scope)

    opts[:status] ||= begin
      if [:unsupported_grant_type, :invalid_request, :invalid_token].include?(response_params[:error])
        400
      elsif [:unauthorized_application].include?(response_params[:error])
        401
      else
        200
      end
    end
    render(:text => response_params.to_json, :status => opts[:status], :content_type => "text/json")
  end

end


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

/*============================================================
**
** Enum:   FileShare
**
**
**
**
** Purpose: Enum describing how to share files with other
** processes - ie, whether two processes can simultaneously
** read from the same file.
**
**
===========================================================*/

using System;

namespace System.IO {
    // Contains constants for controlling file sharing options while
    // opening files.  You can specify what access other processes trying
    // to open the same file concurrently can have.
    //
    // Note these values currently match the values for FILE_SHARE_READ,
    // FILE_SHARE_WRITE, and FILE_SHARE_DELETE in winnt.h
    //
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
    public enum FileShare
    {
        // No sharing. Any request to open the file (by this process or another
        // process) will fail until the file is closed.
        None = 0,

        // Allows subsequent opening of the file for reading. If this flag is not
        // specified, any request to open the file for reading (by this process or
        // another process) will fail until the file is closed.
        Read = 1,

        // Allows subsequent opening of the file for writing. If this flag is not
        // specified, any request to open the file for writing (by this process or
        // another process) will fail until the file is closed.
        Write = 2,

        // Allows subsequent opening of the file for writing or reading. If this flag
        // is not specified, any request to open the file for writing or reading (by
        // this process or another process) will fail until the file is closed.
        ReadWrite = 3,

        // Open the file, but allow someone else to delete the file.
        Delete = 4,

        // Whether the file handle should be inheritable by child processes.
        // Note this is not directly supported like this by Win32.
        Inheritable = 0x10,
    }
}


text:
package org.sakaiproject.content.providers;

/**
 * database methods.
 */
public interface BaseEventDelayHandlerSql
{

	/**
	 * returns the sql statement which adds a new delayed event
	 */
	String getDelayWriteSql();

	/**
	 * returns the sql statement which reads a delayed event
	 */
	String getDelayReadSql();

	/**
	 * returns the sql statement which reads the id of a delayed event
	 */
	String getDelayFindFineSql();

	/**
	 * returns the sql statement which reads a delayed event
	 */
	String getDelayFindEventSql();

	/**
	 * returns the sql statement which reads a delayed event
	 */
	String getDelayFindByRefSql();

	/**
	 * returns the sql statement which reads a delayed event
	 */
	String getDelayFindByRefEventSql();

	/**
	 * returns the sql statement which deletes a delayed event
	 */
	String getDelayDeleteSql();

}


text:
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Rulesets.Catch.Objects;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Catch.Skinning.Argon
{
    internal class ArgonBananaPiece : ArgonFruitPiece
    {
        private Container stabilisedPieceContainer = null!;

        private Drawable fadeContent = null!;

        [BackgroundDependencyLoader]
        private void load()
        {
            AddInternal(fadeContent = new Container
            {
                RelativeSizeAxes = Axes.Both,
                Children = new Drawable[]
                {
                    stabilisedPieceContainer = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Children = new Drawable[]
                        {
                            new Circle
                            {
                                Colour = Color4.White.Opacity(0.4f),
                                Anchor = Anchor.Centre,
                                Origin = Anchor.Centre,
                                Blending = BlendingParameters.Additive,
                                Size = new Vector2(8),
                                Scale = new Vector2(25, 1),
                            },
                            new Box
                            {
                                Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(0), Color4.White.Opacity(0.8f)),
                                RelativeSizeAxes = Axes.X,
                                Blending = BlendingParameters.Additive,
                                Anchor = Anchor.Centre,
                                Origin = Anchor.CentreRight,
                                Width = 1.6f,
                                Height = 2,
                            },
                            new Circle
                            {
                                Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(0.8f), Color4.White.Opacity(0)),
                                RelativeSizeAxes = Axes.X,
                                Blending = BlendingParameters.Additive,
                                Anchor = Anchor.Centre,
                                Origin = Anchor.CentreLeft,
                                Width = 1.6f,
                                Height = 2,
                            },
                        }
                    },
                    new Circle
                    {
                        RelativeSizeAxes = Axes.Both,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Size = new Vector2(1.2f),
                        EdgeEffect = new EdgeEffectParameters
                        {
                            Type = EdgeEffectType.Glow,
                            Hollow = false,
                            Colour = Color4.White.Opacity(0.1f),
                            Radius = 50,
                        },
                        Child =
                        {
                            Alpha = 0,
                            AlwaysPresent = true,
                        },
                        BorderColour = Color4.White.Opacity(0.1f),
                        BorderThickness = 3,
                    },
                }
            });
        }

        protected override void Update()
        {
            base.Update();

            const float parent_scale_application = 0.4f;

            // relative to time on screen
            const float lens_flare_start = 0.3f;
            const float lens_flare_end = 0.8f;

            // Undo some of the parent scale being applied to make the lens flare feel a bit better..
            float scale = parent_scale_application + (1 - parent_scale_application) * (1 / (ObjectState.DisplaySize.X / (CatchHitObject.OBJECT_RADIUS * 2)));

            stabilisedPieceContainer.Rotation = -ObjectState.DisplayRotation;
            stabilisedPieceContainer.Scale = new Vector2(scale, 1);

            double duration = ObjectState.HitObject.StartTime - ObjectState.DisplayStartTime;

            fadeContent.Alpha = MathHelper.Clamp(
                Interpolation.ValueAt(
                    Time.Current, 1f, 0f,
                    ObjectState.DisplayStartTime + duration * lens_flare_start,
                    ObjectState.DisplayStartTime + duration * lens_flare_end,
                    Easing.OutQuint
                ), 0, 1);
        }
    }
}


text:
using System;
using Xamarin.Forms;
using CouchbaseConnect2014.ValueConverters;
using CouchbaseConnect2014.Controls;

namespace CouchbaseConnect2014.Views
{
    public class AgendaCell : ViewCell
    {
        public AgendaCell ()
        {
			var outerRelativeLayout = new RelativeLayout ();
			outerRelativeLayout.SetBinding (RelativeLayout.BackgroundColorProperty, "Track", converter: new TrackBackgroundColorConverter ());

			var leftStack = CreateLeftStack ();
			outerRelativeLayout.Children.Add (leftStack,
				Constraint.RelativeToParent ((parent) => { return parent.X; }),
				Constraint.RelativeToParent ((parent) => { return parent.Y; }),
				Constraint.RelativeToParent ((parent) => { return parent.Width * 0.74; }),
				Constraint.RelativeToParent ((parent) => { return parent.Height; })
			);

			var timeStack = CreateTimeStack ();
			outerRelativeLayout.Children.Add (timeStack,
				Constraint.RelativeToView (leftStack, (parent,sibling) => { return sibling.Width; }),
				Constraint.RelativeToParent ((parent) => { return parent.Y; }),
				Constraint.RelativeToParent ((parent) => { return parent.Width * 0.26; }),
				Constraint.RelativeToParent ((parent) => { return parent.Height; })
			);

			View = outerRelativeLayout;
        }

        static StackLayout CreateLeftStack ()
        {
            var leftStack = new StackLayout
			{
				HorizontalOptions = LayoutOptions.StartAndExpand,
				VerticalOptions = LayoutOptions.EndAndExpand,
				Padding = new Thickness(15, 0, 0, 13)
            };
            leftStack.Children.Add (CreateSessionItem ());
			leftStack.Children.Add (CreateNoSessionStack ());
            return leftStack;
        }

        static SessionItem CreateSessionItem ()
        {
            var sessionItem = new SessionItem ();
            sessionItem.SetBinding (SessionItem.IsVisibleProperty, "IsBooked");
            return sessionItem;
        }

		static StackLayout CreateNoSessionStack ()
        {
			var noSessionStack = new StackLayout
			{
				Orientation = StackOrientation.Horizontal,
				HorizontalOptions = LayoutOptions.StartAndExpand,
				VerticalOptions = LayoutOptions.EndAndExpand,
				Spacing = 10
			};
			noSessionStack.SetBinding (Frame.IsVisibleProperty, "IsBooked", converter: new NegateValueConverter ());
			noSessionStack.Children.Add (CreateAddIcon ());
			noSessionStack.Children.Add (CreateNoSessionLabel ());
			return noSessionStack;
        }

		static Image CreateAddIcon ()
		{
			var addIcon = new Image
			{
				Source = "plus.png",
				WidthRequest = 20,
				HeightRequest = 20,
				HorizontalOptions = LayoutOptions.Start,
				VerticalOptions = LayoutOptions.EndAndExpand
			};
			return addIcon;
		}

		static FontLabel CreateNoSessionLabel ()
		{
			var noSessionLabel = new FontLabel {
				Text = "Choose a Session",
                Font = Font.OfSize(Fonts.OpenSansLight, 14),
				TextColor = Color.FromHex("333333"),
				HorizontalOptions = LayoutOptions.EndAndExpand
			};
			return noSessionLabel;
		}

        static StackLayout CreateTimeStack ()
        {
            var timeStack = new StackLayout {
				HorizontalOptions = LayoutOptions.EndAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
				Orientation = StackOrientation.Horizontal,
				Padding = new Thickness(0, 0, 5, 10),
				Spacing = 2
			};
            timeStack.Children.Add (CreateTimeLabel ());
            timeStack.Children.Add (CreateAMPMLabel ());
            return timeStack;
        }

		static FontLabel CreateTimeLabel ()
        {
			var timeLabel = new FontLabel
			{
                Font = Font.OfSize(Fonts.OpenSansLight, 24),
				HorizontalOptions = LayoutOptions.EndAndExpand,
				VerticalOptions = LayoutOptions.EndAndExpand
			};
			timeLabel.SetBinding (FontLabel.TextProperty, "Time", converter: new DateTimeValueConverter ("h:mm"));
			timeLabel.SetBinding (FontLabel.TextColorProperty, "Track", converter: new TrackTextColorConverter ());
            return timeLabel;
        }

		static FontLabel CreateAMPMLabel ()
        {
			var amPMLabel = new FontLabel
			{
                Font = Font.OfSize(Fonts.OpenSansBold, 9),
				HorizontalOptions = LayoutOptions.End,
				VerticalOptions = LayoutOptions.EndAndExpand,
				YAlign = TextAlignment.End,
				TranslationY = -4
			};
			amPMLabel.SetBinding (FontLabel.TextProperty, "Time", converter: new DateTimeValueConverter ("tt"));
			amPMLabel.SetBinding (FontLabel.TextColorProperty, "Track", converter: new TrackTextColorConverter ());
            return amPMLabel;
        }
    }
}


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

<TITLE>
E-Index
</TITLE>

<META NAME="date" CONTENT="2013-03-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I K L M N O P R S T U W X Y

E

eventsAfterReset -
Static variable in class ch.unifr.pai.twice.mousecontrol.client.TouchPadNintendoDS

extractByRegex(Response, String) -
Static method in class ch.unifr.pai.twice.mousecontrol.client.TouchPadWidget

Helper method to extract values from the HTTP-response by the given regular expression

extractColor(Response) -
Static method in class ch.unifr.pai.twice.mousecontrol.client.TouchPadWidget

extractLastAction(Response) -
Method in class ch.unifr.pai.twice.mousecontrol.client.TouchPadWidget

extractScreenDimensions(Response) -
Static method in class ch.unifr.pai.twice.mousecontrol.client.TouchPadWidget

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I K L M N O P R S T U W X Y


text:
import os

def open_file(filename, mode='rb'):
    """
    Load a file from the fixtures directory.
    """
    path = os.path.join('fixtures', filename)
    if 'tests' in os.listdir('.'):
        path = os.path.join('tests', path)
    return open(path, mode=mode)


text:
<!doctype html>

    <meta charset="utf-8">
    <title>My HTML File</title>
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
      <link rel="stylesheet" href="style.css" />

        <input type="text" ng-model="output" />

                        <button ng-if="$index<keys.length" ng-click="press(keys[$index])" >{{keys[$index]}}</button>
                        <button ng-if="$index+1<keys.length" ng-click="press(keys[$index+1])">{{keys[$index+1]}}</button>
                        <button ng-if="$index+2<keys.length" ng-click="press(keys[$index+2])">{{keys[$index+2]}}</button>
                        <button ng-if="$index+3<keys.length" ng-click="press(keys[$index+3])">{{keys[$index+3]}}</button>


text: pull request test


text:
Releasing
=========

 1. Update the version in `Segment-Localytics.podspec` to a non-beta version.
 2. Update the `CHANGELOG.md` for the impending release.
 3. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
 4. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
 5. `git push && git push --tags`
 6. `pod trunk push Segment-Localytics.podspec --use-libraries`
 7. Update the version `Segment-Localytics.podspec` to the next beta version.
 8. `git commit -am "Prepare next development version."`
 9. `git push`


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Sydowia 5(3-6): 393 (1951)

#### Original name
Coniothyrium withaniae S. Ahmad

### Remarks
null