text:
'use strict';

const addressCT = {
  uid: 'api::address.address',
  settings: {
    bulkable: true,
    filterable: true,
    searchable: true,
    pageSize: 10,
    mainField: 'postal_coder',
    defaultSortBy: 'postal_coder',
    defaultSortOrder: 'ASC',
  },
  metadatas: {
    id: { edit: {}, list: { label: 'Id', searchable: true, sortable: true } },
    postal_coder: {
      edit: {
        label: 'Postal_coder',
        description: '',
        placeholder: '',
        visible: true,
        editable: true,
      },
      list: { label: 'Postal_coder', searchable: true, sortable: true },
    },
    categories: {
      list: {
        label: 'Categories',
        searchable: false,
        sortable: false,
        mainField: { name: 'name', schema: { type: 'string' } },
      },
      edit: {
        label: 'Categories',
        description: '',
        placeholder: '',
        visible: true,
        editable: true,
        mainField: { name: 'name', schema: { type: 'string' } },
      },
    },
    cover: {
      edit: { label: 'Cover', description: '', placeholder: '', visible: true, editable: true },
      list: { label: 'Cover', searchable: false, sortable: false },
    },
    images: {
      edit: { label: 'Images', description: '', placeholder: '', visible: true, editable: true },
      list: { label: 'Images', searchable: false, sortable: false },
    },
    city: {
      edit: { label: 'City', description: '', placeholder: '', visible: true, editable: true },
      list: { label: 'City', searchable: true, sortable: true },
    },
    likes: {
      list: {
        label: 'Likes',
        searchable: false,
        sortable: false,
        mainField: { name: 'id', schema: { type: 'integer' } },
      },
      edit: {
        label: 'Likes',
        description: '',
        placeholder: '',
        visible: true,
        editable: true,
        mainField: { name: 'id', schema: { type: 'integer' } },
      },
    },
    json: {
      edit: { label: 'Json', description: '', placeholder: '', visible: true, editable: true },
      list: { label: 'Json', searchable: false, sortable: false },
    },
    slug: {
      edit: { label: 'Slug', description: '', placeholder: '', visible: true, editable: true },
      list: { label: 'Slug', searchable: true, sortable: true },
    },
    notrepeat_req: {
      edit: {
        label: 'Notrepeat_req',
        description: '',
        placeholder: '',
        visible: true,
        editable: true,
      },
      list: { label: 'Notrepeat_req', searchable: false, sortable: false },
    },
    repeat_req: {
      edit: {
        label: 'Repeat_req',
        description: '',
        placeholder: '',
        visible: true,
        editable: true,
      },
      list: { label: 'Repeat_req', searchable: false, sortable: false },
    },
    repeat_req_min: {
      edit: {
        label: 'Repeat_req_min',
        description: '',
        placeholder: '',
        visible: true,
        editable: true,
      },
      list: { label: 'Repeat_req_min', searchable: false, sortable: false },
    },
    createdAt: {
      edit: {
        label: 'CreatedAt',
        description: '',
        placeholder: '',
        visible: false,
        editable: true,
      },
      list: { label: 'CreatedAt', searchable: true, sortable: true },
    },
    updatedAt: {
      edit: {
        label: 'UpdatedAt',
        description: '',
        placeholder: '',
        visible: false,
        editable: true,
      },
      list: { label: 'UpdatedAt', searchable: true, sortable: true },
    },
  },
  layouts: {
    list: [
      {
        key: '__id_key__',
        name: 'id',
        fieldSchema: { type: 'integer' },
        metadatas: { label: 'Id', searchable: true, sortable: true },
      },
      {
        key: '__postal_coder_key__',
        name: 'postal_coder',
        fieldSchema: { type: 'string', pluginOptions: { i18n: { localized: true } } },
        metadatas: { label: 'Postal_coder', searchable: true, sortable: true },
      },
      {
        key: '__categories_key__',
        name: 'categories',
        fieldSchema: {
          collection: 'category',
          via: 'addresses',
          dominant: true,
          attribute: 'category',
          column: 'id',
          isVirtual: true,
          type: 'relation',
          targetModel: 'api::category.category',
          relationType: 'manyToMany',
        },
        metadatas: {
          label: 'Categories',
          searchable: false,
          sortable: false,
          mainField: { name: 'name', schema: { type: 'string' } },
        },
        queryInfos: {
          endPoint: 'collection-types/api::address.address',
          defaultParams: {},
        },
      },
      {
        key: '__cover_key__',
        name: 'cover',
        fieldSchema: {
          type: 'media',
          multiple: false,
          required: false,
          allowedTypes: ['files', 'images', 'videos'],
          pluginOptions: { i18n: { localized: true } },
        },
        metadatas: { label: 'Cover', searchable: false, sortable: false },
      },
    ],
    edit: [
      [
        {
          name: 'postal_coder',
          size: 6,
          fieldSchema: { type: 'string', pluginOptions: { i18n: { localized: true } } },
          metadatas: {
            label: 'Postal_coder',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
        {
          name: 'cover',
          size: 6,
          fieldSchema: {
            type: 'media',
            multiple: false,
            required: false,
            allowedTypes: ['files', 'images', 'videos'],
            pluginOptions: { i18n: { localized: true } },
          },
          metadatas: {
            label: 'Cover',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
      ],
      [
        {
          name: 'images',
          size: 6,
          fieldSchema: {
            type: 'media',
            multiple: true,
            required: false,
            allowedTypes: ['images'],
            pluginOptions: { i18n: { localized: true } },
          },
          metadatas: {
            label: 'Images',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
        {
          name: 'city',
          size: 6,
          fieldSchema: {
            type: 'string',
            required: true,
            maxLength: 200,
            pluginOptions: { i18n: { localized: true } },
          },
          metadatas: {
            label: 'City',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
      ],
      [
        {
          name: 'json',
          size: 12,
          fieldSchema: { type: 'json', pluginOptions: { i18n: { localized: true } } },
          metadatas: {
            label: 'Json',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
      ],
      [
        {
          name: 'slug',
          size: 6,
          fieldSchema: { type: 'uid', targetField: 'city' },
          metadatas: {
            label: 'Slug',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
      ],
      [
        {
          name: 'notrepeat_req',
          size: 12,
          fieldSchema: {
            type: 'component',
            repeatable: false,
            pluginOptions: { i18n: { localized: false } },
            component: 'blog.test-como',
            required: true,
          },
          metadatas: {
            label: 'Notrepeat_req',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
      ],
      [
        {
          name: 'repeat_req',
          size: 12,
          fieldSchema: {
            type: 'component',
            repeatable: true,
            pluginOptions: { i18n: { localized: true } },
            component: 'blog.test-como',
            required: true,
          },
          metadatas: {
            label: 'Repeat_req',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
      ],
      [
        {
          name: 'repeat_req_min',
          size: 12,
          fieldSchema: {
            type: 'component',
            repeatable: true,
            pluginOptions: { i18n: { localized: true } },
            component: 'blog.test-como',
            required: false,
            min: 2,
          },
          metadatas: {
            label: 'Repeat_req_min',
            description: '',
            placeholder: '',
            visible: true,
            editable: true,
          },
        },
      ],
    ],
    editRelations: [
      {
        name: 'categories',
        size: 6,
        fieldSchema: {
          collection: 'category',
          via: 'addresses',
          dominant: true,
          attribute: 'category',
          column: 'id',
          isVirtual: true,
          type: 'relation',
          targetModel: 'api::category.category',
          relationType: 'manyToMany',
        },
        metadatas: {
          label: 'Categories',
          description: '',
          placeholder: '',
          visible: true,
          editable: true,
          mainField: { name: 'name', schema: { type: 'string' } },
        },
        queryInfos: {
          endPoint: '/content-manager/relations/api::address.address/categories',
          containsKey: 'name_contains',
          defaultParams: {},
          shouldDisplayRelationLink: true,
        },
        targetModelPluginOptions: {},
      },
      {
        name: 'likes',
        size: 6,
        fieldSchema: {
          collection: 'like',
          via: 'address',
          isVirtual: true,
          type: 'relation',
          targetModel: 'api::like.like',
          relationType: 'oneToMany',
        },
        metadatas: {
          label: 'Likes',
          description: '',
          placeholder: '',
          visible: true,
          editable: true,
          mainField: { name: 'id', schema: { type: 'integer' } },
        },
        queryInfos: {
          endPoint: '/content-manager/relations/api::address.address/likes',
          containsKey: 'id_contains',
          defaultParams: {},
          shouldDisplayRelationLink: true,
        },
        targetModelPluginOptions: {},
      },
    ],
  },
  isDisplayed: true,
  apiID: 'address',
  kind: 'collectionType',
  info: { displayName: 'addresse', name: 'address', description: '', label: 'Addresses' },
  options: {
    draftAndPublish: true,
    increments: true,
    timestamps: ['createdAt', 'updatedAt'],
    comment: '',
  },
  pluginOptions: { i18n: { localized: true } },
  attributes: {
    id: { type: 'integer' },
    postal_coder: { type: 'string', pluginOptions: { i18n: { localized: true } } },
    categories: {
      collection: 'category',
      via: 'addresses',
      dominant: true,
      attribute: 'category',
      column: 'id',
      isVirtual: true,
      type: 'relation',
      targetModel: 'api::category.category',
      relationType: 'manyToMany',
    },
    cover: {
      type: 'media',
      multiple: false,
      required: false,
      allowedTypes: ['files', 'images', 'videos'],
      pluginOptions: { i18n: { localized: true } },
    },
    images: {
      type: 'media',
      multiple: true,
      required: false,
      allowedTypes: ['images'],
      pluginOptions: { i18n: { localized: true } },
    },
    city: {
      type: 'string',
      required: true,
      maxLength: 200,
      pluginOptions: { i18n: { localized: true } },
    },
    likes: {
      collection: 'like',
      via: 'address',
      isVirtual: true,
      type: 'relation',
      targetModel: 'api::like.like',
      relationType: 'oneToMany',
    },
    json: { type: 'json', pluginOptions: { i18n: { localized: true } } },
    slug: { type: 'uid', targetField: 'city' },
    notrepeat_req: {
      type: 'component',
      repeatable: false,
      pluginOptions: { i18n: { localized: false } },
      component: 'blog.test-como',
      required: true,
    },
    repeat_req: {
      type: 'component',
      repeatable: true,
      pluginOptions: { i18n: { localized: true } },
      component: 'blog.test-como',
      required: true,
    },
    repeat_req_min: {
      type: 'component',
      repeatable: true,
      pluginOptions: { i18n: { localized: true } },
      component: 'blog.test-como',
      required: false,
      min: 2,
    },
    createdAt: { type: 'timestamp' },
    updatedAt: { type: 'timestamp' },
  },
};

module.exports = addressCT;


text:
module.exports = {
    users:   require(__dirname + '/users'),
    boards:  require(__dirname + '/boards'),
    sockets: require(__dirname + '/sockets')
};

redpajama_set_name: RedPajamaGithub


text:
package com.chute.android.photopickerplus.models;

import com.chute.android.photopickerplus.models.enums.MediaType;

/**
 * {@link DeliverMediaModel} wraps up asset attributes needed when delivering a
 * result back to the activity that started the PhotoPicker+.
 *
 */
public class DeliverMediaModel {

	/**
	 * URL of the image
	 */
	private String imageUrl;
	/**
	 * URL of the video
	 */
	private String videoUrl;
	/**
	 * Thumbnail URL
	 */
	private String thumbnail;
	/**
	 * Media type: image or video
	 */
	private MediaType mediaType;

	/**
	 * Getters and setters
	 *
	 */
	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	public String getVideoUrl() {
		return videoUrl;
	}

	public void setVideoUrl(String videoUrl) {
		this.videoUrl = videoUrl;
	}

	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}

	public MediaType getMediaType() {
		return mediaType;
	}

	public void setMediaType(MediaType mediaType) {
		this.mediaType = mediaType;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("DeliverMediaModel [imageUrl=");
		builder.append(imageUrl);
		builder.append(", videoUrl=");
		builder.append(videoUrl);
		builder.append(", thumbnail=");
		builder.append(thumbnail);
		builder.append(", mediaType=");
		builder.append(mediaType);
		builder.append("]");
		return builder.toString();
	}

}


text:
	    <meta http-equiv="refresh" content="1;url=<%- filename %>">

	If you are not redirected automatically, follow the <a href='<%- filename %>'>link


text:
/*
    Author     : Kamila Przychodzen <kamila.przychodzen@gmail.com>
*/

'use strict';

/**
 * This one is to transform ugly response from Neo. I know it is ugly but not as ugly as response xD
 *
 *
 */

fyd.factory('TransformNoeResponse', function () {
    return {
        proceed: function (response) {
            var transformedObject = [];
            var response = JSON.parse(response);
            if (response.results)
            {
                var responseData = response.results[0].data;
                for (var idx in responseData) {
                    var row = {};
                    for (var i in responseData[idx].row) {
                        var columnLabel = response.results[0].columns[i];
                        row[columnLabel] = responseData[idx].row[i];
                    }
                    transformedObject.push(row);
                }
            }
            return transformedObject;
        }
    };
});


text:
// Copyright 2010 The Kyua Authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
//   notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the
//   documentation and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors
//   may be used to endorse or promote products derived from this software
//   without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "utils/signals/timer.hpp"

extern "C" {
#include <sys/time.h>

#include <signal.h>
}

#include <cerrno>
#include <map>
#include <set>
#include <vector>

#include "utils/datetime.hpp"
#include "utils/format/macros.hpp"
#include "utils/logging/macros.hpp"
#include "utils/noncopyable.hpp"
#include "utils/optional.ipp"
#include "utils/sanity.hpp"
#include "utils/signals/exceptions.hpp"
#include "utils/signals/interrupts.hpp"
#include "utils/signals/programmer.hpp"

namespace datetime = utils::datetime;
namespace signals = utils::signals;

using utils::none;
using utils::optional;

namespace {

static void sigalrm_handler(const int);

/// Calls setitimer(2) with exception-based error reporting.
///
/// This does not currently support intervals.
///
/// \param delta The time to the first activation of the programmed timer.
/// \param old_timeval If not NULL, pointer to a timeval into which to store the
///     existing system timer.
///
/// \throw system_error If the call to setitimer(2) fails.
static void
safe_setitimer(const datetime::delta& delta, itimerval* old_timeval)
{
    ::itimerval timeval;
    timerclear(&timeval.it_interval);
    timeval.it_value.tv_sec = delta.seconds;
    timeval.it_value.tv_usec = delta.useconds;

    if (::setitimer(ITIMER_REAL, &timeval, old_timeval) == -1) {
        const int original_errno = errno;
        throw signals::system_error("Failed to program system's interval timer",
                                    original_errno);
    }
}

/// Deadline scheduler for all user timers on top of the unique system timer.
class global_state : utils::noncopyable {
    /// Collection of active timers.
    ///
    /// Because this is a collection of pointers, all timers are guaranteed to
    /// be unique, and we want all of these pointers to be valid.
    typedef std::set< signals::timer* > timers_set;

    /// Sequence of ordered timers.
    typedef std::vector< signals::timer* > timers_vector;

    /// Collection of active timestamps by their activation timestamp.
    ///
    /// This collection is ordered intentionally so that it can be scanned
    /// sequentially to find either expired or expiring-now timers.
    typedef std::map< datetime::timestamp, timers_set > timers_by_timestamp_map;

    /// The original timer before any timer was programmed.
    ::itimerval _old_timeval;

    /// Programmer for the SIGALRM handler.
    std::auto_ptr< signals::programmer > _sigalrm_programmer;

    /// Time of the current activation of the timer.
    datetime::timestamp _timer_activation;

    /// Mapping of all active timers using their timestamp as the key.
    timers_by_timestamp_map _all_timers;

    /// Adds a timer to the _all_timers map.
    ///
    /// \param timer The timer to add.
    void
    add_to_all_timers(signals::timer* timer)
    {
        timers_set& timers = _all_timers[timer->when()];
        INV(timers.find(timer) == timers.end());
        timers.insert(timer);
    }

    /// Removes a timer from the _all_timers map.
    ///
    /// This ensures that empty vectors are removed from _all_timers if the
    /// removal of the timer causes its bucket to be emptied.
    ///
    /// \param timer The timer to remove.
    void
    remove_from_all_timers(signals::timer* timer)
    {
        // We may not find the timer in _all_timers if the timer has fired,
        // because fire() took it out from the map.
        timers_by_timestamp_map::iterator iter = _all_timers.find(
            timer->when());
        if (iter != _all_timers.end()) {
            timers_set& timers = (*iter).second;
            INV(timers.find(timer) != timers.end());
            timers.erase(timer);
            if (timers.empty()) {
                _all_timers.erase(iter);
            }
        }
    }

    /// Calculates all timers to execute at this timestamp.
    ///
    /// \param now The current timestamp.
    ///
    /// \post _all_timers is updated to contain only the timers that are
    /// strictly in the future.
    ///
    /// \return A sequence of valid timers that need to be invoked in the order
    /// of activation.  These are all previously registered timers with
    /// activations in the past.
    timers_vector
    compute_timers_to_run_and_prune_old(
        const datetime::timestamp& now,
        const signals::interrupts_inhibiter& /* inhibiter */)
    {
        timers_vector to_run;

        timers_by_timestamp_map::iterator iter = _all_timers.begin();
        while (iter != _all_timers.end() && (*iter).first <= now) {
            const timers_set& timers = (*iter).second;
            to_run.insert(to_run.end(), timers.begin(), timers.end());

            // Remove expired entries here so that we can always assume that
            // the first entry in all_timers corresponds to the next
            // activation.
            const timers_by_timestamp_map::iterator previous_iter = iter;
            ++iter;
            _all_timers.erase(previous_iter);
        }

        return to_run;
    }

    /// Adjusts the global system timer to point to the next activation.
    ///
    /// \param now The current timestamp.
    ///
    /// \throw system_error If the programming fails.
    void
    reprogram_system_timer(
        const datetime::timestamp& now,
        const signals::interrupts_inhibiter& /* inhibiter */)
    {
        if (_all_timers.empty()) {
            // Nothing to do.  We can reach this case if all the existing timers
            // are in the past and they all fired.  Just ignore the request and
            // leave the global timer as is.
            return;
        }

        // While fire() prunes old entries from the list of timers, it is
        // possible for this routine to run with "expired" timers (i.e. timers
        // whose deadline lies in the past but that have not yet fired for
        // whatever reason that is out of our control) in the list.  We have to
        // iterate until we find the next activation instead of assuming that
        // the first entry represents the desired value.
        timers_by_timestamp_map::const_iterator iter = _all_timers.begin();
        PRE(!(*iter).second.empty());
        datetime::timestamp next = (*iter).first;
        while (next < now) {
            ++iter;
            if (iter == _all_timers.end()) {
                // Nothing to do.  We can reach this case if all the existing
                // timers are in the past but they have not yet fired.
                return;
            }
            PRE(!(*iter).second.empty());
            next = (*iter).first;
        }

        if (next < _timer_activation || now > _timer_activation) {
            INV(next >= now);
            const datetime::delta delta = next - now;
            LD(F("Reprogramming timer; firing on %s; now is %s") % next % now);
            safe_setitimer(delta, NULL);
            _timer_activation = next;
        }
    }

public:
    /// Programs the first timer.
    ///
    /// The programming of the first timer involves setting up the SIGALRM
    /// handler and installing a timer handler for the first time, which in turn
    /// involves keeping track of the old handlers so that we can restore them.
    ///
    /// \param timer The timer being programmed.
    /// \param now The current timestamp.
    ///
    /// \throw system_error If the programming fails.
    global_state(signals::timer* timer, const datetime::timestamp& now) :
        _timer_activation(timer->when())
    {
        PRE(now < timer->when());

        signals::interrupts_inhibiter inhibiter;

        const datetime::delta delta = timer->when() - now;
        LD(F("Installing first timer; firing on %s; now is %s") %
           timer->when() % now);

        _sigalrm_programmer.reset(
            new signals::programmer(SIGALRM, sigalrm_handler));
        try {
            safe_setitimer(delta, &_old_timeval);
            _timer_activation = timer->when();
            add_to_all_timers(timer);
        } catch (...) {
            _sigalrm_programmer.reset(NULL);
            throw;
        }
    }

    /// Unprograms all timers.
    ///
    /// This clears the global system timer and unsets the SIGALRM handler.
    ~global_state(void)
    {
        signals::interrupts_inhibiter inhibiter;

        LD("Unprogramming all timers");

        if (::setitimer(ITIMER_REAL, &_old_timeval, NULL) == -1) {
            UNREACHABLE_MSG("Failed to restore original timer");
        }

        _sigalrm_programmer->unprogram();
        _sigalrm_programmer.reset(NULL);
    }

    /// Programs a new timer, possibly adjusting the global system timer.
    ///
    /// Programming any timer other than the first one only involves reloading
    /// the existing timer, not backing up the previous handler nor installing a
    /// handler for SIGALRM.
    ///
    /// \param timer The timer being programmed.
    /// \param now The current timestamp.
    ///
    /// \throw system_error If the programming fails.
    void
    program_new(signals::timer* timer, const datetime::timestamp& now)
    {
        signals::interrupts_inhibiter inhibiter;

        add_to_all_timers(timer);
        reprogram_system_timer(now, inhibiter);
    }

    /// Unprograms a timer.
    ///
    /// This removes the timer from the global state and reprograms the global
    /// system timer if necessary.
    ///
    /// \param timer The timer to unprogram.
    ///
    /// \return True if the system interval timer has been reprogrammed to
    /// another future timer; false if there are no more active timers.
    bool
    unprogram(signals::timer* timer)
    {
        signals::interrupts_inhibiter inhibiter;

        LD(F("Unprogramming timer; previously firing on %s") % timer->when());

        remove_from_all_timers(timer);
        if (_all_timers.empty()) {
            return false;
        } else {
            reprogram_system_timer(datetime::timestamp::now(), inhibiter);
            return true;
        }
    }

    /// Executes active timers.
    ///
    /// Active timers are all those that fire on or before 'now'.
    ///
    /// \param now The current time.
    void
    fire(const datetime::timestamp& now)
    {
        timers_vector to_run;
        {
            signals::interrupts_inhibiter inhibiter;
            to_run = compute_timers_to_run_and_prune_old(now, inhibiter);
            reprogram_system_timer(now, inhibiter);
        }

        for (timers_vector::iterator iter = to_run.begin();
             iter != to_run.end(); ++iter) {
            signals::detail::invoke_do_fired(*iter);
        }
    }
};

/// Unique instance of the global state.
static std::auto_ptr< global_state > globals;

/// SIGALRM handler for the timer implementation.
///
/// \param signo The signal received; must be SIGALRM.
static void
sigalrm_handler(const int signo)
{
    PRE(signo == SIGALRM);
    globals->fire(datetime::timestamp::now());
}

}  // anonymous namespace

/// Indirection to invoke the private do_fired() method of a timer.
///
/// \param timer The timer on which to run do_fired().
void
utils::signals::detail::invoke_do_fired(timer* timer)
{
    timer->do_fired();
}

/// Internal implementation for the timer.
///
/// We assume that there is a 1-1 mapping between timer objects and impl
/// objects.  If this assumption breaks, then the rest of the code in this
/// module breaks as well because we use pointers to the parent timer as the
/// identifier of the timer.
struct utils::signals::timer::impl : utils::noncopyable {
    /// Timestamp when this timer is expected to fire.
    ///
    /// Note that the timer might be processed after this timestamp, so users of
    /// this field need to check for timers that fire on or before the
    /// activation time.
    datetime::timestamp when;

    /// True until unprogram() is called.
    bool programmed;

    /// Whether this timer has fired already or not.
    ///
    /// This is updated from an interrupt context, hence why it is marked
    /// volatile.
    volatile bool fired;

    /// Constructor.
    ///
    /// \param when_ Timestamp when this timer is expected to fire.
    impl(const datetime::timestamp& when_) :
        when(when_), programmed(true), fired(false)
    {
    }

    /// Destructor.
    ~impl(void) {
    }
};

/// Constructor; programs a run-once timer.
///
/// This programs the global timer and signal handler if this is the first timer
/// being installed.  Otherwise, reprograms the global timer if this timer
/// expires earlier than all other active timers.
///
/// \param delta The time until the timer fires.
signals::timer::timer(const datetime::delta& delta)
{
    signals::interrupts_inhibiter inhibiter;

    const datetime::timestamp now = datetime::timestamp::now();
    _pimpl.reset(new impl(now + delta));
    if (globals.get() == NULL) {
        globals.reset(new global_state(this, now));
    } else {
        globals->program_new(this, now);
    }
}

/// Destructor; unprograms the timer if still programmed.
///
/// Given that this is a destructor and it can't report errors back to the
/// caller, the caller must attempt to call unprogram() on its own.  This is
/// extremely important because, otherwise, expired timers will never run!
signals::timer::~timer(void)
{
    signals::interrupts_inhibiter inhibiter;

    if (_pimpl->programmed) {
        LW("Auto-destroying still-programmed signals::timer object");
        try {
            unprogram();
        } catch (const system_error& e) {
            UNREACHABLE;
        }
    }

    if (!_pimpl->fired) {
        const datetime::timestamp now = datetime::timestamp::now();
        if (now > _pimpl->when) {
            LW("Expired timer never fired; the code never called unprogram()!");
        }
    }
}

/// Returns the time of the timer activation.
///
/// \return A timestamp that has no relation to the current time (i.e. can be in
/// the future or in the past) nor the timer's activation status.
const datetime::timestamp&
signals::timer::when(void) const
{
    return _pimpl->when;
}

/// Callback for the SIGALRM handler when this timer expires.
///
/// \warning This is executed from a signal handler context without signals
/// inhibited.  See signal(7) for acceptable system calls.
void
signals::timer::do_fired(void)
{
    PRE(!_pimpl->fired);
    _pimpl->fired = true;
    callback();
}

/// User-provided callback to run when the timer expires.
///
/// The default callback does nothing.  We record the activation of the timer
/// separately, which may be appropriate in the majority of the cases.
///
/// \warning This is executed from a signal handler context without signals
/// inhibited.  See signal(7) for acceptable system calls.
void
signals::timer::callback(void)
{
    // Intentionally left blank.
}

/// Checks whether the timer has fired already or not.
///
/// \return Returns true if the timer has fired.
bool
signals::timer::fired(void) const
{
    return _pimpl->fired;
}

/// Unprograms the timer.
///
/// \pre The timer is programmed (i.e. this can only be called once).
///
/// \post If the timer never fired asynchronously because the signal delivery
/// did not arrive on time, make sure we invoke the timer's callback here.
///
/// \throw system_error If unprogramming the timer failed.
void
signals::timer::unprogram(void)
{
    signals::interrupts_inhibiter inhibiter;

    if (!_pimpl->programmed) {
        // We cannot assert that the timer is not programmed because it might
        // have been unprogrammed asynchronously between the time we called
        // unprogram() and the time we reach this.  Simply return in this case.
        LD("Called unprogram on already-unprogrammed timer; possibly just "
           "a race");
        return;
    }

    if (!globals->unprogram(this)) {
        globals.reset(NULL);
    }
    _pimpl->programmed = false;

    // Handle the case where the timer has expired before we ever got its
    // corresponding signal.  Do so by invoking its callback now.
    if (!_pimpl->fired) {
        const datetime::timestamp now = datetime::timestamp::now();
        if (now > _pimpl->when) {
            LW(F("Firing expired timer on destruction (was to fire on %s)") %
               _pimpl->when);
            do_fired();
        }
    }
}


text:
using System;
using System.Collections.Generic;
using Yaapii.Atoms.Fail;
using Yaapii.Atoms.Func;
using Yaapii.Atoms.Scalar;
using Yaapii.Atoms.Text;

namespace Yaapii.Atoms.Enumerable
{
    /// <summary>
    /// Element from position in a <see cref="IEnumerable{T}"/>.
    /// </summary>
    /// <typeparam name="T">type of element</typeparam>
    public sealed class ItemAt<T> : ScalarEnvelope<T>
    {
        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with given Exception thrwon on fallback
        /// </summary>
        /// <param name="source"></param>
        /// <param name="ex"></param>
        public ItemAt(IEnumerable<T> source, Exception ex) : this(
            source,
            0,
            ex
        )
        { }

        /// <summary>
        /// Element at position in <see cref="IEnumerable{T}"/> with given Exception thrown on fallback
        /// </summary>
        /// <param name="source"></param>
        /// <param name="position"></param>
        /// <param name="ex"></param>
        public ItemAt(IEnumerable<T> source, int position, Exception ex) : this(
            source,
            position,
            new FuncOf<IEnumerable<T>, T>(itr =>
                throw ex
            )
        )
        { }

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        public ItemAt(IEnumerable<T> source) : this(
            source,
            new BiFuncOf<Exception, IEnumerable<T>, T>((ex, itr) =>
                throw new NoSuchElementException(
                    new Formatted("Cannot get first element: {0}", ex.Message).AsString()
                )
            )
        )
        { }

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with a fallback value.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="fallback">fallback func</param>
        public ItemAt(IEnumerable<T> source, T fallback) : this(
            source,
            new FuncOf<IEnumerable<T>, T>(b => fallback)
        )
        { }

        /// <summary>
        /// Element at a position in a <see cref="IEnumerable{T}"/> with a fallback value.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position</param>
        /// <param name="fallback">fallback func</param>
        public ItemAt(IEnumerable<T> source, int position, T fallback) : this(
            source,
            position,
            new FuncOf<IEnumerable<T>, T>(b => fallback)
        )
        { }

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with a fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">soruce enum</param>
        /// <param name="fallback">fallback value</param>
        public ItemAt(IEnumerable<T> source, IBiFunc<Exception, IEnumerable<T>, T> fallback) : this(
            source,
            0,
            fallback
        )
        { }

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with a fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">soruce enum</param>
        /// <param name="fallback">fallback value</param>
        public ItemAt(IEnumerable<T> source, Func<IEnumerable<T>, T> fallback) : this(
            source,
            0,
            new FuncOf<IEnumerable<T>, T>(fallback)
        )
        { }

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with a fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">soruce enum</param>
        /// <param name="fallback">fallback value</param>
        public ItemAt(IEnumerable<T> source, IFunc<IEnumerable<T>, T> fallback) : this(
            source,
            0,
            fallback
        )
        { }

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        public ItemAt(IEnumerable<T> source, int position) : this(
                source,
                position,
                new BiFuncOf<Exception, IEnumerable<T>, T>((ex, itr) =>
                {
                    throw
                        new NoSuchElementException(
                            new Formatted(
                                "Cannot get element at position {0}: {1}",
                                position+1,
                                ex.Message,
                                position
                            ).AsString()
                    );
                }
            )
        )
        { }

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/> fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        /// <param name="fallback">fallback func</param>
        public ItemAt(IEnumerable<T> source, int position, IFunc<IEnumerable<T>, T> fallback) : this(
            source,
            position,
            (ex, enumerable) => fallback.Invoke(enumerable)
        )
        { }

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/> fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        /// <param name="fallback">fallback func</param>
        public ItemAt(IEnumerable<T> source, int position, Func<IEnumerable<T>, T> fallback) : this(
            source,
            position,
            new BiFuncOf<Exception, IEnumerable<T>, T>((ex, enumerable) =>
                fallback.Invoke(enumerable)
            )
        )
        { }

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/> fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        /// <param name="fallback">fallback func</param>
        public ItemAt(IEnumerable<T> source, int position, Func<Exception, IEnumerable<T>, T> fallback) : this(
            source,
            position,
            new BiFuncOf<Exception, IEnumerable<T>, T>((ex, enumerable) =>
                fallback.Invoke(ex, enumerable)
            )
        )
        { }

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/> fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        /// <param name="fallback">fallback func</param>
        public ItemAt(IEnumerable<T> source, int position, IBiFunc<Exception, IEnumerable<T>, T> fallback) : base(() =>
            new Enumerator.ItemAt<T>(
                source.GetEnumerator(),
                position,
                fallback
            ).Value()
        )
        { }
    }

    public sealed class ItemAt
    {
        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with given Exception thrwon on fallback
        /// </summary>
        /// <param name="source"></param>
        /// <param name="ex"></param>
        public static IScalar<T> New<T>(IEnumerable<T> source, Exception ex)
            => new ItemAt<T>(source, ex);

        /// <summary>
        /// Element at position in <see cref="IEnumerable{T}"/> with given Exception thrown on fallback
        /// </summary>
        /// <param name="source"></param>
        /// <param name="position"></param>
        /// <param name="ex"></param>
        public static IScalar<T> New<T>(IEnumerable<T> source, int position, Exception ex)
            => new ItemAt<T>(source, position, ex);

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        public static IScalar<T> New<T>(IEnumerable<T> source)
            => new ItemAt<T>(source);

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with a fallback value.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="fallback">fallback func</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, T fallback)
            => new ItemAt<T>(source, fallback);

        /// <summary>
        /// Element at a position in a <see cref="IEnumerable{T}"/> with a fallback value.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position</param>
        /// <param name="fallback">fallback func</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, int position, T fallback)
            => new ItemAt<T>(source, position, fallback);

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with a fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">soruce enum</param>
        /// <param name="fallback">fallback value</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, IBiFunc<Exception, IEnumerable<T>, T> fallback)
            => new ItemAt<T>(source, fallback);

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with a fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">soruce enum</param>
        /// <param name="fallback">fallback value</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, Func<IEnumerable<T>, T> fallback)
            => new ItemAt<T>(source, fallback);

        /// <summary>
        /// First element in a <see cref="IEnumerable{T}"/> with a fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">soruce enum</param>
        /// <param name="fallback">fallback value</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, IFunc<IEnumerable<T>, T> fallback)
            => new ItemAt<T>(source, fallback);

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, int position)
            => new ItemAt<T>(source, position);

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/> fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        /// <param name="fallback">fallback func</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, int position, IFunc<IEnumerable<T>, T> fallback)
            => new ItemAt<T>(source, position, fallback);

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/> fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        /// <param name="fallback">fallback func</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, int position, Func<IEnumerable<T>, T> fallback)
            => new ItemAt<T>(source, position, fallback);

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/> fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        /// <param name="fallback">fallback func</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, int position, Func<Exception, IEnumerable<T>, T> fallback)
            => new ItemAt<T>(source, position, fallback);

        /// <summary>
        /// Element from position in a <see cref="IEnumerable{T}"/> fallback function <see cref="IFunc{In, Out}"/>.
        /// </summary>
        /// <param name="source">source enum</param>
        /// <param name="position">position of item</param>
        /// <param name="fallback">fallback func</param>
        public static IScalar<T> New<T>(IEnumerable<T> source, int position, IBiFunc<Exception, IEnumerable<T>, T> fallback)
            => new ItemAt<T>(source, position, fallback);
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Tricholoma konradianum Maire

### Remarks
null


text:
/* DO NOT EDIT */
/* This file was generated from team_linked_apps.stone */

package com.dropbox.core.v2.team;

import com.dropbox.core.stone.StoneDeserializerLogger;
import com.dropbox.core.stone.StoneSerializers;
import com.dropbox.core.stone.UnionSerializer;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;

import java.io.IOException;
import java.util.Arrays;

/**
 * Error returned by {@link
 * DbxTeamTeamRequests#linkedAppsListMemberLinkedApps(String)}.
 */
public enum ListMemberAppsError {
    // union team.ListMemberAppsError (team_linked_apps.stone)
    /**
     * Member not found.
     */
    MEMBER_NOT_FOUND,
    /**
     * Catch-all used for unknown tag values returned by the Dropbox servers.
     *
     * <p> Receiving a catch-all value typically indicates this SDK version is
     * not up to date. Consider updating your SDK version to handle the new
     * tags. </p>
     */
    OTHER; // *catch_all

    /**
     * For internal use only.
     */
    static class Serializer extends UnionSerializer<ListMemberAppsError> {
        public static final Serializer INSTANCE = new Serializer();

        @Override
        public void serialize(ListMemberAppsError value, JsonGenerator g) throws IOException, JsonGenerationException {
            switch (value) {
                case MEMBER_NOT_FOUND: {
                    g.writeString("member_not_found");
                    break;
                }
                default: {
                    g.writeString("other");
                }
            }
        }

        @Override
        public ListMemberAppsError deserialize(JsonParser p) throws IOException, JsonParseException {
            ListMemberAppsError value;
            boolean collapsed;
            String tag;
            if (p.getCurrentToken() == JsonToken.VALUE_STRING) {
                collapsed = true;
                tag = getStringValue(p);
                p.nextToken();
            }
            else {
                collapsed = false;
                expectStartObject(p);
                tag = readTag(p);
            }
            if (tag == null) {
                throw new JsonParseException(p, "Required field missing: " + TAG_FIELD);
            }
            else if ("member_not_found".equals(tag)) {
                value = ListMemberAppsError.MEMBER_NOT_FOUND;
            }
            else {
                value = ListMemberAppsError.OTHER;
            }
            if (!collapsed) {
                skipFields(p);
                expectEndObject(p);
            }
            return value;
        }
    }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\modules\library\models\search\SeriesSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'name') ?>

    <?= $form->field($model, 'description') ?>

    <?= $form->field($model, 'total_books_in_series') ?>

    <?= $form->field($model, 'date_created') ?>

    <?php // echo $form->field($model, 'date_updated') ?>

        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
    <img src="<?php echo DEFAULT_BANNER_IMAGE_PATH . $banner_image; ?>" class="img-responsive center-block">

        <?php echo lang('New');?>
<?php echo lang('Group');?>

        <form class="" role="form" method="get" action="<?php echo base_url() . "groupplan" ?>" id="filterby_form">

                    <select class="selectpicker filterby" data-style="btn-info" name="filterby">
                        <option value="newest" <?php echo (isset($filterby) && $filterby == 'newest') ? "selected" : "" ?>><?php echo lang('Newest');?></option>
                        <option value="popular" <?php echo (isset($filterby) && $filterby == 'popular') ? "selected" : "" ?>><?php echo lang('Popular');?></option>
                        <option value="recommended" <?php echo (isset($filterby) && $filterby == 'recommended') ? "selected" : "" ?>><?php echo lang('Recommended');?></option>
                    </select>

        </form>

                <form class="" role="form" method="get" action="<?php echo base_url() . "groupplan/search" ?>" id="search_form">

                            <input type="hidden" class="search-query form-control" placeholder="<?php echo lang('Find your group');?>" name="topic_filter" value="<?php echo (isset($filterby)) ? $filterby : "" ?>"/>
                            <input type="text" class="search-query form-control" placeholder="<?php echo lang('Find your Group plan');?>" name="topic" />

                                <button class="btn btn-danger find_topic" type="submit">

                                </button>

                </form>

    <?php
    $message = $this->session->flashdata('message');
    if (!empty($message) && isset($message)) {
        ($message['class'] != '') ? $message['class'] : '';
        echo '
' . $message['message'] . '
';
    }

    $all_errors = validation_errors();
    if (isset($all_errors) && !empty($all_errors)) {
        echo '
' . $all_errors . '
';
    }
    $cnt = 0;
    ?>

                    <?php
                    if (isset($Group_plans) && !empty($Group_plans)) {
                        $cnt = count($Group_plans);
                        foreach ($Group_plans as $Group_plan) {
//                            pr($Group_plan);
                            ?>

                                        <a href="#" data-toggle="modal" data-target="#groupplan1post" data-title="<?php echo $Group_plan['name'] ?>" data-image="<?php echo DEFAULT_GROUPPLAN_IMAGE_PATH . $Group_plan['group_cover'] ?>" data-user="<?php echo $Group_plan['display_name'] ?>" data-uimage="<?php echo DEFAULT_PROFILE_IMAGE_PATH . $Group_plan['user_image'] ?>">
                                            <img src="<?php echo DEFAULT_GROUPPLAN_IMAGE_PATH . $Group_plan['group_cover'] ?> " class="img-responsive center-block">

<?php echo $Group_plan['name'] ?>

<?php echo $Group_plan['slogan'] ?>

<?php echo $Group_plan['introduction'] ?>

<?php echo $Group_plan['display_name'] ?> <?php echo lang('Created Group');?>

<?php echo $Group_plan['Total_User'] . "/" . $Group_plan['user_limit'] ?> <?php echo lang('Users');?>

                                                <?php if ($Group_plan['Is_Requested'] != 0) { ?>
                                                    <?php echo lang('Requested');?>
                                                <?php }
                                                else if($Group_plan['is_joined'] == 1){
                                                    ?>
                                                    <a href="<?php echo base_url() . "groupplan/details/" . urlencode(base64_encode($Group_plan['id'])) ?>" class="pstbtn requested"><?php echo lang('Joined');?>
                                                    <?php
                                                }
                                                else {
                                                    ?>
                                                    <a href="<?php echo base_url() . "groupplan/join/" . urlencode(base64_encode($Group_plan['id'])) ?>" class="pstbtn join"><?php echo lang('Join');?>
                                                <?php }
                                                ?>

                            <?php
                        }
                    } else {
                        ?>

                            <?php echo lang('No Group plan found.');?>

                        <?php
                    }
                    ?>

    <?php
    if ($cnt >= 2) {
        ?>

                    <?php echo lang('Load More');?>

                        <img class = "img-responsive" src = "<?php echo DEFAULT_IMAGE_PATH . "upload.png" ?>">

        <?php
    }
    ?>

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <?php echo lang('CREATE NEW GROUP');?>

                <form class="" role="form" method="post" action="<?php echo base_url() . "groupplan/add_group"; ?>" enctype="multipart/form-data">

                            <input type="text" class="form-control" id="inputEmail" placeholder="<?php echo lang('Group');?>:" name="name" required="true">

                            <input type="text" class="form-control" id="inputEmail" placeholder="<?php echo lang('Slogan');?> : " name="slogan">

                            <input type="text" class="form-control" placeholder="<?php echo lang('Number of maximum members');?> : " pattern="^[0-9]{3}$" name="user_limit">

                            <input type="text" class="form-control" id="inputEmail" placeholder="<?php echo lang('Group introduction');?> : " name="introduction">

                                 <?php echo lang('Images'); ?>
                                <input type="file" name="group_cover" class="upload" id="uploadFile"/>

                            <input type="submit" class="pstbtn" value="<?php echo lang('Create') ?>"/>

                </form>

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>


text:
<?php

class Mage_Rule_Block_Rule extends Mage_Core_Block_Abstract
{

}


text:
package org.kie.dmn.core.compiler.alphanetbased;

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

public class ResultCollector {

    private final List<Object> results = new ArrayList<>();

    public void addResult(Object o) {
        results.add(o);
    }

    public void clearResults() {
        results.clear();
    }

    public Object getWithHitPolicy() {
        return results.isEmpty() ? null : results.get(0);
    }
}


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>News - Summary Extraction</title>
		<link rel="stylesheet" href="css/bootstrap.css">
		<link rel="stylesheet" href="css/news.css">

		Images of moon are first ever to be captured by a 3D printed telescope

		www.dailymail.co.uk

			The £100 ($160) Pikon is able to produce images with a quality equal to telescopes that cost ten times as much, according to its designers at ...


text:
using System.Runtime.Serialization;

namespace EncompassRest.Loans.Enums
{
    /// <summary>
    /// GSEAgencyQMStatusQMAvailable
    /// </summary>
    public enum GSEAgencyQMStatusQMAvailable
    {
        /// <summary>
        /// Meets Standard
        /// </summary>
        [EnumMember(Value = "Meets Standard")]
        MeetsStandard = 0,
        /// <summary>
        /// Not Meet
        /// </summary>
        [EnumMember(Value = "Not Meet")]
        NotMeet = 1
    }
}


text:
endpoint=$1
software=$2
version=$3
step=$4
label=$5
link=$6

curl -F "label=${label}" -F "link=${link}" -X POST ${endpoint}/create/release-${software}/version-${version}/step-${step}/attachments/href.json


text:
require 'bundler/setup'
Bundler.require

require 'lolcloud'
require 'pry'

Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}

RSpec.configure do |config|
end


text:
import numpy as np
from sklearn.metrics import pairwise_distances
from sklearn.neighbors import BallTree

def kmeans(X, C):
    """The Loyd's algorithm for the k-centers problems.
    X : data matrix
    C : initial centers
    """
    C = C.copy()
    V = np.zeros(C.shape[0])
    for x in X:
        idx = np.argmin(((C - x)**2).sum(1))
        V[idx] += 1
        eta = 1.0 / V[idx]
        C[idx] = (1.0 - eta) * C[idx] + eta * x

    return C

def mini_batch_kmeans(X, C, b, t, replacement=True):
    """The mini-batch k-means algorithms (Sculley et al. 2007) for the
    k-centers problem.
    X : data matrix
    C : initial centers
    b : size of the mini-batches
    t : number of iterations
    replacement: whether to sample batches with replacement or not.
    """
    C = C.copy()
    for i in range(t):
        # Sample a mini batch:
        if replacement:
            X_batch = X[np.random.permutation(X.shape[0])[:b]]
        else:
            X_batch = X[b*t:b*(t+1)]

        V = np.zeros(C.shape[0])
        idxs = np.empty(X_batch.shape[0])
        # Assign the closest centers without update for the whole batch:
        for j, x in enumerate(X_batch):
            idxs[j] = np.argmin(((C - x)**2).sum(1))

        # Update centers:
        for j, x in enumerate(X_batch):
            V[idxs[j]] += 1
            eta = 1.0 / V[idxs[j]]
            C[idxs[j]] = (1.0 - eta) * C[idxs[j]] + eta * x

    return C

def compute_labels(X, C):
    """Compute the cluster labels for dataset X given centers C.
    """
    # labels = np.argmin(pairwise_distances(C, X), axis=0) # THIS REQUIRES TOO MUCH MEMORY FOR LARGE X
    tree = BallTree(C)
    labels = tree.query(X, k=1, return_distance=False).squeeze()
    return labels

if __name__ == '__main__':

    from sklearn.datasets import make_blobs
    import matplotlib.pyplot as plt
    from sklearn.metrics import adjusted_rand_score

    np.random.seed(1)

    n = 10000
    d = 2
    X, y = make_blobs(n, d, centers=3)
    plt.plot(X[:,0], X[:,1], 'ko')

    k = 3

    # In case we want to permute the order of X:
    # np.random.seed(0)
    # X = np.random.permutation(X)

    C_init = X[:k]
    plt.plot(C_init[:,0], C_init[:,1], 'bo', markersize=10, label='initialization')

    C_kmeans = kmeans(X, C_init)

    plt.plot(C_kmeans[:,0], C_kmeans[:,1], 'ro', markersize=10, label='k-means')

    b = 50
    t = 10

    C_mbkm = mini_batch_kmeans(X, C_init, b=b, t=t, replacement=True)
    plt.plot(C_mbkm[:,0], C_mbkm[:,1], 'go', markersize=10, label='mini-batch k-means')

    C_mbkm_wr = mini_batch_kmeans(X, C_init, b=b, t=t, replacement=False)
    plt.plot(C_mbkm_wr[:,0], C_mbkm_wr[:,1], 'mo', markersize=10, label='mini-batch k-means w/o rep.')

    # from sklearn.cluster import MiniBatchKMeans
    # mbkm_skl = MiniBatchKMeans(n_clusters=k, max_iter=1, max_no_improvement=None, tol=0.0, batch_size=b, init=C_init, compute_labels=False)
    # mbkm_skl.fit(X)
    # C_mbkm_skl = mbkm_skl.cluster_centers_
    # plt.plot(C_mbkm_skl[:,0], C_mbkm_skl[:,1], 'co', markersize=10, label='mini-batch k-means SKL')

    plt.legend(numpoints=1, loc='lower right')

    labels_init = compute_labels(X, C_init)
    labels_kmeans = compute_labels(X, C_kmeans)
    labels_mbkm = compute_labels(X, C_mbkm)
    labels_mbkm_wr = compute_labels(X, C_mbkm_wr)
    print "Adjusted rand scores:"
    print "labels_kmeans, labels_init =", adjusted_rand_score(labels_kmeans, labels_init)
    print "labels_kmeans, labels_mbkm =", adjusted_rand_score(labels_kmeans, labels_mbkm)
    print "labels_kmeans, labels_mbkm_wr =", adjusted_rand_score(labels_kmeans, labels_mbkm_wr)

    plt.show()


text:
import { TdDataTableService } from '@covalent/core/data-table';
import { FdsDialogService, FdsSnackBarService } from '@nifi-fds/core';
import { Component } from '@angular/core';
import NfRegistryService from 'services/nf-registry.service';
import { ActivatedRoute, Router } from '@angular/router';
import NfRegistryApi from 'services/nf-registry.api';
import { MatDialog } from '@angular/material';
import NfRegistryAddUserToGroups from 'components/administration/users/dialogs/add-user-to-groups/nf-registry-add-user-to-groups';
import { switchMap } from 'rxjs/operators';

/**
 * NfRegistryManageUser constructor.
 *
 * @param nfRegistryApi         The api service.
 * @param nfRegistryService     The nf-registry.service module.
 * @param tdDataTableService    The covalent data table service module.
 * @param fdsDialogService      The FDS dialog service.
 * @param fdsSnackBarService    The FDS snack bar service module.
 * @param activatedRoute        The angular route module.
 * @param router                The angular router module.
 * @param matDialog             The angular material dialog module.
 * @constructor
 */
function NfRegistryManageUser(nfRegistryApi, nfRegistryService, tdDataTableService, fdsDialogService, fdsSnackBarService, activatedRoute, router, matDialog) {
    // local state
    this.sortBy = null;
    this.sortOrder = null;
    this.filteredUserGroups = [];
    this.userGroupsSearchTerms = [];
    this.username = '';
    this.manageUserPerspective = 'membership';
    this.userGroupsColumns = [
        {
            name: 'identity',
            label: 'Display Name',
            sortable: true,
            tooltip: 'Group name.',
            width: 100,
            active: true
        }
    ];

    // Services
    this.nfRegistryService = nfRegistryService;
    this.route = activatedRoute;
    this.router = router;
    this.dialog = matDialog;
    this.nfRegistryApi = nfRegistryApi;
    this.dialogService = fdsDialogService;
    this.snackBarService = fdsSnackBarService;
    this.dataTableService = tdDataTableService;
}

NfRegistryManageUser.prototype = {
    constructor: NfRegistryManageUser,

    /**
     * Initialize the component.
     */
    ngOnInit: function () {
        var self = this;
        // subscribe to the route params
        this.$subscription = self.route.params
            .pipe(
                switchMap(function (params) {
                    return self.nfRegistryApi.getUser(params['userId']);
                })
            )
            .subscribe(function (response) {
                if (!response.status || response.status === 200) {
                    self.nfRegistryService.sidenav.open();
                    self.nfRegistryService.user = response;
                    self.username = response.identity;
                    self.sortGroups(self.userGroupsColumns.find(userGroupsColumn => userGroupsColumn.active === true));
                } else if (response.status === 404) {
                    self.router.navigateByUrl('administration/users');
                } else if (response.status === 409) {
                    self.router.navigateByUrl('administration/workflow');
                }
            });
    },

    /**
     * Destroy the component.
     */
    ngOnDestroy: function () {
        this.nfRegistryService.sidenav.close();
        this.$subscription.unsubscribe();
    },

    /**
     * Navigate to administer users for current registry.
     */
    closeSideNav: function () {
        this.router.navigateByUrl('administration/users');
    },

    /**
     * Toggles the manage bucket privileges for the user.
     *
     * @param $event
     * @param policyAction      The action to be toggled
     */
    toggleUserManageBucketsPrivileges: function ($event, policyAction) {
        var self = this;
        if ($event.checked) {
            // eslint-disable-next-line no-restricted-syntax
            for (const resource in this.nfRegistryService.BUCKETS_PRIVS) {
                if (this.nfRegistryService.BUCKETS_PRIVS.hasOwnProperty(resource)) {
                    this.nfRegistryService.BUCKETS_PRIVS[resource].forEach(function (action) {
                        if (!policyAction || (action === policyAction)) {
                            self.nfRegistryApi.getPolicyActionResource(action, resource).subscribe(function (policy) {
                                if (policy.status && policy.status === 404) {
                                    // resource does NOT exist, let's create it
                                    self.nfRegistryApi.postPolicyActionResource(action, resource, [self.nfRegistryService.user], []).subscribe(
                                        function (response) {
                                            // can manage buckets privileges created and granted!!!...now update the view
                                            response.users.forEach(function (user) {
                                                if (user.identifier === self.nfRegistryService.user.identifier) {
                                                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                        self.nfRegistryService.user = response;
                                                    });
                                                }
                                            });
                                        }
                                    );
                                } else {
                                    // resource exists, let's update it
                                    policy.users.push(self.nfRegistryService.user);
                                    self.nfRegistryApi.putPolicyActionResource(policy.identifier, policy.action,
                                        policy.resource, policy.users, policy.userGroups).subscribe(
                                        function (response) {
                                            // can manage buckets privileges updated!!!...now update the view
                                            response.users.forEach(function (user) {
                                                if (user.identifier === self.nfRegistryService.user.identifier) {
                                                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                        self.nfRegistryService.user = response;
                                                    });
                                                }
                                            });
                                        }
                                    );
                                }
                            });
                        }
                    });
                }
            }
        } else {
            // Remove the current user from the /buckets resources
            // eslint-disable-next-line no-restricted-syntax
            for (const resource in this.nfRegistryService.BUCKETS_PRIVS) {
                if (this.nfRegistryService.BUCKETS_PRIVS.hasOwnProperty(resource)) {
                    this.nfRegistryService.BUCKETS_PRIVS[resource].forEach(function (action) {
                        if (!policyAction || (action === policyAction)) {
                            self.nfRegistryApi.getPolicyActionResource(action, resource).subscribe(function (policy) {
                                if (policy.status && policy.status === 404) {
                                    // resource does NOT exist
                                } else {
                                    // resource exists, let's filter out the current user and update it
                                    policy.users = policy.users.filter(function (user) {
                                        return (user.identifier !== self.nfRegistryService.user.identifier);
                                    });
                                    self.nfRegistryApi.putPolicyActionResource(policy.identifier, policy.action,
                                        policy.resource, policy.users, policy.userGroups).subscribe(
                                        function (response) {
                                            // can manage buckets privileges updated!!!...now update the view
                                            self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                self.nfRegistryService.user = response;
                                            });
                                        }
                                    );
                                }
                            });
                        }
                    });
                }
            }
        }
    },

    /**
     * Toggles the manage tenants privileges for the user.
     *
     * @param $event
     * @param policyAction      The action to be toggled
     */
    toggleUserManageTenantsPrivileges: function ($event, policyAction) {
        var self = this;
        if ($event.checked) {
            // eslint-disable-next-line no-restricted-syntax
            for (const resource in this.nfRegistryService.TENANTS_PRIVS) {
                if (this.nfRegistryService.TENANTS_PRIVS.hasOwnProperty(resource)) {
                    this.nfRegistryService.TENANTS_PRIVS[resource].forEach(function (action) {
                        if (!policyAction || (action === policyAction)) {
                            self.nfRegistryApi.getPolicyActionResource(action, resource).subscribe(function (policy) {
                                if (policy.status && policy.status === 404) {
                                    // resource does NOT exist, let's create it
                                    self.nfRegistryApi.postPolicyActionResource(action, resource, [self.nfRegistryService.user], []).subscribe(
                                        function (response) {
                                            // can manage tenants privileges created and granted!!!...now update the view
                                            response.users.forEach(function (user) {
                                                if (user.identifier === self.nfRegistryService.user.identifier) {
                                                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                        self.nfRegistryService.user = response;
                                                    });
                                                }
                                            });
                                        }
                                    );
                                } else {
                                    // resource exists, let's update it
                                    policy.users.push(self.nfRegistryService.user);
                                    self.nfRegistryApi.putPolicyActionResource(policy.identifier, policy.action,
                                        policy.resource, policy.users, policy.userGroups).subscribe(
                                        function (response) {
                                            // can manage tenants privileges updated!!!...now update the view
                                            response.users.forEach(function (user) {
                                                if (user.identifier === self.nfRegistryService.user.identifier) {
                                                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                        self.nfRegistryService.user = response;
                                                    });
                                                }
                                            });
                                        }
                                    );
                                }
                            });
                        }
                    });
                }
            }
        } else {
            // Remove the current user from the administrator resources
            // eslint-disable-next-line no-restricted-syntax
            for (const resource in this.nfRegistryService.TENANTS_PRIVS) {
                if (this.nfRegistryService.TENANTS_PRIVS.hasOwnProperty(resource)) {
                    this.nfRegistryService.TENANTS_PRIVS[resource].forEach(function (action) {
                        if (!policyAction || (action === policyAction)) {
                            self.nfRegistryApi.getPolicyActionResource(action, resource).subscribe(function (policy) {
                                if (policy.status && policy.status === 404) {
                                    // resource does NOT exist
                                } else {
                                    // resource exists, let's filter out the current user and update it
                                    policy.users = policy.users.filter(function (user) {
                                        return (user.identifier !== self.nfRegistryService.user.identifier);
                                    });
                                    self.nfRegistryApi.putPolicyActionResource(policy.identifier, policy.action,
                                        policy.resource, policy.users, policy.userGroups).subscribe(
                                        function (response) {
                                            // can manage tenants privileges updated!!!...now update the view
                                            self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                self.nfRegistryService.user = response;
                                            });
                                        }
                                    );
                                }
                            });
                        }
                    });
                }
            }
        }
    },

    /**
     * Toggles the manage policies privileges for the user.
     *
     * @param $event
     * @param policyAction      The action to be toggled
     */
    toggleUserManagePoliciesPrivileges: function ($event, policyAction) {
        var self = this;
        if ($event.checked) {
            // eslint-disable-next-line no-restricted-syntax
            for (const resource in this.nfRegistryService.POLICIES_PRIVS) {
                if (this.nfRegistryService.POLICIES_PRIVS.hasOwnProperty(resource)) {
                    this.nfRegistryService.POLICIES_PRIVS[resource].forEach(function (action) {
                        if (!policyAction || (action === policyAction)) {
                            self.nfRegistryApi.getPolicyActionResource(action, resource).subscribe(function (policy) {
                                if (policy.status && policy.status === 404) {
                                    // resource does NOT exist, let's create it
                                    self.nfRegistryApi.postPolicyActionResource(action, resource, [self.nfRegistryService.user], []).subscribe(
                                        function (response) {
                                            // can manage policies privileges created and granted!!!...now update the view
                                            response.users.forEach(function (user) {
                                                if (user.identifier === self.nfRegistryService.user.identifier) {
                                                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                        self.nfRegistryService.user = response;
                                                    });
                                                }
                                            });
                                        }
                                    );
                                } else {
                                    // resource exists, let's update it
                                    policy.users.push(self.nfRegistryService.user);
                                    self.nfRegistryApi.putPolicyActionResource(policy.identifier, policy.action,
                                        policy.resource, policy.users, policy.userGroups).subscribe(
                                        function (response) {
                                            // can manage policies privileges updated!!!...now update the view
                                            response.users.forEach(function (user) {
                                                if (user.identifier === self.nfRegistryService.user.identifier) {
                                                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                        self.nfRegistryService.user = response;
                                                    });
                                                }
                                            });
                                        }
                                    );
                                }
                            });
                        }
                    });
                }
            }
        } else {
            // Remove the current user from the administrator resources
            // eslint-disable-next-line no-restricted-syntax
            for (const resource in this.nfRegistryService.POLICIES_PRIVS) {
                if (this.nfRegistryService.POLICIES_PRIVS.hasOwnProperty(resource)) {
                    this.nfRegistryService.POLICIES_PRIVS[resource].forEach(function (action) {
                        if (!policyAction || (action === policyAction)) {
                            self.nfRegistryApi.getPolicyActionResource(action, resource).subscribe(function (policy) {
                                if (policy.status && policy.status === 404) {
                                    // resource does NOT exist
                                } else {
                                    // resource exists, let's filter out the current user and update it
                                    policy.users = policy.users.filter(function (user) {
                                        return (user.identifier !== self.nfRegistryService.user.identifier);
                                    });
                                    self.nfRegistryApi.putPolicyActionResource(policy.identifier, policy.action,
                                        policy.resource, policy.users, policy.userGroups).subscribe(
                                        function (response) {
                                            // can manage policies privileges updated!!!...now update the view
                                            self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                self.nfRegistryService.user = response;
                                            });
                                        }
                                    );
                                }
                            });
                        }
                    });
                }
            }
        }
    },

    /**
     * Toggles the manage proxy privileges for the user.
     *
     * @param $event
     * @param policyAction      The action to be toggled
     */
    toggleUserManageProxyPrivileges: function ($event, policyAction) {
        var self = this;
        if ($event.checked) {
            // eslint-disable-next-line no-restricted-syntax
            for (const resource in this.nfRegistryService.PROXY_PRIVS) {
                if (this.nfRegistryService.PROXY_PRIVS.hasOwnProperty(resource)) {
                    this.nfRegistryService.PROXY_PRIVS[resource].forEach(function (action) {
                        if (!policyAction || (action === policyAction)) {
                            self.nfRegistryApi.getPolicyActionResource(action, resource).subscribe(function (policy) {
                                if (policy.status && policy.status === 404) {
                                    // resource does NOT exist, let's create it
                                    self.nfRegistryApi.postPolicyActionResource(action, resource, [self.nfRegistryService.user], []).subscribe(
                                        function (response) {
                                            // can manage proxy privileges created and granted!!!...now update the view
                                            response.users.forEach(function (user) {
                                                if (user.identifier === self.nfRegistryService.user.identifier) {
                                                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                        self.nfRegistryService.user = response;
                                                    });
                                                }
                                            });
                                        }
                                    );
                                } else {
                                    // resource exists, let's update it
                                    policy.users.push(self.nfRegistryService.user);
                                    self.nfRegistryApi.putPolicyActionResource(policy.identifier, policy.action,
                                        policy.resource, policy.users, policy.userGroups).subscribe(
                                        function (response) {
                                            // can manage proxy privileges updated!!!...now update the view
                                            response.users.forEach(function (user) {
                                                if (user.identifier === self.nfRegistryService.user.identifier) {
                                                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                        self.nfRegistryService.user = response;
                                                    });
                                                }
                                            });
                                        }
                                    );
                                }
                            });
                        }
                    });
                }
            }
        } else {
            // Remove the current user from the administrator resources
            // eslint-disable-next-line no-restricted-syntax
            for (const resource in this.nfRegistryService.PROXY_PRIVS) {
                if (this.nfRegistryService.PROXY_PRIVS.hasOwnProperty(resource)) {
                    this.nfRegistryService.PROXY_PRIVS[resource].forEach(function (action) {
                        if (!policyAction || (action === policyAction)) {
                            self.nfRegistryApi.getPolicyActionResource(action, resource).subscribe(function (policy) {
                                if (policy.status && policy.status === 404) {
                                    // resource does NOT exist
                                } else {
                                    // resource exists, let's filter out the current user and update it
                                    policy.users = policy.users.filter(function (user) {
                                        return (user.identifier !== self.nfRegistryService.user.identifier);
                                    });
                                    self.nfRegistryApi.putPolicyActionResource(policy.identifier, policy.action,
                                        policy.resource, policy.users, policy.userGroups).subscribe(
                                        function (response) {
                                            // administrator privileges updated!!!...now update the view
                                            self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier).subscribe(function (response) {
                                                self.nfRegistryService.user = response;
                                            });
                                        }
                                    );
                                }
                            });
                        }
                    });
                }
            }
        }
    },

    /**
     * Opens a modal dialog UX enabling the addition of this user to multiple groups.
     */
    addUserToGroups: function () {
        var self = this;
        this.dialog.open(NfRegistryAddUserToGroups, {
            data: {
                user: this.nfRegistryService.user,
                disableClose: true
            },
            width: '400px'
        }).afterClosed().subscribe(function () {
            self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier)
                .subscribe(function (response) {
                    self.nfRegistryService.user = response;
                    self.username = response.identity;
                    self.filterGroups(this.sortBy, this.sortOrder);
                });
        });
    },

    /**
     * Filter groups.
     *
     * @param {string} [sortBy]       The column name to sort `userGroupsColumns` by.
     * @param {string} [sortOrder]    The order. Either 'ASC' or 'DES'
     */
    filterGroups: function (sortBy, sortOrder) {
        // if `sortOrder` is `undefined` then use 'ASC'
        if (sortOrder === undefined) {
            if (this.sortOrder === undefined) {
                sortOrder = 'ASC';
            } else {
                sortOrder = this.sortOrder;
            }
        }
        // if `sortBy` is `undefined` then find the first sortable column in `userGroupsColumns`
        if (sortBy === undefined) {
            if (this.sortBy === undefined) {
                var arrayLength = this.userGroupsColumns.length;
                for (var i = 0; i < arrayLength; i++) {
                    if (this.userGroupsColumns[i].sortable === true) {
                        sortBy = this.userGroupsColumns[i].name;
                        //only one column can be actively sorted so we reset all to inactive
                        this.userGroupsColumns.forEach(function (c) {
                            c.active = false;
                        });
                        //and set this column as the actively sorted column
                        this.userGroupsColumns[i].active = true;
                        this.userGroupsColumns[i].sortOrder = sortOrder;
                        break;
                    }
                }
            } else {
                sortBy = this.sortBy;
            }
        }

        var newUserGroupsData = this.nfRegistryService.user.userGroups || [];

        for (var i = 0; i < this.userGroupsSearchTerms.length; i++) {
            newUserGroupsData = this.dataTableService.filterData(newUserGroupsData, this.userGroupsSearchTerms[i], true);
        }

        newUserGroupsData = this.dataTableService.sortData(newUserGroupsData, sortBy, sortOrder);
        this.filteredUserGroups = newUserGroupsData;
    },

    /**
     * Sort `groups` by `column`.
     *
     * @param column    The column to sort by.
     */
    sortGroups: function (column) {
        if (column.sortable) {
            this.sortBy = column.name;
            this.sortOrder = (column.sortOrder === 'ASC') ? 'DESC' : 'ASC';
            column.sortOrder = this.sortOrder;
            this.filterGroups(this.sortBy, this.sortOrder);

            //only one column can be actively sorted so we reset all to inactive
            this.userGroupsColumns.forEach(function (c) {
                c.active = false;
            });
            //and set this column as the actively sorted column
            column.active = true;
        }
    },

    /**
     * Remove user from group.
     *
     * @param group
     */
    removeUserFromGroup: function (group) {
        var self = this;
        this.nfRegistryApi.getUserGroup(group.identifier).subscribe(function (response) {
            if (!response.error) {
                var fullGroup = response;
                var users = fullGroup.users.filter(function (user) {
                    return self.nfRegistryService.user.identifier !== user.identifier;
                });
                self.nfRegistryApi.updateUserGroup(fullGroup.identifier, fullGroup.identity, users).subscribe(function (response) {
                    self.nfRegistryApi.getUser(self.nfRegistryService.user.identifier)
                        .subscribe(function (response) {
                            self.nfRegistryService.user = response;
                            self.filterGroups(this.sortBy, this.sortOrder);
                        });
                    self.snackBarService.openCoaster({
                        title: 'Success',
                        message: 'This user has been removed from the ' + group.identity + ' group.',
                        verticalPosition: 'bottom',
                        horizontalPosition: 'right',
                        icon: 'fa fa-check-circle-o',
                        color: '#1EB475',
                        duration: 3000
                    });
                });
            }
        });
    },

    /**
     * Update user name.
     *
     * @param username
     */
    updateUserName: function (username) {
        var self = this;
        this.nfRegistryApi.updateUser(this.nfRegistryService.user.identifier, username).subscribe(function (response) {
            if (!response.status || response.status === 200) {
                self.nfRegistryService.user = response;
                self.nfRegistryService.users.filter(function (user) {
                    return self.nfRegistryService.user.identifier === user.identifier;
                }).forEach(function (user) {
                    user.identity = response.identity;
                });
                self.snackBarService.openCoaster({
                    title: 'Success',
                    message: 'This user name has been updated.',
                    verticalPosition: 'bottom',
                    horizontalPosition: 'right',
                    icon: 'fa fa-check-circle-o',
                    color: '#1EB475',
                    duration: 3000
                });
            } else if (response.status === 409) {
                self.username = self.nfRegistryService.user.identity;
                self.dialogService.openConfirm({
                    title: 'Error',
                    message: 'This user already exists. Please enter a different identity/user name.',
                    acceptButton: 'Ok',
                    acceptButtonColor: 'fds-warn'
                });
            }
        });
    },

    /**
     * Determine disabled state of 'Add to Groups' button
     * @returns {boolean}
     */
    canAddNonConfigurableUserToGroup: function () {
        var disabled = true;
        this.nfRegistryService.groups.forEach(function (userGroup) {
            if (userGroup.configurable === true) {
                disabled = false;
            }
        });
        return disabled;
    },

    /**
     * Determine if 'Special Privileges' can be edited.
     * @returns {boolean}
     */
    canEditSpecialPrivileges: function () {
        return this.nfRegistryService.currentUser.resourcePermissions.policies.canWrite
                && !(this.nfRegistryService.currentUser.identity === this.nfRegistryService.user.identity)
                && this.nfRegistryService.registry.config.supportsConfigurableAuthorizer;
    }

};

