text:
<?php
namespace Chat\ApplicationBundle\Entity;

use Doctrine\ORM\Mapping AS ORM;
use JMS\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
use Hateoas\Configuration\Annotation as Hateoas;

/**
 * @ORM\Entity(repositoryClass="Chat\ApplicationBundle\Entity\Repository\TopicRepository")
 *
 * @Hateoas\Relation(
 *      "self",
 *      href = @Hateoas\Route(
 *          "chat_application_topic_get",
 *          parameters = {
 *              "id" = "expr(object.getId())"
 *          }
 *      )
 * )
 *
 * @Serializer\ExclusionPolicy("none")
 */
class Topic
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=100, nullable=true)
     *
     * @Assert\Length(min = "2", max = "100")
     * @Assert\NotNull
     */
    private $title;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $description;

    /**
     * @ORM\OneToMany(targetEntity="Message", mappedBy="Topic")
     *
     * @serializer\Exclude
     */
    private $Messages;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->Messages = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set title
     *
     * @param string $title
     * @return Topic
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set description
     *
     * @param string $description
     * @return Topic
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Add Messages
     *
     * @param \Chat\ApplicationBundle\Entity\Message $messages
     * @return Topic
     */
    public function addMessage(\Chat\ApplicationBundle\Entity\Message $messages)
    {
        $this->Messages[] = $messages;

        return $this;
    }

    /**
     * Remove Messages
     *
     * @param \Chat\ApplicationBundle\Entity\Message $messages
     */
    public function removeMessage(\Chat\ApplicationBundle\Entity\Message $messages)
    {
        $this->Messages->removeElement($messages);
    }

    /**
     * Get Messages
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getMessages()
    {
        return $this->Messages;
    }
}


text:
package edu.mit.ll.nics.common.entity;

// Generated Sep 30, 2011 1:24:44 PM by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

/**
 * MessagePermissions generated by hbm2java
 */
@Entity
@Proxy(lazy=false)
@Table(name = "messagepermissions")
public class MessagePermissions implements SADisplayPersistedEntity {

	private int systemroleid;
	private String messageType;

	public MessagePermissions() {
	}

	public MessagePermissions(int systemroleid, String message) {
		this.systemroleid = systemroleid;
		this.messageType = message;
	}

	@Id
	@Column(name = "systemroleid", nullable = false)
	public int getSystemroleid() {
		return this.systemroleid;
	}

	public void setSystemroleid(int systemroleid) {
		this.systemroleid = systemroleid;
	}

	@Column(name = "messagetype", length = 50)
	public String getMessageType() {
		return this.messageType;
	}

	public void setMessageType(String messageType) {
		this.messageType = messageType;
	}
}

redpajama_set_name: RedPajamaGithub


text:
require 'twilio-ruby/rest/base_client'
module Twilio
  module REST
    class LookupsClient < BaseClient
      API_VERSION = 'v1'

      attr_reader :phone_numbers

      host 'lookups.twilio.com'

      ##
      # Instantiate a new HTTP Lookups client to talk to Twilio. The parameters
      # +account_sid+, +auth_token+ and +workspace_sid are required, unless you
      # have configured them already using the block configure syntax, and used
      # to generate the HTTP basic auth header in each request. The +options+
      # parameter is a hash of connection configuration options. the following
      # keys are supported:
      #
      # === <tt>host: 'lookups.twilio.com'</tt>
      #
      # The domain to which you'd like the client to make HTTP requests. Useful
      # for testing. Defaults to 'lookups.twilio.com'.
      #
      # === <tt>port: 443</tt>
      #
      # The port on which to connect to the above domain. Defaults to 443 and
      # should be left that way except in testing environments.
      #
      # === <tt>use_ssl: true</tt>
      #
      # Declare whether ssl should be used for connections to the above domain.
      # Defaults to true and should be left alone except when testing.
      #
      # === <tt>ssl_verify_peer: true</tt>
      #
      # Declare whether to verify the host's ssl cert when setting up the
      # connection to the above domain. Defaults to true, but can be turned off
      # to avoid ssl certificate verification failures in environments without
      # the necessary ca certificates.
      #
      # === <tt>ssl_ca_file: '/path/to/ca/file'</tt>
      #
      # Specify the path to the certificate authority bundle you'd like to use
      # to verify Twilio's SSL certificate on each request. If not specified, a
      # certificate bundle extraced from Firefox is packaged with the gem and
      # used by default.
      #
      # === <tt>timeout: 30</tt>
      #
      # Set the time in seconds to wait before timing out the HTTP request.
      # Defaults to 30 seconds. If you aren't fetching giant pages of call or
      # SMS logs you can safely decrease this to something like 3 seconds or
      # lower. In paricular if you are sending SMS you can set this to 1 second
      # or less and swallow the exception if you don't care about the response.
      #
      # === <tt>proxy_addr: 'proxy.host.domain'</tt>
      #
      # The domain of a proxy through which you'd like the client to make HTTP
      # requests. Defaults to nil.
      #
      # === <tt>proxy_port: 3128</tt>
      #
      # The port on which to connect to the above proxy. Defaults to nil.
      #
      # === <tt>proxy_user: 'username'</tt>
      #
      # The user name to use for authentication with the proxy. Defaults to nil.
      #
      # === <tt>proxy_pass: 'password'</tt>
      #
      # The password to use for authentication with the proxy. Defaults to nil.
      #
      # === <tt>retry_limit: 1</tt>
      #
      # The number of times to retry a request that has failed before throwing
      # an exception. Defaults to one.
      def inspect # :nodoc:
        "<Twilio::REST::LookupsClient @account_sid=#{@account_sid}>"
      end

      protected

      ##
      # Set up +phone_numbers+ attribute.
      def set_up_subresources # :doc:
        @phone_numbers = Twilio::REST::Lookups::PhoneNumbers.new "/#{API_VERSION}/PhoneNumbers", self
      end

      ##
      # Builds up full request path
      def build_full_path(path, params, method)
        path = path.dup
        path << "?#{url_encode(params)}" if method == :get && !params.empty?
        path
      end

    end
  end
end


text:
package implement_strStr

import (
	"fmt"
	"testing"
)

func TestStrStr(t *testing.T) {
	haystack := "bonjour"
	needle := "jour"
	fmt.Println(strStr(haystack, needle))

	haystack = "bonjour"
	needle = "hello"
	fmt.Println(strStr(haystack, needle))
}


text:
package org.togglz.spring.test;

import org.togglz.core.Feature;
import org.togglz.core.annotation.EnabledByDefault;
import org.togglz.core.context.FeatureContext;

public enum BasicFeatures implements Feature {

    FEATURE1,

    @EnabledByDefault
    FEATURE2;

    public boolean isActive() {
        return FeatureContext.getFeatureManager().isActive(this);
    }

}


text:
package com.emitrom.ti4j.mobile.client.filesystem;

import com.emitrom.ti4j.mobile.client.core.TiFactory;
import com.emitrom.ti4j.mobile.client.core.TiModule;

/**
 * The top level filesystem module. the filesystem module is used for reading
 * and saving files and directories on the device.
 */
public class FileSystem extends TiModule {

    public static final int MODE_APPEND = MODE_APPEND();
    public static final int MODE_READ = MODE_READ();
    public static final int MODE_WRITE = MODE_WRITE();

    private static FileSystem instance = null;

    public static FileSystem get() {
        if (instance == null) {
            instance = new FileSystem();
        }
        return instance;
    }

    private FileSystem() {
        createPeer();
    }

