text:
set -eux

sudo apt-get update -qq
sudo apt-get install --yes apt-transport-https curl lsb-release software-properties-common sudo wget

DISTRO="$(lsb_release --short --id)"
DISTRO="${DISTRO,,}" # Make lowercase: e.g. Debian -> debian, Ubuntu -> ubuntu
CODENAME="$(lsb_release --short --codename)"

BASEDIST="$DISTRO"
if [[ "$BASEDIST" = "neon" ]]; then
  BASEDIST="ubuntu"
fi

rm --recursive --force /tmp/setup-phanective

mkdir /tmp/setup-phanective
cd /tmp/setup-phanective

sudo apt-get remove --yes --ignore-missing \
  akregator \
  amarok \
  dragonplayer \
  fonts-droid \
  fonts-horai-umefont \
  fonts-takao-pgothic \
  jovie \
  juk \
  kaddressbook \
  kde-telepathy-contact-list \
  kde-telepathy-text-ui \
  kmag \
  kmail \
  kmousetool \
  kmouth \
  knotes \
  kolourpaint4 \
  kontact \
  konversation \
  kopete \
  korganizer \
  kwrite \
  krdc \
  ktorrent \
  openjdk-7-* \
  partitionmanager \
  xterm

if [[ "${DISTRO}" == "debian" ]]; then
  sudo apt-get remove --yes --ignore-missing \
    kde-full \
    kde-standard \
    kdeplasma-addons \
    plasma-scriptengine-superkaramba \
    plasma-widget-lancelot
fi

sudo apt-get autoremove --yes
sudo apt-get dist-upgrade --yes

# Add Node.js Repo
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

# Add VirtualBox Repo
echo "deb http://download.virtualbox.org/virtualbox/debian $CODENAME contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

# Add Hashicorp Repo
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"

sudo apt-get update -qq

# Install from deb files
curl --silent --show-error --output /tmp/setup-phanective/docker-desktop.deb  --location "https://desktop.docker.com/linux/main/amd64/docker-desktop-4.9.0-amd64.deb"
curl --silent --show-error --output /tmp/setup-phanective/dropbox.deb --location "https://www.dropbox.com/download?dl=packages/$BASEDIST/dropbox_2019.02.14_amd64.deb"
curl --silent --show-error --output /tmp/setup-phanective/vscode.deb  --location "https://go.microsoft.com/fwlink/?LinkID=760868"

# Ignore error that dependencies are not installed
set +eu
  sudo dpkg --install \
    /tmp/setup-phanective/docker-desktop.deb \
    /tmp/setup-phanective/dropbox.deb \
    /tmp/setup-phanective/vscode.deb
set -eux

sudo apt-get --fix-broken install --yes
sudo apt-get install --yes --no-install-recommends --ignore-missing \
  apt-transport-https \
  build-essential \
  clamav \
  curl \
  git \
  fcitx \
  fcitx-mozc \
  firefox \
  fonts-vlgothic \
  kde-config-fcitx \
  kolourpaint \
  nodejs \
  openssh-client \
  snapd \
  sudo \
  uvccapture guvcview \
  vagrant \
  virtualbox-6.1 \
  vlc \
  wget \
  whois \
  yakuake

if [[ "$BASEDIST" = "debian" ]]; then
  snap install firefox
fi

# Dropbox proprietary daemon installation
(cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -)
dropbox autostart y

# Allow Dropbox to watch more number of files
echo "fs.inotify.max_user_watches = 100000" | sudo tee /etc/sysctl.d/dropbox.conf

# Vagrant plugins
vagrant plugin install vagrant-vbguest

sudo npm update --global

#
# git config
#

# Don't convert line endings to CRLF
git config --global core.autocrlf false
# Don't commit file permission change
git config --global core.fileMode false

git config --global user.name "Jumpei Ogawa"
# git config --global user.email "phanect@example.com" # Do it manually

if [[ ! -f ~/.ssh/id_rsa ]]; then
  ssh-keygen -t ed25519 -f ~/.ssh/id_rsa -N ""
fi

rm --recursive --force /tmp/setup-phanective

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMMON_SCOPE_EXIT_H_
#define COMMON_SCOPE_EXIT_H_

namespace common {

/**
 * The Scope Exit idiom
 *
 * Func - callable type (function, standard functor, lambda function...)
 *
 * This idiom provides way to release resources when execution exits lexical
 * scope exit.
 *
 * Template class encapsulate callable object. This object is being called
 * automatically upon exiting function, block scope. This guarantees resource
 * cleanup at any way of exit from scope - normal function return or exception.
 *
 * Example:
 *
 *   struct unit;
 *   struct unit* unit_new();
 *   void unit_free(unit*);
 *
 *   void ExampleFunctionScope() {
 *     struct unit* u = unit_new();
 *
 *     // automatic cleanup for all cases
 *     auto scope_exit = MakeScopeExit([=]() {
 *       unit_free(u);
 *     });
 *
 *     // do 1st operation with unit and possibly quit function
 *     // do 2nd operation with unit and possibly quit function
 *     // do 3rd operation with unit and possibly quit function
 *   }
 */
template<typename Func>
class ScopeExit final {
 public:
  ScopeExit(Func func) : func_(func), released_(false) { }  // NOLINT
  ~ScopeExit() noexcept(false) {
    if (!released_)
      func_();
  }

  ScopeExit(const ScopeExit&) = delete;
  ScopeExit& operator=(const ScopeExit&) = delete;
  ScopeExit(ScopeExit&& other)  // NOLINT
      : func_(std::move(other.func_)),
        released_(other.released_) {
    other.released_ = true;
  }

 private:
  Func func_;
  bool released_;
};

template <typename F>
ScopeExit<F> MakeScopeExit(F f) {
  return ScopeExit<F>(f);
}

}  // namespace common

#endif  // COMMON_SCOPE_EXIT_H_


text:
package org.kuali.rice.krms.framework.engine.expression;

import org.kuali.rice.krms.api.engine.ExecutionEnvironment;

/**
 * Interface for implementing Expressions, invoked on a {@link ExecutionEnvironment}
 * @author Kuali Rice Team (rice.collab@kuali.org)
 *
 */
public interface Expression<T> {

    /**
     * Invoke on the given {@link ExecutionEnvironment}.
     * @param environment {@link ExecutionEnvironment} to invoke on.
     * @return T
     */
	T invoke(ExecutionEnvironment environment);

}


text:
<!DOCTYPE html>

	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta charset="utf-8" />
	<title> category - GlosoTech </title>
	<meta content="" name="keywords"/>
	<meta id="description" content="" name="description"/>
			<link href="/css/index.css" rel="stylesheet" type="text/css" />
		<link href="/css/main.css" rel="stylesheet" type="text/css" />

		<link rel="stylesheet" type="text/css"
			href="/gadmin/jsplugin/alerts/css/jquery.alerts.css"></link>

			<link rel="stylesheet" type="text/css"
			href="/css/thickbox/css/thickbox.css"></link>

HOME &gt PRODUCT

					Sort by

Sort by

Listing date

MinorderNum

Search by Parameter

				<select id="selectprodutyType">
							<option value="">
								Product Category
							</option>
						</select>
						<select id="selectproduty">
							<option value="">
								Series
							</option>
						</select>
						<select id="ampere">
							<option value="">Ampere Rating</option>
							<option value="10"><10A</option>
							<option value="20">11-20A</option>
							<option value="30">21-30A</option>
							<option value="50">31-50A</option>
							<option value="90">51-100A</option>
							<option value="100">>100A</option>
						</select>
						<select id="volt">
							<option value="">Voltage Type</option>
							<option value="0">AC/DC</option>
							<option value="1">AC</option>
							<option value="2">DC</option>
						</select>
						<input type="hidden" id="samp"><input type="hidden" id="eamp">
						<input type="submit" value="Search" onclick="toCategory();">


text:
require EnjuTrunkCirculation::Engine.root.join('app', 'models', 'ability') if Setting.operation

engines = []
engines << EnjuSubject::Engine  if defined?(EnjuSubject)
engines << EnjuEvent::Engine    if defined?(EnjuEvent)
engines << EnjuMessage::Engine  if defined?(EnjuMessage)
engines << EnjuTrunkIll::Engine if defined?(EnjuTrunkIll)
engines << EnjuBookmark::Engine if defined?(EnjuBookmark)
engines << EnjuTrunkReport::Engine if defined?(EnjuTrunkReport)
engines << EnjuTrunkOrder::Engine if defined?(EnjuTrunkOrder)
engines.map{|engine| require engine.root.join('app', 'models','ability') if defined?(engine)}

class Ability
  include CanCan::Ability

  def initialize(user, ip_address = nil)
    # TODO
    initialize_circulation(user, ip_address) if Setting.operation
    initialize_event(user, ip_address) if defined?(EnjuEvent)
    initialize_subject(user, ip_address) if defined?(EnjuSubject)
