text:
//          Copyright Oliver Kowalke 2013.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef BOOST_FIBERS_BOUNDED_CHANNEL_H
#define BOOST_FIBERS_BOUNDED_CHANNEL_H

#warn "template bounded_channel is deprecated"

#include <algorithm>
#include <atomic>
#include <chrono>
#include <cstddef>
#include <memory>
#include <mutex>
#include <system_error>
#include <utility>

#include <boost/config.hpp>
#include <boost/intrusive_ptr.hpp>

#include <boost/fiber/detail/config.hpp>
#include <boost/fiber/exceptions.hpp>
#include <boost/fiber/exceptions.hpp>
#include <boost/fiber/condition_variable.hpp>
#include <boost/fiber/mutex.hpp>
#include <boost/fiber/channel_op_status.hpp>

#ifdef BOOST_HAS_ABI_HEADERS
#  include BOOST_ABI_PREFIX
#endif

namespace boost {
namespace fibers {

template< typename T,
          typename Allocator = std::allocator< T >
>
class bounded_channel {
public:
    typedef T   value_type;

private:
    struct node {
        typedef intrusive_ptr< node >                   ptr_t;
        typedef typename std::allocator_traits< Allocator >::template rebind_alloc<
            node
        >                                               allocator_t;
        typedef std::allocator_traits< allocator_t >    allocator_traits_t;

#if ! defined(BOOST_FIBERS_NO_ATOMICS)
        std::atomic< std::size_t >  use_count{ 0 };
#else
        std::size_t                 use_count{ 0 };
#endif
        allocator_t                 alloc;
        T                           va;
        ptr_t                       nxt{};

        node( T const& t, allocator_t const& alloc_) noexcept :
            alloc{ alloc_ },
            va{ t } {
        }

        node( T && t, allocator_t & alloc_) noexcept :
            alloc{ alloc_ },
            va{ std::move( t) } {
        }

        friend
        void intrusive_ptr_add_ref( node * p) noexcept {
            ++p->use_count;
        }

        friend
        void intrusive_ptr_release( node * p) noexcept {
            if ( 0 == --p->use_count) {
                allocator_t alloc( p->alloc);
                allocator_traits_t::destroy( alloc, p);
                allocator_traits_t::deallocate( alloc, p, 1);
            }
        }
    };

    using ptr_t = typename node::ptr_t;
    using allocator_t = typename node::allocator_t;
    using allocator_traits_t = typename node::allocator_traits_t;

    enum class queue_status {
        open = 0,
        closed
    };

    allocator_t         alloc_;
    queue_status        state_{ queue_status::open };
    std::size_t         count_{ 0 };
    ptr_t               head_{};
    ptr_t           *   tail_;
    mutable mutex       mtx_{};
    condition_variable  not_empty_cond_{};
    condition_variable  not_full_cond_{};
    std::size_t         hwm_;
    std::size_t         lwm_;

    bool is_closed_() const noexcept {
        return queue_status::closed == state_;
    }

    void close_( std::unique_lock< boost::fibers::mutex > & lk) noexcept {
        state_ = queue_status::closed;
        lk.unlock();
        not_empty_cond_.notify_all();
        not_full_cond_.notify_all();
    }

    std::size_t size_() const noexcept {
        return count_;
    }

    bool is_empty_() const noexcept {
        return ! head_;
    }

    bool is_full_() const noexcept {
        return count_ >= hwm_;
    }

    channel_op_status push_( ptr_t new_node,
                             std::unique_lock< boost::fibers::mutex > & lk) {
        if ( is_closed_() ) {
            return channel_op_status::closed;
        }
        not_full_cond_.wait( lk,
                             [this](){
                                return ! is_full_();
                             });
        return push_and_notify_( new_node, lk);
    }

    channel_op_status try_push_( ptr_t new_node,
                                 std::unique_lock< boost::fibers::mutex > & lk) noexcept {
        if ( is_closed_() ) {
            return channel_op_status::closed;
        }
        if ( is_full_() ) {
            return channel_op_status::full;
        }
        return push_and_notify_( new_node, lk);
    }

    template< typename Clock, typename Duration >
    channel_op_status push_wait_until_( ptr_t new_node,
                                        std::chrono::time_point< Clock, Duration > const& timeout_time,
                                        std::unique_lock< boost::fibers::mutex > & lk) {
        if ( is_closed_() ) {
            return channel_op_status::closed;
        }
        if ( ! not_full_cond_.wait_until( lk, timeout_time,
                                          [this](){
                                               return ! is_full_();
                                          })) {
            return channel_op_status::timeout;
        }
        return push_and_notify_( new_node, lk);
    }

    channel_op_status push_and_notify_( ptr_t new_node,
                                        std::unique_lock< boost::fibers::mutex > & lk) noexcept {
        push_tail_( new_node);
        lk.unlock();
        not_empty_cond_.notify_one();
        return channel_op_status::success;
    }

    void push_tail_( ptr_t new_node) noexcept {
        * tail_ = new_node;
        tail_ = & new_node->nxt;
        ++count_;
    }

    value_type value_pop_( std::unique_lock< boost::fibers::mutex > & lk) {
        BOOST_ASSERT( ! is_empty_() );
        auto old_head = pop_head_();
        if ( size_() <= lwm_) {
            if ( lwm_ == hwm_) {
                lk.unlock();
                not_full_cond_.notify_one();
            } else {
                lk.unlock();
                // more than one producer could be waiting
                // to push a value
                not_full_cond_.notify_all();
            }
        }
        return std::move( old_head->va);
    }

    ptr_t pop_head_() noexcept {
        auto old_head = head_;
        head_ = old_head->nxt;
        if ( ! head_) {
            tail_ = & head_;
        }
        old_head->nxt.reset();
        --count_;
        return old_head;
    }

public:
    bounded_channel( std::size_t hwm, std::size_t lwm,
                     Allocator const& alloc = Allocator() ) :
        alloc_{ alloc },
        tail_{ & head_ },
        hwm_{ hwm },
        lwm_{ lwm } {
        if ( hwm_ <= lwm_) {
            throw fiber_error( std::make_error_code( std::errc::invalid_argument),
                               "boost fiber: high-watermark is less than or equal to low-watermark for bounded_channel");
        }
        if ( 0 == hwm) {
            throw fiber_error( std::make_error_code( std::errc::invalid_argument),
                               "boost fiber: high-watermark is zero");
        }
    }

    bounded_channel( std::size_t wm,
                     Allocator const& alloc = Allocator() ) :
        alloc_{ alloc },
        tail_{ & head_ },
        hwm_{ wm },
        lwm_{ wm - 1 } {
        if ( 0 == wm) {
            throw fiber_error( std::make_error_code( std::errc::invalid_argument),
                               "boost fiber: watermark is zero");
        }
    }

    bounded_channel( bounded_channel const&) = delete;
    bounded_channel & operator=( bounded_channel const&) = delete;

    std::size_t upper_bound() const noexcept {
        return hwm_;
    }

    std::size_t lower_bound() const noexcept {
        return lwm_;
    }

    void close() noexcept {
        std::unique_lock< mutex > lk( mtx_);
        close_( lk);
    }

    channel_op_status push( value_type const& va) {
        typename allocator_traits_t::pointer ptr{
            allocator_traits_t::allocate( alloc_, 1) };
        try {
            allocator_traits_t::construct( alloc_, ptr, va, alloc_);
        } catch (...) {
            allocator_traits_t::deallocate( alloc_, ptr, 1);
            throw;
        }
        std::unique_lock< mutex > lk( mtx_);
        return push_( { detail::convert( ptr) }, lk);
    }

    channel_op_status push( value_type && va) {
        typename allocator_traits_t::pointer ptr{
            allocator_traits_t::allocate( alloc_, 1) };
        try {
            allocator_traits_t::construct(
                    alloc_, ptr, std::move( va), alloc_);
        } catch (...) {
            allocator_traits_t::deallocate( alloc_, ptr, 1);
            throw;
        }
        std::unique_lock< mutex > lk( mtx_);
        return push_( { detail::convert( ptr) }, lk);
    }

    template< typename Rep, typename Period >
    channel_op_status push_wait_for( value_type const& va,
                                     std::chrono::duration< Rep, Period > const& timeout_duration) {
        return push_wait_until( va,
                                std::chrono::steady_clock::now() + timeout_duration);
    }

    template< typename Rep, typename Period >
    channel_op_status push_wait_for( value_type && va,
                                     std::chrono::duration< Rep, Period > const& timeout_duration) {
        return push_wait_until( std::forward< value_type >( va),
                                std::chrono::steady_clock::now() + timeout_duration);
    }

    template< typename Clock, typename Duration >
    channel_op_status push_wait_until( value_type const& va,
                                       std::chrono::time_point< Clock, Duration > const& timeout_time) {
        typename allocator_traits_t::pointer ptr{
            allocator_traits_t::allocate( alloc_, 1) };
        try {
            allocator_traits_t::construct( alloc_, ptr, va, alloc_);
        } catch (...) {
            allocator_traits_t::deallocate( alloc_, ptr, 1);
            throw;
        }
        std::unique_lock< mutex > lk( mtx_);
        return push_wait_until_( { detail::convert( ptr) }, timeout_time, lk);
    }

    template< typename Clock, typename Duration >
    channel_op_status push_wait_until( value_type && va,
                                       std::chrono::time_point< Clock, Duration > const& timeout_time) {
        typename allocator_traits_t::pointer ptr{
            allocator_traits_t::allocate( alloc_, 1) };
        try {
            allocator_traits_t::construct(
                    alloc_, ptr, std::move( va), alloc_);
        } catch (...) {
            allocator_traits_t::deallocate( alloc_, ptr, 1);
            throw;
        }
        std::unique_lock< mutex > lk( mtx_);
        return push_wait_until_( { detail::convert( ptr) }, timeout_time, lk);
    }

    channel_op_status try_push( value_type const& va) {
        typename allocator_traits_t::pointer ptr{
            allocator_traits_t::allocate( alloc_, 1) };
        try {
            allocator_traits_t::construct( alloc_, ptr, va, alloc_);
        } catch (...) {
            allocator_traits_t::deallocate( alloc_, ptr, 1);
            throw;
        }
        std::unique_lock< mutex > lk( mtx_);
        return try_push_( { detail::convert( ptr) }, lk);
    }

    channel_op_status try_push( value_type && va) {
        typename allocator_traits_t::pointer ptr{
            allocator_traits_t::allocate( alloc_, 1) };
        try {
            allocator_traits_t::construct(
                    alloc_, ptr, std::move( va), alloc_);
        } catch (...) {
            allocator_traits_t::deallocate( alloc_, ptr, 1);
            throw;
        }
        std::unique_lock< mutex > lk( mtx_);
        return try_push_( { detail::convert( ptr) }, lk);
    }

    channel_op_status pop( value_type & va) {
        std::unique_lock< mutex > lk( mtx_);
        not_empty_cond_.wait( lk,
                              [this](){
                                return is_closed_() || ! is_empty_();
                              });
        if ( is_closed_() && is_empty_() ) {
            return channel_op_status::closed;
        }
        va = value_pop_( lk);
        return channel_op_status::success;
    }

    value_type value_pop() {
        std::unique_lock< mutex > lk( mtx_);
        not_empty_cond_.wait( lk,
                              [this](){
                                return is_closed_() || ! is_empty_();
                              });
        if ( is_closed_() && is_empty_() ) {
            throw fiber_error(
                    std::make_error_code( std::errc::operation_not_permitted),
                    "boost fiber: queue is closed");
        }
        return value_pop_( lk);
    }