    /**
     * @return Readonly constant where your application data directory is
     *         located. this directory should be used to place
     *         applications-specific files. on iphone, this directory is also
     *         backed up.
     */
    public native String getApplicationDataDirectory() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.applicationDataDirectory;
    }-*/;

    /**
     * @return Readonly constant where your application is located
     */
    public native String getApplicationDirectory() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.applicationDirectory;
    }-*/;

    /**
     * @return Readonly platform specific line ending constant
     */
    public native String getLineEnding() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.lineEnding;
    }-*/;

    /**
     * @return Readonly constant where your application resources are located
     */
    public native String getResourcesDirectory() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.resourcesDirectory;
    }-*/;

    /**
     * @return Readonly path separator constant
     */
    public native String getSeparator() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.separator;
    }-*/;

    /**
     * @return Readonly constant where your application can place temporary
     *         files
     */
    public native String getTempDirectory() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.tempDirectory;
    }-*/;

    public static native File createFile() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		var obj = jso.createFile();
		var toReturn = @com.emitrom.ti4j.mobile.client.filesystem.File::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj);
		return toReturn;
    }-*/;

    public native FileStream createFileStream() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		var obj = jso.createFileStream();
		var toReturn = @com.emitrom.ti4j.mobile.client.filesystem.FileStream::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj);
		return toReturn;
    }-*/;

    /**
     * Create temp file and return a
     * {@link com.emitrom.ti4j.mobile.client.filesystem.File}
     */
    public native File createTempDirectory() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		var obj = jso.createTempDirectory();
		var toReturn = @com.emitrom.ti4j.mobile.client.filesystem.File::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj);
		return toReturn;
    }-*/;

    /**
     * Create a temp file and return a
     * {@link com.emitrom.ti4j.mobile.client.filesystem.File}
     */
    public native File createTempFile() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		var obj = jso.createTempFile();
		var toReturn = @com.emitrom.ti4j.mobile.client.filesystem.File::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj);
		return toReturn;
    }-*/;

    /**
     * Return a fully formed file path as a
     * {@link com.emitrom.ti4j.mobile.client.filesystem.File} object
     *
     * @param path
     *            one or more path arguments to form the full path joined
     *            together with the platform specific path separator. if a
     *            relative path is passed, the full path will be relative to the
     *            application resource folder.
     */
    public native File getFile(String path) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		var obj = jso.getFile(path);
		var toReturn = @com.emitrom.ti4j.mobile.client.filesystem.File::new(Lcom/google/gwt/core/client/JavaScriptObject;)(obj);
		return toReturn;
    }-*/;

    public static native boolean isExternalStoragePresent() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.isExternalStoragePresent();
    }-*/;

    private static native final int MODE_APPEND() /*-{
		return Titanium.Filesystem.MODE_APPEND;
    }-*/;

    private static native final int MODE_READ() /*-{
		return Titanium.Filesystem.MODE_READ;
    }-*/;

    private static native final int MODE_WRITE() /*-{
		return Titanium.Filesystem.MODE_WRITE;
    }-*/;

    @Override
    public void createPeer() {
        jsObj = TiFactory.createNativeFileSystemModule();
    }

}


text:
"use strict";

require("rootpath")();

const Event = require("components/api/events/events.model");
const Goal = require("components/api/goals/goals.model");
const settings = require(`configs/environments/settings.${process.env.NODE_ENV || "development"}`);
const select = "_id name description category hashtags media location completed publicGoalId isPrivate createdAt";
const winston = require("winston");

module.exports.getGoals = (req, res) => {
    let redirect = req.body.redirect || false;
    let errorObj = {};
    let successObj = {};
    let pageSize = parseInt(req.query.pageSize || settings.api.results.defaultPageSize || 1);
    let page = parseInt(req.query.page || 0);
    let filter = {};

    if (req.query.isPrivate) {
        filter.isPrivate = req.query.isPrivate;
    }

    if (req.query._id) {
        filter._id = req.query._id;
    }

    if (req.query._ids) {
        let idList = req.query._ids;
        filter._id = {
            $in: idList
        };
    }

    Goal.paginate(filter, {
        select,
        offset: page * pageSize,
        limit: pageSize
    }, (err, goals) => {
        if (err) {
            winston.error(JSON.stringify(err));
            errorObj = {
                success: false,
                errCode: "0001",
                errMsg: "Failed to get goals.",
                redirect: redirect
            };
            return res.status(500).send(errorObj);
        }

        successObj = {
            success: true,
            msg: "Goals retrieved successfully.",
            goals: goals.docs,
            totalResults: goals.total,
            pageSize: pageSize,
            page: page,
            nextPage: `${settings.server.http.host}:${settings.server.http.port}/api/goals?page=${page+1}`,
            previousPage: (page - 1 < 0) ? false : `${settings.server.http.host}:${settings.server.http.port}/api/goals?page=${page-1}`,
            redirect: redirect
        };

        return res.status(200).send(successObj);
    });
};

module.exports.searchGoals = (req, res) => {
    let redirect = req.body.redirect || false;
    let errorObj = {};
    let successObj = {};
    let pageSize = parseInt(req.query.pageSize || settings.api.results.defaultPageSize || 1);
    let page = parseInt(req.query.page || 0);
    let searchSelect = "_id name hashtags";
    let filter = {
        $text: {
            $search: req.body.searchText
        }
    };

    if (req.query.isPrivate) {
        filter.isPrivate = req.query.isPrivate;
    }

    Goal.paginate(
        filter, {
            select,
            offset: page * pageSize,
            limit: pageSize
        }, (err, goals) => {
            if (err) {
                winston.error(JSON.stringify(err));
                errorObj = {
                    success: false,
                    errCode: "0016",
                    errMsg: "Failed to get goals.",
                    redirect: redirect
                };
                return res.status(200).send(errorObj);
            }

            successObj = {
                success: true,
                msg: "Goals retrieved successfully.",
                goals: goals.docs,
                totalResults: goals.total,
                pageSize: pageSize,
                page: page,
                nextPage: `${settings.server.http.host}:${settings.server.http.port}/api/goals?page=${page+1}`,
                previousPage: (page - 1 < 0) ? false : `${settings.server.http.host}:${settings.server.http.port}/api/goals?page=${page-1}`,
                redirect: redirect
            };

            return res.status(200).send(successObj);
        });
};

module.exports.createGoal = (req, res) => {
    let redirect = req.body.redirect || false;
    let errorObj = {};
    let successObj = {};

    if (!req.body.goal) {
        errorObj = {
            success: false,
            errCode: "0002",
            errMsg: "No goal data supplied",
            redirect: redirect
        };
        return res.status(200).send(errorObj);
    }

    let goal = new Goal({
        name: req.body.goal.name,
        description: req.body.goal.description,
        category: req.body.goal.category,
        hashtags: req.body.goal.hashtags,
        location: req.body.goal.location,
        media: req.body.goal.media,
        completed: req.body.goal.completed,
        publicGoalId: req.body.goal.publicGoalId,
        isPrivate: req.body.goal.isPrivate
    });

    if (req.body.goal._id) {
        goal._id = req.body.goal._id;
    }

    goal.save(function (err) {
        if (err && err.name === "ValidationError") {
            winston.error(JSON.stringify(err.errors));
            errorObj = {
                success: false,
                errCode: "0006",
                errMsg: "Validation error creating goal.",
                msg: JSON.stringify(err.errors),
                redirect: redirect
            };
            return res.status(200).send(errorObj);
        } else if (err) {
            winston.error(JSON.stringify(err));
            errorObj = {
                success: false,
                errCode: "0007",
                errMsg: "Error creating goal.",
                redirect: redirect
            };
            return res.status(200).send(errorObj);
        } else {
            successObj = {
                success: true,
                msg: "Goal created successfully.",
                goal: {
                    _id: goal._id,
                    name: goal.name,
                    description: goal.description,
                    category: goal.category,
                    hashtags: goal.hashtags,
                    location: goal.location,
                    media: goal.media,
                    completed: goal.completed,
                    publicGoalId: goal.publicGoalId,
                    isPrivate: goal.isPrivate
                },
                redirect: redirect
            };
            return res.status(201).send(successObj);
        }
    });
};

module.exports.updateGoalById = (req, res) => {
    let redirect = req.body.redirect || false;
    let errorObj = {};
    let successObj = {};

    Goal.findOne({
        _id: req.params._id
    }, (err, goal) => {
        if (!goal) {
            errorObj = {
                success: false,
                errCode: "0013",
                errMsg: "Goal does not exist.",
                redirect: redirect
            };

            return res.status(404).send(errorObj);
        }

        if (err) {
            winston.error(JSON.stringify(err));
            errorObj = {
                success: false,
                errCode: "0014",
                errMsg: "Failed to update goal.",
                msg: JSON.stringify(err),
                redirect: redirect
            };
            return res.status(500).send(errorObj);
        }

        let updategoal = {
            $set: {
                name: req.body.goal.name,
                description: req.body.goal.description,
                category: req.body.goal.category,
                hashtags: req.body.goal.hashtags,
                location: req.body.goal.location,
                media: req.body.goal.media,
                completed: req.body.goal.completed,
                publicGoalId: req.body.goal.publicGoalId,
                isPrivate: req.body.goal.isPrivate
            }
        }

        Goal.update({
            _id: goal._id
        }, updategoal, {
            upsert: false
        }, (err) => {
            if (err) {
                winston.error(JSON.stringify(err));
                errorObj = {
                    success: false,
                    errCode: "0015",
                    errMsg: "Failed to update goal.",
                    msg: JSON.stringify(err),
                    redirect: redirect
                };
                return res.status(200).send(errorObj);
            }

            successObj = {
                success: true,
                msg: "Goal updated successfully.",
                goal: {
                    _id: goal._id,
                    name: req.body.goal.name,
                    description: req.body.goal.description,
                    category: req.body.goal.category,
                    hashtags: req.body.goal.hashtags,
                    location: req.body.goal.location,
                    media: req.body.goal.media,
                    completed: req.body.goal.completed,
                    publicGoalId: req.body.goal.publicGoalId,
                    isPrivate: req.body.goal.isPrivate
                },
                redirect: redirect
            };
            return res.status(200).send(successObj);
        });
    });
};