#    initialize_theme(user,ip_address) if defined?(EnjuTrunkTheme)
    initialize_message(user, ip_address) if defined?(EnjuMessage)
    initialize_ill(user, ip_address) if defined?(EnjuTrunkIll)
    initialize_bookmark(user, ip_address) if defined?(EnjuBookmark)
    initialize_report(user, ip_address) if defined?(EnjuTrunkReport)
    case user.try(:role).try(:name)
    when 'Administrator'
      can [:read, :create, :update], AcceptType
      can :destroy, AcceptType do |accept_type|
        accept_type.items.count == 0
      end
      can [:read, :output], BarcodeRegistration
      can [:read, :create, :update], Bookstore
      can :destroy, Bookstore do |bookstore|
        if defined? EnjuTrunkOrder
          bookstore.order_lists.empty?
        else
          true
        end
      end
      can [:read, :create, :update], Budget
      can :destroy, Budget do |budget|
        budget.expenses.empty?
      end
      can [:read, :create, :update], BudgetType
      can :destroy, BudgetType do |budget_type|
        budget_type.budgets.empty?
      end
      can [:read, :create, :update, :remove, :restore, :upload_to_nacsis], Item
      can :destroy, Item do |item|
        item.deletable?
      end
      can [:read, :create, :update], Library
      can :destroy, Library do |library|
        #library.shelves.empty? and library.users.empty? and library.budgets.empty? and library.events.empty? and !library.web?
        library.id != 0 and  library.shelves.size == 1 and library.shelves[0].open_access == 9 and library.shelves[0].items.empty? and library.budgets.empty? and library.events.empty? and !library.web?
      end
      can [:read, :create, :update, :output_excelx, :upload_to_nacsis], Manifestation
      can :destroy, Manifestation do |manifestation|
        if manifestation.items.empty? and Setting.operation and !manifestation.is_reserved?
          true
        else
          if SystemConfiguration.get("manifestation.has_one_item")
            if manifestation.items.first.new_record?
              Setting.operation and !manifestation.is_reserved?
            else
              manifestation.items.first.deletable? and Setting.operation and !manifestation.is_reserved?
            end
          else
            false
          end
        end
      end
      can [:read, :create, :update], SeriesStatement
      can :destroy, SeriesStatement do |series_statement|
        series_statement.manifestations.blank? or (series_statement.manifestations.size == 1 and
          series_statement.root_manifestation = series_statement.manifestations.first)
      end
      can [:read, :create, :update], Agent
      can :destroy, Agent do |agent|
        if agent.user
          agent.user.checkouts.not_returned.empty?
        else
          true
        end
      end
      can [:read, :create, :output, :search_name], Shelf
      can :update, Shelf do |shelf|
        shelf.open_access < 9
      end
      can :destroy, Shelf do |shelf|
        shelf.items.count == 0
      end
      can [:read, :create, :update], RetentionPeriod
      can :destroy, RetentionPeriod do |retention_period|
        retention_period.items.empty?
      end
      can [:read, :create, :update], RemoveReason
      can :destroy, RemoveReason do |remove_reason|
        remove_reason.items.count == 0
      end
      can [:read, :create, :update], User
      can :destroy, User do |u|
        u.deletable? and u != user
      end
      can [:read, :create, :update], UserGroup
      can :destroy, UserGroup do |user_group|
        user_group.users.empty?
      end
      can :manage, [
        Abbreviation,
        AccessLog,
        Answer,
        Approval,
        ApprovalExtext,
        BarcodeList,
        BindingItem,
        Bookbinding,
        BudgetCategory,
        CarrierTypeHasCheckoutType,
        Catalog,
        Checkoutlist,
        CheckoutStatHasManifestation,
        CheckoutStatHasUser,
        CheckoutType,
        ClaimType,
        Classmark,
        CopyRequest,
        Create,
        CreateType,
        Currency,
        Department,
        Donate,
        ExchangeRate,
        Expense,
        Family,
        FunctionClass,
        FunctionClassAbility,
        IdentifierType,
        ImportRequest,
        ItemHasOperator,
        ItemHasUseRestriction,
        Keycode,
        KeywordCount,
        LibraryReport,
        ManifestationCheckoutStat,
        ManifestationRelationship,
        ManifestationRelationshipType,
        ManifestationReserveStat,
        NacsisUserRequest,
        Numbering,
        Own,
        AgentImportFile,
        AgentMerge,
        AgentMergeList,
        AgentRelationship,
        AgentRelationshipType,
        PictureFile,
        Produce,
        ProduceType,
        PublicationStatus,
        PurchaseRequest,
        Question,
        Realize,
        RealizeType,
        RelationshipFamily,
        ReserveStatHasManifestation,
        ReserveStatHasUser,
        ResourceImportFile,
        ResourceImportTextfile,
        SearchEngine,
        SearchHistory,
        SequencePattern,
        SeriesStatementRelationship,
        SeriesHasManifestation,
        SeriesStatementMerge,
        SeriesStatementMergeList,
        SubCarrierType,
        Subscribe,
        Subscription,
        SystemConfiguration,
        Term,
        Title,
        TitleType,
        EnjuTerminal,
        UserCheckoutStat,
        UserHasRole,
        UserReserveStat,
        UserStatus,
        Wareki,
        WorkHasTitle,
        Language,
        LanguageType,
        TaxRate,
        Accept,
        OrderList,
        Order
      ]
      can [:read, :update], [
        AcceptType,
        CarrierType,
        CirculationStatus,
        ContentType,
        Country,
        Extent,
        Frequency,
        FormOfWork,
        LibraryGroup,
        License,
        ManifestationType,
        MediumOfPerformance,
        AgentType,
        RequestStatusType,
        RequestType,
        Role,
        SeriesStatementRelationshipType,
        UseRestriction
      ]
      can :read, [
        AgentImportResult,
        ResourceImportResult,
        ResourceImportTextresult,
        UserRequestLog
      ]
    when 'Librarian'
      can [:read, :output], BarcodeRegistration
      can [:read, :create, :update], Bookstore
      can :destroy, Bookstore do |bookstore|
        if defined? EnjuTrunkOrder
          bookstore.order_lists.empty?
        else
          true
        end
      end
      can [:read, :create, :update], Budget
      can :destroy, Budget do |budget|
        budget.expenses.empty?
      end
      can [:read, :create, :update], BudgetType
      can :destroy, BudgetType do |budget_type|
        budget_type.budgets.empty?
      end
      can [:read, :create, :update, :search_name], BudgetCategory
      can [:read, :create, :update, :remove, :restore, :upload_to_nacsis], Item
      can :destroy, Item do |item|
        item.deletable?
      end
      can [:read, :create, :update], Keycode
      can [:read, :create, :update, :output_excelx, :upload_to_nacsis], Manifestation
      can :destroy, Manifestation do |manifestation|
        if SystemConfiguration.get("manifestation.has_one_item")
          manifestation.items.first.deletable? and Setting.operation
        else
          manifestation.items.empty? and Setting.operation and !manifestation.is_reserved?
        end
      end
      can [:read, :create, :update], SeriesStatement
      can :destroy, SeriesStatement do |series_statement|
        series_statement.manifestations.blank? or (series_statement.manifestations.size == 1 and
          series_statement.root_manifestation = series_statement.manifestations.first)
      end
      can [:index, :create], Agent
      can :show, Agent do |agent|
        agent.required_role_id <= 3
      end
      can [:update, :destroy], Agent do |agent|
        !agent.user.try(:has_role?, 'Librarian') and agent.required_role_id <= 3
      end
      can [:index, :create], PurchaseRequest
      can [:index, :create], PurchaseRequest
      can [:show, :update, :destroy], PurchaseRequest do |purchase_request|
        purchase_request.user == user
      end
      can [:index, :create], Question
      can [:update, :destroy], Question do |question|
        question.user == user
      end
      can :show, Question do |question|
        question.user == user or question.shared
      end
#      can [:update, :destroy, :show], Reserve do |reserve|
#        reserve.try(:user) == user
#      end
      can :index, SearchHistory
      can [:show, :destroy], SearchHistory do |search_history|
        search_history.user == user
      end
      can [:read, :create, :update], User
      can :destroy, User do |u|
        u.checkouts.not_returned.empty? and (u.role.name == 'User' || u.role.name == 'Guest') and u != user
      end
      can [:read, :create, :update], UserCheckoutStat
      can [:read, :create, :update], UserReserveStat
      can [:read, :create, :update], RemoveReason
      can :destroy, RemoveReason do |remove_reason|
        remove_reason.items.count == 0
      end
      can :manage, [
        Abbreviation,
        AccessLog,
        Answer,
        Approval,
        ApprovalExtext,
        BarcodeList,
        BindingItem,
        Bookbinding,
        Catalog,
        Checkoutlist,
        ClaimType,
        Classmark,
        CopyRequest,
        Create,
        CreateType,
        Currency,
        Department,
        Donate,
        ExchangeRate,
        Expense,
        Family,
        ImportRequest,
        ItemHasOperator,
        KeywordCount,
        Language,
        LanguageType,
        LibraryReport,
        ManifestationCheckoutStat,
        ManifestationRelationship,
        ManifestationReserveStat,
        NacsisUserRequest,
        Numbering,
        Own,
        AgentImportFile,
        AgentMerge,
        AgentMergeList,
        AgentRelationship,
        PictureFile,
        Produce,
        ProduceType,
        PublicationStatus,
        PurchaseRequest,
        Question,
        Realize,
        RealizeType,
        RelationshipFamily,
        ResourceImportFile,
        ResourceImportTextfile,
        SearchHistory,
        SequencePattern,
        SeriesStatementRelationship,
        SeriesHasManifestation,
        SeriesStatementMerge,
        SeriesStatementMergeList,
        Shelf,
        Subscribe,
        Subscription,
        SystemConfiguration,
        Term,
        Title,
        TitleType,
        UserStatus,
        WorkHasTitle,
        Accept,
        OrderList,
        Order
      ]
      can [:read, :update], [
        SeriesStatementRelationshipType
      ]
      can :read, [
        AcceptType,
        CarrierType,
        CarrierTypeHasCheckoutType,
        CheckoutType,
        CheckoutStatHasManifestation,
        CheckoutStatHasUser,
        CirculationStatus,
        ContentType,
        Country,
        Extent,
        Frequency,
        FormOfWork,
        ItemHasUseRestriction,
        Library,
        LibraryGroup,
        License,
        ManifestationType,
        ManifestationRelationshipType,
        MediumOfPerformance,
        AgentImportResult,
        AgentRelationshipType,
        AgentType,
        RequestStatusType,
        RequestType,
        ReserveStatHasManifestation,
        ReserveStatHasUser,
        ResourceImportResult,
        ResourceImportTextresult,
        RetentionPeriod,
        Role,
        SearchEngine,
        EnjuTerminal,
        UseRestriction,
        UserGroup,
        UserRequestLog,
        Wareki,
        TaxRate
      ]
    when 'User'
      can [:index, :create], Answer
      can :show, Answer do |answer|
        if answer.user == user
          true
        elsif answer.question.shared
          answer.shared
        end
      end
      can [:update, :destroy], Answer do |answer|
        answer.user == user
      end
      can :index, Item
      can :show, Item do |item|
        item.required_role_id <= 2 && item.shelf.required_role_id <= 2 && item.circulation_status.name != 'Removed'
      end
      can :read, Manifestation do |manifestation|
        manifestation.required_role_id <= 2 && (!SystemConfiguration.get('manifestation.search.hide_without_accessible_item') || manifestation.has_available_items?(2))
      end
      can :edit, Manifestation #TODO not necessary?
      can [:index, :create], Question
      can [:update, :destroy], Question do |question|
        question.user == user
      end
      can :show, Question do |question|
        question.user == user or question.shared
      end
      can [:index, :create], Agent
      can :update, Agent do |agent|
        agent.user == user
      end
      can :show, Agent do |agent|
        if agent.user == user
          true
        elsif agent.user != user
          true if agent.required_role_id <= 2 #name == 'Administrator'
        end
      end
      can :index, PictureFile
      can :show, PictureFile do |picture_file|
        begin
          true if picture_file.picture_attachable.required_role_id <= 2
        rescue NoMethodError
          true
        end
      end
      can [:index, :create, :show], PurchaseRequest
      can [:update, :destroy], PurchaseRequest do |purchase_request|
        purchase_request.user == user
      end
      can :index, SearchHistory
      can [:show, :destroy], SearchHistory do |search_history|
        search_history.user == user
      end
      can :show, User
      can :update, User do |u|
        u == user
      end
      can :create, CopyRequest
      can [:read, :update, :destroy], CopyRequest do |copy_request|
        copy_request.user == user
      end
      can [:read, :update, :destroy], NacsisUserRequest, :user_id => user.id
      can :read, [
        AcceptType,
        CarrierType,
        CirculationStatus,
        Classmark,
        ContentType,
        Country,
        Create,
        CreateType,
        Department,
        Extent,
        Frequency,
        FormOfWork,
        Language,
        Library,
        LibraryGroup,
        License,
        ManifestationRelationship,
        ManifestationRelationshipType,
        ManifestationCheckoutStat,
        ManifestationReserveStat,
        MediumOfPerformance,
        Own,
        AgentRelationship,
        AgentRelationshipType,
        Produce,
        ProduceType,
        Realize,
        RealizeType,
        RelationshipFamily,
        RemoveReason,
        SeriesStatement,
        SeriesHasManifestation,
        Shelf,
        EnjuTerminal,
        UserCheckoutStat,
        UserReserveStat,
        UserStatus,
        UserGroup,
        Wareki,
        TaxRate
      ]
    else
      can :index, Agent
      can :show, Agent do |agent|
        agent.required_role_id == 1 #name == 'Guest'
      end
      can :read, Item do |item|
        item.required_role_id <= 1 && item.shelf.required_role_id <= 1 && item.circulation_status.name != 'Removed'
      end
      can :read, Manifestation do |manifestation|
        manifestation.required_role_id <= 1 && (!SystemConfiguration.get('manifestation.search.hide_without_accessible_item') || manifestation.has_available_items?(1))
      end
      can [:index, :create, :show], PurchaseRequest unless SystemConfiguration.isWebOPAC
      can :read, [
        CarrierType,
        CirculationStatus,
        Classmark,
        ContentType,
        Country,
        Create,
        CreateType,
        Extent,
        Frequency,
        FormOfWork,
        Language,
        Library,
        LibraryGroup,
        License,
        ManifestationCheckoutStat,
        ManifestationRelationship,
        ManifestationRelationshipType,
        ManifestationReserveStat,
        MediumOfPerformance,
        Own,
        AgentRelationship,
        AgentRelationshipType,
        PictureFile,
        Produce,
        ProduceType,
        Realize,
        RealizeType,
        RelationshipFamily,
        RemoveReason,
        SeriesStatement,
        SeriesHasManifestation,
        Shelf,
        UserCheckoutStat,
        UserGroup,
        UserReserveStat,
        Wareki,
        TaxRate
      ]
    end

    can :manage, :opac
  end