    channel_op_status try_pop( value_type & va) {
        std::unique_lock< mutex > lk( mtx_);
        if ( is_closed_() && is_empty_() ) {
            // let other fibers run
            lk.unlock();
            this_fiber::yield();
            return channel_op_status::closed;
        }
        if ( is_empty_() ) {
            // let other fibers run
            lk.unlock();
            this_fiber::yield();
            return channel_op_status::empty;
        }
        va = value_pop_( lk);
        return channel_op_status::success;
    }

    template< typename Rep, typename Period >
    channel_op_status pop_wait_for( value_type & va,
                                    std::chrono::duration< Rep, Period > const& timeout_duration) {
        return pop_wait_until( va,
                               std::chrono::steady_clock::now() + timeout_duration);
    }

    template< typename Clock, typename Duration >
    channel_op_status pop_wait_until( value_type & va,
                                      std::chrono::time_point< Clock, Duration > const& timeout_time) {
        std::unique_lock< mutex > lk( mtx_);
        if ( ! not_empty_cond_.wait_until( lk,
                                           timeout_time,
                                           [this](){
                                                return is_closed_() || ! is_empty_();
                                           })) {
            return channel_op_status::timeout;
        }
        if ( is_closed_() && is_empty_() ) {
            return channel_op_status::closed;
        }
        va = value_pop_( lk);
        return channel_op_status::success;
    }
};

}}

#ifdef BOOST_HAS_ABI_HEADERS
#  include BOOST_ABI_SUFFIX
#endif

#endif // BOOST_FIBERS_BOUNDED_CHANNEL_H


text:
class Sequence < ActiveRecord::Base

  attr_accessible :description, :title, :theme_id, :project_id, :defunct,
    :user_id, :logo, :display_title, :thumbnail_url, :abstract, :publication_hash,
    :runtime, :project, :background_image

  include Publishable # defines methods to publish to portals
  include PublicationStatus # defines publication status scopes and helpers
  include FixedWidthLayout # defines fixed width options
  has_many :lightweight_activities_sequences, :order => :position, :dependent => :destroy
  has_many :lightweight_activities, :through => :lightweight_activities_sequences, :order => :position
  belongs_to :user
  belongs_to :theme
  belongs_to :project

  has_many :imports, as: :import_item

  # scope :newest, order("updated_at DESC")
  # TODO: Sequences and possibly activities will eventually belong to projects e.g. HAS, SFF

  def name
    # activities have names, so to be consistent ...
    self.title
  end
  def time_to_complete
    time = 0
    lightweight_activities.map { |a| time = time + (a.time_to_complete ? a.time_to_complete : 0) }
    time
  end

  def activities
    lightweight_activities
  end

  def next_activity(activity)
    # Given an activity, return the next one in the sequence
    get_neighbor(activity, false)
  end

  def previous_activity(activity)
    # Given an activity, return the previous one in the sequence
    get_neighbor(activity, true)
  end

  def to_hash
    # We're intentionally not copying:
    # - is_official (defaults to false, can be changed)
    # - user_id (the copying user should be the owner)
    {
      title: title,
      description: description,
      publication_status: publication_status,
      abstract: abstract,
      theme_id: theme_id,
      project: project,
      logo: logo,
      display_title: display_title,
      thumbnail_url: thumbnail_url,
      runtime: runtime
    }
  end

  def fix_activity_position(positions)
    # This is not necessary, as 'lightweight_activities_sequences' is ordered by
    # position, so we already copied and add activities in a right order. However
    # copying exact position values seems to be safer and more resistant
    # to possible errors in the future.
    self.lightweight_activities_sequences.each_with_index do |sa, i|
      sa.position = positions[i]
      sa.save!
    end
    self.save!
  end

  def duplicate(new_owner)
    helper = LaraDuplicationHelper.new
    new_sequence = Sequence.new(self.to_hash)
    Sequence.transaction do
      new_sequence.title = "Copy of #{self.name}"
      new_sequence.user = new_owner
      positions = []
      lightweight_activities_sequences.each do |sa|
        new_a = sa.lightweight_activity.duplicate(new_owner, helper)
        new_a.name = new_a.name.sub('Copy of ', '')
        new_a.save!
        new_sequence.activities << new_a
        positions << sa.position
      end
      new_sequence.save!
      new_sequence.fix_activity_position(positions)
    end
    new_sequence
  end

  def export
    sequence_json = self.as_json(only: [:title,
                                        :description,
                                        :abstract,
                                        :theme_id,
                                        :logo,
                                        :display_title,
                                        :thumbnail_url,
                                        :runtime,
                                        :background_image,
                                        :defunct
    ])
    sequence_json[:project] = self.project ? self.project.export : nil
    sequence_json[:activities] = []
    self.lightweight_activities.each_with_index do |a,i|
      activity_hash = a.export
      activity_hash[:position] = i+1
      sequence_json[:activities] << activity_hash
    end
    sequence_json[:type] = "Sequence"
    sequence_json[:export_site] = "Lightweight Activities Runtime and Authoring"
    if self.runtime == "Activity Player"
      sequence_json[:fixed_width_layout] = self.fixed_width_layout
    end
    return sequence_json.to_json
  end

  def serialize_for_portal_basic(host)
    local_url = "#{host}#{Rails.application.routes.url_helpers.sequence_path(self)}"
    api_url = "#{host}#{Rails.application.routes.url_helpers.api_v1_sequence_path(self)}.json"
    ap_url = ENV["ACTIVITY_PLAYER_URL"] + "?sequence=" + api_url

    if self.runtime == "Activity Player"
      run_url = ap_url
      source_type = "Activity Player"
      append_auth_token = true
      tool_id = ENV["ACTIVITY_PLAYER_URL"]
    else
      run_url = local_url
      source_type = "LARA"
      append_auth_token = false
      tool_id = ""
    end

    {
      'source_type' => source_type,
      'type' => 'Sequence',
      'name' => self.title,
      "url" => run_url,
      "author_url" => "#{local_url}/edit",
      "print_url"  => "#{local_url}/print_blank",
      "thumbnail_url" => thumbnail_url,
      # These are specific to the Activity Player publish
      "tool_id" => tool_id,
      "append_auth_token" => append_auth_token
    }
  end

  def serialize_for_portal(host)
    data = serialize_for_portal_basic(host)
    data["create_url"] = data["url"]
    data["author_email"] = self.user.email
    # Description is not used by new Portal anymore. However, we still need to send it to support older Portal instances.
    # Otherwise, the old Portal code would reset its description copy each time the sequence was published.
    # When all Portals are upgraded to v1.31 we can stop sending this property.
    data["description"] = self.description
    # Abstract is not used by new Portal anymore. However, we still need to send it to support older Portal instances.
    # Otherwise, the old Portal code would reset its abstract copy each time the sequence was published.
    # When all Portals are upgraded to v1.31 we can stop sending this property.

    data["abstract"] = self.abstract
    data["activities"] = self.activities.map { |a| a.serialize_for_portal(host) }
    data
  end

  def serialize_for_report_service(host)
    local_url = "#{host}#{Rails.application.routes.url_helpers.sequence_path(self)}"
    data = {
      id: 'sequence_' + self.id.to_s,
      type: 'sequence',
      name: self.title,
      url: local_url
    }
    if self.runtime == "Activity Player"
      data[:preview_url] = self.activity_player_sequence_url(host, preview: true)
    end

    # FIXME: the urls and preview_urls in these activities do not include the
    # the sequence, so links in the report to the activities or activity pages
    # will not show the activity or page in the context of a sequence
    # see https://www.pivotaltracker.com/story/show/177122631
    migration_status = "unknown"
    data[:children] = self.activities.map { |a|
      if a.migration_status != "migrated"
        migration_status = "not_migrated"
      end
      a.serialize_for_report_service(host)
    }
    if data[:children].count > 0 && migration_status == "unknown"
      migration_status = "migrated"
    end
    data[:migration_status] = migration_status
    data
  end

  def activity_player_sequence_url(host, preview: false, mode: nil, activity: nil)
    sequence_api_url = "#{host}#{Rails.application.routes.url_helpers.api_v1_sequence_path(self)}.json"
    uri = URI.parse(ENV["ACTIVITY_PLAYER_URL"])
    query = Rack::Utils.parse_query(uri.query)
    query["sequence"] = sequence_api_url
    if preview
      query["preview"] = nil # adds 'preview' to query string as a valueless param
    end
    if mode
      query["mode"] = mode
    end
    if activity
      query["sequenceActivity"] = activity
    end
    uri.query = Rack::Utils.build_query(query)
    return uri.to_s
  end

  def self.extract_from_hash(sequence_json_object)
    {
      abstract: sequence_json_object[:abstract],
      description: sequence_json_object[:description],
      display_title: sequence_json_object[:display_title],
      logo: sequence_json_object[:logo],
      theme_id: sequence_json_object[:theme_id],
      thumbnail_url: sequence_json_object[:thumbnail_url],
      title: sequence_json_object[:title],
      runtime: sequence_json_object[:runtime],
      background_image: sequence_json_object[:background_image]
    }

  end

  def self.import(sequence_json_object, new_owner, imported_activity_url=nil)
    helper = LaraSerializationHelper.new
    import_sequence = Sequence.new(self.extract_from_hash(sequence_json_object))
    import_sequence.runtime = sequence_json_object[:runtime]
    import_sequence.project = Project.find_or_create(sequence_json_object[:project]) if sequence_json_object[:project]
    Sequence.transaction do
      import_sequence.title = import_sequence.title
      import_sequence.imported_activity_url = imported_activity_url
      import_sequence.user = new_owner
      positions = []
      sequence_json_object[:activities].each do |sa|
        import_a = LightweightActivity.import(sa, new_owner, nil, helper)
        import_a.save!
        import_sequence.activities << import_a
        positions << sa[:position]
      end
      import_sequence.save!
      import_sequence.fix_activity_position(positions)
    end
    return import_sequence
  end

  def self.search(query)
    where("title LIKE ?", "%#{query}%")
  end

  private
  def get_neighbor(activity, higher)
    join = lightweight_activities_sequences.find_by_lightweight_activity_id(activity.id)
    if join.blank? || (join.first? && higher) || (join.last? && !higher)
      return nil
    elsif join && higher
      return join.higher_item.lightweight_activity
    elsif join && !higher
      return join.lower_item.lightweight_activity
    else
      return nil
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package lib.neo4j

import lib.joda._
import scala.language.implicitConversions