NfRegistryManageUser.annotations = [
    new Component({
        templateUrl: './nf-registry-manage-user.html'
    })
];

NfRegistryManageUser.parameters = [
    NfRegistryApi,
    NfRegistryService,
    TdDataTableService,
    FdsDialogService,
    FdsSnackBarService,
    ActivatedRoute,
    Router,
    MatDialog
];

export default NfRegistryManageUser;


text:
> Check if a path exists

NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed.

While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.

Never use this before handling a file though:

> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there.

## Install

```
$ npm install path-exists
```

## Usage

```js
// foo.js
const pathExists = require('path-exists');

(async () => {
	console.log(await pathExists('foo.js'));
	//=> true
})();
```

## API

### pathExists(path)

Returns a `Promise<boolean>` of whether the path exists.

### pathExists.sync(path)

Returns a `boolean` of whether the path exists.

## Related

- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module

## License

MIT © [Sindre Sorhus](https://sindresorhus.com)


text:
 0">

{{ cat.label }}

                    Nom du bateau
                    Référent
                    Validation
                    Paiement
                    Temps

                    {{ boat.name }}
                    {{ boat.leader.rower.lastname | uppercase }} {{ boat.leader.rower.firstname }}

                    {{ boat.record | recordDisp }}

 0 && (boats | filter:recherche).length == 0" class="text-center well">
        Aucun bateau ne correspond à cette recherche...

 0 && (boats | filter:searchCat).length == 0" class="text-center well">
        Aucun bateau ne correspond dans cette catégorie...

    <input type="text" ng-model="recherche" class="form-control" placeholder="Recherche" />

    <select ng-model="searchCat" class="form-control">
        <option value="">Filtrer par catégorie</option>
        <option ng-repeat="cat in categoriesBoat" value="{{ cat.codeN }}">{{ cat.label }}</option>
    </select>


text:
@component('mail::message', ['url' => $contact->request_url])
## Contact requested by {{ $contact->fname }} {{ $contact->lname }}

Message:

{{$contact->message}}

Contact Details:

Phone: {{ $contact->phone }}

E-mail: {{ $contact->email }}

@endcomponent


text:
package org.deri.iris.builtins;

import static org.deri.iris.factory.Factory.BASIC;

import java.util.Set;

import org.deri.iris.EvaluationException;
import org.deri.iris.api.basics.IPredicate;
import org.deri.iris.api.terms.ITerm;
import org.deri.iris.basics.EqualityTypeItem;

/**
 *

 * Represents a multiply operation. In at the evaluation time there must be only
 * one variable be left for computation, otherwise an exception will be thrown.
 *

 *

 * $Id: DivideBuiltin.java,v 1.15 2007-10-12 12:40:58 bazbishop237 Exp $
 *

 *
 * @author Richard Pöttler, richard dot poettler at deri dot org
 * @version $Revision: 1.15 $
 */
public class DivideBuiltin extends ArithmeticBuiltin {

    /** The predicate defining this builtin. */
    private static final IPredicate PREDICATE = BASIC.createPredicate("DIVIDE",
	    3);

    /**
     * Constructs a builtin. Three terms must be passed to the constructor,
     * otherwise an exception will be thrown.
     *
     * @param t
     *            the terms
     * @throws NullPointerException
     *             if one of the terms is {@code null}
     * @throws IllegalArgumentException
     *             if the number of terms submitted is not 3
     * @throws NullPointerException
     *             if t is null
     */
    public DivideBuiltin(final ITerm... t) {
	super(PREDICATE, t);
    }

    protected ITerm computeMissingTerm(int missingTermIndex, ITerm[] terms)
	    throws EvaluationException {
	switch (missingTermIndex) {
	case 0:
	    return BuiltinHelper.multiply(terms[2], terms[1]);

	case 1:
	    return BuiltinHelper.divide(terms[0], terms[2]);

	default:
	    return BuiltinHelper.divide(terms[0], terms[1]);
	}
    }

    public Set<EqualityTypeItem> getEqualityType() {
	return this.getEqualityType();
    }
}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.2.3.6-3-106
description: >
    Object.defineProperty - 'configurable' property in 'Attributes' is
    NaN (8.10.5 step 4.b)
includes: [propertyHelper.js]
---*/

var obj = { };

Object.defineProperty(obj, "property", { configurable: NaN });

assert(obj.hasOwnProperty("property"));
verifyNotConfigurable(obj, "property");