end


text:
import {DeviceManagerClient} from '@google-cloud/iot';

// check that the client class type name can be used
function doStuffWithDeviceManagerClient(client: DeviceManagerClient) {
  client.close();
}

function main() {
  // check that the client instance can be created
  const deviceManagerClient = new DeviceManagerClient();
  doStuffWithDeviceManagerClient(deviceManagerClient);
}

main();


text:
SYNONYM

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

#### Published in
Hyménomycètes (Alençon) 111 (1874)

#### Original name
Agaricus bufonius Pers., 1801

### Remarks
null


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GrPPI: testing::internal::UniversalPrinter< T > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

GrPPI
    1.0

Generic and Reusable Parallel Pattern Interface

testing

internal

UniversalPrinter

Static Public Member Functions |
List of all members

testing::internal::UniversalPrinter< T > Class Template Reference

#include <gtest-printers.h>

Inheritance diagram for testing::internal::UniversalPrinter< T >:

<map name="atesting_1_1internal_1_1_universal_printer_3_01_t_01_4_inherit__map" id="atesting_1_1internal_1_1_universal_printer_3_01_t_01_4_inherit__map">
<area shape="rect" title=" " alt="" coords="23,5,170,47"/>
<area shape="rect" href="classtesting_1_1internal_1_1_universal_printer_3_01const_01_t_01_4.html" title=" " alt="" coords="5,95,188,136"/>
</map>
[legend]

Static Public Member Functions

static void 	Print (const T &value, ::std::ostream *os)

static void 	Print (const T &value, ::std::ostream *os)

Member Function Documentation

◆ Print() [1/2]

template<typename T >

          static void testing::internal::UniversalPrinter< T >::Print
          (
          const T &
          value,

          ::std::ostream *
          os

          )

inlinestatic

◆ Print() [2/2]

template<typename T >

          static void testing::internal::UniversalPrinter< T >::Print
          (
          const T &
          value,

          ::std::ostream *
          os

          )

inlinestatic

The documentation for this class was generated from the following files:

cmake-build-debug/googletest-src/googletest/include/gtest/gtest-printers.h

cmake-build-release/googletest-src/googletest/include/gtest/gtest-printers.h

<address class="footer">
Generated by  1.9.2
</address>


text:
package steps

import "reg/t"

type Source interface {
	Start(src <-chan t.Ticks, prod chan<- t.TicksSteps)
}


text:
'use strict';

angular.module('freshcardServices')
	.factory('ContactSearchService', function(configuration, $rootScope, VCardService) {
		return {
			getIndex: function() {
				var algolia = new AlgoliaSearch($rootScope.algoliaApplicationID, $rootScope.user.searchPublicKey, 'https');
				algolia.setSecurityTags('user_' + $rootScope.user.id + '_organization_' + $rootScope.user.currentOrganizationId);
				var index = algolia.initIndex(configuration.algoliaContactSearchIndex);
				return index;
			},
			getIndexForCoWorkers: function() {
				var algolia = new AlgoliaSearch($rootScope.algoliaApplicationID, $rootScope.user.searchPublicKeyForCoWorkers, 'https');
				algolia.setSecurityTags('coworkers_organization_' + $rootScope.user.currentOrganizationId);
				var index = algolia.initIndex(configuration.algoliaContactSearchIndex);
				return index;
			},
			search: function($scope, searchIndex, page) {
				searchIndex.search(
					$scope.query,
					function(success, content) {
						if (!success || $scope.query !== content.query) {
							return;
						}
						$scope.hits = content.hits;
						$scope.total = content.nbHits;

						for (var i = 0; i < $scope.hits.length; i++) {
							$scope.hits[i].vcard = angular.fromJson($scope.hits[i].vcard);
							$scope.hits[i].vCardData = VCardService.parseData($scope.hits[i].vcard);
						}

						if ($scope.initRun) {
							$scope.$apply();
							$scope.initRun = false;
						}
					},
					{
						hitsPerPage: $scope.itemsPerPage,
						page: (page !== undefined && page !== null) ? page - 1: 0
					}
				);
			}
		};
	});


text:
.class synthetic Lcom/facebook/internal/SessionTracker$1;
.super Ljava/lang/Object;
.source ""

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/facebook/internal/SessionTracker;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1008
    name = null
.end annotation


text:
class ExamplePlugin < Appcelerator::Plugin
    def on_event(event)
      # this is a catch-all event method - will catch everything
    end
    def plugin_registered(event)
      # called when this plugin is loaded
    end
    def before_command(event)
      # called before a command executes
    end
    def after_command(event)
      # called after a command executes
    end
    def before_create_project(event)
      # called before a project is created
    end
    def after_create_project(event)
      # called after a project is created
    end
    def before_update_project(event)
      # called before a project is updated
    end
    def after_update_project(event)
      # called after a project is updated
    end
    def before_web_sdk_install(event)
      # called before the web sdk is installed
    end
    def after_web_sdk_install(event)
      # called after the web sdk is installed
    end
    def before_copy_web(event)
      # called before the web assets are copied into a project
    end
    def after_copy_web(event)
      # called after the web assets are copied into a project
    end
    def before_create_plugin(event)
      # called before a plugin project is created
    end
    def after_create_plugin(event)
      # called after a plugin project is created
    end
    def before_install_plugin(event)
      # called before a plugin is installed
    end
    def after_install_plugin(event)
      # called after a plugin is installed
    end
    def before_add_widget(event)
      # called before a widget is added to a project directory
    end
    def after_add_widget(event)
      # called after a widget is added to a project directory
    end
    def before_create_html(event)
      # called before an HTML template is created in a project directory
    end
    def after_create_html(event)
      # called after an HTML template is created in a project directory
    end
    def before_run_server(event)
      # called before the project specific server is run
    end
    def after_run_server(event)
      # called after the project specific server is run
    end
    def before_create_war(event)
      # called before a project war is created for java
    end
    def after_create_war(event)
      # called after a project war is created for java
    end
    def before_add_plugin(event)
      # called before a plugin is added to a project
    end
    def after_add_plugin(event)
      # called after a plugin is added to a project
    end
    def before_install_component(event)
      # called before a component is installed
    end
    def after_install_component(event)
      # called after a component is installed
    end
end


text:
var TestMenusLayer = function() {
    this.onMenuItemAClicked = function(sender) {
        this.mMenuItemStatusLabelBMFont.setString("Menu Item A clicked.");
    };

    this.onMenuItemBClicked = function(sender) {
        this.mMenuItemStatusLabelBMFont.setString("Menu Item B clicked.");
    };

    this.onMenuItemCClicked = function(sender) {
        this.mMenuItemStatusLabelBMFont.setString("Menu Item C clicked.");
    };
};


text:
layout: post
title: "One R Fortune A Day!"
date: 2013-08-06 10:36
comments: true
categories: R
---