package object data {
  import org.neo4j.graphdb._
  import org.neo4j.graphdb.index.Index

  type Node = org.neo4j.graphdb.Node
  type Relationship = org.neo4j.graphdb.Relationship
  type RelationshipType = org.neo4j.graphdb.RelationshipType

  def escape(str: String) = "`" + str + "`"

  def convert(data: Any): Option[Any] = data match {
    case None => None
    case net.flatmap.ace.Unassigned => None
    case net.flatmap.ace.Assigned(x) => convert(x)
    case d: org.joda.time.LocalDate => Some(toLong(d))
    case t: org.joda.time.LocalTime => Some(toLong(t))
    case dt: org.joda.time.LocalDateTime => Some(toLong(dt))
    case Some(x) => convert(x)
    case x => Some(x)
  }

  def property(columnName: String) =
    Parser.getProperty(columnName)
  def property[T](columnName: String, propertyName: String)(implicit transformer: net.flatmap.ace.Column[T]) =
    Parser.getProperty(columnName, propertyName)(transformer)
  def propertyOpt[T](columnName: String, propertyName: String)(implicit transformer: net.flatmap.ace.Column[T]) =
    Parser.getPropertyOpt(columnName, propertyName)(transformer)

  /** Implicitly converts a `Node` into a [[lib.neo4j.data.RichNode]]. */
  implicit def node2RichNode(node: Node): RichNode = RichNode(node)

  /** Implicitly converts a `Relationship` into a [[lib.neo4j.data.RichRelationship]]. */
  implicit def relationship2RichRelationship(relationship: Relationship): RichRelationship = RichRelationship(relationship)

  /** Implicitly converts a [[lib.neo4j.data.RichNode]] into a `Node`. */
  private[data] implicit def richNode2Node(richNode: RichNode): Node = richNode.base

  /** Implicitly converts a `String` into a [[lib.neo4j.data.RelationshipType]]. */
  implicit def string2RelationshipType(name: String) = DynamicRelationshipType.withName(name)

  /** Implicitly converts a [[lib.neo4j.data.RichRelationship]] into a `Relationship`. */
  private[data] implicit def richRelationship2relation(richRelationship: RichRelationship): Relationship = richRelationship.base

  /** Implicitly converts an `Index` into a [[lib.neo4j.data.RichIndex]]. */
  implicit def index2RichIndex[T <: PropertyContainer](index: Index[T]): RichIndex[T] = RichIndex(index)
}


text:
<?php

/**
 * Class WPML_Elementor_Icon_List
 */
class WPML_Elementor_Icon_List extends WPML_Elementor_Module_With_Items {

	/**
	 * @return string
	 */
	public function get_items_field() {
		return 'icon_list';
	}

	/**
	 * @return array
	 */
	public function get_fields() {
		return array( 'text', 'link' => array( 'url' ) );
	}

	/**
	 * @param string $field
	 *
	 * @return string
	 */
	protected function get_title( $field ) {
		switch( $field ) {
			case 'text':
				return esc_html__( 'Icon List: Text', 'wpml-string-translation' );

			case 'url':
				return esc_html__( 'Icon List: Link URL', 'wpml-string-translation' );

			default:
				return '';
		}
	}

	/**
	 * @param string $field
	 *
	 * @return string
	 */
	protected function get_editor_type( $field ) {
		switch( $field ) {
			case 'text':
				return 'LINE';
			case 'url':
				return 'LINK';

			default:
				return '';
		}
	}

}


text:
package goci

import specs "github.com/opencontainers/runtime-spec/specs-go"

// Bndl represents an in-memory OCI bundle
type Bndl struct {
	Spec specs.Spec
}

// Bundle creates a Bndl
func Bundle() Bndl {
	return Bndl{
		Spec: specs.Spec{
			Version: "1.0.0",
			Linux:   &specs.Linux{},
			Windows: &specs.Windows{
				Network:      &specs.WindowsNetwork{},
				LayerFolders: []string{},
			},
			Process: &specs.Process{
				ConsoleSize: &specs.Box{},
			},
			Root: &specs.Root{},
		},
	}
}

var (
	NetworkNamespace = specs.LinuxNamespace{Type: specs.NetworkNamespace}
	UserNamespace    = specs.LinuxNamespace{Type: specs.UserNamespace}
	PIDNamespace     = specs.LinuxNamespace{Type: specs.PIDNamespace}
	IPCNamespace     = specs.LinuxNamespace{Type: specs.IPCNamespace}
	UTSNamespace     = specs.LinuxNamespace{Type: specs.UTSNamespace}
	MountNamespace   = specs.LinuxNamespace{Type: specs.MountNamespace}
	CgroupNamespace  = specs.LinuxNamespace{Type: specs.CgroupNamespace}
)

// WithProcess returns a bundle with the process replaced with the given Process. The original bundle is not modified.
func (b Bndl) WithProcess(process specs.Process) Bndl {
	b.Spec.Process = &process
	return b
}

func (b Bndl) CGroupPath() string {
	return b.Spec.Linux.CgroupsPath
}

func (b Bndl) WithCGroupPath(path string) Bndl {
	b.Spec.Linux.CgroupsPath = path
	return b
}

func (b Bndl) Hostname() string {
	return b.Spec.Hostname
}

func (b Bndl) WithHostname(hostname string) Bndl {
	b.Spec.Hostname = hostname
	return b
}

func (b Bndl) Process() specs.Process {
	return *(b.Spec.Process)
}

func (b Bndl) WithApparmorProfile(profile string) Bndl {
	b.CloneProcess().Spec.Process.ApparmorProfile = profile
	return b
}

func (b Bndl) WithRootFS(absolutePath string) Bndl {
	b.Spec.Root = &specs.Root{Path: absolutePath}
	return b
}

func (b Bndl) RootFSPropagation() string {
	return b.Spec.Linux.RootfsPropagation
}

func (b Bndl) WithRootFSPropagation(rootfsPropagation string) Bndl {
	b.Spec.Linux.RootfsPropagation = rootfsPropagation
	return b
}

// RootFS returns the path to the rootfs of this bundle. Nothing is modified
func (b Bndl) RootFS() string {
	return b.Spec.Root.Path
}

func (b Bndl) WithWindows(windows specs.Windows) Bndl {
	b.Spec.Windows = &windows
	return b
}

func (b Bndl) Resources() *specs.LinuxResources {
	return b.Spec.Linux.Resources
}

func (b Bndl) WindowsResources() *specs.WindowsResources {
	return b.Spec.Windows.Resources
}

func (b Bndl) WithBlockIO(blockIO specs.LinuxBlockIO) Bndl {
	resources := b.Resources()
	if resources == nil {
		resources = &specs.LinuxResources{}
	}

	resources.BlockIO = &blockIO
	b.CloneLinux().Spec.Linux.Resources = resources

	return b
}

func (b Bndl) WithCPUShares(shares specs.LinuxCPU) Bndl {
	resources := b.Resources()
	if resources == nil {
		resources = &specs.LinuxResources{}
	}

	resources.CPU = &shares
	b.CloneLinux().Spec.Linux.Resources = resources

	return b
}

func (b Bndl) WithWindowsCPUShares(shares specs.WindowsCPUResources) Bndl {
	resources := b.WindowsResources()
	if resources == nil {
		resources = &specs.WindowsResources{}
	}

	resources.CPU = &shares
	b.CloneWindows().Spec.Windows.Resources = resources

	return b
}

func (b Bndl) WithMemoryLimit(limit specs.LinuxMemory) Bndl {
	resources := b.Resources()
	if resources == nil {
		resources = &specs.LinuxResources{}
	}

	resources.Memory = &limit
	b.CloneLinux().Spec.Linux.Resources = resources

	return b
}

func (b Bndl) WithWindowsMemoryLimit(limit specs.WindowsMemoryResources) Bndl {
	resources := b.WindowsResources()
	if resources == nil {
		resources = &specs.WindowsResources{}
	}

	resources.Memory = &limit
	b.CloneWindows().Spec.Windows.Resources = resources

	return b
}

func (b Bndl) WithPidLimit(limit specs.LinuxPids) Bndl {
	resources := b.Resources()
	if resources == nil {
		resources = &specs.LinuxResources{}
	}

	resources.Pids = &limit
	b.CloneLinux().Spec.Linux.Resources = resources

	return b
}

func (b Bndl) WithDeviceRestrictions(deviceRestrictions []specs.LinuxDeviceCgroup) Bndl {
	resources := b.Resources()
	if resources == nil {
		resources = &specs.LinuxResources{}
	}

	resources.Devices = deviceRestrictions
	b.CloneLinux().Spec.Linux.Resources = resources

	return b
}

// WithNamespace returns a bundle with the given namespace in the list of namespaces. The bundle is not modified, but any
// existing namespace of this type will be replaced.
func (b Bndl) WithNamespace(ns specs.LinuxNamespace) Bndl {
	slice := NamespaceSlice(b.Spec.Linux.Namespaces)
	b.CloneLinux().Spec.Linux.Namespaces = []specs.LinuxNamespace(slice.Set(ns))
	return b
}

func (b Bndl) Namespaces() []specs.LinuxNamespace {
	return b.Spec.Linux.Namespaces
}

func (b Bndl) WithUIDMappings(mappings ...specs.LinuxIDMapping) Bndl {
	b.CloneLinux().Spec.Linux.UIDMappings = mappings
	return b
}

func (b Bndl) UIDMappings() []specs.LinuxIDMapping {
	return b.Spec.Linux.UIDMappings
}

func (b Bndl) WithGIDMappings(mappings ...specs.LinuxIDMapping) Bndl {
	b.CloneLinux().Spec.Linux.GIDMappings = mappings
	return b
}

func (b Bndl) GIDMappings() []specs.LinuxIDMapping {
	return b.Spec.Linux.GIDMappings
}

func (b Bndl) WithPrestartHooks(hook ...specs.Hook) Bndl {
	b.Spec.Hooks = &specs.Hooks{Prestart: hook}
	return b
}

func (b Bndl) PrestartHooks() []specs.Hook {
	return b.Spec.Hooks.Prestart
}

func (b Bndl) WithPoststopHooks(hook ...specs.Hook) Bndl {
	b.Spec.Hooks = &specs.Hooks{Poststop: hook}
	return b
}

func (b Bndl) PoststopHooks() []specs.Hook {
	return b.Spec.Hooks.Poststop
}

// WithNamespaces returns a bundle with the given namespaces. The original bundle is not modified, but the original
// set of namespaces is replaced in the returned bundle.
func (b Bndl) WithNamespaces(namespaces ...specs.LinuxNamespace) Bndl {
	b.CloneLinux().Spec.Linux.Namespaces = namespaces
	return b
}

// WithDevices returns a bundle with the given devices added. The original bundle is not modified.
func (b Bndl) WithDevices(devices ...specs.LinuxDevice) Bndl {
	b.CloneLinux().Spec.Linux.Devices = devices
	return b
}

func (b Bndl) Devices() []specs.LinuxDevice {
	return b.Spec.Linux.Devices
}

// WithCapabilities returns a bundle with the given capabilities added. The original bundle is not modified.
func (b Bndl) WithCapabilities(capabilities ...string) Bndl {
	caps := &specs.LinuxCapabilities{
		Bounding:    capabilities,
		Inheritable: capabilities,
		Permitted:   capabilities,
	}
	b.CloneProcess().Spec.Process.Capabilities = caps
	return b
}

func (b Bndl) Capabilities() []string {
	if b.Spec.Process.Capabilities == nil {
		return []string{}
	}

	return b.Spec.Process.Capabilities.Bounding
}

// WithMounts returns a bundle with the given mounts appended. The original bundle is not modified.
func (b Bndl) WithMounts(mounts ...specs.Mount) Bndl {
	b.Spec.Mounts = append(b.Spec.Mounts, mounts...)
	return b
}

// WithPrependedMounts returns a bundle with the given mounts prepended. The original bundle is not modified.
func (b Bndl) WithPrependedMounts(mounts ...specs.Mount) Bndl {
	b.Spec.Mounts = append(mounts, b.Spec.Mounts...)
	return b
}

func (b Bndl) Mounts() []specs.Mount {
	return b.Spec.Mounts
}

func (b Bndl) WithMaskedPaths(maskedPaths []string) Bndl {
	b.CloneLinux().Spec.Linux.MaskedPaths = maskedPaths
	return b
}

func (b Bndl) MaskedPaths() []string {
	return b.Spec.Linux.MaskedPaths
}

type NamespaceSlice []specs.LinuxNamespace