module.exports.deleteGoalById = (req, res) => {
    let redirect = req.body.redirect || false;
    let errorObj = {};
    let successObj = {};

    Goal.remove({
        _id: req.params._id
    }, function (err) {
        if (err) {
            winston.error(JSON.stringify(err));
            errorObj = {
                success: false,
                errCode: "0011",
                errMsg: "Error deleting goal.",
                msg: JSON.stringify(err),
                redirect: redirect
            };
            return res.status(200).send(errorObj);
        }

        successObj = {
            success: true,
            msg: "Goal deleted successfully.",
            redirect: redirect
        };
        return res.status(200).send(successObj);
    });
};


text:
package com.facebook.common.references;

import com.facebook.common.internal.Preconditions;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Nullsafe;
import javax.annotation.Nullable;

@Nullsafe(Nullsafe.Mode.STRICT)
public class DefaultCloseableReference<T> extends CloseableReference<T> {

  private static final String TAG = "DefaultCloseableReference";

  private DefaultCloseableReference(
      SharedReference<T> sharedReference, LeakHandler leakHandler, @Nullable Throwable stacktrace) {
    super(sharedReference, leakHandler, stacktrace);
  }

  /*package*/ DefaultCloseableReference(
      T t,
      ResourceReleaser<T> resourceReleaser,
      LeakHandler leakHandler,
      @Nullable Throwable stacktrace) {
    super(t, resourceReleaser, leakHandler, stacktrace, true);
  }

  @Override
  public CloseableReference<T> clone() {
    Preconditions.checkState(isValid());
    return new DefaultCloseableReference<T>(
        mSharedReference, mLeakHandler, mStacktrace != null ? new Throwable(mStacktrace) : null);
  }

  @Override
  protected void finalize() throws Throwable {
    try {
      // We put synchronized here so that lint doesn't warn about accessing mIsClosed, which is
      // guarded by this. Lint isn't aware of finalize semantics.
      synchronized (this) {
        if (mIsClosed) {
          return;
        }
      }

      T ref = mSharedReference.get();
      FLog.w(
          TAG,
          "Finalized without closing: %x %x (type = %s)",
          System.identityHashCode(this),
          System.identityHashCode(mSharedReference),
          ref == null ? null : ref.getClass().getName());

      mLeakHandler.reportLeak((SharedReference<Object>) mSharedReference, mStacktrace);

      close();
    } finally {
      super.finalize();
    }
  }
}


text:
var TestRunner = require("../../test-runner.js"),
    test = new TestRunner();

describe("cuetext/tag-format tests", function(){

  before(function(onDone) {
    test.init(onDone);
  });

  after(function() {
    test.shutdown();
  });

  it("bogus-span-name.vtt", function(onDone){
    test.jsonEqualAll("cuetext/tag-format/bogus-span-name.vtt", "cuetext/tag-format/bogus-span-name.json", onDone);
  });

  it("end-tag-no-gt.vtt", function(onDone){
    test.jsonEqualAll("cuetext/tag-format/end-tag-no-gt.vtt", "cuetext/tag-format/end-tag-no-gt.json", onDone);
  });

  it("incorrect-close-tag-order.vtt", function(onDone){
    test.jsonEqualAll("cuetext/tag-format/incorrect-close-tag-order.vtt", "cuetext/tag-format/incorrect-close-tag-order.json", onDone);
  });

  it("no-closing-gt", function(onDone){
    test.jsonEqualAll("cuetext/tag-format/no-closing-gt.vtt", "cuetext/tag-format/no-closing-gt.json", onDone);
  });

  it("no-start-tag.vtt", function(onDone){
    test.jsonEqualAll("cuetext/tag-format/no-start-tag.vtt", "cuetext/tag-format/no-start-tag.json", onDone);
  });

  it("start-tag-missing-gt.vtt", function(onDone){
    test.jsonEqualAll("cuetext/tag-format/start-tag-missing-gt.vtt", "cuetext/tag-format/start-tag-missing-gt.json", onDone);
  });

});