Just found this interesting package [fortunes](http://cran.r-project.org/web/packages/fortunes/index.html) though it have been built for 9 years! I wrote a simple  application and deployed it on Rstudio server, So you can read those wisdom where you have internet connection.

Source code can be downloaded [here](https://gist.github.com/withr/d17fe7d161514fed287f).


text:
jQuery(document).ready(function($) {
/* Mouse Drag Event
var clicking = false;
$('.mom_user_rate').mousedown(function(){
    clicking = true;
    console.log(clicking);
});

$(document).mouseup(function(){
    clicking = false;
    console.log(clicking);
})
*/

$(".mom_user_rate").mousemove(function(e){
       //if(clicking == false) return;

   var style = $(this).data('style');
    var thisOffset = $(this).offset();
   //or $(this).offset(); if you really just want the current element's offset
   var relX = e.pageX - thisOffset.left;
   var relY = e.pageY - thisOffset.top;
   if (!$(this).hasClass('rated')) {
   var percent = relX/parseFloat($(this).width())*100;
   var score = Math.round(percent);
   var starts = (score/20).toFixed(1);
   if (style === 'bars') {
      $(this).find('.ub-inner').css({width: score+'%' });
      $(this).find('.ub-inner').find('span').text(score+'%');
   } else if (style === 'circles') {

   } else {
      $(this).children('span').css({width: (score+1)+'%' });
   }
   //$(this).next('.mom_user_rate_score').children('span').text(score/20);
      if ($(this).hasClass('star-rating')) {
         $(this).parent().find('.yr').text(starts+'/5');
      }
   }
});

// show your user rate
$(".mom_user_rate, .mom_user_rate_cr").hover( function() {
   if (!$(this).hasClass('rated')) {
      $('.review-footer .mom_user_rate_title').find('.user_rate').hide();
      $('.review-footer .mom_user_rate_title').find('.your_rate').show();
   }

}, function() {
   if (!$(this).hasClass('rated')) {
      $('.mom_user_rate_title').find('.user_rate').show();
      $('.mom_user_rate_title').find('.your_rate').hide();
   }
});

	$(".mom_user_rate").click(function(){

		stars = jQuery(this);
		post_id = stars.data("post_id");
		style = stars.data("style");
                score = 0;
                if (style === 'stars') {
		score = parseFloat(stars.children('span').width())/parseFloat($(this).width())*100;
                }
                if (style === 'bars') {
		score = parseFloat(stars.children('.ub-inner').width())/parseFloat($(this).width())*100;
                }
		score = Math.round(score);
                vc = stars.data("votes_count");
   if (!$(this).hasClass('rated')) {

		jQuery.ajax({
			type: "post",
			url: ajax_var.url,
			data: "action=user-rate&nonce="+ajax_var.nonce+"&user_rate=&post_id="+post_id+"&user_rate_score="+score,
			success: function(rate){
				if(rate != "already")
				{
					stars.addClass('rated');
					$('.review-footer .mom_user_rate_title').find('.user_rate').hide();
					$('.review-footer .mom_user_rate_title').find('.your_rate').show();
                                        $('.review-footer .total-votes').find('.tv-count').text(vc+1);
				}
					//alert(score);
			}
		});
   }
	})

//Circles
if ($('.mom-reveiw-system').length) {
   $(".urc-value").knob({
      displayInput: false,
      change: function (value) {
       //console.log("changed to: " + value);
        $('.user-rate-circle').find('.cru-num').text(value);
      },
      release: function (value) {
         	circle = jQuery('.user-rate-circle .mom_user_rate_cr');
		post_id = circle.data("post_id");
		style = circle.data("style");
		score = value;
                vc = circle.data("votes_count");

		jQuery.ajax({
			type: "post",
			url: ajax_var.url,
			data: "action=user-rate&nonce="+ajax_var.nonce+"&user_rate=&post_id="+post_id+"&user_rate_score="+score,
			success: function(rate){
				if(rate != "already")
				{
					circle.addClass('rated');
					$('.review-footer .mom_user_rate_title').find('.user_rate').hide();
					$('.review-footer .mom_user_rate_title').find('.your_rate').show();
                                        $('.review-footer .total-votes').find('.tv-count').text(vc+1);

				}

					//alert(score);
			}
		});
      }
   });
}

})


text:
package org.jitsi.jirecon.datachannel;

import java.io.*;
import java.net.*;
import java.util.concurrent.*;

import net.java.sip.communicator.util.Logger;

import org.jitsi.impl.neomedia.*;
import org.jitsi.impl.neomedia.transform.dtls.*;
import org.jitsi.jirecon.xmppcomponent.ComponentLauncher;
import org.jitsi.jirecon.xmppcomponent.XMPPComponent;
import org.jitsi.sctp4j.*;
import org.jitsi.service.libjitsi.*;
import org.jitsi.service.packetlogging.*;

/**
 * An implementation of <tt>NetworkLink</tt> which is used for receiving and
 * sending packet under SCTP connection.
 * <p>
 * This link will use ICE-UDP and DTLS protocol.
 *
 * @author lishunyang
 *
 */
public class IceUdpDtlsLink
    implements NetworkLink
{

	private final static Logger logger = Logger.getLogger("IceUdpDtlsLink.class");

    /**
     * DTLS transport buffer size. Note: randomly chosen.
     */
    private final static int DTLS_BUFFER_SIZE = 2048;

    /**
     * SCTP transport buffer size.
     */
    private final static int SCTP_BUFFER_SIZE = DTLS_BUFFER_SIZE - 13;

    /**
     * <tt>SctpSocket</tt> instance that is used in this connection.
     */
    private SctpSocket sctpSocket;

    /**
     * ICE-UDP socket, used for receiving packets.
     */
    private DatagramSocket datagramSocket;

    /**
     * DTLS transform engine, used for sending packets.
     */
    private DtlsPacketTransformer transformer;

    private ExecutorService executorService = Executors
        .newSingleThreadExecutor();

    /**
     * Switch used for debugging SCTP traffic purposes. FIXME to be removed
     */
    private final static boolean LOG_SCTP_PACKETS = false;

    /**
     * Generator used to track debug IDs.
     */
    private static int debugIdGen = -1;

    /**
     * Debug ID used to distinguish SCTP sockets in packet logs.
     */
    private int debugId = generateDebugId();

    /**
     *
     * @param sctpSocket Indicate which <tt>SctpSocket</tt> this link will bind to.
     * @param datagramSocket ICE-UDP socket which is used for receiving packets.
     * @param transformer DTLS transformer which is used for sending packets.
     */
    public IceUdpDtlsLink(SctpSocket sctpSocket, DatagramSocket datagramSocket,
        DtlsPacketTransformer transformer)
    {
        this.sctpSocket = sctpSocket;
        this.datagramSocket = datagramSocket;
        this.transformer = transformer;

        startReceiving();
    }

    private void startReceiving()
    {
        executorService.execute(new Runnable()
        {
            public void run()
            {
                byte[] receiveBuffer = new byte[SCTP_BUFFER_SIZE];
                DatagramPacket rcvPacket =
                    new DatagramPacket(receiveBuffer, 0, receiveBuffer.length);

                try
                {
                    /*
                     * Once SctpSocket is closed, this loop will be broken down,
                     * so we don't have to worry about closing this link.
                     */
                    do
                    {
                        datagramSocket.receive(rcvPacket);

                        RawPacket raw =
                            new RawPacket(rcvPacket.getData(), rcvPacket
                                .getOffset(), rcvPacket.getLength());

                        raw = transformer.reverseTransform(raw);
                        // Check for app data
                        if (raw == null)
                            continue;

                        if (LOG_SCTP_PACKETS)
                        {
                            LibJitsi.getPacketLoggingService().logPacket(
                                PacketLoggingService.ProtocolName.ICE4J,
                                new byte[]
                                { 0, 0, 0, (byte) (debugId + 1) },
                                datagramSocket.getPort(), new byte[]
                                { 0, 0, 0, (byte) debugId }, 5000,
                                PacketLoggingService.TransportName.UDP, false,
                                raw.getBuffer(), raw.getOffset(),
                                raw.getLength());
                        }

                        // Pass network packet to SCTP stack
                        sctpSocket.onConnIn(raw.getBuffer(), raw.getOffset(),
                            raw.getLength());
                    }
                    while (true);
                }
                catch (IOException e)
                {
                    //e.printStackTrace();

                	 logger.info("Socket closed.");

                }
            }
        });
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void onConnOut(final SctpSocket s, final byte[] packetData)
        throws IOException
    {
        RawPacket rawPacket = new RawPacket();

        // Send through DTLS transport
        rawPacket.setBuffer(packetData);
        rawPacket.setLength(packetData.length);

        transformer.transform(rawPacket);
    }

    private static synchronized int generateDebugId()
    {
        debugIdGen += 2;
        return debugIdGen;
    }
}


text:
import json

from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext

from crits.core import form_consts
from crits.core.user_tools import user_can_view_data
from crits.core.user_tools import user_is_admin
from crits.certificates.forms import UploadCertificateForm
from crits.certificates.handlers import handle_cert_file
from crits.certificates.handlers import delete_cert, get_certificate_details
from crits.certificates.handlers import generate_cert_jtable, generate_cert_csv

@user_passes_test(user_can_view_data)
def certificates_listing(request,option=None):
    """
    Generate Certificate Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """

    if option == "csv":
        return generate_cert_csv(request)
    return generate_cert_jtable(request, option)

@user_passes_test(user_can_view_data)
def certificate_details(request, md5):
    """
    Generate Certificate Details template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param md5: The MD5 of the Certificate.
    :type md5: str
    :returns: :class:`django.http.HttpResponse`
    """

    template = 'certificate_details.html'
    analyst = request.user.username
    (new_template, args) = get_certificate_details(md5, analyst)
    if new_template:
        template = new_template
    return render_to_response(template,
                              args,
                              RequestContext(request))

@user_passes_test(user_can_view_data)
def upload_certificate(request):
    """
    Add a new Certificate to CRITs.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :returns: :class:`django.http.HttpResponse`
    """

    if request.method == 'POST':
        form = UploadCertificateForm(request.user, request.POST, request.FILES)
        if form.is_valid():
            filedata = request.FILES['filedata']
            filename = filedata.name
            data = filedata.read() # XXX: Should be using chunks here.
            source = form.cleaned_data.get('source')
            user = request.user.username
            description = form.cleaned_data.get('description', '')
            related = form.cleaned_data.get('related_id', '')
            related_type = form.cleaned_data.get('related_type', '')
            bucket_list = form.cleaned_data.get(form_consts.Common.BUCKET_LIST_VARIABLE_NAME)
            ticket = form.cleaned_data.get(form_consts.Common.TICKET_VARIABLE_NAME)
            method = form.cleaned_data.get('method', '') or 'Upload'
            reference = form.cleaned_data.get('reference', '')
            status = handle_cert_file(filename, data, source, user, description,
                                      related_id=related, related_type=related_type,
                                      method=method, reference=reference,
                                      bucket_list=bucket_list, ticket=ticket)
            if status['success']:
                return render_to_response('file_upload_response.html',
                                          {'response': json.dumps({
                    'message': 'Certificate uploaded successfully! View Certificate'
                        % reverse('crits.certificates.views.certificate_details',
                                  args=[status['md5']]), 'success': True})},
                                          RequestContext(request))
            else:
                return render_to_response('file_upload_response.html',
                                          {'response': json.dumps({ 'success': False,
                                                                   'message': status['message']})}
                                          , RequestContext(request))
        else:
            return render_to_response('file_upload_response.html',
                                      {'response': json.dumps({'success': False,
                                                               'form': form.as_table()})},
                RequestContext(request))
    else:
        return render_to_response('error.html',
                                  {'error': "Expected POST."},
                                  RequestContext(request))

@user_passes_test(user_is_admin)
def remove_certificate(request, md5):
    """
    Remove a Certificate from CRITs.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param md5: The MD5 of the Certificate.
    :type md5: str
    :returns: :class:`django.http.HttpResponse`
    """

    result = delete_cert(md5, '%s' % request.user.username)
    if result:
        return HttpResponseRedirect(reverse('crits.certificates.views.certificates_listing'))
    else:
        return render_to_response('error.html',
                                  {'error': "Could not delete certificate"})


text:
package main

import "fmt"

func main() {
  var x string = "Hello World"
  fmt.Println(x)
}


text:
require 'rails/generators/named_base'

module Riaction
  module Generators
    class Base < Rails::Generators::Base
      def self.source_root
        @_riaction_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'riaction', generator_name, 'templates'))
      end
    end
  end
end


text:
#*******************************************************************************
# E.S.O. - ALMA project
#
# "@(#) $Id: Makefile,v 1.160 2010/07/07 10:25:21 alopatin Exp $"
#
# Makefile of ........
#
# who       when      what
# --------  --------  ----------------------------------------------
# dave 2003-09-04 removed startACS as it has been moved to the acsstartup module
# gchiozzi 2003-06-04 Added acsdataClean script
# gchiozzi 2003-06-02 Moved acsIrFeed in the acsutil module, since it is needed before acsBuild is built
# gchiozzi 2003-02-03 Re-written man and install targets to handle whole ACS documentation, but still an hack
# gchiozzi 2003-02-03 Removed acsBUILDInstallReadme
# gchiozzi 2003-01-09 Replaced INTROOT with VLTTOP in man target
# gchiozzi 2002-12-12 Added acsBUILDPrepareKit.sh
# almamgr 2002-11-28 Added hook for retrieve
# gchiozzi 2002-11-22 Added acsTATPrologue acsTATEpilogue
# jibsen   2002-04-10 acsDHCPBoot, acsDHCPConfig added
# psivera  2002-03-14 Added acsBUILDAfterBuildMod.sh.
# gchiozzi 2002-01-17 Added acsBUILDTest.
# gchiozzi 2001-11-19 Removed acsAllOrbacus.idl file
# gchiozzi 2001-11-16 Added acsIrfeed
# gchiozzi 2001-09-19 Added clean_dist target
# gchiozzi 2001-09-19 Added various startup/shutdown scripts
# psivera 2001-08-31 moved the installation of config files from
#		     "make install" to "make man" section
# psivera 2001-08-30 removed acsBUILDAfterInstall.sh (obsolete)
# almamgr 2001-08-07 Added doxygen of man pages
# almamgr 2001-05-28 Renamed module acsBUILD.
# rkarban  29/02/00  created
#

#*******************************************************************************
# This Makefile follows VLT Standards (see Makefile(5) for more).
#*******************************************************************************
# REMARKS
#    None
#------------------------------------------------------------------------

#
# user definable C-compilation flags
#USER_CFLAGS =

#
# additional include and library search paths
#USER_INC =
#USER_LIB =

#
# MODULE CODE DESCRIPTION:
# ------------------------
# As a general rule:  public file are "cleaned" and "installed"
#                     local (_L) are not "installed".

#
# C programs (public and local)
# -----------------------------
EXECUTABLES     =
EXECUTABLES_L   =

#
# <brief description of xxxxx program>
xxxxx_OBJECTS   =
xxxxx_LDFLAGS   =
xxxxx_LIBS      =

#
# special compilation flags for single c sources
#yyyyy_CFLAGS   =

#
# Includes (.h) files (public only)
# ---------------------------------
INCLUDES        =

#
# Libraries (public and local)
# ----------------------------
LIBRARIES       =
LIBRARIES_L     =

#
# <brief description of lllll library>
lllll_OBJECTS   =

DEBUG = on

#
# Jarfiles and their directories
# Currently the produced JAR file is not installed,
# so just uncomment the following two lines to  build it manually.
# This will provide the ProcessCvs2clOutput command to generate ChangeLog files for the wiki.
#
#JARFILES = acsBUILD
#acsBUILD_DIRS =  alma

#
# Scripts (public and local)
# ----------------------------
SCRIPTS         = acsBUILDBeforeInstall.sh acsBUILDTest \
                  acsBUILDPrepareKit.sh \
                  acsStartLoggingClient \
                  acsDHCPBoot \
                  generateJarsFromIDLs acsBUILDAfterBuildMod.sh\
                  acsBUILDCheckModuleTree.sh \
                  acsUpdate \
                  acsCopyMidlToPidl
SCRIPTS_L       =

PY_SCRIPTS =
PY_SCRIPTS_L = acsGenGlobalPythonIndex
PY_PACKAGES =

#
# TCL scripts (public and local)
# ------------------------------
TCL_SCRIPTS     =
TCL_SCRIPTS_L   =

#
# <brief description of tttttt tcl-script>
tttttt_OBJECTS  =
tttttt_TCLSH    =
tttttt_LIBS     =

#
# TCL libraries (public and local)
# ------------------------------
TCL_LIBRARIES   =
TCL_LIBRARIES_L =

#
# <brief description of tttlll library>
tttlll_OBJECTS  =

#
# UIF panels (public and local)
# ----------------------------
PANELS   =
PANELS_L =

#
# man pages to be done
# --------------------
MANSECTIONS = 1
MAN1 = acsDHCPBoot acsUpdate
MAN3 =
MAN5 =
MAN7 =
MAN8 =

#
# local man pages
# ---------------
MANl =

#
# ASCII file to be converted into Framemaker-MIF
# --------------------
ASCII_TO_MIF =

#
# INS_ROOT files to be installed
#-------------------------------
INS_ROOT_FILES =
INS_ROOT_DIR   =

#
# other files to be installed
#----------------------------
INSTALL_FILES =

#
# list of all possible C-sources (used to create automatic dependencies)
# ------------------------------
CSOURCENAMES = \
	$(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \
	$(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS))

#
#>>>>> END OF standard rules

#
# CHOSE PLATFORM
# --------------
# Default is UNIX, for VxVorks application next line MUST BE UNCOMMENTED
#MAKE_VXWORKS = on

#
# INCLUDE STANDARDS
# -----------------
SHELL = /bin/bash
MAKEDIRTMP := $(shell searchFile include/acsMakefile)
ifneq ($(MAKEDIRTMP),\#error\#)
   MAKEDIR := $(MAKEDIRTMP)/include
   include $(MAKEDIR)/acsMakefile
endif

#
# ACS supported TARGETS
# -------
all:	do_all
	@echo " . . . 'all' done"

clean : clean_all
	$(RM) ../*~ ../*/*~ ../*/*~ ../*/*/*~ ../*/*/*/*~ ../*/*/*/*/*~
	@echo " . . . clean done"

clean_dist : clean clean_dist_all
	@echo "Cleaning up documentation tree in ../.."
	@rm -rf ../../man
	@echo " . . . clean_dist done"

#
# TODO: GCH build and install of complete ACS documentation is an hack
#           and should be re-written in a nicer way
#
man   : do_man man_prepare man_idl man_cpp man_java man_schema man_python man_errors
	@echo " . . . documentation page(s) done"
man_prepare:
	@echo "Generating complete ACS documentation in build root ../.."
	@echo "Cleaning up documentation tree"
	@rm -rf ../../man/*

man_idl:
	@echo "Generating IDL documentation"
	@cd ../..; doxygen acsBUILD/config/Doxyfile.idl
man_cpp:
	@echo "Generating C++ API documentation"
	@cd ../..; doxygen acsBUILD/config/Doxyfile.cpp
man_java:
	@echo "Generating Java API documentation"
	@cd ../..; doxygen acsBUILD/config/Doxyfile.java
	@cp ../../man/java/annotated.html ../../man/java/index.html
man_schema:
	@echo "Generating schema documentation "
	@mkdir -p $(PRJTOP)/man/schemas/src
	@cp -f $(PRJTOP)/config/CDB/schemas/*.xsd $(PRJTOP)/idl/*.xsd $(PRJTOP)/config/CDB/schemas/*.dtd $(PRJTOP)/man/schemas/src
	@cp ../config/xsddocSchemaAntBuild.xml $(PRJTOP)/man/schemas/src/build.xml
	@cd $(PRJTOP)/man/schemas/src; \
         export CLASSPATH=$(shell searchFile lib/xsddoc.jar)/lib/xsddoc.jar:$(ACSROOT)/lib/xalan.jar:$(ACSROOT)/lib/xalan_serializer.jar:$(CLASSPATH) ;\
         ant
man_python:
	@echo "Generating global Python API documentation index file"
	@mkdir -p $(PRJTOP)/man/py
	@acsGenGlobalPythonIndex $(PRJTOP)/man/py > $(PRJTOP)/man/py/index.html

man_errors:
	@echo "Generating errors documentation"
	@mkdir -p $(PRJTOP)/man/errors
	@python acsGenErrorsDocumentation.py $(PRJTOP) $(PRJTOP)/man/errors

install : install_doc install_config install_cdb install_svc_conf install_all
	@echo " . . . installation done"

install_doc:
	@echo " . . . installing ACS documentation from ../.."
	-@cp -r ../../man $(PRJTOP);\
	         chmod -R ug+rw $(PRJTOP)/man;

install_config:
	@echo " . . . installing user account configuration files $(PRJTOP)/config"
	-@tar -cf - --exclude=".svn" -C ../config .acs  | tar -xf - -C $(PRJTOP)/config; \
	         chmod -R ug+rw $(PRJTOP)/config/.acs;
	@echo " . . . copying rc.d configuration files for DHCP in $(PRJTOP)/config"
	-@tar -cf - --exclude=".svn" -C ../config rc.d  | tar -xf - -C $(PRJTOP)/config; \
	         chmod -R ug+rw $(PRJTOP)/config/rc.d;

install_cdb:
	@echo " . . . copying default CDB in $(ACSDATA)/config"
	-@tar -cf - --exclude=".svn" -C ../config defaultCDB  | tar -xf - -C $(ACSDATA)/config; \
	         chmod -R ug+rw $(ACSDATA)/config/defaultCDB;
	@echo " . . . copying demo CDB in $(ACSDATA)/config"
	-@tar -cf - --exclude=".svn" -C ../config demoCDB  | tar -xf - -C $(ACSDATA)/config; \
	         chmod -R ug+rw $(ACSDATA)/config/demoCDB;

install_svc_conf:
	@echo " . . . copying svc.conf files"
	-@cp -r ../config/svc.conf $(ACSROOT)/config;\
	     	 chmod -R ug+rw $(ACSROOT)/config/svc.conf;
#___oOo___


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

<arquillian xmlns="http://jboss.org/schema/arquillian"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <group qualifier="wildfly" default="true">
        <container qualifier="jboss" default="true" mode="manual">
            <configuration>
                <property name="jbossHome">${jboss.home}</property>
                <property name="allowConnectingToRunningServer">false</property>
                <property name="javaVmArguments">${jvm.args}</property>
                <property name="serverConfig">${wildfly.standalone.config}</property>
            </configuration>
        </container>
        <container qualifier="wildfly" default="false" mode="manual">
            <configuration>
                <property name="jbossHome">${jboss.home}</property>
                <property name="allowConnectingToRunningServer">false</property>
                <!-- Change the management port to ensure only the correct client will work with the server -->
                <property name="managementPort">9999</property>
                <property name="jbossArguments">-Djboss.management.http.port=9999</property>
                <property name="javaVmArguments">${jvm.args}</property>
                <property name="serverConfig">${wildfly.standalone.config}</property>
            </configuration>
        </container>
        <container qualifier="read-only-config" default="false" mode="manual">
            <configuration>
                <property name="jbossHome">${jboss.home}</property>
                <property name="allowConnectingToRunningServer">false</property>
                <property name="javaVmArguments">${jvm.args}</property>
                <property name="readOnlyServerConfig">${wildfly.standalone.config}</property>
            </configuration>
        </container>
    </group>
</arquillian>


text:
<ion-header>

  <ion-navbar>
    <ion-title>{{ 'SEARCH_TITLE' | translate }}</ion-title>
  </ion-navbar>

</ion-header>

<ion-content>
  <ion-searchbar (ionInput)="getItems($event)" placeholder="{{ 'SEARCH_PLACEHOLDER' | translate }}"></ion-searchbar>
  <ion-list>
    <button ion-item (click)="openItem(item)" *ngFor="let item of currentItems">
      <ion-avatar item-left>

      </ion-avatar>

{{item.name}}

{{item.about}}

      <ion-note item-right *ngIf="item.note">{{item.note}}</ion-note>
    </button>
  </ion-list>
</ion-content>


text:
require 'fog/rackspace/core'

module Fog
  module Rackspace
    class NetworkingV2 < Fog::Service
      include Fog::Rackspace::Errors

      class ServiceError < Fog::Rackspace::Errors::ServiceError; end
      class InternalServerError < Fog::Rackspace::Errors::InternalServerError; end
      class BadRequest < Fog::Rackspace::Errors::BadRequest; end

      NETWORKS_DFW_URL = "https://dfw.networks.api.rackspacecloud.com/v2.0"
      NETWORKS_LON_URL = "https://lon.networks.api.rackspacecloud.com/v2.0"
      NETWORKS_IAD_URL = "https://iad.networks.api.rackspacecloud.com/v2.0"
      NETWORKS_ORD_URL = "https://ord.networks.api.rackspacecloud.com/v2.0"

      class InvalidStateException < ::RuntimeError
        attr_reader :desired_state
        attr_reader :current_state

        def initialize(desired_state, current_state)
          @desired_state = desired_state
          @current_state = current_state
        end
      end

      class InvalidServerStateException < InvalidStateException
        def to_s
          "Server should have transitioned to '#{desired_state}' not '#{current_state}'"
        end
      end

      class InvalidImageStateException < InvalidStateException
        def to_s
          "Image should have transitioned to '#{desired_state}' not '#{current_state}'"
        end
      end

      requires :rackspace_username, :rackspace_api_key
      recognizes :rackspace_endpoint
      recognizes :rackspace_auth_url
      recognizes :rackspace_auth_token
      recognizes :rackspace_region
      recognizes :rackspace_networking_v2_url

      model_path 'fog/rackspace/models/networking_v2'

      model :network
      collection :networks

      model :subnet
      collection :subnets

      model :port
      collection :ports

      model :security_group
      collection :security_groups

      model :security_group_rule
      collection :security_group_rules

      request_path 'fog/rackspace/requests/networking_v2'
      request :list_networks
      request :create_network
      request :show_network
      request :update_network
      request :delete_network

      request :list_subnets
      request :create_subnet
      request :show_subnet
      request :update_subnet
      request :delete_subnet

      request :list_ports
      request :create_port
      request :show_port
      request :update_port
      request :delete_port

      request :list_security_groups
      request :create_security_group
      request :show_security_group
      request :update_security_group
      request :delete_security_group

      request :list_security_group_rules
      request :create_security_group_rule
      request :show_security_group_rule
      request :delete_security_group_rule

      class Mock < Fog::Rackspace::Service
        include Fog::Rackspace::MockData

        def initialize(options)
          @rackspace_api_key = options[:rackspace_api_key]
        end

        def request(params)
          Fog::Mock.not_implemented
        end

        def response(params={})
          body    = params[:body] || {}
          status  = params[:status] || 200
          headers = params[:headers] || {}

          response = Excon::Response.new(:body => body, :headers => headers, :status => status)
          if params.key?(:expects) && ![*params[:expects]].include?(response.status)
            raise(Excon::Errors.status_error(params, response))
          else response
          end
        end
      end

      class Real < Fog::Rackspace::Service
        def initialize(options = {})
          @rackspace_api_key = options[:rackspace_api_key]
          @rackspace_username = options[:rackspace_username]
          @rackspace_auth_url = options[:rackspace_auth_url]
          setup_custom_endpoint(options)
          @rackspace_must_reauthenticate = false
          @connection_options = options[:connection_options] || {}

          authenticate

          deprecation_warnings(options)

          @persistent = options[:persistent] || false
          @connection = Fog::Core::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
        end

        def request(params, parse_json = true)
          super
        rescue Excon::Errors::NotFound => error
          raise NotFound.slurp(error, self)
        rescue Excon::Errors::BadRequest => error
          raise BadRequest.slurp(error, self)
        rescue Excon::Errors::InternalServerError => error
          raise InternalServerError.slurp(error, self)
        rescue Excon::Errors::HTTPStatusError => error
          raise ServiceError.slurp(error, self)
        end

        def authenticate(options={})
          super({
                  :rackspace_api_key => @rackspace_api_key,
                  :rackspace_username => @rackspace_username,
                  :rackspace_auth_url => @rackspace_auth_url,
                  :connection_options => @connection_options
          })
        end

        def service_name
          :cloudNetworks
        end

        def request_id_header
          "x-networks-request-id"
        end

        def region
          @rackspace_region
        end

        def endpoint_uri(service_endpoint_url=nil)
          @uri = super(@rackspace_endpoint || service_endpoint_url, :rackspace_networking_v2_url)
        end

        private

        def setup_custom_endpoint(options)
          @rackspace_endpoint = Fog::Rackspace.normalize_url(options[:rackspace_networking_v2_url] || options[:rackspace_endpoint])

          if v2_authentication?
            case @rackspace_endpoint
            when NETWORKS_DFW_URL
              @rackspace_endpoint = nil
              @rackspace_region = :dfw
            when NETWORKS_ORD_URL
              @rackspace_endpoint = nil
              @rackspace_region = :ord
            when NETWORKS_LON_URL
              @rackspace_endpoint = nil
              @rackspace_region = :lon
            else
              # we are actually using a custom endpoint
              @rackspace_region = options[:rackspace_region]
            end
          else
            #if we are using auth1 and the endpoint is not set, default to NETWORKS_DFW_URL for historical reasons
            @rackspace_endpoint ||= NETWORKS_DFW_URL
          end
        end

        def deprecation_warnings(options)
          Fog::Logger.deprecation("The :rackspace_endpoint option is deprecated. Please use :rackspace_networking_v2_url for custom endpoints") if options[:rackspace_endpoint]

          if [NETWORKS_DFW_URL, NETWORKS_ORD_URL, NETWORKS_LON_URL].include?(@rackspace_endpoint) && v2_authentication?
            regions = @identity_service.service_catalog.display_service_regions(service_name)
            Fog::Logger.deprecation("Please specify region using :rackspace_region rather than :rackspace_endpoint. Valid regions for :rackspace_region are #{regions}.")
          end
        end

        def append_tenant_v1(credentials)
          account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1]

          endpoint = @rackspace_endpoint || credentials['X-Server-Management-Url'] || NETWORKS_DFW_URL
          @uri = URI.parse(endpoint)
          @uri.path = "#{@uri.path}/#{account_id}"
        end

        def authenticate_v1(options)
          credentials = Fog::Rackspace.authenticate(options, @connection_options)
          append_tenant_v1 credentials
          @auth_token = credentials['X-Auth-Token']
        end
      end
    end
  end
end


text:
package org.elasticsearch.search.aggregations.bucket.range;

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.AggregationStreams;
import org.elasticsearch.search.aggregations.Aggregations;
import org.elasticsearch.search.aggregations.InternalAggregation;
import org.elasticsearch.search.aggregations.InternalAggregations;
import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import org.elasticsearch.search.aggregations.support.ValueType;
import org.elasticsearch.search.aggregations.support.ValuesSourceType;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 *
 */
public class InternalRange<B extends InternalRange.Bucket, R extends InternalRange<B, R>> extends InternalMultiBucketAggregation<R, B>
        implements Range {

    static final Factory FACTORY = new Factory();

    public static final Type TYPE = new Type("range");

    private static final AggregationStreams.Stream STREAM = new AggregationStreams.Stream() {
        @Override
        public InternalRange readResult(StreamInput in) throws IOException {
            InternalRange ranges = new InternalRange();
            ranges.readFrom(in);
            return ranges;
        }
    };

    public static void registerStream() {
        AggregationStreams.registerStream(STREAM, TYPE.stream());
    }

    public static class Bucket extends InternalMultiBucketAggregation.InternalBucket implements Range.Bucket {

        protected final transient boolean keyed;
        protected final transient DocValueFormat format;
        protected double from;
        protected double to;
        private long docCount;
        InternalAggregations aggregations;
        private String key;

        public Bucket(boolean keyed, DocValueFormat formatter) {
            this.keyed = keyed;
            this.format = formatter;
        }

        public Bucket(String key, double from, double to, long docCount, InternalAggregations aggregations, boolean keyed,
                DocValueFormat formatter) {
            this(keyed, formatter);
            this.key = key != null ? key : generateKey(from, to, formatter);
            this.from = from;
            this.to = to;
            this.docCount = docCount;
            this.aggregations = aggregations;
        }

        @Override
        public String getKey() {
            return getKeyAsString();
        }

        @Override
        public String getKeyAsString() {
            return key;
        }

        @Override
        public Object getFrom() {
            return from;
        }

        @Override
        public Object getTo() {
            return to;
        }

        public boolean getKeyed() {
            return keyed;
        }

        public DocValueFormat getFormat() {
            return format;
        }

        @Override
        public String getFromAsString() {
            if (Double.isInfinite(from)) {
                return null;
            } else {
                return format.format(from);
            }
        }

        @Override
        public String getToAsString() {
            if (Double.isInfinite(to)) {
                return null;
            } else {
                return format.format(to);
            }
        }

        @Override
        public long getDocCount() {
            return docCount;
        }

        @Override
        public Aggregations getAggregations() {
            return aggregations;
        }

        protected Factory<? extends Bucket, ?> getFactory() {
            return FACTORY;
        }

        Bucket reduce(List<Bucket> ranges, ReduceContext context) {
            long docCount = 0;
            List<InternalAggregations> aggregationsList = new ArrayList<>(ranges.size());
            for (Bucket range : ranges) {
                docCount += range.docCount;
                aggregationsList.add(range.aggregations);
            }
            final InternalAggregations aggs = InternalAggregations.reduce(aggregationsList, context);
            return getFactory().createBucket(key, from, to, docCount, aggs, keyed, format);
        }

        @Override
        public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
            if (keyed) {
                builder.startObject(key);
            } else {
                builder.startObject();
                builder.field(CommonFields.KEY, key);
            }
            if (!Double.isInfinite(from)) {
                builder.field(CommonFields.FROM, from);
                if (format != DocValueFormat.RAW) {
                    builder.field(CommonFields.FROM_AS_STRING, format.format(from));
                }
            }
            if (!Double.isInfinite(to)) {
                builder.field(CommonFields.TO, to);
                if (format != DocValueFormat.RAW) {
                    builder.field(CommonFields.TO_AS_STRING, format.format(to));
                }
            }
            builder.field(CommonFields.DOC_COUNT, docCount);
            aggregations.toXContentInternal(builder, params);
            builder.endObject();
            return builder;
        }

        protected String generateKey(double from, double to, DocValueFormat formatter) {
            StringBuilder sb = new StringBuilder();
            sb.append(Double.isInfinite(from) ? "*" : formatter.format(from));
            sb.append("-");
            sb.append(Double.isInfinite(to) ? "*" : formatter.format(to));
            return sb.toString();
        }

        @Override
        public void readFrom(StreamInput in) throws IOException {

        }

        @Override
        public void writeTo(StreamOutput out) throws IOException {

        }
    }

    public static class Factory<B extends Bucket, R extends InternalRange<B, R>> {

        public Type type() {
            return TYPE;
        }

        public ValuesSourceType getValueSourceType() {
            return ValuesSourceType.NUMERIC;
        }

        public ValueType getValueType() {
            return ValueType.NUMERIC;
        }

        @SuppressWarnings("unchecked")
        public R create(String name, List<B> ranges, DocValueFormat formatter, boolean keyed, List<PipelineAggregator> pipelineAggregators,
                Map<String, Object> metaData) {
            return (R) new InternalRange<>(name, ranges, formatter, keyed, pipelineAggregators, metaData);
        }

        @SuppressWarnings("unchecked")
        public B createBucket(String key, double from, double to, long docCount, InternalAggregations aggregations, boolean keyed,
                DocValueFormat formatter) {
            return (B) new Bucket(key, from, to, docCount, aggregations, keyed, formatter);
        }

        @SuppressWarnings("unchecked")
        public R create(List<B> ranges, R prototype) {
            return (R) new InternalRange<>(prototype.name, ranges, prototype.format, prototype.keyed, prototype.pipelineAggregators(),
                    prototype.metaData);
        }

        @SuppressWarnings("unchecked")
        public B createBucket(InternalAggregations aggregations, B prototype) {
            return (B) new Bucket(prototype.getKey(), prototype.from, prototype.to, prototype.getDocCount(), aggregations, prototype.keyed,
                    prototype.format);
        }
    }

    private List<B> ranges;
    protected DocValueFormat format;
    protected boolean keyed;

    public InternalRange() {} // for serialization

    public InternalRange(String name, List<B> ranges, DocValueFormat format, boolean keyed,
            List<PipelineAggregator> pipelineAggregators,
            Map<String, Object> metaData) {
        super(name, pipelineAggregators, metaData);
        this.ranges = ranges;
        this.format = format;
        this.keyed = keyed;
    }

    @Override
    public Type type() {
        return TYPE;
    }

    @Override
    public List<B> getBuckets() {
        return ranges;
    }

    public Factory<B, R> getFactory() {
        return FACTORY;
    }

    @SuppressWarnings("unchecked")
    @Override
    public R create(List<B> buckets) {
        return getFactory().create(buckets, (R) this);
    }

    @Override
    public B createBucket(InternalAggregations aggregations, B prototype) {
        return getFactory().createBucket(aggregations, prototype);
    }

    @SuppressWarnings("unchecked")
    @Override
    public InternalAggregation doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
        List<Bucket>[] rangeList = new List[ranges.size()];
        for (int i = 0; i < rangeList.length; ++i) {
            rangeList[i] = new ArrayList<Bucket>();
        }
        for (InternalAggregation aggregation : aggregations) {
            InternalRange<B, R> ranges = (InternalRange<B, R>) aggregation;
            int i = 0;
            for (Bucket range : ranges.ranges) {
                rangeList[i++].add(range);
            }
        }

        final List<B> ranges = new ArrayList<>();
        for (int i = 0; i < this.ranges.size(); ++i) {
            ranges.add((B) rangeList[i].get(0).reduce(rangeList[i], reduceContext));
        }
        return getFactory().create(name, ranges, format, keyed, pipelineAggregators(), getMetaData());
    }

    @Override
    protected void doReadFrom(StreamInput in) throws IOException {
        format = in.readNamedWriteable(DocValueFormat.class);
        keyed = in.readBoolean();
        int size = in.readVInt();
        List<B> ranges = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            String key = in.readOptionalString();
            ranges.add(getFactory().createBucket(key, in.readDouble(), in.readDouble(), in.readVLong(), InternalAggregations.readAggregations(in), keyed, format));
        }
        this.ranges = ranges;
    }

    @Override
    protected void doWriteTo(StreamOutput out) throws IOException {
        out.writeNamedWriteable(format);
        out.writeBoolean(keyed);
        out.writeVInt(ranges.size());
        for (B bucket : ranges) {
            out.writeOptionalString(((Bucket) bucket).key);
            out.writeDouble(((Bucket) bucket).from);
            out.writeDouble(((Bucket) bucket).to);
            out.writeVLong(((Bucket) bucket).docCount);
            bucket.aggregations.writeTo(out);
        }
    }

    @Override
    public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException {
        if (keyed) {
            builder.startObject(CommonFields.BUCKETS);
        } else {
            builder.startArray(CommonFields.BUCKETS);
        }
        for (B range : ranges) {
            range.toXContent(builder, params);
        }
        if (keyed) {
            builder.endObject();
        } else {
            builder.endArray();
        }
        return builder;
    }

}