func (slice NamespaceSlice) Set(ns specs.LinuxNamespace) NamespaceSlice {
	for i, namespace := range slice {
		if namespace.Type == ns.Type {
			slice[i] = ns
			return slice
		}
	}

	return append(slice, ns)
}

// Process returns an OCI Process struct with the given args.
func Process(args ...string) specs.Process {
	return specs.Process{Args: args}
}

func (b *Bndl) CloneLinux() Bndl {
	l := copy(*b.Spec.Linux)
	b.Spec.Linux = &l
	return *b
}
func (b *Bndl) CloneWindows() Bndl {
	l := copyWindows(*b.Spec.Windows)
	b.Spec.Windows = &l
	return *b
}

func (b *Bndl) CloneProcess() Bndl {
	l := (*b.Spec.Process)
	b.Spec.Process = &l
	return *b
}

func copy(l specs.Linux) specs.Linux {
	return l
}

func copyWindows(l specs.Windows) specs.Windows {
	return l
}


text:
import '../../styles/global/base.scss';
import React, { PropTypes, Component } from 'react';

export default class App extends Component {

  static propTypes = {
    children: PropTypes.element.isRequired,
    error: PropTypes.object,
    history: PropTypes.object.isRequired,
    routes: PropTypes.array,
    params: PropTypes.object,
  };

  constructor() {
    super();
  }

  render() {
    return (

          {this.props.children}

    );
  }
}


text:
package Q13_08_Lambda_Random;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.function.Predicate;
import java.util.stream.Collectors;

public class QuestionC {
	public static Random random = new Random();
	public static Predicate<Object> flipCoin = o -> {
		return random.nextBoolean();
	};

	public static List<Integer> getRandomSubset(List<Integer> list) {
 		List<Integer> subset = list.stream().filter(flipCoin).
 			collect(Collectors.toList());
 		return subset;
	}

 	public static void main(String... args) {
 		List<Integer> list = new ArrayList<Integer>();
 		list.add(1);
 		list.add(2);
 		list.add(3);
 		list.add(4);
 		List<Integer> subset = getRandomSubset(list);
 		System.out.println(subset.toString());
 	}

}


text:
from FTModuleClass import *

#----------------------------------------------------------------
# Documentation for the user:

docs = {FTM_Name       : "<Module name>",
        FTM_Version    : 1,
        FTM_ModifiesDB : False,
        FTM_Synopsis   : "<description>",
        FTM_Help       : None,
        FTM_Description:
"""
<more detail here>
""" }

#----------------------------------------------------------------
# The main processing function

def MainFunction(project, report, modifyAllowed):
    """
    This is the main processing function.

    """
    #report.Info("Starting")
    #report.Warning("The sky is falling!")
    #report.Error("Failed to ...")

#----------------------------------------------------------------
# The name 'FlexToolsModule' must be defined like this:

FlexToolsModule = FlexToolsModuleClass(runFunction = MainFunction,
                                       docs = docs)


text:
package slick.jdbc

import scala.collection.mutable.Builder
import scala.util.control.NonFatal

import slick.dbio._
import slick.sql.{FixedSqlAction, FixedSqlStreamingAction}
import slick.util.{DumpInfo, CloseableIterator, ignoreFollowOnError}

/** A streaming Action that wraps an Invoker.
  * It is used for the Lifted Embedding, Direct Embedding, Plain SQL queries, and JDBC metadata.
  */
trait StreamingInvokerAction[R, T, -E <: Effect] extends SynchronousDatabaseAction[R, Streaming[T], JdbcBackend, E] with FixedSqlStreamingAction[R, T, E] { self =>

  protected[this] def createInvoker(sql: Iterable[String]): Invoker[T]
  protected[this] def createBuilder: Builder[T, R]

  type StreamState = CloseableIterator[T]

  final def run(ctx: JdbcBackend#Context): R = {
    val b = createBuilder
    createInvoker(statements).foreach(x => b += x)(ctx.session)
    b.result()
  }

  override final def emitStream(ctx: JdbcBackend#StreamingContext, limit: Long, state: StreamState): StreamState = {
    val bufferNext = ctx.bufferNext
    val it = if(state ne null) state else createInvoker(statements).iteratorTo(0)(ctx.session)
    var count = 0L
    try {
      while(if(bufferNext) it.hasNext && count < limit else count < limit && it.hasNext) {
        count += 1
        ctx.emit(it.next())
      }
    } catch {
      case NonFatal(ex) =>
        try it.close() catch ignoreFollowOnError
        throw ex
    }
    if(if(bufferNext) it.hasNext else count == limit) it else null
  }