text:
Adds support to Ruby for encrypting, decrypting, signing and validating
the signatures of XML documents, according to the [XML Encryption Syntax and
Processing](http://www.w3.org/TR/xmlenc-core/) standard, by wrapping around the
[xmlsec](http://www.aleksey.com/xmlsec) C library and adding relevant methods
to `Nokogiri::XML::Document`.

## Installation

Add this line to your application's Gemfile:

    gem 'nokogiri-xmlsec'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install nokogiri-xmlsec

## Usage

Several methods are added to `Nokogiri::XML::Document` which expose this gem's
functionality.

### Signing

The `sign!` method adds a digital signature to the XML document so that it can
later be determined whether the document itself has been tampered with. If the
document changes, the signature will be invalid.

Signing a document will add XML nodes directly to the document itself, and
then returns itself.

    # First, get an XML document
    doc = Nokogiri::XML("<doc><greeting>Hello, World!</greeting></doc>")

    # Sign the document with a certificate, a key, and a key name
    doc.sign! certificate: 'certificate data',
              key: 'private key data',
              name: 'private key name'

You only need one of `certificate` or `key`, but you can pass both. If you do,
the certificate will be included as part of the signature, so that it can be
later verified by certificate instead of by key.

The `name` is implicitly converted into a string. Thus it is effectively
optional, since `nil` converts to `""`, and its value only matters if you plan
to verify the signature with any of a set of keys, as in the following example:

### Signature verification

Verification of signatures always returns `true` if successful, `false`
otherwise.

    # Verify the document's signature to ensure it has not been tampered with
    doc.verify_with({
      'key-name-1' => 'public key contents',
      'key-name-2' => 'another public key content'
    })

In the above example, the `name` field from the signing process will be used
to determine which key to validate with. If you plan to always verify with the
same key, you can do it like so, effectively ignoring the `name` value:

    # Verify the document's signature with a specific key
    doc.verify_with key: 'public key contents'

Finally, you can also verify with a certificate:

    # Verify the document's signature with a single certificate
    doc.verify_with certificate: 'certificate data'

    # Verify the document's signature with multiple certificates. Any one match
    # will pass verification.
    doc.verify_with certificates: [ 'cert1', 'cert2', 'cert3' ]

If the certificate has been installed to your system certificates, then you can
verify signatures like so:

    # Verify with installed CA certificates
    doc.verify_signature

### Encryption & Decryption

Encrypted documents can only be decrypted with the private key that corresponds
to the public key that was used to encrypt it. Thus, the party that encrypted
the document can be sure that the document will only be readable by its intended
recipient.

Both encryption and decryption of a document manipulates the XML nodes of the
document in-place. Both methods return the original document, after the changes
have been made to it.

To encrypt a document, use a public key:

    doc.encrypt! key: 'public key content'

To decrypt a document, use a private key:

    doc.decrypt! key: 'private key content'

## Limitations and Known Issues

Following is a list of limitations and/or issues I know about, but have no
immediate plan to resolve. This is probably because I haven't needed the
functionality, and no one has sent a pull request. (Hint, hint!)

- Currently, it is not possible to operate on individual XML nodes. The
  `nokogiri-xmlsec` operations must be performed on the entire document.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
require 'protobuf'

##
# Enum Classes
#
class Lsp_event < ::Protobuf::Enum
  define :INITIATED, 0
  define :CONCLUDED_UP, 1
  define :CONCLUDED_TORN_DOWN, 2
  define :PROTECTION_AVAILABLE, 3
  define :PROTECTION_UNAVAILABLE, 4
  define :AUTOBW_SUCCESS, 5
  define :AUTOBW_FAIL, 6
  define :RESV_TEAR_RECEIVED, 7
  define :DESELECT_ACTIVE_PATH, 8
  define :CHANGE_ACTIVE_PATH, 9
  define :DETOUR_UP, 10
  define :DETOUR_DOWN, 11
  define :ORIGINATE_MBB, 12
  define :SELECT_ACTIVE_PATH, 13
  define :CSPF_NO_ROUTE, 14
  define :CSPF_SUCCESS, 15
  define :RESTART_RECOVERY_FAIL, 16
  define :PATHERR_RECEIVED, 17
  define :PATH_MTU_CHANGE, 18
  define :TUNNEL_LOCAL_REPAIRED, 19
end

class Event_subcode < ::Protobuf::Enum
  define :ADMISSION_CONTROL_FAILURE, 1
  define :SESSION_PREEMPTED, 2
  define :BAD_LOOSE_ROUTE, 3
  define :BAD_STRICT_ROUTE, 4
  define :LABEL_ALLOCATION_FAILURE, 5
  define :NON_RSVP_CAPABLE_ROUTER, 6
  define :TTL_EXPIRED, 7
  define :ROUTING_LOOP_DETECTED, 8
  define :REQUESTED_BANDWIDTH_UNAVAILABLE, 9
end

##
# Message Classes
#
class Key < ::Protobuf::Message; end
class Lsp_monitor_data_event < ::Protobuf::Message; end
class Ero_type_entry < ::Protobuf::Message; end
class Ero_ipv4_type < ::Protobuf::Message; end
class Rro_type_entry < ::Protobuf::Message; end
class Rro_ipv4_type < ::Protobuf::Message; end
class Lsp_monitor_data_property < ::Protobuf::Message; end
class Lsp_mon < ::Protobuf::Message; end

##
# Message Fields
#
class Key
  required :string, :name, 1
  required :int32, :instance_identifier, 2
  required :uint64, :time_stampg, 3
end

class Lsp_monitor_data_event
  required ::Lsp_event, :event_identifier, 1
  optional ::Event_subcode, :subcode, 2
end

class Ero_type_entry
  required :uint32, :ip, 1
  optional :string, :flags, 2
end

class Ero_ipv4_type
  repeated ::Ero_type_entry, :entry, 1
end

class Rro_type_entry
  optional :uint32, :nodeid, 1
  optional :uint32, :flags, 2
  optional :uint32, :intf_addr, 3
  optional :uint32, :label, 4
end

class Rro_ipv4_type
  repeated ::Rro_type_entry, :rro_entry, 1
end

class Lsp_monitor_data_property
  optional :uint64, :bandwidth, 1
  optional :string, :path_name, 2
  optional :int32, :metric, 3
  optional :float, :max_avg_bw, 4
  optional ::Ero_ipv4_type, :ero, 5
  optional ::Rro_ipv4_type, :rro, 6
end

class Lsp_mon
  required ::Key, :key_field, 1
  optional ::Lsp_monitor_data_event, :event_field, 2
  optional ::Lsp_monitor_data_property, :property_field, 3
end


text:
<?php

namespace SleepingOwl\Admin\Contracts\Display;

use Illuminate\Contracts\Support\Arrayable;

interface DisplayExtensionInterface extends Arrayable
{
    /**
     * @return int
     */
    public function getOrder();

    /**
     * @param int $order
     *
     * @return $this
     */
    public function setOrder($order);

    /**
     * @return DisplayInterface
     */
    public function getDisplay();

    /**
     * @param DisplayInterface $display
     *
     * @return $this
     */
    public function setDisplay(DisplayInterface $display);

    /**
     * @param \Illuminate\Database\Eloquent\Builder $query
     */
    public function modifyQuery(\Illuminate\Database\Eloquent\Builder $query);
}


text:
void foo() {
}

#if __cplusplus >= 201103L
// expected-note@+2 4 {{declared here}}
#endif
bool foobool(int argc) {
  return argc;
}

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

template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen // expected-error {{expected '(' after 'simdlen'}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen () // expected-error {{expected expression}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

// expected-error@+5 {{expected ')'}} expected-note@+5 {{to match this '('}}
// expected-error@+4 2 {{expression is not an integral constant expression}}
// expected-note@+3 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (argc
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

// expected-error@+3 {{argument to 'simdlen' clause must be a strictly positive integer value}}
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (1)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen ((ST > 0) ? 1 + ST : 2)
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#if __cplusplus >= 201103L
  // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) // expected-error 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} expected-error 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (S) // expected-error {{'S' does not refer to a value}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#if __cplusplus <= 199711L
  // expected-error@+6 2 {{expression is not an integral constant expression}}
#else
  // expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (4)
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (N) // expected-error {{argument to 'simdlen' clause must be a strictly positive integer value}}
  for (T i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

  return argc;
}

int main(int argc, char **argv) {
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen // expected-error {{expected '(' after 'simdlen'}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen () // expected-error {{expected expression}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#if __cplusplus >= 201103L
  // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#if __cplusplus >= 201103L
  // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) // expected-error {{expression is not an integral constant expression}} expected-error 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} expected-error 2 {{argument to 'simdlen' clause must be a strictly positive integer value}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#if __cplusplus <= 199711L
  // expected-error@+6 {{expression is not an integral constant expression}}
#else
  // expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
#endif
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd simdlen(simdlen(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}} expected-note {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
  foo(); // expected-error {{statement after '#pragma omp distribute parallel for simd' must be a for loop}}

  // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 12, 4>' requested here}}
  return tmain<int, char, 12, 4>(argc, argv);
}


text:
This will produce a Singularity image (suitable for running in a cluster environment) using [https://hub.docker.com/r/sachet/polysolver/](https://hub.docker.com/r/sachet/polysolver/). We do this by way of a bootstrap file for the Docker image.

## 1. Install Singularity

Instructions can be found on the [singularity site](https://singularityware.github.io).

## 2. Bootstrap the image

    sudo singularity create --size 4000 polysolver.img
    sudo singularity bootstrap polysolver.img Singularity

## 3. Running commands

For each of the following commands, you will want to [mount a local data folder](http://singularity.lbl.gov/docs-mount) to `/data` inside the container, and then provide paths to `/data` to the executable.

## Polysolver Documentation

## Description

This software package consists of 3 main tools:

### 1.1 POLYSOLVER (POLYmorphic loci reSOLVER)

This tool can be used for HLA typing based on an input exome BAM file and is currently infers infers alleles for the three major MHC class I  (HLA-A, -B, -C).

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_call_hla_type

#### Input:

	-bam: path to the BAM file to be used for HLA typing
	-race: ethnicity of the individual (Caucasian, Black, Asian or Unknown)
	-includeFreq: flag indicating whether population-level allele frequencies should be used as priors (0 or 1)
	-build: reference genome used in the BAM file (hg18 or hg19)
	-format: fastq format (STDFQ, ILMFQ, ILM1.8 or SLXFQ; see Novoalign documentation)
	-insertCalc: flag indicating whether empirical insert size distribution should be used in the model (0 or 1)
	-outDir: output directory

#### Output:

- `winners.hla.txt`: file containing the two inferred alleles for each of HLA-A, HLA-B and HLA-C

### 1.2 POLYSOLVER-based mutation detection

This tool works on a tumor/normal pair of exome BAM files and inferred mutations in the tumor file. It assumes that POLYSOLVER has already been run on the normal BAM.

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_call_hla_mutations_from_type

#### Input:

	-normal_bam_hla: path to the normal BAM file
	-tumor_bam_hla: path to the tumor BAM file
	-hla: inferred HLA allele file from POLYSOLVER (winners.hla.txt or winners.hla.nofreq.txt)
	-build: reference genome used in the BAM file (hg18 or hg19)
	-format: fastq format (STDFQ, ILMFQ, ILM1.8 or SLXFQ; see Novoalign documentation)
	-outDir: output directory

#### Output:

	call_stats.$allele.out: Mutect output for each inferred allele in winners.hla.txt
	$allele.all.somatic.indels.vcf: Strelka output for each inferred allele in winners.hla.txt

### 1.3 Annotation of mutations

This tool annotates the predicted mutations from (ii) with gene compartment and amino acid change information

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_annotate_hla_mutations

#### Input:

	-indiv: individual ID, used as prefix for output files
	-dir: directory containing the raw call files (Mutect: call_stats*, Strelka: *all.somatic.indels.vcf). Also the output directory

### Output:

        (a). Mutect
	$indiv.mutect.unfiltered.nonsyn.annotated -  list of all unfiltered mutations
	$indiv.mutect.filtered.nonsyn.annotated -  list of cleaned non-synonymous mutations
	$indiv.mutect.filtered.syn.annotated - list of cleaned synonymous changes
	$indiv.mutect.ambiguous.annotated - list of ambiguous calls. This will generally be empty (save for the header). It will be populated if the same mutation (ex. p.A319E) is found in two or more alleles in the individual, with the same allele fractions. In such cases one allele is randomly chosen and included in the .nonysn.annotated file while the complete list of alleles is listed in the .ambiguous.annotated file. If the ethnicity of the individual is known, an alternate method would be to pick the allele with the highest frequency.

        (b). Strelka
	$indiv.mutect.unfiltered.nonsyn.annotated -  list of all unfiltered indels (as detected by Strelka)
	$indiv.strelka_indels.filtered.annotated - list of cleaned indels (as detected by Strelka)
	$indiv.strelka_indels.ambiguous.annotated - see description of $indiv.mutect.ambiguous.annotated in (a). above

### Testing

Your installation can be tested by running the following command from $PSHOME. **NOTE: this has not been tested - the correct paths to dependencies need to be set in [Singularity](Singularity) and the data folders correctly mounted from the local machine.**

#### 3.1 POLYSOLVER

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_call_hla_type test/test.bam Unknown 1 hg19 STDFQ 0 test

If successful, the following command should not yield any differences:

      diff test/winners.hla.txt test/orig.winners.hla.txt

#### 3.2 POLYSOLVER-based mutation detection

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_call_hla_mutations_from_type test/test.bam test/test.tumor.bam test/winners.hla.txt hg19 STDFQ test

If successful, the following command should not yield any differences:

      diff test/call_stats.hla_b_39_01_01_02l.out test/orig.call_stats.hla_b_39_01_01_02l.out

#### 3.3 Annotation of mutations

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_annotate_hla_mutations indiv test

If successful, the following command should not yield any differences:

      diff test/indiv.mutect.filtered.nonsyn.annotated test/orig.indiv.mutect.filtered.nonsyn.annotated

### Running

The tools can be run using the following commands:

#### 4.1 POLYSOLVER

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_call_hla_type </path/to/bam> <race> <includeFreq> <build> <format> <insertCalc> </path/to/output_directory>

example:

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_call_hla_type test/test.bam Unknown 1 hg19 STDFQ 0 test

#### 4.2 POLYSOLVER-based mutation detection

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_call_hla_mutations_from_type </path/to/normal_bam> </path/to/tumor_bam> </path/to/winners.hla.txt> <build> <format> </path/to/output_directory>

example:

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_call_hla_mutations_from_type test/test.bam test/test.tumor.bam test/winners.hla.txt hg19 STDFQ test

#### 4.3 Annotation of mutations

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_annotate_hla_mutations <prefix_to_use> </path/to/directory_with_mutation_detection_output>

example:

      singularity exec polysolver.img /usr/local/libexec/polysolver/scripts/shell_annotate_hla_mutations indiv test


text:
package com.greasemonk.timetable;

import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.mikepenz.fastadapter.items.AbstractItem;

/**
 * Created by Wiebe Geertsma on 21-12-2016.
 * E-mail: e.w.geertsma@gmail.com
 */
public abstract class AbstractGridItem<T extends AbstractGridItem<?,?>, VH extends RecyclerView.ViewHolder> implements IGridItem
{
	private int itemColor = Color.parseColor("#1EFFD900");

	/**
	 * If the TimeRange is null, your item will NOT be displayed.
	 *
	 * @return the time range of this item
	 */
	@Nullable
	public abstract TimeRange getTimeRange();

	/**
	 * Get the text that is displayed in the tile.
	 *
	 * @return the text that is displayed in the tile
	 */
	@Override
	public abstract String getName();

	/**
	 * Get the text that is displayed on the Y axis.
	 *
	 * @return the text that is displayed on the Y axis
	 */
	@Override
	public abstract String getPersonName();

	/**
	 * Get the item color
	 *
	 * @return the color of the item.
	 */
	@Override
	public int getItemColor()
	{
		return itemColor;
	}

	/**
	 * Set the item color.
	 *
	 * @param itemColor the color to set the item to.
	 */
	public void setItemColor(int itemColor)
	{
		this.itemColor = itemColor;
	}

	/**
	 * Executed when the user clicked on the item.
	 */
	public void onClick(View view)
	{
		// Do nothing. Override me!
	}
}


text:
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "base58.h"
#include "chain.h"
#include "clientversion.h"
#include "core_io.h"
#include "init.h"
#include "validation.h"
#include "httpserver.h"
#include "net.h"
#include "netbase.h"
#include "rpc/blockchain.h"
#include "rpc/server.h"
#include "timedata.h"
#include "util.h"
#include "utilstrencodings.h"
#ifdef ENABLE_WALLET
#include "wallet/rpcwallet.h"
#include "wallet/wallet.h"
#include "wallet/walletdb.h"
#endif
#include "warnings.h"

#include <stdint.h>
#ifdef HAVE_MALLOC_INFO
#include <malloc.h>
#endif

#include <univalue.h>

#ifdef ENABLE_WALLET
class DescribeAddressVisitor : public boost::static_visitor<UniValue>
{
public:
    CWallet * const pwallet;

    explicit DescribeAddressVisitor(CWallet *_pwallet) : pwallet(_pwallet) {}

    UniValue operator()(const CNoDestination &dest) const { return UniValue(UniValue::VOBJ); }

    UniValue operator()(const CKeyID &keyID) const {
        UniValue obj(UniValue::VOBJ);
        CPubKey vchPubKey;
        obj.push_back(Pair("isscript", false));
        if (pwallet && pwallet->GetPubKey(keyID, vchPubKey)) {
            obj.push_back(Pair("pubkey", HexStr(vchPubKey)));
            obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed()));
        }
        return obj;
    }

    UniValue operator()(const CScriptID &scriptID) const {
        UniValue obj(UniValue::VOBJ);
        CScript subscript;
        obj.push_back(Pair("isscript", true));
        if (pwallet && pwallet->GetCScript(scriptID, subscript)) {
            std::vector<CTxDestination> addresses;
            txnouttype whichType;
            int nRequired;
            ExtractDestinations(subscript, whichType, addresses, nRequired);
            obj.push_back(Pair("script", GetTxnOutputType(whichType)));
            obj.push_back(Pair("hex", HexStr(subscript.begin(), subscript.end())));
            UniValue a(UniValue::VARR);
            for (const CTxDestination& addr : addresses) {
                a.push_back(EncodeDestination(addr));
            }
            obj.push_back(Pair("addresses", a));
            if (whichType == TX_MULTISIG)
                obj.push_back(Pair("sigsrequired", nRequired));
        }
        return obj;
    }
};
#endif

UniValue validateaddress(const JSONRPCRequest& request)
{
    if (request.fHelp || request.params.size() != 1)
        throw std::runtime_error(
            "validateaddress \"address\"\n"
            "\nReturn information about the given bitcoin address.\n"
            "\nArguments:\n"
            "1. \"address\"     (string, required) The bitcoin address to validate\n"
            "\nResult:\n"
            "{\n"
            "  \"isvalid\" : true|false,       (boolean) If the address is valid or not. If not, this is the only property returned.\n"
            "  \"address\" : \"address\", (string) The bitcoin address validated\n"
            "  \"scriptPubKey\" : \"hex\",       (string) The hex encoded scriptPubKey generated by the address\n"
            "  \"ismine\" : true|false,        (boolean) If the address is yours or not\n"
            "  \"iswatchonly\" : true|false,   (boolean) If the address is watchonly\n"
            "  \"isscript\" : true|false,      (boolean) If the key is a script\n"
            "  \"script\" : \"type\"             (string, optional) The output script type. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash, witness_v0_scripthash\n"
            "  \"hex\" : \"hex\",                (string, optional) The redeemscript for the p2sh address\n"
            "  \"addresses\"                   (string, optional) Array of addresses associated with the known redeemscript\n"
            "    [\n"
            "      \"address\"\n"
            "      ,...\n"
            "    ]\n"
            "  \"sigsrequired\" : xxxxx        (numeric, optional) Number of signatures required to spend multisig output\n"
            "  \"pubkey\" : \"publickeyhex\",    (string) The hex value of the raw public key\n"
            "  \"iscompressed\" : true|false,  (boolean) If the address is compressed\n"
            "  \"account\" : \"account\"         (string) DEPRECATED. The account associated with the address, \"\" is the default account\n"
            "  \"timestamp\" : timestamp,        (number, optional) The creation time of the key if available in seconds since epoch (Jan 1 1970 GMT)\n"
            "  \"hdkeypath\" : \"keypath\"       (string, optional) The HD keypath if the key is HD and available\n"
            "  \"hdmasterkeyid\" : \"<hash160>\" (string, optional) The Hash160 of the HD master pubkey\n"
            "}\n"
            "\nExamples:\n"
            + HelpExampleCli("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
            + HelpExampleRpc("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
        );

#ifdef ENABLE_WALLET
    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);

    LOCK2(cs_main, pwallet ? &pwallet->cs_wallet : nullptr);
#else
    LOCK(cs_main);
#endif

    CTxDestination dest = DecodeDestination(request.params[0].get_str());
    bool isValid = IsValidDestination(dest);

    UniValue ret(UniValue::VOBJ);
    ret.push_back(Pair("isvalid", isValid));
    if (isValid)
    {
        std::string currentAddress = EncodeDestination(dest);
        ret.push_back(Pair("address", currentAddress));

        CScript scriptPubKey = GetScriptForDestination(dest);
        ret.push_back(Pair("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end())));

#ifdef ENABLE_WALLET
        isminetype mine = pwallet ? IsMine(*pwallet, dest) : ISMINE_NO;
        ret.push_back(Pair("ismine", bool(mine & ISMINE_SPENDABLE)));
        ret.push_back(Pair("iswatchonly", bool(mine & ISMINE_WATCH_ONLY)));
        UniValue detail = boost::apply_visitor(DescribeAddressVisitor(pwallet), dest);
        ret.pushKVs(detail);
        if (pwallet && pwallet->mapAddressBook.count(dest)) {
            ret.push_back(Pair("account", pwallet->mapAddressBook[dest].name));
        }
        if (pwallet) {
            const auto& meta = pwallet->mapKeyMetadata;
            const CKeyID *keyID = boost::get<CKeyID>(&dest);
            auto it = keyID ? meta.find(*keyID) : meta.end();
            if (it == meta.end()) {
                it = meta.find(CScriptID(scriptPubKey));
            }
            if (it != meta.end()) {
                ret.push_back(Pair("timestamp", it->second.nCreateTime));
                if (!it->second.hdKeypath.empty()) {
                    ret.push_back(Pair("hdkeypath", it->second.hdKeypath));
                    ret.push_back(Pair("hdmasterkeyid", it->second.hdMasterKeyID.GetHex()));
                }
            }
        }
#endif
    }
    return ret;
}

// Needed even with !ENABLE_WALLET, to pass (ignored) pointers around
class CWallet;

/**
 * Used by addmultisigaddress / createmultisig:
 */
CScript _createmultisig_redeemScript(CWallet * const pwallet, const UniValue& params)
{
    int nRequired = params[0].get_int();
    const UniValue& keys = params[1].get_array();

    // Gather public keys
    if (nRequired < 1)
        throw std::runtime_error("a multisignature address must require at least one key to redeem");
    if ((int)keys.size() < nRequired)
        throw std::runtime_error(
            strprintf("not enough keys supplied "
                      "(got %u keys, but need at least %d to redeem)", keys.size(), nRequired));
    if (keys.size() > 16)
        throw std::runtime_error("Number of addresses involved in the multisignature address creation > 16\nReduce the number");
    std::vector<CPubKey> pubkeys;
    pubkeys.resize(keys.size());
    for (unsigned int i = 0; i < keys.size(); i++)
    {
        const std::string& ks = keys[i].get_str();
#ifdef ENABLE_WALLET
        // Case 1: Bitcoin address and we have full public key:
        CTxDestination dest = DecodeDestination(ks);
        if (pwallet && IsValidDestination(dest)) {
            const CKeyID *keyID = boost::get<CKeyID>(&dest);
            if (!keyID) {
                throw std::runtime_error(strprintf("%s does not refer to a key", ks));
            }
            CPubKey vchPubKey;
            if (!pwallet->GetPubKey(*keyID, vchPubKey)) {
                throw std::runtime_error(strprintf("no full public key for address %s", ks));
            }
            if (!vchPubKey.IsFullyValid())
                throw std::runtime_error(" Invalid public key: "+ks);
            pubkeys[i] = vchPubKey;
        }

        // Case 2: hex public key
        else
#endif
        if (IsHex(ks))
        {
            CPubKey vchPubKey(ParseHex(ks));
            if (!vchPubKey.IsFullyValid())
                throw std::runtime_error(" Invalid public key: "+ks);
            pubkeys[i] = vchPubKey;
        }
        else
        {
            throw std::runtime_error(" Invalid public key: "+ks);
        }
    }
    CScript result = GetScriptForMultisig(nRequired, pubkeys);

    if (result.size() > MAX_SCRIPT_ELEMENT_SIZE)
        throw std::runtime_error(
                strprintf("redeemScript exceeds size limit: %d > %d", result.size(), MAX_SCRIPT_ELEMENT_SIZE));

    return result;
}

UniValue createmultisig(const JSONRPCRequest& request)
{
#ifdef ENABLE_WALLET
    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);
#else
    CWallet * const pwallet = nullptr;
#endif

    if (request.fHelp || request.params.size() < 2 || request.params.size() > 2)
    {
        std::string msg = "createmultisig nrequired [\"key\",...]\n"
            "\nCreates a multi-signature address with n signature of m keys required.\n"
            "It returns a json object with the address and redeemScript.\n"

            "\nArguments:\n"
            "1. nrequired      (numeric, required) The number of required signatures out of the n keys or addresses.\n"
            "2. \"keys\"       (string, required) A json array of keys which are bitcoin addresses or hex-encoded public keys\n"
            "     [\n"
            "       \"key\"    (string) bitcoin address or hex-encoded public key\n"
            "       ,...\n"
            "     ]\n"

            "\nResult:\n"
            "{\n"
            "  \"address\":\"multisigaddress\",  (string) The value of the new multisig address.\n"
            "  \"redeemScript\":\"script\"       (string) The string value of the hex-encoded redemption script.\n"
            "}\n"

            "\nExamples:\n"
            "\nCreate a multisig address from 2 addresses\n"
            + HelpExampleCli("createmultisig", "2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
            "\nAs a json rpc call\n"
            + HelpExampleRpc("createmultisig", "2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"")
        ;
        throw std::runtime_error(msg);
    }

    // Construct using pay-to-script-hash:
    CScript inner = _createmultisig_redeemScript(pwallet, request.params);
    CScriptID innerID(inner);

    UniValue result(UniValue::VOBJ);
    result.push_back(Pair("address", EncodeDestination(innerID)));
    result.push_back(Pair("redeemScript", HexStr(inner.begin(), inner.end())));

    return result;
}

UniValue verifymessage(const JSONRPCRequest& request)
{
    if (request.fHelp || request.params.size() != 3)
        throw std::runtime_error(
            "verifymessage \"address\" \"signature\" \"message\"\n"
            "\nVerify a signed message\n"
            "\nArguments:\n"
            "1. \"address\"         (string, required) The bitcoin address to use for the signature.\n"
            "2. \"signature\"       (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n"
            "3. \"message\"         (string, required) The message that was signed.\n"
            "\nResult:\n"
            "true|false   (boolean) If the signature is verified or not.\n"
            "\nExamples:\n"
            "\nUnlock the wallet for 30 seconds\n"
            + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") +
            "\nCreate the signature\n"
            + HelpExampleCli("signmessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"my message\"") +
            "\nVerify the signature\n"
            + HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"") +
            "\nAs json rpc\n"
            + HelpExampleRpc("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"signature\", \"my message\"")
        );

    LOCK(cs_main);

    std::string strAddress  = request.params[0].get_str();
    std::string strSign     = request.params[1].get_str();
    std::string strMessage  = request.params[2].get_str();

    CTxDestination destination = DecodeDestination(strAddress);
    if (!IsValidDestination(destination)) {
        throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
    }

    const CKeyID *keyID = boost::get<CKeyID>(&destination);
    if (!keyID) {
        throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
    }

    bool fInvalid = false;
    std::vector<unsigned char> vchSig = DecodeBase64(strSign.c_str(), &fInvalid);

    if (fInvalid)
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding");

    CHashWriter ss(SER_GETHASH, 0);
    ss << strMessageMagic;
    ss << strMessage;

    CPubKey pubkey;
    if (!pubkey.RecoverCompact(ss.GetHash(), vchSig))
        return false;

    return (pubkey.GetID() == *keyID);
}

UniValue signmessagewithprivkey(const JSONRPCRequest& request)
{
    if (request.fHelp || request.params.size() != 2)
        throw std::runtime_error(
            "signmessagewithprivkey \"privkey\" \"message\"\n"
            "\nSign a message with the private key of an address\n"
            "\nArguments:\n"
            "1. \"privkey\"         (string, required) The private key to sign the message with.\n"
            "2. \"message\"         (string, required) The message to create a signature of.\n"
            "\nResult:\n"
            "\"signature\"          (string) The signature of the message encoded in base 64\n"
            "\nExamples:\n"
            "\nCreate the signature\n"
            + HelpExampleCli("signmessagewithprivkey", "\"privkey\" \"my message\"") +
            "\nVerify the signature\n"
            + HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"") +
            "\nAs json rpc\n"
            + HelpExampleRpc("signmessagewithprivkey", "\"privkey\", \"my message\"")
        );

    std::string strPrivkey = request.params[0].get_str();
    std::string strMessage = request.params[1].get_str();

    CBitcoinSecret vchSecret;
    bool fGood = vchSecret.SetString(strPrivkey);
    if (!fGood)
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key");
    CKey key = vchSecret.GetKey();
    if (!key.IsValid())
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range");

    CHashWriter ss(SER_GETHASH, 0);
    ss << strMessageMagic;
    ss << strMessage;

    std::vector<unsigned char> vchSig;
    if (!key.SignCompact(ss.GetHash(), vchSig))
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed");

    return EncodeBase64(vchSig.data(), vchSig.size());
}

UniValue setmocktime(const JSONRPCRequest& request)
{
    if (request.fHelp || request.params.size() != 1)
        throw std::runtime_error(
            "setmocktime timestamp\n"
            "\nSet the local time to given timestamp (-regtest only)\n"
            "\nArguments:\n"
            "1. timestamp  (integer, required) Unix seconds-since-epoch timestamp\n"
            "   Pass 0 to go back to using the system time."
        );

    if (!Params().MineBlocksOnDemand())
        throw std::runtime_error("setmocktime for regression testing (-regtest mode) only");

    // For now, don't change mocktime if we're in the middle of validation, as
    // this could have an effect on mempool time-based eviction, as well as
    // IsCurrentForFeeEstimation() and IsInitialBlockDownload().
    // TODO: figure out the right way to synchronize around mocktime, and
    // ensure all call sites of GetTime() are accessing this safely.
    LOCK(cs_main);

    RPCTypeCheck(request.params, {UniValue::VNUM});
    SetMockTime(request.params[0].get_int64());

    return NullUniValue;
}

static UniValue RPCLockedMemoryInfo()
{
    LockedPool::Stats stats = LockedPoolManager::Instance().stats();
    UniValue obj(UniValue::VOBJ);
    obj.push_back(Pair("used", uint64_t(stats.used)));
    obj.push_back(Pair("free", uint64_t(stats.free)));
    obj.push_back(Pair("total", uint64_t(stats.total)));
    obj.push_back(Pair("locked", uint64_t(stats.locked)));
    obj.push_back(Pair("chunks_used", uint64_t(stats.chunks_used)));
    obj.push_back(Pair("chunks_free", uint64_t(stats.chunks_free)));
    return obj;
}

#ifdef HAVE_MALLOC_INFO
static std::string RPCMallocInfo()
{
    char *ptr = nullptr;
    size_t size = 0;
    FILE *f = open_memstream(&ptr, &size);
    if (f) {
        malloc_info(0, f);
        fclose(f);
        if (ptr) {
            std::string rv(ptr, size);
            free(ptr);
            return rv;
        }
    }
    return "";
}
#endif

UniValue getmemoryinfo(const JSONRPCRequest& request)
{
    /* Please, avoid using the word "pool" here in the RPC interface or help,
     * as users will undoubtedly confuse it with the other "memory pool"
     */
    if (request.fHelp || request.params.size() > 1)
        throw std::runtime_error(
            "getmemoryinfo (\"mode\")\n"
            "Returns an object containing information about memory usage.\n"
            "Arguments:\n"
            "1. \"mode\" determines what kind of information is returned. This argument is optional, the default mode is \"stats\".\n"
            "  - \"stats\" returns general statistics about memory usage in the daemon.\n"
            "  - \"mallocinfo\" returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+).\n"
            "\nResult (mode \"stats\"):\n"
            "{\n"
            "  \"locked\": {               (json object) Information about locked memory manager\n"
            "    \"used\": xxxxx,          (numeric) Number of bytes used\n"
            "    \"free\": xxxxx,          (numeric) Number of bytes available in current arenas\n"
            "    \"total\": xxxxxxx,       (numeric) Total number of bytes managed\n"
            "    \"locked\": xxxxxx,       (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.\n"
            "    \"chunks_used\": xxxxx,   (numeric) Number allocated chunks\n"
            "    \"chunks_free\": xxxxx,   (numeric) Number unused chunks\n"
            "  }\n"
            "}\n"
            "\nResult (mode \"mallocinfo\"):\n"
            "\"<malloc version=\"1\">...\"\n"
            "\nExamples:\n"
            + HelpExampleCli("getmemoryinfo", "")
            + HelpExampleRpc("getmemoryinfo", "")
        );

    std::string mode = request.params[0].isNull() ? "stats" : request.params[0].get_str();
    if (mode == "stats") {
        UniValue obj(UniValue::VOBJ);
        obj.push_back(Pair("locked", RPCLockedMemoryInfo()));
        return obj;
    } else if (mode == "mallocinfo") {
#ifdef HAVE_MALLOC_INFO
        return RPCMallocInfo();
#else
        throw JSONRPCError(RPC_INVALID_PARAMETER, "mallocinfo is only available when compiled with glibc 2.10+");
#endif
    } else {
        throw JSONRPCError(RPC_INVALID_PARAMETER, "unknown mode " + mode);
    }
}

uint32_t getCategoryMask(UniValue cats) {
    cats = cats.get_array();
    uint32_t mask = 0;
    for (unsigned int i = 0; i < cats.size(); ++i) {
        uint32_t flag = 0;
        std::string cat = cats[i].get_str();
        if (!GetLogCategory(&flag, &cat)) {
            throw JSONRPCError(RPC_INVALID_PARAMETER, "unknown logging category " + cat);
        }
        mask |= flag;
    }
    return mask;
}

UniValue logging(const JSONRPCRequest& request)
{
    if (request.fHelp || request.params.size() > 2) {
        throw std::runtime_error(
            "logging [include,...] <exclude>\n"
            "Gets and sets the logging configuration.\n"
            "When called without an argument, returns the list of categories that are currently being debug logged.\n"
            "When called with arguments, adds or removes categories from debug logging.\n"
            "The valid logging categories are: " + ListLogCategories() + "\n"
            "libevent logging is configured on startup and cannot be modified by this RPC during runtime."
            "Arguments:\n"
            "1. \"include\" (array of strings) add debug logging for these categories.\n"
            "2. \"exclude\" (array of strings) remove debug logging for these categories.\n"
            "\nResult: <categories>  (string): a list of the logging categories that are active.\n"
            "\nExamples:\n"
            + HelpExampleCli("logging", "\"[\\\"all\\\"]\" \"[\\\"http\\\"]\"")
            + HelpExampleRpc("logging", "[\"all\"], \"[libevent]\"")
        );
    }

    uint32_t originalLogCategories = logCategories;
    if (request.params[0].isArray()) {
        logCategories |= getCategoryMask(request.params[0]);
    }

    if (request.params[1].isArray()) {
        logCategories &= ~getCategoryMask(request.params[1]);
    }

    // Update libevent logging if BCLog::LIBEVENT has changed.
    // If the library version doesn't allow it, UpdateHTTPServerLogging() returns false,
    // in which case we should clear the BCLog::LIBEVENT flag.
    // Throw an error if the user has explicitly asked to change only the libevent
    // flag and it failed.
    uint32_t changedLogCategories = originalLogCategories ^ logCategories;
    if (changedLogCategories & BCLog::LIBEVENT) {
        if (!UpdateHTTPServerLogging(logCategories & BCLog::LIBEVENT)) {
            logCategories &= ~BCLog::LIBEVENT;
            if (changedLogCategories == BCLog::LIBEVENT) {
            throw JSONRPCError(RPC_INVALID_PARAMETER, "libevent logging cannot be updated when using libevent before v2.1.1.");
            }
        }
    }

    UniValue result(UniValue::VOBJ);
    std::vector<CLogCategoryActive> vLogCatActive = ListActiveLogCategories();
    for (const auto& logCatActive : vLogCatActive) {
        result.pushKV(logCatActive.category, logCatActive.active);
    }

    return result;
}

UniValue echo(const JSONRPCRequest& request)
{
    if (request.fHelp)
        throw std::runtime_error(
            "echo|echojson \"message\" ...\n"
            "\nSimply echo back the input arguments. This command is for testing.\n"
            "\nThe difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in"
            "bitcoin-cli and the GUI. There is no server-side difference."
        );

    return request.params;
}

static const CRPCCommand commands[] =
{ //  category              name                      actor (function)         argNames
  //  --------------------- ------------------------  -----------------------  ----------
    { "control",            "getmemoryinfo",          &getmemoryinfo,          {"mode"} },
    { "util",               "validateaddress",        &validateaddress,        {"address"} }, /* uses wallet if enabled */
    { "util",               "createmultisig",         &createmultisig,         {"nrequired","keys"} },
    { "util",               "verifymessage",          &verifymessage,          {"address","signature","message"} },
    { "util",               "signmessagewithprivkey", &signmessagewithprivkey, {"privkey","message"} },

    /* Not shown in help */
    { "hidden",             "setmocktime",            &setmocktime,            {"timestamp"}},
    { "hidden",             "echo",                   &echo,                   {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
    { "hidden",             "echojson",               &echo,                   {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
    { "hidden",             "logging",                &logging,                {"include", "exclude"}},
};

void RegisterMiscRPCCommands(CRPCTable &t)
{
    for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
        t.appendCommand(commands[vcidx].name, &commands[vcidx]);
}


text:
package org.apache.olingo.commons.api.edm.annotation;

/**
 * Represents a dynamic expression
 */
public interface EdmDynamicExpression extends EdmExpression {

  /**
   * Returns true if the expression is a logical edm:Not expression
   * @return  true if the expression is a logical edm:Not expression
   */
  boolean isNot();

  /**
   * Casts the expression to a {@link EdmNot} expression
   * @return EdmNot expression
   */
  EdmNot asNot();

  /**
   * Returns true if the expression is a logical edm:And expression
   * @return  true if the expression is a logical edm:And expression
   */
  boolean isAnd();

  /**
   * Casts the expression to a {@link EdmAnd} expression
   * @return EdmAnd expression
   */
  EdmAnd asAnd();

  /**
   * Returns true if the expression is a logical edm:Or expression
   * @return  true if the expression is a logical edm:Or expression
   */
  boolean isOr();

  /**
   * Casts the expression to a {@link EdmOr} expression
   * @return EdmOr expression
   */
  EdmOr asOr();

  /**
   * Returns true if the expression is a edm:Eq expression
   * @return  true if the expression is a edm:Eq expression
   */
  boolean isEq();

  /**
   * Casts the expression to a {@link EdmEq} expression
   * @return EdmEq expression
   */
  EdmEq asEq();

  /**
   * Returns true if the expression is a edm:Ne expression
   * @return  true if the expression is a edm:Ne expression
   */
  boolean isNe();

  /**
   * Casts the expression to a {@link EdmNe} expression
   * @return EdmNe expression
   */
  EdmNe asNe();

  /**
   * Returns true if the expression is a edm:Gt expression
   * @return  true if the expression is a edm:Gt expression
   */
  boolean isGt();

  /**
   * Casts the expression to a {@link EdmGt} expression
   * @return EdmGt expression
   */
  EdmGt asGt();

  /**
   * Returns true if the expression is a edm:Ge expression
   * @return  true if the expression is a edm:Ge expression
   */
  boolean isGe();

  /**
   * Casts the expression to a {@link EdmGe} expression
   * @return EdmGe expression
   */
  EdmGe asGe();

  /**
   * Returns true if the expression is a edm:Lt expression
   * @return  true if the expression is a edm:Lt expression
   */
  boolean isLt();

  /**
   * Casts the expression to a {@link EdmLt} expression
   * @return EdmLt expression
   */
  EdmLt asLt();

  /**
   * Returns true if the expression is a edm:Le expression
   * @return  true if the expression is a edm:Le expression
   */
  boolean isLe();

  /**
   * Casts the expression to a {@link EdmLe} expression
   * @return EdmLe expression
   */
  EdmLe asLe();

  /**
   * Returns true if the expression is a edm:AnnotationPath expression
   * @return  true if the expression is a edm:AnnotationPath expression
   */
  boolean isAnnotationPath();

  /**
   * Casts the expression to a {@link EdmAnnotationPath} expression
   * @return EdmAnnotationPath expression
   */
  EdmAnnotationPath asAnnotationPath();

  /**
   * Returns true if the expression is a edm:Apply expression
   * @return  true if the expression is a edm:Apply expression
   */
  boolean isApply();

  /**
   * Casts the expression to a {@link EdmApply} expression
   * @return EdmApply expression
   */
  EdmApply asApply();

  /**
   * Returns true if the expression is a edm:Cast expression
   * @return  true if the expression is a edm:Cast expression
   */
  boolean isCast();

  /**
   * Casts the expression to a {@link EdmCast} expression
   * @return EdmCast expression
   */
  EdmCast asCast();

  /**
   * Returns true if the expression is a edm:Collection expression
   * @return  true if the expression is a edm:Collection expression
   */
  boolean isCollection();

  /**
   * Casts the expression to a {@link EdmCollection} expression
   * @return EdmCollection expression
   */
  EdmCollection asCollection();

  /**
   * Returns true if the expression is a edm:If expression
   * @return  true if the expression is a edm:If expression
   */
  boolean isIf();

  /**
   * Casts the expression to a {@link EdmIf} expression
   * @return EdmIf expression
   */
  EdmIf asIf();

  /**
   * Returns true if the expression is a edm:IsOf expression
   * @return  true if the expression is a edm:IsOf expression
   */
  boolean isIsOf();

  /**
   * Casts the expression to a {@link EdmIsOf} expression
   * @return EdmIsOf expression
   */
  EdmIsOf asIsOf();

  /**
   * Returns true if the expression is a edm:LabeledElement expression
   * @return  true if the expression is a edm:LabeledElement expression
   */
  boolean isLabeledElement();

  /**
   * Casts the expression to a {@link EdmLabeledElement} expression
   * @return EdmLabeledElement expression
   */
  EdmLabeledElement asLabeledElement();

  /**
   * Returns true if the expression is a edm:LabeledElementReference expression
   * @return  true if the expression is a edm:LabeledElementReference expression
   */
  boolean isLabeledElementReference();

  /**
   * Casts the expression to a {@link EdmLabeledElementReference} expression
   * @return EdmLabeledElementReference expression
   */
  EdmLabeledElementReference asLabeledElementReference();

  /**
   * Returns true if the expression is a edm:Null expression
   * @return  true if the expression is a edm:Null expression
   */
  boolean isNull();

  /**
   * Casts the expression to a {@link EdmNull} expression
   * @return EdmNull expression
   */
  EdmNull asNull();

  /**
   * Returns true if the expression is a edm:NavigationPropertyPath expression
   * @return  true if the expression is a edm:NavigationPropertyPath expression
   */
  boolean isNavigationPropertyPath();

  /**
   * Casts the expression to a {@link EdmNavigationPropertyPath} expression
   * @return EdmNavigationPropertyPath expression
   */
  EdmNavigationPropertyPath asNavigationPropertyPath();

  /**
   * Returns true if the expression is a edm:Path expression
   * @return  true if the expression is a edm:Path expression
   */
  boolean isPath();

  /**
   * Casts the expression to a {@link EdmPath} expression
   * @return EdmPath expression
   */
  EdmPath asPath();

  /**
   * Returns true if the expression is a edm:PropertyPath expression
   * @return  true if the expression is a edm:PropertyPath expression
   */
  boolean isPropertyPath();

  /**
   * Casts the expression to a {@link EdmPropertyPath} expression
   * @return EdmPropertyPath expression
   */
  EdmPropertyPath asPropertyPath();

  /**
   * Returns true if the expression is a edm:PropertyValue expression
   * @return  true if the expression is a edm:PropertyValue expression
   */
  boolean isPropertyValue();

  /**
   * Casts the expression to a {@link EdmPropertyValue} expression
   * @return EdmPropertyValue expression
   */
  EdmPropertyValue asPropertyValue();

  /**
   * Returns true if the expression is a edm:Record expression
   * @return  true if the expression is a edm:Record expression
   */
  boolean isRecord();

  /**
   * Casts the expression to a {@link EdmRecord} expression
   * @return EdmRecord expression
   */
  EdmRecord asRecord();

  /**
   * Returns true if the expression is a edm:UrlRef expression
   * @return  true if the expression is a edm:UrlRef expression
   */
  boolean isUrlRef();

  /**
   * Casts the expression to a {@link EdmUrlRef} expression
   * @return EdmUrlRef expression
   */
  EdmUrlRef asUrlRef();
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Annln naturh. Mus. Wien 15: 208 (1900)

#### Original name
Placodium garovaglioi Körb.

### Remarks
null


text:
package utils

import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
)

func FileReadBytes(path string) ([]byte, error) {
	finfo, err := os.Stat(path)
	if err != nil {
		return nil, err
	}

	if finfo.Size() == 0 {
		return nil, fmt.Errorf("size is zero. file: %s", path)
	}

	fi, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer fi.Close()
	return ioutil.ReadAll(fi)
}

func Mkdirp(path string) (bool, error) {
	if _, err := os.Stat(path); os.IsNotExist(err) {
		if err := os.MkdirAll(path, os.ModeDir|os.ModePerm); err != nil {
			return false, err
		} else {
			return true, nil
		}
	} else {
		return false, err
	}
}

func FileCopy(destPath string, srcPath string) error {
	srcFile, err := os.Open(srcPath)
	if err != nil {
		return err
	}
	defer srcFile.Close()
	destFile, err := os.Create(destPath)
	if err != nil {
		return err
	}
	defer destFile.Close()
	_, err = io.Copy(destFile, srcFile)
	return err
}


text:
/* ========================================================================
 * shop-item-detail.js
 * Page/renders: frontend/shop-item-detail.html
 * Plugins used: layer-slider
 * ======================================================================== */

'use strict';

(function (factory) {
    if (typeof define === 'function' && define.amd) {
        define([
            'layer-slider'
        ], factory);
    } else {
        factory();
    }
}(function () {

    $(function () {
        // Layer slider
        // ================================
        $('#layerslider').layerSlider({
            autoStart: false,
            skin: 'fullwidth',
            hoverPrevNext: false,
            navStartStop: false,
            showCircleTimer: false,
            //thumbnailNavigation: 'always',
            skinsPath: '../plugins/layerslider/skins/'
        });

        // Touch spin
        // ================================
        $('form[name="add-to-cart"] input[name="quantity"]').TouchSpin({
            initval: 1,
            verticalbuttons: true,
            verticalupclass: 'glyphicon glyphicon-plus',
            verticaldownclass: 'glyphicon glyphicon-minus'
        });
    });

}));