text:
package org.jetbrains.plugins.groovy.console;

import com.intellij.execution.Executor;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.execution.ui.RunContentManager;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.compiler.CompileContext;
import com.intellij.openapi.compiler.CompileStatusNotification;
import com.intellij.openapi.compiler.CompilerManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.util.Consumer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.GroovyBundle;

public class BuildAndRestartConsoleAction extends AnAction {

  private final Module myModule;
  private final Project myProject;
  private final Executor myExecutor;
  private final RunContentDescriptor myContentDescriptor;
  private final Consumer<? super Module> myRestarter;

  public BuildAndRestartConsoleAction(@NotNull Module module,
                                      @NotNull Project project,
                                      @NotNull Executor executor,
                                      @NotNull RunContentDescriptor contentDescriptor,
                                      @NotNull Consumer<? super Module> restarter) {
    super(
      GroovyBundle.message("action.build.restart.text"),
      GroovyBundle.message("action.build.module.restart.description", module.getName()),
      AllIcons.Actions.Restart
    );
    myModule = module;
    myProject = project;
    myExecutor = executor;
    myContentDescriptor = contentDescriptor;
    myRestarter = restarter;
  }

  @Override
  public @NotNull ActionUpdateThread getActionUpdateThread() {
    return ActionUpdateThread.BGT;
  }