  override final def cancelStream(ctx: JdbcBackend#StreamingContext, state: StreamState): Unit = state.close()

  override def getDumpInfo = super.getDumpInfo.copy(name = "StreamingResultAction")

  final def head: FixedSqlAction[T, NoStream, E] = new HeadAction(statements)

  final def headOption: FixedSqlAction[Option[T], NoStream, E] = new HeadOptionAction(statements)

  private[this] class HeadAction(val statements: Iterable[String]) extends SynchronousDatabaseAction[T, NoStream, JdbcBackend, E] with FixedSqlAction[T, NoStream, E] {
    def run(ctx: JdbcBackend#Context): T = createInvoker(statements).first(ctx.session)
    def overrideStatements(_statements: Iterable[String]) = new HeadAction(_statements)
  }

  private[this] class HeadOptionAction(val statements: Iterable[String]) extends SynchronousDatabaseAction[Option[T], NoStream, JdbcBackend, E] with FixedSqlAction[Option[T], NoStream, E] {
    def run(ctx: JdbcBackend#Context): Option[T] = createInvoker(statements).firstOption(ctx.session)
    def overrideStatements(_statements: Iterable[String]) = new HeadOptionAction(_statements)
  }

  final def overrideStatements(_statements: Iterable[String]): FixedSqlAction[R, Streaming[T], E] = new StreamingInvokerAction[R, T, E] {
    def statements = _statements
    protected[this] def createInvoker(sql: Iterable[String]): Invoker[T] = self.createInvoker(sql)
    protected[this] def createBuilder: Builder[T, R] = self.createBuilder
  }
}

/** A non-streaming Action that wraps a JDBC call. */
case class SimpleJdbcAction[+R](f: JdbcBackend#Context => R) extends SynchronousDatabaseAction[R, NoStream, JdbcBackend, Effect.All] {
  def run(context: JdbcBackend#Context): R = f(context)
  def getDumpInfo = DumpInfo(name = "SimpleJdbcAction")
}


text:
let manage = window.manage;

var Router = {
    routes: {
        "/": "indexPage",
        "/rating": "ratingPage",
        "/about": "aboutPage",
        "/login": "loginPage",
        "/game":"gamePage"
    },
    init: function (){
        this._routes = [];
        for( var route in this.routes ){
            var methodName = this.routes[route];
            this._routes.push({
                pattern: new RegExp('^'+route.replace(/:\w+/, '(\\w+)')+'$'),
                callback: this[methodName]
            });
        }
    },
    nav: function (path){
        var i = this._routes.length;
        while( i-- ){
            var args = path.match(this._routes[i].pattern);
            if( args ){
                this._routes[i].callback.apply(this, args.slice(1));
            }
        }
    },

    indexPage: function () {
        history.pushState(null, null, "/");
        game.clear();
        game.stop();
        document.getElementById("PointJS-canvas_0").classList.remove("game-canvas-active");
        document.getElementById("PointJS-canvas_0").classList.add("game-canvas-not");
        manage = window.manage;
        manage.showInd();
    },

    ratingPage: function () {
        history.pushState(null, null, "/rating");
        manage = window.manage;
        manage.showRating();
    },

    aboutPage: function () {
        history.pushState(null, null, "/about");
        manage = window.manage;
        manage.showAbout();
    },

    loginPage: function () {
        history.pushState(null, null, "/login");
        manage.showLogin();
    },

    gamePage: function () {
        history.pushState(null, null, "/game");
        manage = window.manage;
        manage.showGame();
    }
};

var getLocation = function(href) {
    var l = document.createElement("a");
    l.href = href;
    return l;
};

window.onpopstate = function(e){
    e.preventDefault();
    var l = getLocation(document.location.href);
    Router.nav(l.pathname);
};

window.router = Router;

Router.init();
let str = getLocation(document.location.href).pathname;

Router.init();
//alert(str.substring(0, str.length - 1));
Router.nav(str.substring(0, str.length - 1));


text:
// COPYRIGHT_BEGIN
// The MIT License (MIT)
//
// Copyright (c) 2013 Wizzer Works
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// COPYRIGHT_END

#ifndef __VPCOORD_H_
#define __VPCOORD_H_

// Include QtVp header files.
#include "qtvp_global.h"
#include "vptypes.h"

class QString;

class QTVPSHARED_EXPORT VpCoord
{
  public:

    // Most XY points to one command. XXX - move to another class or get rid of it.
    static const int MAX_COORDS = 256;

    /**
     * A constructor that specifies the (x,y,z) components of a
     * 3-dimensional coordinate.
     *
     * @param x The x component of the coordinate.
     * @param y The y component of the coordinate.
     * @param z The z component of the coordinate.
     */
    explicit VpCoord(int x = 0, int y = 0, int z = 0);

    /**
     * @brief Copy constructor
     *
     * @param coord The AuCoord to copy.
     */
    VpCoord(const VpCoord &coord);

    /**
     * @brief The destructor.
     */
    virtual ~VpCoord();

    // Accessors for setting the global resolution of the device.
    static int getResolution() { return g_resolution; }
    static void setResolution(int value) { g_resolution = value; }

    /**
     * Get the x component of the coordinate.
     *
     * @return An integer is returned representing the value of the x component
     * in world coordinate space.
     */
    int getX() { return m_x; }

    /**
     * Set the x component of the coordinate.
     *
     * @param value An integer representing the value of the x component
     * in world coordinate space.
     */
    void setX(const int value) { m_x = value; }

    /**
     * Get the y component of the coordinate.
     *
     * @return An integer is returned representing the value of the y component
     * in world coordinate space.
     */
    int getY() { return m_y; }

    /**
     * Set the y component of the coordinate.
     *
     * @param value An integer representing the value of the y component
     * in world coordinate space.
     */
    void setY(const int value) { m_y = value; }

    /**
     * Get the z component of the coordinate.
     *
     * @return An integer is returned representing the value of the z component
     * in world coordinate space.
     */
    int getZ() { return m_z; }

    /**
     * Set the z component of the coordinate.
     *
     * @param value An integer representing the value of the z component
     * in world coordinate space.
     */
    void setZ(const int value) { m_z = value; }

    QString getName() { return m_name; }

    void setName(const QString name) { m_name = name; }

    /**
     * Formats the coordinate as (x,y,z,vpname).
     *
     * @return A String is returned, formatting the contents of the VpCoord
     * suitable for display.
     */
    const QString toString();

    /**
     * @brief Assigns a copy of AuCoord to this coord, and returns a reference to it.
     *
     * @param coord The AuCoord to assign.
     *
     * @return A reference to this coord is returned.
     */
    VpCoord & operator=(const VpCoord & coord);

    /**
     * @brief Equality operator.
     *
     * @param coord The AuCoord to test for equality.
     *
     * @return Returns true if this coord has the same coordinate values as coord;
     * otherwise returns false.
     */
    bool operator==(const VpCoord & coord) const;

    /**
     * @brief Inequality operator.
     *
     * @param coord The AuCoord to test for inequality.
     *
     * @return Returns true if this coord has different coordinate values from coord;
     * otherwise returns false.
     */
    bool operator!=(const VpCoord & coord) const;

    /**
     * A method for converting internal coordinates (stored)
     * to world coordinates.
     *
     * @param x The internal coordinate to convert.
     *
     * @return The world coordinate is returned.
     */
    static double internalToWorld(const int x);

    /**
     * A method for converting world coordinates to internal
     * coordinates (stored).
     *
     * @param x The world coordinate to convert.
     *
     * @return The internal coordinate is returned.
     */
    static int worldToInternal(const double x);

  protected:

    /** The x component of the coordinate. Defaults to 0. */
    int m_x;
    /** The y component of the coordinate. Defaults to 0. */
    int m_y;
    /** The z component of the coordinate. Defaults to 0. */
    int m_z;
    /** The name of the associated Viewport. */
    QString m_name;

  private:

    // The resolution of a viewport.
    static int g_resolution;

};

#endif // __VPCOORD_H_


text:
<?php
  session_start();
  session_regenerate_id(true);

    date_default_timezone_set("Asia/Manila");
	$getuser = $_SESSION['SESS_USER_ID'];

    include_once "php/secured.php";

	include_once '/php/conn.php';
    // Checks if already logged in.
    if(!isset($_SESSION['SESS_USER_ID'])) {

      $message = encryptor("encrypt","Login Required");
      header("location: ../index.php?message=".$message);
    exit();
    }
?>

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

          </button>
          Doc Dispatch 1.0

              Clients

Clients List

                <?php if($_SESSION['addclient'] == 1){
                  ?>

Add New Client

                <?php } ?>

	<?php
	$result01 = mysqli_query($con,"
											SELECT *
												FROM doc_transactions
													WHERE status='In Process'
														AND userID='$getuser'");

			$getmydocs = mysqli_num_rows($result01);

			$result02 = mysqli_query($con,"
											SELECT *
												FROM doc_transactions
													WHERE status='For Out'");

			$getforout = mysqli_num_rows($result02);

	?>

              Documents <?php

			  if ($_SESSION['dispatchdoc'] != 1){
				 echo $getmydocs;
			  } else{
				  echo $getmydocs + $getforout;
			  }

			  ?>

Document List

                <?php if($_SESSION['pickupdeliver'] == 1){
                  ?>

My Documents <?php echo $getmydocs; ?>

                <?php } ?>

For Delivery

For Pickup

In Process

For Out <?php
				if ($_SESSION['dispatchdoc'] == 1){
					echo $getforout;
				}
				?>

For Dispatch

For Completion

Completed

                <?php if($_SESSION['adddoc'] == 1){
                  ?>

Add Document Type

                <?php } ?>

Document Type List

            <?php if($_SESSION['itinerary'] == 1){
                  ?>

Itinerary

            <?php } ?>

            <?php if($_SESSION['adduser'] == 1 || $_SESSION['updateuser'] == 1 || $_SESSION['addmess'] == 1 || $_SESSION['updatemess'] == 1){
                  ?>
			<?php

			$result = mysqli_query($con,"
											SELECT *
												FROM delete_request");

			$getdelrequest = mysqli_num_rows($result);

			?>

              Admin <?php if($_SESSION['admindelete'] == 1){
			  ?><?php echo $getdelrequest; ?><?php } ?>
            <?php } ?>

Users List

                <?php if($_SESSION['adduser'] == 1){
                  ?>

Add New User

                <?php } ?>

Messengers List

                <?php if($_SESSION['addmess'] == 1){
                  ?>

Add New Messenger

                <?php } ?>
                <?php if($_SESSION['backupdb'] == 1){
                  ?>

Backup DB

                <?php } ?>
				<?php if($_SESSION['admindelete'] == 1){
                  ?>

Deletion Request <?php echo $getdelrequest; ?>

Deleted Transactions

                <?php } ?>

              <?php if($_SESSION['reports'] == 1){
                  ?>
                Reports
              <?php } ?>

Messenger Productivity

              <?php if($_SESSION['audittrails'] == 1){
                  ?>

Audit Trails

              <?php } ?>

 <?php echo $_SESSION['SESS_UNAME']; ?>

Change Password

 Log out

<?php
            echo "";
            echo date("F d, Y");
            echo '
';
            echo date("D - ");
            echo "";
            ?>


text:
/**
 * This whole file is wrapped in a function by our gulpfile.js
 * The function is injected the global `this` as `__root__`
 **/
declare let __root__: any;
declare let __fbx__dnm__: any;
declare const WorkerGlobalScope: any;

const $isWebWorker = typeof WorkerGlobalScope !== "undefined";
const $isBrowser = typeof window !== "undefined" && typeof window.navigator !== "undefined" || $isWebWorker;
const g = $isBrowser ? ($isWebWorker ? {} : window) : global;

/**
 * Package name to version
 */
type PackageVersions = {
    [pkg: string]: /** version e.g. `1.0.0`` */string
};

/**
 * Holds the details for a loaded package
 */
type PackageDetails = {
    /** Holds the package scope */
    s: {
        entry?: string
        file?: any
    },
    /** Holds package files */
    f: {
        [name: string]: {
            fn: Function
            /** Locals if any */
            locals?: any
        }
    },
    v: PackageVersions,
};

/**
 * A runtime storage for FuseBox
 */
type FSBX = {
    p?: {
        [packageName: string]: PackageDetails;
    },
    /** FuseBox events */
    e?: {
        "after-import"?: any;
    }
};

// Patching global variable
if ($isBrowser) {
    g["global"] = $isWebWorker ? {} : window;
}

// Set root
// __fbx__dnm__ is a variable that is used in dynamic imports
// In order for dynamic imports to work, we need to switch window to module.exports
__root__ = !$isBrowser || typeof __fbx__dnm__ !== "undefined" ? module.exports : __root__;

/**
 * A runtime storage for FuseBox
 */
const $fsbx: FSBX = $isBrowser ? $isWebWorker ? {} : (window["__fsbx__"] = window["__fsbx__"] || {})
    : g["$fsbx"] = g["$fsbx"] || {}; // in case of nodejs

if (!$isBrowser) {
    g["require"] = require;
}
/**
 * All packages are here
 *  Used to reference to the outside world
 */
const $packages = $fsbx.p = $fsbx.p || {};

// A list of custom events
// For example "after-import"
const $events = $fsbx.e = $fsbx.e || {};

/**
 * Reference interface
 * Contain information about user import;
 * Having FuseBox.import("./foo/bar") makes analysis on the string
 * Detects if it's package or not, explicit references are given as well
 */
interface IReference {
    file?: any;
    /**
     * serverReference is a result of nodejs require statement
     * In case if module is not in a bundle
     */
    server?: string;
    /** Current package name */
    pkgName?: string;
    /** Custom version to take into a consideration */
    versions?: any;
    /** User path */
    filePath?: string;
    /**
     * Converted valid path (with extension)
     * That can be recognized by FuseBox
     */
    validPath?: string;
    /** Require with wildcards (e.g import("/lib/*")) */
    wildcard?: string;
}

/**
 * $getNodeModuleName
 * Considers a partial request
 * for Example
 * require("lodash/dist/hello")
 */
function $getNodeModuleName(name: string) {
    const n = name.charCodeAt(0);
    const s = name.charCodeAt(1);
    // basically a hack for windows to stop recognising
    // c:\ as a valid node module
    if (!$isBrowser && s === 58) {
        return;
    }
    // https://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
    // basically lowcase alphabet starts with 97 ends with 122, and symbol @ is 64
    // which 2x faster than /^([@a-z].*)$/
    if (n >= 97 && n <= 122 || n === 64) {
        if (n === 64) { // if it's "@" symbol
            let s = name.split("/");
            let target = s.splice(2, s.length).join("/");
            return [`${s[0]}/${s[1]}`, target || undefined];
        }
        // this approach is 3x - 4x faster than
        // name.split(/\/(.+)?/);
        let index = name.indexOf("/");
        if (index === -1) {
            return [name];
        }
        let first = name.substring(0, index);
        let second = name.substring(index + 1);
        return [first, second];
    }
};

/** Gets file directory */
function $getDir(filePath: string) {
    return filePath.substring(0, filePath.lastIndexOf("/")) || "./";
};

/**
 * Joins paths
 * Works like nodejs path.join
 */
function $pathJoin(...string: string[]): string {
    let parts: string[] = [];
    for (let i = 0, l = arguments.length; i < l; i++) {
        parts = parts.concat(arguments[i].split("/"));
    }
    let newParts = [];
    for (let i = 0, l = parts.length; i < l; i++) {
        let part = parts[i];
        if (!part || part === ".") continue;
        if (part === "..") {
            newParts.pop();
        } else {
            newParts.push(part);
        }
    }
    if (parts[0] === "") newParts.unshift("");
    return newParts.join("/") || (newParts.length ? "/" : ".");
};

/**
 * Adds javascript extension if no extension was spotted
 */
function $ensureExtension(name: string): string {
    let matched = name.match(/\.(\w{1,})$/);
    if (matched) {
        // @NOTE: matched [1] is the `ext` we are looking for
        //
        // Adding extension if none was found
        // Might ignore the case of weird convention like this:
        // modules/core.object.define (core-js)
        // Will be handled differently afterwards
        if (!matched[1]) {
            return name + ".js";
        }
        return name;
    }
    return name + ".js";
};

/**
 * Loads a url
 *  inserts a script tag or a css link based on url extension
 */
function $loadURL(url: string) {
    if ($isBrowser) {
        let d = document;
        var head = d.getElementsByTagName("head")[0];
        var target;
        if (/\.css$/.test(url)) {
            target = d.createElement("link");
            target.rel = "stylesheet";
            target.type = "text/css";
            target.href = url;
        } else {
            target = d.createElement("script");
            target.type = "text/javascript";
            target.src = url;
            target.async = true;
        }
        head.insertBefore(target, head.firstChild);
    }
};

/**
 * Loop through an objects own keys and call a function with the key and value
 */
function $loopObjKey(obj: Object, func: Function) {
    for (let key in obj) {
        if (obj.hasOwnProperty(key)) {
            func(key, obj[key]);
        }
    }
};

function $serverRequire(path) {
    return { server: require(path) };
};

type RefOpts = {
    path?: string;
    pkg?: string;
    v?: PackageVersions;
};
function $getRef(name: string, o: RefOpts): IReference {
    let basePath = o.path || "./";
    let pkgName = o.pkg || "default";
    let nodeModule = $getNodeModuleName(name);

    if (nodeModule) {
        // reset base path
        basePath = "./";
        pkgName = nodeModule[0];
        // if custom version is detected
        // We need to modify package path
        // To look like pkg@1.0.0
        if (o.v && o.v[pkgName]) {
            pkgName = `${pkgName}@${o.v[pkgName]}`;
        }
        name = nodeModule[1];
    }
    // Tilde test
    // Charcode is 2x faster
    //if (/^~/.test(name)) {
    if (name) {
        if (name.charCodeAt(0) === 126) {
            name = name.slice(2, name.length);
            basePath = "./";
        } else {
            // check for absolute paths for nodejs
            // either first one is / (47 for *nix) or second one : (58 for windows)
            if (!$isBrowser && (name.charCodeAt(0) === 47 || name.charCodeAt(1) === 58)) {
                return $serverRequire(name);
            }
        }
    }

    let pkg = $packages[pkgName];

    if (!pkg) {
        if ($isBrowser && FuseBox.target !== "electron") {
            throw "Package not found " + pkgName;
        } else {
            // Return "real" node module
            return $serverRequire(pkgName + (name ? "/" + name : ""));
        }
    }

    name = name ? name : "./" + pkg.s.entry;

    // get rid of options
    // if (name.indexOf("?") > -1) {
    //     let paramsSplit = name.split(/\?(.+)/);
    //     name = paramsSplit[0];
    // }

    let filePath = $pathJoin(basePath, name);
    // Try first adding .js if missing
    let validPath = $ensureExtension(filePath);
    let file = pkg.f[validPath];
    let wildcard;
    // Probing for wildcard
    if (!file && validPath.indexOf("*") > -1) {
        wildcard = validPath;
    }
    if (!file && !wildcard) {
        // try index.js
        validPath = $pathJoin(filePath, "/", "index.js");
        file = pkg.f[validPath];

        if (!file && filePath === ".") {
            validPath = pkg.s && pkg.s.entry || "index.js";
            file = pkg.f[validPath];
        }
        // last resort try adding .js extension
        // Some libraries have a weired convention of naming file lile "foo.bar""
        if (!file) {
            validPath = filePath + ".js";
            file = pkg.f[validPath];
        }

        // if file is not found STILL
        // then we can try JSX
        if (!file) {
            // try for JSX one last time
            file = pkg.f[filePath + ".jsx"];
        }

        if (!file) {
            validPath = filePath + "/index.jsx";
            file = pkg.f[validPath];
        }
    }

    return {
        file,
        wildcard,
        pkgName,
        versions: pkg.v,
        filePath,
        validPath,
    };
};

/**
 * $async
 * Async request
 * Makes it possible to request files asynchronously
 */
function $async(file: string, cb: (imported?: any) => any, o: any = {}) {
    if ($isBrowser) {
        if (o && o.ajaxed === file) {
            return console.error(file, 'does not provide a module');
        }
        var xmlhttp: XMLHttpRequest = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    let contentType = xmlhttp.getResponseHeader("Content-Type");
                    let content = xmlhttp.responseText;
                    if (/json/.test(contentType)) {
                        content = `module.exports = ${content}`;
                    } else {
                        if (!/javascript/.test(contentType)) {
                            content = `module.exports = ${JSON.stringify(content)}`;
                        }
                    }
                    let normalized = $pathJoin("./", file);
                    FuseBox.dynamic(normalized, content);
                    cb(FuseBox.import(file, { ajaxed: file }));
                } else {
                    console.error(file, 'not found on request');
                    cb(undefined);
                }
            }
        };
        xmlhttp.open("GET", file, true);
        xmlhttp.send();
    } else {
        if (/\.(js|json)$/.test(file)) return cb(g["require"](file));
        return cb("");
    }
};

/**
 * Trigger events
 * If a registered callback returns "false"
 * We break the loop
 */
function $trigger(name: string, args: any) {
    let e = $events[name];
    if (e) {
        for (let i in e) {
            let res = e[i].apply(null, args);
            if (res === false) {
                return false;
            }
        }
        ;
    }
};

function syntheticDefaultExportPolyfill(input){
    return input !== null && ['function', 'object', 'array']
        .indexOf(typeof input) > -1 && input.default === undefined ?
             Object.isFrozen(input) ? input.default = input : Object.defineProperty(input, "default", {value : input, writable : true, enumerable : false}) : void 0;
}

/**
 * Imports File
 * With opt provided it's possible to set:
 *   1) Base directory
 *   2) Target package name
 */
function $import(name: string, o: any = {}) {

    // Test for external URLS
    // Basically : symbol can occure only at 4 and 5 position
    // Cuz ":" is a not a valid symbol in filesystem
    // Charcode test is 3-4 times faster than regexp
    // 58 charCode is ":""
    // console.log( ":".charCodeAt(0) )
    // if (/^(http(s)?:|\/\/)/.test(name)) {
    //     return $loadURL(name);
    // }
    if (name.charCodeAt(4) === 58 || name.charCodeAt(5) === 58) {
        return $loadURL(name);
    }

    let ref = $getRef(name, o);
    if (ref.server) {
        return ref.server;
    }
    let file = ref.file;

    // Wild card reference
    if (ref.wildcard) {
        // Prepare wildcard regexp
        let safeRegEx: RegExp = new RegExp(ref.wildcard
            .replace(/\*/g, "@")
            .replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&")
            .replace(/@@/g, ".*")
            .replace(/@/g, "[a-z0-9$_-]+"), "i");

        let pkg = $packages[ref.pkgName];
        if (pkg) {
            let batch = {};
            for (let n in pkg.f) {
                if (safeRegEx.test(n)) {
                    batch[n] = $import(`${ref.pkgName}/${n}`);
                }
            }
            return batch;
        }
    }

    if (!file) {
        let asyncMode = typeof o === "function";
        let processStopped = $trigger("async", [name, o]);
        if (processStopped === false) {
            return;
        }
        return $async(name, (result) => asyncMode ? o(result) : null, o);
        // throw `File not found ${ref.validPath}`;
    }

    // pkgName
    let pkg = ref.pkgName;

    if (file.locals && file.locals.module) return file.locals.module.exports;
    let locals: any = file.locals = {};

    // @NOTE: is fuseBoxDirname
    const path = $getDir(ref.validPath);

    locals.exports = {};
    locals.module = { exports: locals.exports };
    locals.require = (name: string, optionalCallback: any) => {
        const result =  $import(name, {
            pkg,
            path,
            v: ref.versions,
        });
        if( FuseBox["sdep"] ){ syntheticDefaultExportPolyfill(result); }
        return result;
    };

    if ($isBrowser || !g["require"].main) {
        locals.require.main = { filename: "./", paths: [] };
    } else {
        locals.require.main = g["require"].main;
    }

    let args = [locals.module.exports, locals.require, locals.module, ref.validPath, path, pkg];
    $trigger("before-import", args);

    file.fn.apply(args[0], args);
    // fn(locals.module.exports, locals.require, locals.module, validPath, fuseBoxDirname, pkgName)
    $trigger("after-import", args);
    return locals.module.exports;
};

type SourceChangedEvent = {
    type: "js" | "css",
    content: string,
    path: string
};

interface LoaderPlugin {
    /**
     * If true is returned by the plugin
     *  it means that module change has been handled
     *  by plugin and no special work is needed by FuseBox
     **/
    hmrUpdate?(evt: SourceChangedEvent): boolean;
}

/**
 * The FuseBox client side loader API
 */
class FuseBox {
    public static packages = $packages;
    public static mainFile: string;
    public static isBrowser = $isBrowser;
    public static isServer = !$isBrowser;

    public static global(key: string, obj?: any) {
        if (obj === undefined) return g[key];
        g[key] = obj;
    }

    /**
     * Imports a module
     */
    public static import(name: string, o?: any) {
        return $import(name, o);
    }

    /**
     * @param  {string} n name
     * @param  {any}    fn   [description]
     * @return void
     */
    public static on(n: string, fn: any) {
        $events[n] = $events[n] || [];
        $events[n].push(fn);
    }

    /**
     * Check if a file exists in path
     */
    public static exists(path: string) {
        try {
            let ref = $getRef(path, {});
            return ref.file !== undefined;
        }
        catch (err) {
            return false;
        }
    }

    /**
     * Removes a module
     */
    public static remove(path: string) {
        let ref = $getRef(path, {});
        let pkg = $packages[ref.pkgName];
        if (pkg && pkg.f[ref.validPath]) {
            delete pkg.f[ref.validPath];
        }
    }

    public static main(name: string) {
        this.mainFile = name;
        return FuseBox.import(name, {});
    }

    public static expose(obj: any) {
        for (let k in obj) {
            let alias = obj[k].alias;
            let xp = $import(obj[k].pkg);
            if (alias === "*") {
                $loopObjKey(xp, (exportKey, value) => __root__[exportKey] = value);
            } else if (typeof alias === "object") {
                $loopObjKey(alias, (exportKey, value) => __root__[value] = xp[exportKey]);
            } else {
                __root__[alias] = xp;
            }
        }
    }

    /**
     * Registers a dynamic path
     *
     * @param str a function that is invoked with
     *  - `true, exports,require,module,__filename,__dirname,__root__`
     */
    public static dynamic(path: string, str: string, opts?: {
        /** The name of the package */
        pkg: string
    }) {
        this.pkg(opts && opts.pkg || "default", {}, function (___scope___: any) {
            ___scope___.file(path, function (exports: any, require: any, module: any, __filename: string, __dirname: string) {
                var res = new Function("__fbx__dnm__", "exports", "require", "module", "__filename", "__dirname", "__root__", str);
                res(true, exports, require, module, __filename, __dirname, __root__);
            });
        });
    }

    /**
     * Flushes the cache for the default package
     * @param shouldFlush you get to chose if a particular file should be flushed from cache
     */
    public static flush(
        shouldFlush?: (fileName: string) => boolean
    ) {
        let def = $packages["default"];
        for (let fileName in def.f) {
            if (!shouldFlush || shouldFlush(fileName)) {
                delete def.f[fileName].locals;
            }
        }
    }

    /**
     *
     * Register a package
     */
    public static pkg(name: string, v: PackageVersions, fn: Function) {
        // Let's not register a package scope twice
        if ($packages[name]) return fn($packages[name].s);

        // create new package
        let pkg = $packages[name] = {} as PackageDetails;

        // file
        pkg.f = {};

        // storing v
        pkg.v = v;

        // scope
        pkg.s = {
            // Scope file
            file: (name: string, fn: any) => pkg.f[name] = { fn },
        };
        return fn(pkg.s);
    }
    public static target: string;
    /**
     * Loader plugins
     */
    public static plugins: LoaderPlugin[] = [];

    /** Adds a Loader plugin */
    public static addPlugin(plugin: LoaderPlugin) {
        this.plugins.push(plugin);
    }
}

if (!$isBrowser) {
    g["FuseBox"] = FuseBox;
}

/**
 * Injected into the global namespace by the fsbx-default-css-plugin
 * Generates a tag with an `id` based on `__filename`
 * If you call it it again with the same file name the same tag is patched
 * @param __filename the name of the source file
 * @param contents if provided creates a style tag
 *  otherwise __filename is added as a link tag
 **/
declare var __fsbx_css: { (__filename: string, contents?: string): void };


text:
/* ###
 * IP: GHIDRA
 *
 * 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.
 */
package ghidra.graph.viewer.event.mouse;

import java.awt.Cursor;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;

import edu.uci.ics.jung.visualization.VisualizationViewer;
import edu.uci.ics.jung.visualization.control.AnimatedPickingGraphMousePlugin;
import ghidra.graph.viewer.*;

/**
 * A mouse handler to center a vertex when the header is double-clicked
 *
 * @param <V> the vertex type
 * @param <E> the edge type
 */
public class VisualGraphAnimatedPickingGraphMousePlugin<V extends VisualVertex, E extends VisualEdge<V>>
		extends AnimatedPickingGraphMousePlugin<V, E> implements VisualGraphMousePlugin<V, E> {

	private boolean isHandlingMouseEvents;

	public VisualGraphAnimatedPickingGraphMousePlugin() {
		super(InputEvent.BUTTON1_DOWN_MASK);
		this.cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
	}

	@Override
	public void mousePressed(MouseEvent e) {
		if (e.getClickCount() != 2) {
			return;
		}

		super.mousePressed(e);

		if (vertex == null) {
			return; // no vertex clicked, nothing to do
		}

		isHandlingMouseEvents = true;
	}

	@Override
	public void mouseClicked(MouseEvent e) {
		if (!checkModifiers(e) || !isHandlingMouseEvents) {
			return;
		}

		isHandlingMouseEvents = false;

		GraphViewer<V, E> viewer = getGraphViewer(e);
		VisualGraphViewUpdater<V, E> updater = viewer.getViewUpdater();
		updater.moveVertexToCenterWithAnimation(vertex);
		e.consume();
		vertex = null;
	}

	@Override
	public void mouseDragged(MouseEvent e) {
		if (isHandlingMouseEvents) {
			e.consume();
		}
	}

	@Override
	public void mouseMoved(MouseEvent e) {
		if (isHandlingMouseEvents) {
			e.consume();
		}

		if (isOverVertex(e)) {
			installCursor(cursor, e);
			e.consume();
		}
	}

	@SuppressWarnings("unchecked")
	private boolean isOverVertex(MouseEvent e) {
		VisualizationViewer<V, E> viewer = (VisualizationViewer<V, E>) e.getSource();
		return (GraphViewerUtils.getVertexFromPointInViewSpace(viewer, e.getPoint()) != null);
	}

	@SuppressWarnings("unchecked")
	private void installCursor(Cursor newCursor, MouseEvent e) {
		VisualizationViewer<V, E> viewer = (VisualizationViewer<V, E>) e.getSource();
		viewer.setCursor(newCursor);
	}

	/*
	 * Override subclass method to translate the master view instead of this satellite view
	 */
	@Override
	public void mouseReleased(MouseEvent e) {
		if (isHandlingMouseEvents) {
			e.consume();
		}
	}
}


text:
package com.intellij.designer.model;

import com.intellij.designer.palette.DefaultPaletteItem;
import com.intellij.designer.palette.PaletteGroup;
import com.intellij.designer.palette.PaletteItem;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import org.jdom.Attribute;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Alexander Lobas
 */
public abstract class MetaManager extends ModelLoader {
  private static final String META = "meta";
  private static final String PALETTE = "palette";
  private static final String GROUP = "group";
  private static final String NAME = "name";
  private static final String ITEM = "item";
  private static final String TAG = "tag";
  private static final String WRAP_IN = "wrap-in";

  private final Map<String, MetaModel> myTag2Model = new HashMap<>();
  private final Map<String, MetaModel> myTarget2Model = new HashMap<>();
  private final List<PaletteGroup> myPaletteGroups = new ArrayList<>();
  private final List<MetaModel> myWrapModels = new ArrayList<>();

  private final Map<Object, Object> myCache = new HashMap<>();

  protected MetaManager(Project project, String name) {
    super(project);
    load(name);
  }

  @Override
  protected void loadDocument(Element rootElement) throws Exception {
    ClassLoader classLoader = getClass().getClassLoader();

    Map<MetaModel, List<String>> modelToMorphing = new HashMap<>();

    for (Element element : rootElement.getChildren(META)) {
      loadModel(classLoader, element, modelToMorphing);
    }

    for (Element element : rootElement.getChild(PALETTE).getChildren(GROUP)) {
      loadGroup(element);
    }

    Element wrapInElement = rootElement.getChild(WRAP_IN);
    if (wrapInElement != null) {
      for (Element element : wrapInElement.getChildren(ITEM)) {
        myWrapModels.add(myTag2Model.get(element.getAttributeValue("tag")));
      }
    }

    for (Map.Entry<MetaModel, List<String>> entry : modelToMorphing.entrySet()) {
      MetaModel meta = entry.getKey();
      List<MetaModel> morphingModels = new ArrayList<>();

      for (String tag : entry.getValue()) {
        MetaModel morphingModel = myTag2Model.get(tag);
        if (morphingModel != null) {
          morphingModels.add(morphingModel);
        }
      }

      if (!morphingModels.isEmpty()) {
        meta.setMorphingModels(morphingModels);
      }
    }
  }

  @NotNull
  @SuppressWarnings("unchecked")
  protected MetaModel loadModel(ClassLoader classLoader, Element element, Map<MetaModel, List<String>> modelToMorphing) throws Exception {
    String modelValue = element.getAttributeValue("model");
    Class<RadComponent> model = modelValue == null ? null : (Class<RadComponent>)classLoader.loadClass(modelValue);
    String target = element.getAttributeValue("class");
    String tag = element.getAttributeValue(TAG);

    MetaModel meta = createModel(model, target, tag);

    String layout = element.getAttributeValue("layout");
    if (layout != null) {
      meta.setLayout((Class<RadLayout>)classLoader.loadClass(layout));
    }

    String delete = element.getAttributeValue("delete");
    if (delete != null) {
      meta.setDelete(Boolean.parseBoolean(delete));
    }

    Element presentation = element.getChild("presentation");
    if (presentation != null) {
      meta.setPresentation(presentation.getAttributeValue("title"), presentation.getAttributeValue("icon"));
    }

    Element palette = element.getChild("palette");
    if (palette != null) {
      meta.setPaletteItem(createPaletteItem(palette));
    }

    Element creation = element.getChild("creation");
    if (creation != null) {
      meta.setCreation(creation.getTextTrim());
    }

    Element properties = element.getChild("properties");
    if (properties != null) {
      loadProperties(meta, properties);
    }

    Element morphing = element.getChild("morphing");
    if (morphing != null) {
      modelToMorphing.put(meta, StringUtil.split(morphing.getAttribute("to").getValue(), " "));
    }

    loadOther(meta, element);

    if (tag != null) {
      myTag2Model.put(tag, meta);
    }

    if (target != null) {
      myTarget2Model.put(target, meta);
    }

    return meta;
  }

  @NotNull
  protected MetaModel createModel(Class<RadComponent> model, String target, String tag) throws Exception {
    return new MetaModel(model, target, tag);
  }

  @NotNull
  protected DefaultPaletteItem createPaletteItem(Element palette) {
    return new DefaultPaletteItem(palette);
  }

  @NotNull
  protected VariationPaletteItem createVariationPaletteItem(PaletteItem paletteItem, MetaModel model, Element itemElement) {
    return new VariationPaletteItem(paletteItem, model, itemElement);
  }

  @NotNull
  protected PaletteGroup createPaletteGroup(String name) {
    return new PaletteGroup(name);
  }

  protected void loadProperties(MetaModel meta, Element properties) throws Exception {
    Attribute inplace = properties.getAttribute("inplace");
    if (inplace != null) {
      meta.setInplaceProperties(StringUtil.split(inplace.getValue(), " "));
    }

    Attribute top = properties.getAttribute("top");
    if (top != null) {
      meta.setTopProperties(StringUtil.split(top.getValue(), " "));
    }

    Attribute normal = properties.getAttribute("normal");
    if (normal != null) {
      meta.setNormalProperties(StringUtil.split(normal.getValue(), " "));
    }

    Attribute important = properties.getAttribute("important");
    if (important != null) {
      meta.setImportantProperties(StringUtil.split(important.getValue(), " "));
    }

    Attribute expert = properties.getAttribute("expert");
    if (expert != null) {
      meta.setExpertProperties(StringUtil.split(expert.getValue(), " "));
    }

    Attribute deprecated = properties.getAttribute("deprecated");
    if (deprecated != null) {
      meta.setDeprecatedProperties(StringUtil.split(deprecated.getValue(), " "));
    }
  }

  protected void loadOther(MetaModel meta, Element element) throws Exception {
  }

  @NotNull
  protected PaletteGroup loadGroup(Element element) throws Exception {
    PaletteGroup group = createPaletteGroup(element.getAttributeValue(NAME));

    for (Element itemElement : element.getChildren(ITEM)) {
      MetaModel model = getModelByTag(itemElement.getAttributeValue(TAG));
      PaletteItem paletteItem = model.getPaletteItem();

      if (!itemElement.getChildren().isEmpty()) {
        // Replace the palette item shown in the palette; it might provide a custom
        // title, icon or creation logic (and this is done here rather than in the
        // default palette item, since when loading elements back from XML, there's
        // no variation matching. We don't want for example to call the default
        // LinearLayout item "LinearLayout (Horizontal)", since that item would be
        // shown in the component tree for any <LinearLayout> found in the XML, including
        // those which set orientation="vertical". In the future, consider generalizing
        // this such that the {@link MetaModel} can hold multiple {@link PaletteItem}
        // instances, and perform attribute matching.
        if (itemElement.getAttribute("title") != null) {
          paletteItem = createVariationPaletteItem(paletteItem, model, itemElement);
        }
        group.addItem(paletteItem);

        for (Element grandChild : itemElement.getChildren(ITEM)) {
          group.addItem(createVariationPaletteItem(paletteItem, model, grandChild));
        }
      }
      else {
        group.addItem(paletteItem);
      }
    }

    myPaletteGroups.add(group);

    return group;
  }

  @SuppressWarnings("unchecked")
  public <K, V> Map<K, V> getCache(Object key) {
    return (Map<K, V>)myCache.get(key);
  }

  public void setCache(Object key, Object value) {
    myCache.put(key, value);
  }

  @Nullable
  public MetaModel getModelByTag(String tag) {
    return myTag2Model.get(tag);
  }

  @Nullable
  public MetaModel getModelByTarget(String target) {
    return myTarget2Model.get(target);
  }

  public List<MetaModel> getWrapInModels() {
    return myWrapModels;
  }

  public List<PaletteGroup> getPaletteGroups() {
    return myPaletteGroups;
  }
}


text:
import { IAuthBase, IAuthRequest } from './AuthBase';
import { IPasswordToken } from './passwordtoken';
import { IClientToken } from './clienttoken';
import { IUserToken } from './usertoken';
import { IRefreshToken } from './refreshtoken';
import { IImplicitToken } from './implicittoken';
/**
 * AuthClient client interface.
 */
export interface IAuthClient extends IAuthBase {
    /**
    * get the PasswordToken interface.
    * @return {IPasswordToken}    The PasswordToken.
    */
    getPasswordToken(): IPasswordToken;
    /**
    * get the ClientToken interface.
    * @return {IClientToken}    The ClientToken.
    */
    getClientToken(): IClientToken;
    /**
    * get the UserToken interface.
    * @return {IUserToken}    The UserToken.
    */
    getUserToken(): IUserToken;
    /**
    * get the RefreshToken interface.
    * @return {IRefreshToken}    The RefreshToken.
    */
    getRefreshToken(): IRefreshToken;
    /**
    * get the ImplicitToken interface.
    * @return {IImplicitToken}    The ImplicitToken.
    */
    getImplicitToken(): IImplicitToken;
    /**
     * Create the base64 encoded authorization key.
     *
     * @param {string}		appName				The application name.
     * @param {string}		vendorName			The vendor name.
     * @param {string}		businessUnitNumber	The business unit number.
     * @return {string}		The base64 encoded authorization key.
    */
    createAuthorizationKey(appName: string, vendorName: string, businessUnitNumber?: string): string;
    /**
     * Get the base64 decoded authorization key.
     *
     * @param {string}		authKey		The base64 encoded authorization key.
     * @return {string}		The base64 decoded authorization key.
    */
    getAuthorizationKey(authKey: string): string;
    /**
     * Create the base64 encoded authorization key.
     *
     * @param {string}		appName			The application name.
     * @param {string}		vendorName		The vendor name.
     * @param {string}		applicationId	The application id.
     * @return {string}		The base64 encoded authorization key.
    */
    createAuthorizationAppIdKey(appName: string, vendorName: string, applicationId: string): string;
}
/**
 * AuthClient client implementation.
 */
export declare class AuthClient implements IAuthClient {
    authClientOptions: any;
    authrequest: IAuthRequest;
    passwordtoken: IPasswordToken;
    clienttoken: IClientToken;
    usertoken: IUserToken;
    refreshtoken: IRefreshToken;
    implicittoken: IImplicitToken;
    config: any;
    logger: any;
    parent: any;
    /**
     * AuthClient api implementation.
     *
     * @param {Object}   authClientOptions  A collection of options.
     *
     * @example
     *  options = {
     *		debug: true,
     *      domainURIPath: "https://au1.nice-incontact.com",
     *      timeout: 10000, // default is '0' (0 seconds timeout)
     *  }
     */
    constructor(authClientOptions: any);
    /**
     * On event.
     * @param {string} arg0 Event name.
     * @param {Object} arg1 Event function.
     */
    on(arg0: string, arg1: (event: any, val1: any, val2: any, val3: any) => void): any;
    /**
     * Get the auth request.
     *
     * @return {IAuthRequest}		The auth request.
    */
    getAuthRequest(): IAuthRequest;
    /**
    * get the PasswordToken interface.
    * @return {IPasswordToken}    The PasswordToken.
    */
    getPasswordToken(): IPasswordToken;
    /**
    * get the ClientToken interface.
    * @return {IClientToken}    The ClientToken.
    */
    getClientToken(): IClientToken;
    /**
    * get the UserToken interface.
    * @return {IUserToken}    The UserToken.
    */
    getUserToken(): IUserToken;
    /**
    * get the RefreshToken interface.
    * @return {IRefreshToken}    The RefreshToken.
    */
    getRefreshToken(): IRefreshToken;
    /**
    * get the ImplicitToken interface.
    * @return {IImplicitToken}    The ImplicitToken.
    */
    getImplicitToken(): IImplicitToken;
    /**
     * Create the base64 encoded authorization key.
     *
     * @param {string}		appName				The application name.
     * @param {string}		vendorName			The vendor name.
     * @param {string}		businessUnitNumber	The business unit number.
     * @return {string}		The base64 encoded authorization key.
    */
    createAuthorizationKey(appName: string, vendorName: string, businessUnitNumber?: string): string;
    /**
     * Get the base64 decoded authorization key.
     *
     * @param {string}		authKey		The base64 encoded authorization key.
     * @return {string}		The base64 decoded authorization key.
    */
    getAuthorizationKey(authKey: string): string;
    /**
     * Create the base64 encoded authorization key.
     *
     * @param {string}		appName			The application name.
     * @param {string}		vendorName		The vendor name.
     * @param {string}		applicationId	The application id.
     * @return {string}		The base64 encoded authorization key.
    */
    createAuthorizationAppIdKey(appName: string, vendorName: string, applicationId: string): string;
}


text:
<?php

use humhub\compat\CActiveForm;
use humhub\compat\CHtml;
use humhub\models\Setting;
use yii\helpers\Url;

$this->registerJsFile('@web/resources/admin/uploadLogo.js');
?>

<?php echo Yii::t('AdminModule.views_setting_design', 'Design settings'); ?>

        <?php $form = CActiveForm::begin(['id' => 'authentication-settings-form', 'options' => ['enctype' => 'multipart/form-data']]); ?>

        <?php echo $form->errorSummary($model); ?>

            <?php echo $form->labelEx($model, 'theme'); ?>
            <?php echo $form->dropDownList($model, 'theme', $themes, array('class' => 'form-control')); ?>

            <?php echo $form->labelEx($model, 'paginationSize'); ?>
            <?php echo $form->textField($model, 'paginationSize', array('class' => 'form-control')); ?>

            <?php echo $form->labelEx($model, 'displayName'); ?>
            <?php echo $form->dropDownList($model, 'displayName', array('{username}' => Yii::t('AdminModule.views_setting_design', 'Username (e.g. john)'), '{profile.firstname} {profile.lastname}' => Yii::t('AdminModule.views_setting_design', 'Firstname Lastname (e.g. John Doe)')), array('class' => 'form-control')); ?>

            <?php echo $form->labelEx($model, 'spaceOrder'); ?>
            <?php echo $form->dropDownList($model, 'spaceOrder', array('0' => Yii::t('AdminModule.views_setting_design', 'Alphabetical'), '1' => Yii::t('AdminModule.views_setting_design', 'Last visit')), array('class' => 'form-control')); ?>

        <?php echo $form->labelEx($model, 'logo'); ?>
        <?php echo $form->fileField($model, 'logo', array('id' => 'logo', 'style' => 'display: none', 'name' => 'logo[]')); ?>
        <?php echo $form->error($model, 'logo'); ?>

                <img class="img-rounded" id="logo-image"
                     src="<?php
                     if ($logo->hasImage()) {
                         echo $logo->getUrl();
                     }
                     ?>"
                     data-src="holder.js/140x140"
                     alt="<?php echo Yii::t('AdminModule.views_setting_index', "You're using no logo at the moment. Upload your logo now."); ?>"
                     style="max-height: 40px;"/>

                    <?php
                    echo \humhub\widgets\ModalConfirm::widget(array(
                        'uniqueID' => 'modal_logoimagedelete',
                        'linkOutput' => 'a',
                        'title' => Yii::t('AdminModule.views_setting_index', 'Confirm image deleting'),
                        'message' => Yii::t('UserModule.views_setting_index', 'Do you really want to delete your logo image?'),
                        'buttonTrue' => Yii::t('AdminModule.views_setting_index', 'Delete'),
                        'buttonFalse' => Yii::t('AdminModule.views_setting_index', 'Cancel'),
                        'linkContent' => '',
                        'cssClass' => 'btn btn-danger btn-sm',
                        'style' => $logo->hasImage() ? '' : 'display: none;',
                        'linkHref' => Url::toRoute("/admin/setting/delete-logo-image"),
                        'confirmJS' => 'function(jsonResp) { resetLogoImage(jsonResp); }'
                    ));
                    ?>

        <?php echo CHtml::submitButton(Yii::t('AdminModule.views_setting_design', 'Save'), array('class' => 'btn btn-primary')); ?>

        <?php echo \humhub\widgets\DataSaved::widget(); ?>
        <?php CActiveForm::end(); ?>


text:
import uuid
import re
from datetime import datetime

from tincan.statement_base import StatementBase
from tincan.agent import Agent
from tincan.group import Group
from tincan.result import Result
from tincan.substatement import SubStatement
from tincan.statement_ref import StatementRef
from tincan.activity import Activity
from tincan.conversions.iso8601 import make_datetime
from tincan.version import Version

"""
.. module Statement
   :synopsis: A Statement object that contains all the information for one statement that is sent to an LRS
"""

class Statement(StatementBase):
    _UUID_REGEX = re.compile(
        r'^[a-f0-9]{8}-'
        r'[a-f0-9]{4}-'
        r'[1-5][a-f0-9]{3}-'
        r'[89ab][a-f0-9]{3}-'
        r'[a-f0-9]{12}$'
    )

    _props_req = [
        "id",
        "stored",
        "authority"
    ]

    _props = [
        "result",
        "version"
    ]

    _props.extend(StatementBase._props)
    _props.extend(_props_req)

    def __init__(self, *args, **kwargs):
        self._id = None
        self._stored = None
        self._authority = None
        self._result = None
        self._version = Version.latest

        super(Statement, self).__init__(*args, **kwargs)

    @property
    def id(self):
        """Id for Statement

        :setter: Tries to unicode
        :setter type: unicode
        :rtype: unicode

        """
        return self._id

    @id.setter
    def id(self, value):
        if value is not None and not isinstance(value, uuid.UUID):
            if isinstance(value, str) and not self._UUID_REGEX.match(value):
                raise ValueError("Invalid UUID string")
            value = uuid.UUID(value)
        self._id = value

    @id.deleter
    def id(self):
        del self._id

    @property
    def object(self):
        """Object for Statement

        :setter: Sets the object
        :setter type: :class:`tincan.Agent` | :class:`tincan.Group` | :class:`tincan.StatementRef` |
                      :class:`tincan.SubStatement` | :class:`tincan.Activity`
        :rtype: :class:`tincan.Agent` | :class:`tincan.Group` | :class:`tincan.StatementRef` |
                :class:`tincan.SubStatement` | :class:`tincan.Activity`

        """
        return self._object

    @object.setter
    def object(self, value):
        if value is not None:
            if not isinstance(value, Agent) and \
                    not isinstance(value, Group) and \
                    not isinstance(value, SubStatement) and \
                    not isinstance(value, StatementRef) and \
                    not isinstance(value, Activity):
                if isinstance(value, dict):
                    if 'object_type' in value or 'objectType' in value:
                        if 'objectType' in value:
                            value['object_type'] = value['objectType']
                            value.pop('objectType')
                        if value['object_type'] == 'Agent':
                            value = Agent(value)
                        elif value['object_type'] == 'SubStatement':
                            value = SubStatement(value)
                        elif value['object_type'] == 'StatementRef':
                            value = StatementRef(value)
                        elif value['object_type'] == 'Activity':
                            value = Activity(value)
                        elif value['object_type'] == 'Group':
                            value = Group(value)
                        else:
                            value = Activity(value)
                    else:
                        value = Activity(value)
        self._object = value

    @object.deleter
    def object(self):
        del self._object

    @property
    def stored(self):
        """Storage time. Tries to convert to :class:`datetime.datetime`.
        If no timezone is given, makes a naive `datetime.datetime`.

        Strings will be parsed as ISO 8601 timestamps.

        If a number is provided, it will be interpreted as a UNIX
        timestamp, which by definition is UTC.

        If a `dict` is provided, does `datetime.datetime(**value)`.

        If a `tuple` or a `list` is provided, does
        `datetime.datetime(*value)`. Uses the timezone in the tuple or
        list if provided.

        :setter type: :class:`datetime.datetime` | unicode | str | int | float | dict | tuple | list | None
        :rtype: :class:`datetime.datetime`
        """
        return self._stored

    @stored.setter
    def stored(self, value):
        if value is None or isinstance(value, datetime):
            self._stored = value
            return

        try:
            self._stored = make_datetime(value)
        except TypeError as e:
            message = (
                f"Property 'stored' in a 'tincan.{self.__class__.__name__}' "
                f"object must be set with a "
                f"datetime.datetime, str, unicode, int, float, dict "
                f"or None.\n\n{repr(e)}"
            )
            raise TypeError(message) from e

    @stored.deleter
    def stored(self):
        del self._stored

    @property
    def authority(self):
        """Authority for Statement

        :setter: Tries to convert to :class:`tincan.Agent`
        :setter type: :class:`tincan.Agent`
        :rtype: :class:`tincan.Agent`

        """
        return self._authority

    @authority.setter
    def authority(self, value):
        if value is not None and not isinstance(value, Agent):
            value = Agent(value)
        self._authority = value

    @authority.deleter
    def authority(self):
        del self._authority

    @property
    def result(self):
        """Result for Statement

        :setter: Tries to convert to :class:`tincan.Result`
        :setter type: :class:`tincan.Result`
        :rtype: :class:`tincan.Result`

        """
        return self._result

    @result.setter
    def result(self, value):
        if value is not None and not isinstance(value, Result):
            value = Result(value)
        self._result = value

    @result.deleter
    def result(self):
        del self._result

    @property
    def version(self):
        """Version for Statement

        :setter: Tries to convert to unicode
        :setter type: unicode
        :rtype: unicode

        """
        return self._version

    @version.setter
    def version(self, value):
        if value is not None:
            if value == '':
                raise ValueError("Property version can not be set to an empty string")
            elif not isinstance(value, str):
                value = str(value)
        self._version = value

    @version.deleter
    def version(self):
        del self._version