  @Override
  public void update(@NotNull AnActionEvent e) {
    e.getPresentation().setEnabled(isEnabled());
  }

  private boolean isEnabled() {
    if (myModule == null || myModule.isDisposed()) return false;

    final ProcessHandler processHandler = myContentDescriptor.getProcessHandler();
    if (processHandler == null || processHandler.isProcessTerminated()) return false;

    return true;
  }

  @Override
  public void actionPerformed(@NotNull AnActionEvent e) {
    if (RunContentManager.getInstance(myProject).removeRunContent(myExecutor, myContentDescriptor)) {
      CompilerManager.getInstance(myProject).compile(myModule, new CompileStatusNotification() {
        @Override
        public void finished(boolean aborted, int errors, int warnings, @NotNull CompileContext compileContext) {
          if (!myModule.isDisposed()) {
            myRestarter.consume(myModule);
          }
        }
      });
    }
  }
}


text:
# EventEmitter – Cross-environment event emitter solution for JavaScript

## Installation
### NPM

In your project path:

	$ npm install event-emitter

### Browser

Browser bundle can be easily created with help of [modules-webmake](https://github.com/medikoo/modules-webmake).  Mind that it relies on some EcmaScript5 features, so for older browsers you need as well [es5-shim](https://github.com/kriskowal/es5-shim).

## Usage

```javascript
var ee = require('event-emitter');

var emitter = ee({}), listener;

emitter.on('test', listener = function (args) {
  // …emitter logic
});

emitter.once('test', function (args) {
  // …invoked only once(!)
});

emitter.emit('test', arg1, arg2/*…args*/); // Two above listeners invoked
emitter.emit('test', arg1, arg2/*…args*/); // Only first listener invoked

emitter.off('test', listener);              // Removed first listener
emitter.emit('test', arg1, arg2/*…args*/); // No listeners invoked
```

## Additional functionalities (provided as separate modules)

### allOff(obj)

Remove all listeners

```javascript
var eeAllOff = require('event-emitter/lib/all-off');
eeAllOff(emitter); // Removed all registered listeners on emitter
```

### pipe(emitter1, emitter2)

Pipe events from one emitter to other

```javascript
var eePipe = require('event-emitter/lib/pipe');

var emitter1 = ee(), listener1;
var emitter2 = ee(), listener2;

emitter1.on('test', listener1 = function () { });
emitter2.on('test', listener2 = function () { });

emitter1.emit('test'); // Invoked listener1
emitter2.emit('test'); // Invoked listener2

var pipe = eePipe(emitter1, emitter2);

emitter1.emit('test'); // Invoked listener1 and listener2
emitter2.emit('test'); // Invoked just listener2

pipe.close();

emitter1.emit('test'); // Invoked listener1
emitter2.emit('test'); // Invoked listener2
```

### hasListeners(obj[, type])

Whether given object have registered listeners

```javascript
var emitter = ee();
var hasListeners = require('event-emitter/lib/has-listeners');
var listner = function () {};

hasListeners(emitter); // false

emitter.on('foo', listener);
hasListeners(emitter); // true
hasListeners(emitter, 'foo'); // true
hasListeners(emitter, 'bar'); // false

emitter.off('foo', listener);
hasListeners(emitter, 'foo'); // false
```

## Tests [![Build Status](https://secure.travis-ci.org/medikoo/event-emitter.png?branch=master)](https://secure.travis-ci.org/medikoo/event-emitter)

	$ npm test


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated Nov 9, 2006 6:27:53 PM by Hibernate Tools 3.2.0.beta7 -->
<hibernate-mapping>
    <class name="org.hibernate.test.annotations.xml.hbm.AImpl" table="A"
           proxy="org.hibernate.test.annotations.xml.hbm.A">
        <id name="AId" column="aID" type="java.lang.Integer">
            <generator class="identity"/>
        </id>
    </class>
</hibernate-mapping>


text:
import hTools2.dialogs.glyphs.copy_paste
reload(hTools2.dialogs.glyphs.copy_paste)

hTools2.dialogs.glyphs.copy_paste.copyPasteGlyphDialog()


text:
<?php

namespace Atompulse\Component\Grid\Data\Source;

use Atompulse\Component\Grid\Data\Flow\Parameters;

use Propel\Runtime\Util\PropelModelPager;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\Collection\ArrayCollection;

/**
 * Class PropelDataSource
 * @package Atompulse\Component\Grid\Data\Source
 *
 * @author Petru Cojocar <petru.cojocar@gmail.com>
 */
class PropelDataSource implements DataSourceInterface
{
    /**
     * @var Parameters
     */
    protected $parameters = null;

    /**
     * @var ModelCriteria
     */
    protected $query = null;

    /**
     * @var PropelModelPager
     */
    protected $pager = null;

    /**
     * @var ArrayCollection
     */
    protected $data = null;

    /**
     * @param ModelCriteria $query
     */
    public function __construct(ModelCriteria $query)
    {
        $this->query = $query;
    }

    /**
     * Get the data from the source
     * @param Parameters $parameters
     * @return array|ArrayCollection
     */
    public function getData(Parameters $parameters)
    {
        $this->parameters = $parameters;

        // Get the PropelModelPager instance
        $this->pager = $this->query->paginate($parameters->page, $parameters->pageSize);

        if (!$this->data) {
            $this->data = $this->pager->getResults()->getData();
        }

        return $this->data;
    }

    /**
     * Current page number
     * @return int
     */
    public function getCurrentPageNumber()
    {
        return $this->pager->getPage();
    }

    /**
     * Total pages
     * @return int
     */
    public function getTotalPages()
    {
        return $this->pager->getLastPage();
    }

    /**
     * Get range of pages
     * @param int $nrOfLinks
     * @return array
     */
    public function getPages($nrOfLinks = 5)
    {
        return $this->pager->getLinks($nrOfLinks);
    }

    /**
     * Check if there's pagination required
     * @return bool
     */
    public function haveToPaginate()
    {
        return $this->pager->haveToPaginate();
    }

    /**
     * Total number of records
     * @return int
     */
    public function getTotalRecords()
    {
        return $this->pager->getNbResults();
    }

    /**
     * Current number of records
     * @return int
     */
    public function getCurrentNumberOfRecords()
    {
        return count($this->data);
    }

}


text:
.class Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate$2;
.super Ljava/lang/Object;
.source "KeyguardServiceDelegate.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate;->showScrim()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate;

# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate;)V
    .locals 0

    .prologue
    .line 309
    iput-object p1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate$2;->this$0:Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 2

    .prologue
    .line 312
    const-string v0, "KeyguardServiceDelegate"

    const-string v1, "showScrim() - mScrim.setVisibility(View.VISIBLE)"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 313
    iget-object v0, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate$2;->this$0:Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate;

    # getter for: Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate;->mScrim:Landroid/view/View;
    invoke-static {v0}, Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate;->access$300(Lcom/android/internal/policy/impl/keyguard/KeyguardServiceDelegate;)Landroid/view/View;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    .line 314
    return-void
.end method


text:
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.Extensions.DependencyModel;

namespace Serilog.Settings.Configuration.Assemblies
{
    abstract class AssemblyFinder
    {
        public abstract IReadOnlyList<AssemblyName> FindAssembliesContainingName(string nameToFind);

        protected static bool IsCaseInsensitiveMatch(string text, string textToFind)
        {
            return text != null && text.ToLowerInvariant().Contains(textToFind.ToLowerInvariant());
        }

        public static AssemblyFinder Auto()
        {
            try
            {
                // Need to check `Assembly.GetEntryAssembly()` first because
                // `DependencyContext.Default` throws an exception when `Assembly.GetEntryAssembly()` returns null
                if (Assembly.GetEntryAssembly() != null && DependencyContext.Default != null)
                {
                    return new DependencyContextAssemblyFinder(DependencyContext.Default);
                }
            }
            catch (NotSupportedException) when (typeof(object).Assembly.Location is "") // bundled mode detection
            {
            }

            return new DllScanningAssemblyFinder();
        }

        public static AssemblyFinder ForSource(ConfigurationAssemblySource configurationAssemblySource)
        {
            return configurationAssemblySource switch
            {
                ConfigurationAssemblySource.UseLoadedAssemblies => Auto(),
                ConfigurationAssemblySource.AlwaysScanDllFiles => new DllScanningAssemblyFinder(),
                _ => throw new ArgumentOutOfRangeException(nameof(configurationAssemblySource), configurationAssemblySource, null),
            };
        }

        public static AssemblyFinder ForDependencyContext(DependencyContext dependencyContext)
        {
            return new DependencyContextAssemblyFinder(dependencyContext);
        }
    }
}


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

Ext.ns('Ext.calendar');

 (function() {
    Ext.apply(Ext.calendar, {
        Date: {
            diffDays: function(start, end) {
                day = 1000 * 60 * 60 * 24;
                diff = end.clearTime(true).getTime() - start.clearTime(true).getTime();
                return Math.ceil(diff / day);
            },

            copyTime: function(fromDt, toDt) {
                var dt = toDt.clone();
                dt.setHours(
                fromDt.getHours(),
                fromDt.getMinutes(),
                fromDt.getSeconds(),
                fromDt.getMilliseconds());

                return dt;
            },

            compare: function(dt1, dt2, precise) {
                if (precise !== true) {
                    dt1 = dt1.clone();
                    dt1.setMilliseconds(0);
                    dt2 = dt2.clone();
                    dt2.setMilliseconds(0);
                }
                return dt2.getTime() - dt1.getTime();
            },

            // private helper fn
            maxOrMin: function(max) {
                var dt = (max ? 0: Number.MAX_VALUE),
                i = 0,
                args = arguments[1],
                ln = args.length;
                for (; i < ln; i++) {
                    dt = Math[max ? 'max': 'min'](dt, args[i].getTime());
                }
                return new Date(dt);
            },

            max: function() {
                return this.maxOrMin.apply(this, [true, arguments]);
            },

            min: function() {
                return this.maxOrMin.apply(this, [false, arguments]);
            }
        }
    });
})();


text:
package linkedhashmap

import (
	"github.com/emirpasic/gods/containers"
	"github.com/emirpasic/gods/lists/doublylinkedlist"
)

func assertIteratorImplementation() {
	var _ containers.ReverseIteratorWithKey = (*Iterator)(nil)
}

// Iterator holding the iterator's state
type Iterator struct {
	iterator doublylinkedlist.Iterator
	table    map[interface{}]interface{}
}

// Iterator returns a stateful iterator whose elements are key/value pairs.
func (m *Map) Iterator() Iterator {
	return Iterator{
		iterator: m.ordering.Iterator(),
		table:    m.table}
}

// Next moves the iterator to the next element and returns true if there was a next element in the container.
// If Next() returns true, then next element's key and value can be retrieved by Key() and Value().
// If Next() was called for the first time, then it will point the iterator to the first element if it exists.
// Modifies the state of the iterator.
func (iterator *Iterator) Next() bool {
	return iterator.iterator.Next()
}

// Prev moves the iterator to the previous element and returns true if there was a previous element in the container.
// If Prev() returns true, then previous element's key and value can be retrieved by Key() and Value().
// Modifies the state of the iterator.
func (iterator *Iterator) Prev() bool {
	return iterator.iterator.Prev()
}

// Value returns the current element's value.
// Does not modify the state of the iterator.
func (iterator *Iterator) Value() interface{} {
	key := iterator.iterator.Value()
	return iterator.table[key]
}

// Key returns the current element's key.
// Does not modify the state of the iterator.
func (iterator *Iterator) Key() interface{} {
	return iterator.iterator.Value()
}

// Begin resets the iterator to its initial state (one-before-first)
// Call Next() to fetch the first element if any.
func (iterator *Iterator) Begin() {
	iterator.iterator.Begin()
}

// End moves the iterator past the last element (one-past-the-end).
// Call Prev() to fetch the last element if any.
func (iterator *Iterator) End() {
	iterator.iterator.End()
}

// First moves the iterator to the first element and returns true if there was a first element in the container.
// If First() returns true, then first element's key and value can be retrieved by Key() and Value().
// Modifies the state of the iterator
func (iterator *Iterator) First() bool {
	return iterator.iterator.First()
}

// Last moves the iterator to the last element and returns true if there was a last element in the container.
// If Last() returns true, then last element's key and value can be retrieved by Key() and Value().
// Modifies the state of the iterator.
func (iterator *Iterator) Last() bool {
	return iterator.iterator.Last()
}


text:
<?php

/* Language file for MultiMerch Comments Addon */

$_['ms_account_dashboard_comments'] = 'Last comments';

// Account - Comments
$_['ms_account_comments_name'] = 'Name';
$_['ms_account_comments_product'] = 'Product';
$_['ms_account_comments_comment'] = 'Comment';
$_['ms_account_comments_nocomments'] = 'You don\'t have any comments yet!';

// Product page - Comments
$_['ms_comments_post_comment'] = 'Post Comment';
$_['ms_comments_name'] = 'Name';
$_['ms_comments_note'] = 'Note: HTML is not translated!';
$_['ms_comments_email'] = 'E-mail';
$_['ms_comments_comment'] = 'Comment';
$_['ms_comments_wait'] = 'Please Wait!';
$_['ms_comments_login_register'] = 'Please login or register to post a comment.';
$_['ms_comments_error_name'] = 'Please enter a name between %s and %s characters long';
$_['ms_comments_error_email'] = 'Please enter a valid email';
$_['ms_comments_error_comment_short'] = 'The comment body must be at least %s characters long';
$_['ms_comments_error_comment_long'] = 'The comment body cannot be longer than %s characters';
$_['ms_comments_error_captcha'] = 'Verification code does not match the image';
$_['ms_comments_success'] = 'Thank you for your comment.';
$_['ms_comments_captcha'] = 'Enter the code in the box below:';
$_['ms_comments_no_comments_yet'] = 'No comments added yet';
$_['ms_comments_tab_comments'] = 'Comments (%s)';

$_['ms_catalog_seller_profile_tab_comments'] = 'Comments';

?>


text:
int callRunTests(WrenVM* vm)
{
  wrenEnsureSlots(vm, 1);
  wrenGetVariable(vm, "./test/api/call", "Call", 0);
  WrenHandle* callClass = wrenGetSlotHandle(vm, 0);

  WrenHandle* noParams = wrenMakeCallHandle(vm, "noParams");
  WrenHandle* zero = wrenMakeCallHandle(vm, "zero()");
  WrenHandle* one = wrenMakeCallHandle(vm, "one(_)");
  WrenHandle* two = wrenMakeCallHandle(vm, "two(_,_)");
  WrenHandle* unary = wrenMakeCallHandle(vm, "-");
  WrenHandle* binary = wrenMakeCallHandle(vm, "-(_)");
  WrenHandle* subscript = wrenMakeCallHandle(vm, "[_,_]");
  WrenHandle* subscriptSet = wrenMakeCallHandle(vm, "[_,_]=(_)");

  // Different arity.
  wrenEnsureSlots(vm, 1);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenCall(vm, noParams);

  wrenEnsureSlots(vm, 1);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenCall(vm, zero);

  wrenEnsureSlots(vm, 2);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotDouble(vm, 1, 1.0);
  wrenCall(vm, one);

  wrenEnsureSlots(vm, 3);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotDouble(vm, 1, 1.0);
  wrenSetSlotDouble(vm, 2, 2.0);
  wrenCall(vm, two);

  // Operators.
  wrenEnsureSlots(vm, 1);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenCall(vm, unary);

  wrenEnsureSlots(vm, 2);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotDouble(vm, 1, 1.0);
  wrenCall(vm, binary);

  wrenEnsureSlots(vm, 3);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotDouble(vm, 1, 1.0);
  wrenSetSlotDouble(vm, 2, 2.0);
  wrenCall(vm, subscript);

  wrenEnsureSlots(vm, 4);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotDouble(vm, 1, 1.0);
  wrenSetSlotDouble(vm, 2, 2.0);
  wrenSetSlotDouble(vm, 3, 3.0);
  wrenCall(vm, subscriptSet);

  // Returning a value.
  WrenHandle* getValue = wrenMakeCallHandle(vm, "getValue()");
  wrenEnsureSlots(vm, 1);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenCall(vm, getValue);
  printf("slots after call: %d\n", wrenGetSlotCount(vm));
  WrenHandle* value = wrenGetSlotHandle(vm, 0);

  // Different argument types.
  wrenEnsureSlots(vm, 3);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotBool(vm, 1, true);
  wrenSetSlotBool(vm, 2, false);
  wrenCall(vm, two);

  wrenEnsureSlots(vm, 3);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotDouble(vm, 1, 1.2);
  wrenSetSlotDouble(vm, 2, 3.4);
  wrenCall(vm, two);

  wrenEnsureSlots(vm, 3);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotString(vm, 1, "string");
  wrenSetSlotString(vm, 2, "another");
  wrenCall(vm, two);

  wrenEnsureSlots(vm, 3);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotNull(vm, 1);
  wrenSetSlotHandle(vm, 2, value);
  wrenCall(vm, two);

  // Truncate a string, or allow null bytes.
  wrenEnsureSlots(vm, 3);
  wrenSetSlotHandle(vm, 0, callClass);
  wrenSetSlotBytes(vm, 1, "string", 3);
  wrenSetSlotBytes(vm, 2, "b\0y\0t\0e", 7);
  wrenCall(vm, two);

  // Call ignores with extra temporary slots on stack.
  wrenEnsureSlots(vm, 10);
  wrenSetSlotHandle(vm, 0, callClass);
  for (int i = 1; i < 10; i++)
  {
    wrenSetSlotDouble(vm, i, i * 0.1);
  }
  wrenCall(vm, one);

  wrenReleaseHandle(vm, callClass);
  wrenReleaseHandle(vm, noParams);
  wrenReleaseHandle(vm, zero);
  wrenReleaseHandle(vm, one);
  wrenReleaseHandle(vm, two);
  wrenReleaseHandle(vm, getValue);
  wrenReleaseHandle(vm, value);
  wrenReleaseHandle(vm, unary);
  wrenReleaseHandle(vm, binary);
  wrenReleaseHandle(vm, subscript);
  wrenReleaseHandle(vm, subscriptSet);

  return 0;
}