text:
require 'spec_helper'
require 'token.rb'

describe Token do
  context 'when no parameter is recieved' do
    it "raise an ArgumentError" do
      expect { Token.new  }.to raise_error ArgumentError
    end
  end
  context 'when keyword and value are recieved' do
    before :each do
      @my_token = Token.new "my_keyword", "my_value"
    end

    it "creates a valid Token" do
      @my_token.class == Token
    end

    it "returns the keyword which was used for creation" do
      @my_token.keyword == "my_keyword"
    end

    it "returns the value which was used for creation" do
      @my_token.value == "my_value"
    end
  end
end


text:
package models.domain

import controllers.mappings.Mappings
import models.DayMonthYear
import models.yesNo.YesNoWithText
import utils.helpers.TextLengthHelper

object SelfEmployment extends Identifier(id = "s23") {
  def isSelfEmployed(claim: Claim): Boolean = {
    claim.questionGroup[YourIncomes] match {
      case Some(employment) => employment.beenSelfEmployedSince1WeekBeforeClaim == Mappings.yes
      case _ => false
    }
  }
}

case class Employment(beenSelfEmployedSince1WeekBeforeClaim: String = "", beenEmployedSince6MonthsBeforeClaim: String = "") extends QuestionGroup(Employment)

object Employment extends QGIdentifier(id = s"${SelfEmployment.id}.g0")

object SelfEmploymentDates extends QGIdentifier(id = s"${SelfEmployment.id}.g1") {
  def typeOfWorkMaxLength = TextLengthHelper.textMaxLength("DWPCAClaim//Incomes//SelfEmployment//TypeOfWork//Answer")
}

case class SelfEmploymentDates( typeOfWork: String = "",
                                stillSelfEmployed: String = "",
                                moreThanYearAgo: String = "",
                                startThisWork: Option[DayMonthYear] = None,
                                haveAccounts: Option[String] = None,
                                knowTradingYear: Option[String] = None,
                                tradingYearStart: Option[DayMonthYear] = None,
                                paidMoney: Option[String] = None,
                                paidMoneyDate: Option[DayMonthYear] = None,
                                finishThisWork: Option[DayMonthYear] = None
                                ) extends QuestionGroup(SelfEmploymentDates)

object SelfEmploymentPensionsAndExpenses extends QGIdentifier(id = s"${SelfEmployment.id}.g4")

case class SelfEmploymentPensionsAndExpenses(payPensionScheme: YesNoWithText = YesNoWithText("", None),
                                             haveExpensesForJob: YesNoWithText = YesNoWithText("", None)
                                              ) extends QuestionGroup(SelfEmploymentPensionsAndExpenses)

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Windows;
using System.Windows.Controls;
using MaterialDesignThemes.Wpf;

namespace Material.Application.MaterialDesign
{
    public static partial class MaterialDesignHelper
    {
        private sealed class CustomPasswordBoxHintProxy : IHintProxy
        {
            private readonly PasswordBox passwordBox;

            public bool IsEmpty() => passwordBox.SecurePassword?.Length == 0
                && !passwordBox.IsKeyboardFocused;

            public object Content
            {
                get
                {
                    throw new NotImplementedException();
                }
            }

            public bool IsLoaded => passwordBox.IsLoaded;

            public bool IsVisible => passwordBox.IsVisible;

            public event EventHandler ContentChanged;
            public event EventHandler IsVisibleChanged;
            public event EventHandler Loaded;

            public CustomPasswordBoxHintProxy(PasswordBox passwordBox)
            {
                if (passwordBox == null) throw new ArgumentNullException(nameof(passwordBox));

                this.passwordBox = passwordBox;
                this.passwordBox.PasswordChanged += PasswordBoxPasswordChanged;
                this.passwordBox.IsKeyboardFocusedChanged += PasswordBoxFocusChanged;
                this.passwordBox.Loaded += PasswordBoxLoaded;
                this.passwordBox.IsVisibleChanged += PasswordBoxIsVisibleChanged;
            }

            private void PasswordBoxIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
            {
                IsVisibleChanged?.Invoke(this, EventArgs.Empty);
            }

            private void PasswordBoxLoaded(object sender, RoutedEventArgs e)
            {
                Loaded?.Invoke(this, EventArgs.Empty);
            }

            private void PasswordBoxFocusChanged(object sender, DependencyPropertyChangedEventArgs e)
            {
                ContentChanged?.Invoke(this, EventArgs.Empty);
            }

            private void PasswordBoxPasswordChanged(object sender, RoutedEventArgs e)
            {
                ContentChanged?.Invoke(this, EventArgs.Empty);
            }

            public void Dispose()
            {
                passwordBox.PasswordChanged -= PasswordBoxPasswordChanged;
                passwordBox.IsKeyboardFocusedChanged -= PasswordBoxFocusChanged;
                passwordBox.Loaded -= PasswordBoxLoaded;
                passwordBox.IsVisibleChanged -= PasswordBoxIsVisibleChanged;
            }
        }
    }
}


text:
package org.gradoop.flink.io.impl.csv.tuples;

import org.apache.flink.api.java.tuple.Tuple3;

/**
 * Tuple representing an graph head in a CSV file.
 */
public class CSVGraphHead extends Tuple3<String, String, String> implements CSVElement {

  @Override
  public String getId() {
    return f0;
  }

  @Override
  public void setId(String id) {
    f0 = id;
  }

  @Override
  public String getLabel() {
    return f1;
  }

  @Override
  public void setLabel(String label) {
    f1 = label;
  }

  @Override
  public String getProperties() {
    return f2;
  }

  @Override
  public void setProperties(String properties) {
    f2 = properties;
  }
}


text:
#include "alt_types.h"
#include "sys/alt_dev.h"
#include "altera_avalon_jtag_uart.h"

extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp,
  char* buffer, int space, int flags);
extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp,
  const char* ptr, int count, int flags);
extern int altera_avalon_jtag_uart_ioctl(altera_avalon_jtag_uart_state* sp,
  int req, void* arg);
extern int altera_avalon_jtag_uart_close(altera_avalon_jtag_uart_state* sp,
  int flags);

/* ----------------------------------------------------------------------- */
/* --------------------- WRAPPERS FOR ALT FD SUPPORT --------------------- */
/*
 *
 */

int
altera_avalon_jtag_uart_read_fd(alt_fd* fd, char* buffer, int space)
{
    altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev;

    return altera_avalon_jtag_uart_read(&dev->state, buffer, space,
      fd->fd_flags);
}

int
altera_avalon_jtag_uart_write_fd(alt_fd* fd, const char* buffer, int space)
{
    altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev;

    return altera_avalon_jtag_uart_write(&dev->state, buffer, space,
      fd->fd_flags);
}

#ifndef ALTERA_AVALON_JTAG_UART_SMALL

int
altera_avalon_jtag_uart_close_fd(alt_fd* fd)
{
    altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev;

    return altera_avalon_jtag_uart_close(&dev->state, fd->fd_flags);
}

int
altera_avalon_jtag_uart_ioctl_fd(alt_fd* fd, int req, void* arg)
{
    altera_avalon_jtag_uart_dev* dev = (altera_avalon_jtag_uart_dev*) fd->dev;

    return altera_avalon_jtag_uart_ioctl(&dev->state, req, arg);
}

#endif /* ALTERA_AVALON_JTAG_UART_SMALL */


text:
<?php
error_reporting(-1);
ini_set('display_errors', 1);

require 'vendor/autoload.php';

Dotenv::load(__DIR__);

$session = new SpotifyWebAPI\Session(
    getenv('SPOTIFY_CLIENT_ID'),
    getenv('SPOTIFY_CLIENT_SECRET'),
    getenv('SPOTIFY_REDIRECT_URI')
);

$api = new SpotifyWebAPI\SpotifyWebAPI();

if (isset($_GET['code'])) {
    $session->requestAccessToken($_GET['code']);
    $api->setAccessToken($session->getAccessToken());

    print_r($api->me());
} else {
    $scopes = array(
        'scope' => array(
            'user-read-email',
            'user-library-modify',
        ),
    );

    header('Location: ' . $session->getAuthorizeUrl($scopes));
}


text:
require "rails"

module Alchemy
  module Generators
    class ModuleGenerator < ::Rails::Generators::Base
      desc "This generator generates an Alchemy module for you."
      argument :module_name, banner: "your_module_name"
      source_root File.expand_path("templates", __dir__)

      def init
        @module_name = module_name.downcase
        @class_name = @module_name.singularize.classify
        @controller_name = @module_name.tableize
        @controller_class = @controller_name.classify.pluralize
      end

      def make_route
        route "namespace :admin do\n    resources :#{@controller_name}\n  end"
      end

      def copy_templates
        template "controller.rb.tt", "app/controllers/admin/#{@controller_name}_controller.rb"
        template "ability.rb.tt", "app/models/#{@module_name}_ability.rb"
        template "module_config.rb.tt", "config/initializers/alchemy_#{@module_name}.rb"
      end
    end
  end
end


text:
<novo-data-table [dataTableService]="remoteService"
                 [columns]="sharedColumns"
                 [allowMultipleFilters]="true"
                 [hideGlobalSearch]="!globalSearchEnabled"
                 [displayedColumns]="sharedDisplayColumns"
                 [paginationOptions]="widePaginationOptions"
                 [fixedHeader]="true">

  <ng-template novoTemplate="custom"
               let-row
               let-col="col">
    CUSTOM {{ row.name }}
    CUSTOM
  </ng-template>
</novo-data-table>


text:
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.Azure.Management.WebSites.Models;

namespace Microsoft.Azure.Management.WebSites.Models
{
    /// <summary>
    /// The Get Web Hosting Plan operation response.
    /// </summary>
    public partial class WebHostingPlanGetResponse : AzureOperationResponse
    {
        private WebHostingPlan _webHostingPlan;

        /// <summary>
        /// Optional. Details for the requested Web Hosting Plan.
        /// </summary>
        public WebHostingPlan WebHostingPlan
        {
            get { return this._webHostingPlan; }
            set { this._webHostingPlan = value; }
        }

        /// <summary>
        /// Initializes a new instance of the WebHostingPlanGetResponse class.
        /// </summary>
        public WebHostingPlanGetResponse()
        {
        }
    }
}


text:
int serialOpen(char* port_address, int baud_rate);
int serialFlush(int fd);
int serialFlushRead(int fd);
int serialFlushWrite(int fd);
int serialWrite(int fd, char* data, int length);
int serialRead(int fd, char* temp, int length);
int serialCommandByDelim(int fd, char* cmd, char* reply, int replyLength, int usecs, char delim);
int serialCommandByLength(int fd, char* cmd, char* reply, int replyLength, int usecs);
int serialBufferCount(int fd);
int serialClose(int fd);


text:
<?php

namespace Oro\Bundle\CurrencyBundle\Tests\Unit\ImportExport\Serializer\Normalizer;

use Oro\Bundle\CurrencyBundle\Entity\MultiCurrency;
use Oro\Bundle\CurrencyBundle\ImportExport\Serializer\Normalizer\MultiCurrencyNormalizer;
use Oro\Bundle\LocaleBundle\Formatter\NumberFormatter;

class MultiCurrencyNormalizerTest extends \PHPUnit\Framework\TestCase
{
    /**
     * @var NumberFormatter|\PHPUnit\Framework\MockObject\MockObject
     */
    private $formatter;

    /**
     * @var MultiCurrencyNormalizer
     */
    private $normalizer;

    protected function setUp()
    {
        $this->formatter  = $this->createMock(NumberFormatter::class);
        $this->normalizer = new MultiCurrencyNormalizer($this->formatter);
    }

    public function testSupportsNormalization()
    {
        $multiCurrency = new MultiCurrency('100', 'USD');
        $isNormalizationSupports = $this->normalizer->supportsNormalization($multiCurrency);
        $this->assertTrue($isNormalizationSupports);
    }

    public function testNotSupportsNormalization()
    {
        $multiCurrency = new \stdClass();
        $isNormalizationSupports = $this->normalizer->supportsNormalization($multiCurrency);
        $this->assertFalse($isNormalizationSupports);
    }

    /**
     * @dataProvider getNormalizerData
     *
     * @param string $value
     * @param string $currency
     */
    public function testNormalizeShouldGenerateCorrectString($value, $currency)
    {
        $multiCurrency  = new MultiCurrency($value, $currency);
        $formattedValue = $currency.$value;
        $this->formatter->expects($this->once())
            ->method('formatCurrency')
            ->willReturn($formattedValue);

        $this->assertEquals($formattedValue, $this->normalizer->normalize($multiCurrency));
    }

    /**
     * @return array
     */
    public function getNormalizerData()
    {
        return [
            ['100.00', 'USD']
        ];
    }
}


text:
[![NPM version](https://img.shields.io/npm/v/trace-and-clarify-if-possible.svg)](https://npmjs.com/package/trace-and-clarify-if-possible)
[![Travis Build Status](https://travis-ci.org/nknapp/trace-and-clarify-if-possible.svg?branch=master)](https://travis-ci.org/nknapp/trace-and-clarify-if-possible)
[![Coverage Status](https://img.shields.io/coveralls/nknapp/trace-and-clarify-if-possible.svg)](https://coveralls.io/r/nknapp/trace-and-clarify-if-possible)

> Use `trace` and `clarify` if supported by the current node version

[trace](https://npmjs.com/package/trace) and [clarify](https://npmjs.com/package/clarify) can help greatly to analyze stack-traces

* `trace` shows the part of the stack that would otherwise disappear due to asynchronous callbacks
* `clarify` removes uninteresting parts of the stack

Sadly, `trace` can is only compatible with NodeJS version >=4. It makes sense to include `trace` in your tests all the time (not in production code though). However, when you run the test in [Travis CI](https://travis-ci.org/) with multiple node versions <4, the tests will break.

This package include `trace` and `clarify` only for supported node versions.

# Installation

```
npm install trace-and-clarify-if-possible
```

## Usage

Put the following line a module that is loaded at the start of your program or testcase-spec (remember, do not use in production).

```js
require('trace-and-clarify-if-possible')
```

Or, you can put `--require trace-and-clarify-if-possible into your `test/mocha.opts` to activate it for all tests

# License

`trace-and-clarify-if-possible` is published under the MIT-license.

See [LICENSE.md](LICENSE.md) for details.

# Release-Notes

For release notes, see [CHANGELOG.md](CHANGELOG.md)

# Contributing guidelines

See [CONTRIBUTING.md](CONTRIBUTING.md).


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>File Brew</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/svg" href="/images/favicon.ico">


text:
require 'vk/api/objects'
require 'vk/schema/namespace'

module Vk
  module API
    class Market < Vk::Schema::Namespace
      # @see https://github.com/VKCOM/vk-api-schema/blob/master/objects.json
      class Currency < Vk::Schema::Object
        # @return [Integer] Currency ID
        attribute :id, API::Types::Coercible::Int
        # @return [String] Currency sign
        attribute :name, API::Types::Coercible::String
      end
    end
  end
end


text:
"""
    Lob

    The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?   # noqa: E501

    The version of the OpenAPI document: 1.3.0
    Contact: lob-openapi@lob.com
    Generated by: https://openapi-generator.tech
"""

import re  # noqa: F401
import sys  # noqa: F401

from lob_python.api_client import ApiClient, Endpoint as _Endpoint
from lob_python.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types
)
from lob_python.model.include_model import IncludeModel
from lob_python.model.lob_error import LobError
from lob_python.model.metadata_model import MetadataModel
from lob_python.model.template import Template
from lob_python.model.template_deletion import TemplateDeletion
from lob_python.model.template_list import TemplateList
from lob_python.model.template_update import TemplateUpdate
from lob_python.model.template_writable import TemplateWritable
from lob_python.model.tmpl_id import TmplId

class TemplatesApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client
        self.create_endpoint = _Endpoint(
            settings={
                'response_type': (Template,),
                'auth': [
                    'basicAuth'
                ],
                'endpoint_path': '/templates',
                'operation_id': 'create',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'template_writable',
                ],
                'required': [
                    'template_writable',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'template_writable':
                        (TemplateWritable,),
                },
                'attribute_map': {
                },
                'location_map': {
                    'template_writable': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json',
                    'application/x-www-form-urlencoded',
                    'multipart/form-data'
                ]
            },
            api_client=api_client
        )
        self.delete_endpoint = _Endpoint(
            settings={
                'response_type': (TemplateDeletion,),
                'auth': [
                    'basicAuth'
                ],
                'endpoint_path': '/templates/{tmpl_id}',
                'operation_id': 'delete',
                'http_method': 'DELETE',
                'servers': None,
            },
            params_map={
                'all': [
                    'tmpl_id',
                ],
                'required': [
                    'tmpl_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'tmpl_id':
                        (TmplId,),
                },
                'attribute_map': {
                    'tmpl_id': 'tmpl_id',
                },
                'location_map': {
                    'tmpl_id': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.get_endpoint = _Endpoint(
            settings={
                'response_type': (Template,),
                'auth': [
                    'basicAuth'
                ],
                'endpoint_path': '/templates/{tmpl_id}',
                'operation_id': 'get',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'tmpl_id',
                ],
                'required': [
                    'tmpl_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'tmpl_id':
                        (TmplId,),
                },
                'attribute_map': {
                    'tmpl_id': 'tmpl_id',
                },
                'location_map': {
                    'tmpl_id': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.update_endpoint = _Endpoint(
            settings={
                'response_type': (Template,),
                'auth': [
                    'basicAuth'
                ],
                'endpoint_path': '/templates/{tmpl_id}',
                'operation_id': 'update',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'tmpl_id',
                    'template_update',
                ],
                'required': [
                    'tmpl_id',
                    'template_update',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'tmpl_id':
                        (TmplId,),
                    'template_update':
                        (TemplateUpdate,),
                },
                'attribute_map': {
                    'tmpl_id': 'tmpl_id',
                },
                'location_map': {
                    'tmpl_id': 'path',
                    'template_update': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json',
                    'application/x-www-form-urlencoded',
                    'multipart/form-data'
                ]
            },
            api_client=api_client
        )
        self.list_endpoint = _Endpoint(
            settings={
                'response_type': (TemplateList,),
                'auth': [
                    'basicAuth'
                ],
                'endpoint_path': '/templates',
                'operation_id': 'list',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'limit',
                    'before',
                    'after',
                    'include',
                    'date_created',
                    'metadata',
                ],
                'required': [],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'limit',
                ]
            },
            root_map={
                'validations': {
                    ('limit',): {

                        'inclusive_maximum': 100,
                        'inclusive_minimum': 1,
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'limit':
                        (int,),
                    'before':
                        (str,),
                    'after':
                        (str,),
                    'include':
                        (IncludeModel,),
                    'date_created':
                        ({str: (datetime,)},),
                    'metadata':
                        (MetadataModel,),
                },
                'attribute_map': {
                    'limit': 'limit',
                    'before': 'before',
                    'after': 'after',
                    'include': 'include',
                    'date_created': 'date_created',
                    'metadata': 'metadata',
                },
                'location_map': {
                    'limit': 'query',
                    'before': 'query',
                    'after': 'query',
                    'include': 'query',
                    'date_created': 'query',
                    'metadata': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )

    def create(
        self,
        template_writable,
        **kwargs
    ):
        """create  # noqa: E501

        Creates a new template for use with the Print & Mail API. In Live mode, you can only have as many non-deleted templates as allotted in your current [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions). If you attempt to create a template past your limit, you will receive a `403` error. There is no limit in Test mode.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.create(template_writable, async_req=True)
        >>> result = thread.get()

        Args:
            template_writable (TemplateWritable):

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            Template
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['template_writable'] = \
            template_writable
        return self.create_endpoint.call_with_http_info(**kwargs)

    def delete(
        self,
        tmpl_id,
        **kwargs
    ):
        """delete  # noqa: E501

        Permanently deletes a template.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.delete(tmpl_id, async_req=True)
        >>> result = thread.get()

        Args:
            tmpl_id (TmplId): id of the template

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            TemplateDeletion
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['tmpl_id'] = \
            tmpl_id
        return self.delete_endpoint.call_with_http_info(**kwargs)

    def get(
        self,
        tmpl_id,
        **kwargs
    ):
        """get  # noqa: E501

        Retrieves the details of an existing template.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get(tmpl_id, async_req=True)
        >>> result = thread.get()

        Args:
            tmpl_id (TmplId): id of the template

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            Template
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['tmpl_id'] = \
            tmpl_id
        return self.get_endpoint.call_with_http_info(**kwargs)

    def update(
        self,
        tmpl_id,
        template_update,
        **kwargs
    ):
        """update  # noqa: E501

        Updates the description and/or published version of the template with the given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.update(tmpl_id, template_update, async_req=True)
        >>> result = thread.get()

        Args:
            tmpl_id (TmplId): id of the template
            template_update (TemplateUpdate):

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            Template
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['tmpl_id'] = \
            tmpl_id
        kwargs['template_update'] = \
            template_update
        return self.update_endpoint.call_with_http_info(**kwargs)

    def list(
        self,
        **kwargs
    ):
        """list  # noqa: E501

        Returns a list of your templates. The templates are returned sorted by creation date, with the most recently created templates appearing first.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.list(async_req=True)
        >>> result = thread.get()

        Keyword Args:
            limit (int): How many results to return.. [optional] if omitted the server will use the default value of 10
            before (str): A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the `previous_url` field in the return response. . [optional]
            after (str): A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the `next_url` field in the return response. . [optional]
            include (IncludeModel): Request that the response include the total count by specifying `include[]=total_count`. . [optional]
            date_created ({str: (datetime,)}): Filter by date created.. [optional]
            metadata (MetadataModel): Filter by metadata key-value pair`.. [optional]
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            TemplateList
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        return self.list_endpoint.call_with_http_info(**kwargs)


text:
#ifndef __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_INPUT_UNIT_D_HH__
#define __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_INPUT_UNIT_D_HH__

#include <iostream>
#include <vector>

#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/CreditLink_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.hh"
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
#include "mem/ruby/network/garnet/NetworkHeader.hh"

class Router_d;

class InputUnit_d : public Consumer
{
  public:
    InputUnit_d(int id, Router_d *router);
    ~InputUnit_d();

    void wakeup();
    flitBuffer_d* getCreditQueue() { return creditQueue; }
    void print(std::ostream& out) const {};

    inline int get_inlink_id() { return m_in_link->get_id(); }

    inline void
    set_vc_state(VC_state_type state, int vc, Cycles curTime)
    {
        m_vcs[vc]->set_state(state, curTime);
    }

    inline void
    set_enqueue_time(int invc, Cycles time)
    {
        m_vcs[invc]->set_enqueue_time(time);
    }

    inline Cycles
    get_enqueue_time(int invc)
    {
        return m_vcs[invc]->get_enqueue_time();
    }

    inline void
    update_credit(int in_vc, int credit)
    {
        m_vcs[in_vc]->update_credit(credit);
    }

    inline bool
    has_credits(int vc)
    {
        return m_vcs[vc]->has_credits();
    }

    inline void
    increment_credit(int in_vc, bool free_signal, Cycles curTime)
    {
        flit_d *t_flit = new flit_d(in_vc, free_signal, curTime);
        creditQueue->insert(t_flit);
        m_credit_link->scheduleEventAbsolute(m_router->clockEdge(Cycles(1)));
    }

    inline int
    get_outvc(int invc)
    {
        return m_vcs[invc]->get_outvc();
    }

    inline void
    updateRoute(int vc, int outport, Cycles curTime)
    {
        m_vcs[vc]->set_outport(outport);
        m_vcs[vc]->set_state(VC_AB_, curTime);
    }

    inline void
    grant_vc(int in_vc, int out_vc, Cycles curTime)
    {
        m_vcs[in_vc]->grant_vc(out_vc, curTime);
    }

    inline flit_d*
    peekTopFlit(int vc)
    {
        return m_vcs[vc]->peekTopFlit();
    }

    inline flit_d*
    getTopFlit(int vc)
    {
        return m_vcs[vc]->getTopFlit();
    }

    inline bool
    need_stage(int vc, VC_state_type state, flit_stage stage, Cycles cTime)
    {
        return m_vcs[vc]->need_stage(state, stage, cTime);
    }

    inline bool
    isReady(int invc, Cycles curTime)
    {
        return m_vcs[invc]->isReady(curTime);
    }

    inline int
    get_route(int vc)
    {
        return m_vcs[vc]->get_route();
    }

    inline void
    set_in_link(NetworkLink_d *link)
    {
        m_in_link = link;
    }

    inline void
    set_credit_link(CreditLink_d *credit_link)
    {
        m_credit_link = credit_link;
    }

    double get_buf_read_count(unsigned int vnet) const
    { return m_num_buffer_reads[vnet]; }
    double get_buf_write_count(unsigned int vnet) const
    { return m_num_buffer_writes[vnet]; }

    uint32_t functionalWrite(Packet *pkt);

  private:
    int m_id;
    int m_num_vcs;
    int m_vc_per_vnet;

    Router_d *m_router;
    NetworkLink_d *m_in_link;
    CreditLink_d *m_credit_link;
    flitBuffer_d *creditQueue;

    // Virtual channels
    std::vector<VirtualChannel_d *> m_vcs;

    // Statistical variables
    std::vector<double> m_num_buffer_writes;
    std::vector<double> m_num_buffer_reads;
};

#endif // __MEM_RUBY_NETWORK_GARNET_FIXED_PIPELINE_INPUT_UNIT_D_HH__


text:
package com.ibgwy;

import com.google.common.base.Preconditions;
import com.ib.client.*;
import com.ibgwy.events.InstrumentUpdate;
import com.ibgwy.events.OrderAccepted;
import com.ibgwy.events.OrderExecuted;

/**
 * TODO: Add JavaDoc!
 * <p/>
 * User: Vishal Puri
 */
public class InBound implements EWrapper {

  /*--------------------------------------------
  |             C O N S T A N T S             |
  ============================================*/

  /*--------------------------------------------
  |    I N S T A N C E   V A R I A B L E S    |
  ============================================*/

  private EventBusWrapper eventBus;

  private IBApiHelper ibApiHelper;

  /*--------------------------------------------
  |         C O N S T R U C T O R S           |
  ============================================*/
  public InBound(EventBusWrapper eventBus, IBApiHelper ibApiHelper) {
    Preconditions.checkNotNull(eventBus);
    Preconditions.checkNotNull(ibApiHelper);
    this.eventBus = eventBus;
    this.ibApiHelper = ibApiHelper;
  }

  /*--------------------------------------------
  |              M E T H O D S                |
  ============================================*/

  /**
   * Reference: http://www.interactivebrokers.com/php/apiUsersGuide/apiguide/java/tickprice.htm
   *
   * @param tickerId
   * @param tickType
   * @param price
   * @param canAutoExecute
   */
  @Override
  public void tickPrice(int tickerId, int tickType, double price, int canAutoExecute) {
    InstrumentUpdate instrumentUpdate = new InstrumentUpdate();
    instrumentUpdate.setId(tickerId);
    instrumentUpdate.setPrice(tickType, price);
    eventBus.post(instrumentUpdate);
  }

  @Override
  public void tickSize(int tickerId, int tickType, int size) {
    InstrumentUpdate instrumentUpdate = new InstrumentUpdate();
    instrumentUpdate.setId(tickerId);
    instrumentUpdate.setSize(tickType, size);
    eventBus.post(instrumentUpdate);
  }

  /**
   * @param tickerId
   * @param field
   * @param impliedVol
   * @param delta
   * @param optPrice
   * @param pvDividend
   * @param gamma
   * @param vega
   * @param theta
   * @param undPrice
   */
  @Override
  public void tickOptionComputation(int tickerId, int field, double impliedVol, double delta, double optPrice, double
      pvDividend, double gamma, double vega, double theta, double undPrice) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void tickGeneric(int tickerId, int tickType, double value) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void tickString(int tickerId, int tickType, String value) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void tickEFP(int tickerId, int tickType, double basisPoints, String formattedBasisPoints,
                      double impliedFuture, int holdDays, String futureExpiry, double dividendImpact,
                      double dividendsToExpiry) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  // TODO: Handle other status codes
  @Override
  public void orderStatus(int orderId, String status, int filled, int remaining, double avgFillPrice, int permId,
                          int parentId, double lastFillPrice, int clientId, String whyHeld) {

    if (status.equals(IBApiHelper.OrderStatus.Filled.name())) {
      OrderExecuted event = new OrderExecuted();
      event.setId(orderId);
      event.setPrice(lastFillPrice);
      event.setFilled(filled);
      event.setRemaining(remaining);
      eventBus.post(event);
    } else if (status.equals((IBApiHelper.OrderStatus.Submitted.name()))) {
      OrderAccepted event = new OrderAccepted();
      eventBus.post(event);
    }
  }

  @Override
  public void openOrder(int orderId, Contract contract, Order order, OrderState orderState) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void openOrderEnd() {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void updateAccountValue(String key, String value, String currency, String accountName) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void updatePortfolio(Contract contract, int position, double marketPrice, double marketValue, double
      averageCost, double unrealizedPNL, double realizedPNL, String accountName) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void updateAccountTime(String timeStamp) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void accountDownloadEnd(String accountName) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void nextValidId(int orderId) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void contractDetails(int reqId, ContractDetails contractDetails) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void bondContractDetails(int reqId, ContractDetails contractDetails) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void contractDetailsEnd(int reqId) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void execDetails(int reqId, Contract contract, Execution execution) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void execDetailsEnd(int reqId) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void updateMktDepth(int tickerId, int position, int operation, int side, double price, int size) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void updateMktDepthL2(int tickerId, int position, String marketMaker, int operation, int side, double price,
                               int size) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void updateNewsBulletin(int msgId, int msgType, String message, String origExchange) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void managedAccounts(String accountsList) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void receiveFA(int faDataType, String xml) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void historicalData(int reqId, String date, double open, double high, double low, double close, int volume,
                             int count, double WAP, boolean hasGaps) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void scannerParameters(String xml) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void scannerData(int reqId, int rank, ContractDetails contractDetails, String distance, String benchmark,
                          String projection, String legsStr) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void scannerDataEnd(int reqId) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void realtimeBar(int reqId, long time, double open, double high, double low, double close, long volume,
                          double wap, int count) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void currentTime(long time) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void fundamentalData(int reqId, String data) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void deltaNeutralValidation(int reqId, UnderComp underComp) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void tickSnapshotEnd(int reqId) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void marketDataType(int reqId, int marketDataType) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void commissionReport(CommissionReport commissionReport) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void error(Exception e) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void error(String str) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void error(int id, int errorCode, String errorMsg) {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  @Override
  public void connectionClosed() {
    //To change body of implemented methods use File | Settings | File Templates.
  }
}


text:
#include <stdio.h>
#include BOSS_OPENSSL_U_internal__cryptlib_h //original-code:"internal/cryptlib.h"
#include BOSS_OPENSSL_V_openssl__rsa_h //original-code:<openssl/rsa.h>
#include BOSS_OPENSSL_V_openssl__evp_h //original-code:<openssl/evp.h>
#include BOSS_OPENSSL_V_openssl__objects_h //original-code:<openssl/objects.h>
#include BOSS_OPENSSL_V_openssl__x509_h //original-code:<openssl/x509.h>

int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
                         EVP_PKEY *priv)
{
    int ret = -1;

#ifndef OPENSSL_NO_RSA
    if (EVP_PKEY_id(priv) != EVP_PKEY_RSA) {
#endif
        EVPerr(EVP_F_EVP_PKEY_DECRYPT_OLD, EVP_R_PUBLIC_KEY_NOT_RSA);
#ifndef OPENSSL_NO_RSA
        goto err;
    }

    ret =
        RSA_private_decrypt(ekl, ek, key, EVP_PKEY_get0_RSA(priv),
                            RSA_PKCS1_PADDING);
 err:
#endif
    return ret;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
	<bean id="job1" name="job1" class="org.imirsel.nema.model.Job"
		p:id="100" p:name="job1" p:description="this is the first mock job"
		p:statusCode="1" p:flow-ref="flow1" />

	<bean id="job2" name="job2" class="org.imirsel.nema.model.Job">
		<property name="id" value="5000" />
		<property name="name" value="job2" />
		<property name="description" value="second mock job" />
		<property name="statusCode" value="4" />
		<property name="host" value="nema-c-1" />
		<property name="port" value="11714" />
		<property name="flow" ref="flow2" />
	</bean>

	<bean id="job3" name="job3" class="org.imirsel.nema.model.Job">
		<property name="id" value="5001" />
		<property name="name" value="job3" />
		<property name="description" value=" mock job #3" />
		<property name="statusCode" value="3" />
		<property name="results">
			<set>
				<ref bean="result1" />
				<ref bean="result2" />
			</set>
		</property>
		<property name="flow" ref="flow3" />

	</bean>

	<util:list id="jobList">
		<ref bean="job1" />
		<ref bean="job2" />
		<ref bean="job3" />
	</util:list>

	<bean id="jobResult1" name="result1" class="org.imirsel.nema.model.JobResult"
		p:url="http://mock.nema.lis.illinois.edu/result1" p:job-ref="job3"
		p:id="1" />

	<bean id="jobResult2" name="result2" class="org.imirsel.nema.model.JobResult"
		p:url="http://mock.nema.lis.illinois.edu/result2" p:job-ref="job3"
		p:id="2" />

	<bean id="user" name="user" class="org.imirsel.nema.model.User"
		p:id="100" p:username="userA" p:email="mock@nema.uiuc.edu"/>

	<bean id="flow1" name="flow1" class="org.imirsel.nema.model.Flow"
		p:uri="http://mock.nema.lis.illinois.edu/flow1" p:id="10" p:name="flow 1"
		p:type="FEATURE_EXTRACTION" />
	<bean id="flow2" name="flow2" class="org.imirsel.nema.model.Flow"
		p:uri="http://mock.nema.lis.illinois.edu/flow2" p:id="10" p:name="flow two"
		p:type="FEATURE_EXTRACTION" />
	<bean id="flow3" name="flow3" class="org.imirsel.nema.model.Flow"
		p:uri="http://mock.nema.lis.illinois.edu/flow3" p:id="10" p:name="flow THREE"
		p:type="CLASSIFICATION"/>

	<util:set id="flowSet">
		<ref bean="flow1"/>
		<ref bean="flow2"/>
		<ref bean="flow3"/>
	</util:set>
</beans>


text:
<!DOCTYPE html>

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta charset="utf-8">
  <title>Henge</title>
  <link rel="stylesheet" href="/vendor/bootstrap-3.3.7/css/bootstrap.min.css">
  <link rel="stylesheet" href="/css/site.css">

Floor 43 Image Credits

      01
      02
      03
      04
      05
      06
      07
      08
      09
      10
      11
      12

      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24

      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36

      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48

      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60

      61
      62
      63
      64
      65
      66
      67
      68
      69
      70
      71
      72

      73
      74
      75
      76
      77
      78
      79
      80
      81
      82
      83

Circle #508 co_ment +

commandment

      Public domain / Wikipedia

commencement

      By ptksgc / CC0 / Pixabay

commitment

      By claudioscott / CC0 / Pixabay

compartment

      GFDL / Wikipedia

complement

      By 422737 / CC0 / Pixabay

compliment

      By Irasutoya / License

Circle #509 co_ne +

confine

      By Falkenpost / CC0 / Pixabay

Circle #511 co_ous +

coniferous

      By PublicDomainPictures / CC0 / Pixabay

conscientious

      By Irasutoya / License

conspicuous

      By Magnascan / CC0 / Pixabay

contagious

      By qimono / CC0 / Pixabay

contemporaneous

      By Photoman / CC0 / Pixabay

contemptuous

      By bstad / CC0 / Pixabay

contentious

      By Irasutoya / License

contiguous

      By Mimzy / CC0 / Pixabay

Circle #512 co_rate +

commemorate

      By stux / CC0 / Pixabay

commensurate

      By Mediamodifier / CC0 / Pixabay

commiserate

      By Armitas / CC0 / Pixabay

confederate

      Public domain / Wikipedia

conglomerate

      CC BY-SA 3.0 / Wikipedia

consecrate

      By srsusan / CC0 / Pixabay

considerate

      By kalhh / CC0 / Pixabay

Circle #513 co_re +

concessionaire

      By reverent / CC0 / Pixabay

Circle #514 co_sion +

compassion

      By andreas160578 / CC0 / Pixabay

comprehension

      By Trandoshan / CC0 / Pixabay

compulsion

      By Berzin / CC0 / Pixabay

Circle #516 col_l +

collateral

      By nattanan23 / CC0 / Pixabay


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/Bridge.iml" filepath="$PROJECT_DIR$/Bridge.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
    </modules>
  </component>
</project>


text:
/**
 * @fileOverview Worker executes auction processing.
 */

var debug = require('debug')('auction-game:worker');
var moment = require('moment');

var db = require('./lib/db');
var Auction = db.Auction;
var auctionService = require('./lib/auction-service')(db);

var timeoutId;

/**
 * Socket.io instance.
 *
 * @type       {socket.io}
 */
var io;

/**
 * Updates auction data.
 *
 * @method     tick
 */
function tick() {
  debug('Auction tick');

  Auction.getCurrent(function (err, current) {
    if (err) return console.error(err);

    if (current) {

      // calculating time left
      var endMoment = moment(current.end_time);
      var nowMoment = moment();
      var timeLeft = endMoment.diff(nowMoment, 's');
      current.timeLeft = timeLeft;

      // notify clients
      io.emit('auction-updated', current);

      debug('Current auction (' + current.id  + ') is still active. Going sleep for 1s...');

      timeoutId = setTimeout(tick, 1000);
      return;
    }

    // getting latest auction and processing if required
    Auction.getLatest(function (err, latest) {
      if (err) return console.error(err);

      if (latest && !latest.done) {
        debug('Processing auction ' + latest.id + ': ' + latest.item + ' x ' + latest.quantity + ' = ' + latest.bid);

        return auctionService.processAuction(latest, function (err) {
          if (err) return console.error(err);

          debug('Auction ' + latest.id + ' successfully processed. Going sleep for 10s...');

          // notify clients that auction has been processed
          io.emit('auction-completed');

          timeoutId = setTimeout(tick, 10 * 1000); // 10 seconds delay before next auction
        });
      }

      // starting new auction
      debug('Checking queue for new auctions...');
      auctionService.startAuction(function (err, result) {
        if (err) return console.error(err);

        var auction = result.auction;
        if (auction) {
          if (result.ok) {
            debug('New auction ' + auction.id + ' has been started.');

            // notify clients
            io.emit('auction-started');
          } else {
            // could not start auction (not enough items)
            debug('Auction ' + auction.id + ' could not be started: ' + result.error);

            // checking queue again
            timeoutId = setTimeout(tick, 0);
            return;
          }
        } else {
          // notify clients
            io.emit('no-auctions');
        }

        timeoutId = setTimeout(tick, 1000);
      });
    });

  });
}

/**
 * Auction worker process.
 *
 * @method     exports
 * @param      {Object}  server  Server object.
 * @return     {Object}  Worker interface.
 */
module.exports = function (server) {
  io = require('socket.io')(server);

  var socketPlayers = {};
  var playerSockets = {};
  io.on('connection', function(socket){
    // player logged in
    socket.on('login', function(player_id) {
      debug('Player ' + player_id + ' just logged in.');

      var anotherSocket = playerSockets[player_id];
      if (anotherSocket && anotherSocket.id !== socket.id) {
        // somebody else logged in with the same name, logging out him
        debug('Logging out other user logged in as player ' + player_id + '.');

        socketPlayers[anotherSocket.id] = null;
        playerSockets[player_id].emit('logout');
      }

      var previousPlayerId = socketPlayers[socket.id];
      if (previousPlayerId) {
        // this socket was logged in as another player
        playerSockets[previousPlayerId] = null;
      }

      // saving player connection
      socketPlayers[socket.id] = player_id;
      playerSockets[player_id] = socket;
    });

    // player disconnected
    socket.on('disconnect', function() {
      var playerId = socketPlayers[socket.id];
      debug('Player ' + playerId + ' disconnected.');

      delete playerSockets[playerId];
      delete socketPlayers[socket.id];
    });
  });

  return {
    start: function () {
      timeoutId = setTimeout(tick, 1000);
    },
    stop: function () {
      if (timeoutId) {
        clearTimeout(timeoutId);
      }

      timeoutId = null;
    }
  };
};


text:
package com.thinkbiganalytics.spark.dataprofiler.testcases;

import com.thinkbiganalytics.spark.dataprofiler.columns.StandardColumnStatistics;
import com.thinkbiganalytics.spark.dataprofiler.columns.StringColumnStatistics;
import com.thinkbiganalytics.spark.dataprofiler.core.ProfilerTest;
import com.thinkbiganalytics.spark.dataprofiler.topn.TopNDataItem;
import com.thinkbiganalytics.spark.dataprofiler.topn.TopNDataList;

import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.util.Iterator;
import java.util.TreeSet;

import static org.junit.Assert.assertEquals;

/**
 * String Column Statistics Test Case
 */
public class StringColumnCase3Test extends ProfilerTest {

    private static StandardColumnStatistics columnStats;
    private static long nullCount;
    private static long totalCount;
    private static long uniqueCount;
    private static double percNullValues;
    private static double percUniqueValues;
    private static double percDuplicateValues;
    private static TopNDataList topNValues;
    private static int maxLength;
    private static int minLength;
    private static String longestString;
    private static String shortestString;
    private static long emptyCount;
    private static double percEmptyValues;
    private static String minStringCase;
    private static String maxStringCase;
    private static String minStringICase;
    private static String maxStringICase;

    @AfterClass
    public static void tearDownClass() {
        System.out.println("\t*** Completed run for StringColumnCase1Test ***");
    }

    @Before
    public void setUp() {
        super.setUp();

        columnStats = columnStatsMap.get(4);        //description (comes as varchar(n))
        nullCount = 1L;
        totalCount = 10L;
        uniqueCount = 9L;
        percNullValues = 10.0d;
        percUniqueValues = 90.0d;
        percDuplicateValues = 10.0d;
        topNValues = columnStats.getTopNValues();
        maxLength = 17;
        minLength = 5;
        longestString = "Elizabeth::Taylor";
        shortestString = "Jon::";
        emptyCount = 0;
        percEmptyValues = 0.0d;
        minStringCase = "::Edmundson Jr";
        maxStringCase = "Rachael::Hu";
        minStringICase = "::Edmundson Jr";
        maxStringICase = "Rachael::Hu";

    }

    @Test
    public void testStringNullCount() {
        Assert.assertEquals(nullCount, columnStats.getNullCount());
    }

    @Test
    public void testStringTotalCount() {
        Assert.assertEquals(totalCount, columnStats.getTotalCount());
    }

    @Test
    public void testStringUniqueCount() {
        Assert.assertEquals(uniqueCount, columnStats.getUniqueCount());
    }

    @Test
    public void testStringPercNullValues() {
        assertEquals(percNullValues, columnStats.getPercNullValues(), epsilon);
    }

    @Test
    public void testStringPercUniqueValues() {
        assertEquals(percUniqueValues, columnStats.getPercUniqueValues(), epsilon);
    }

    @Test
    public void testStringPercDuplicateValues() {
        assertEquals(percDuplicateValues, columnStats.getPercDuplicateValues(), epsilon);
    }

    @Test
    public void testStringTopNValues() {
        TreeSet<TopNDataItem> items = topNValues.getTopNDataItemsForColumn();
        Iterator<TopNDataItem> iterator = items.descendingIterator();

        //Verify that there are 3 items
        Assert.assertEquals(3, items.size());

        //Verify the top 3 item counts
        int index = 1;
        while (iterator.hasNext()) {
            TopNDataItem item = iterator.next();
            if (index == 1) {
                Assert.assertEquals("Rachael::", item.getValue());
                Assert.assertEquals(Long.valueOf(2L), item.getCount());
            }
                        /*
                    Not checking values for index 2 and 3 since they can be arbitrary.
                    All remaining values have count 1
                */
            else if (index == 2) {
                Assert.assertEquals(Long.valueOf(1L), item.getCount());
            } else if (index == 3) {
                Assert.assertEquals(Long.valueOf(1L), item.getCount());
            }

            index++;
        }
    }

    @Test
    public void testStringMaxLength() {
        Assert.assertEquals(maxLength, ((StringColumnStatistics) columnStats).getMaxLength());
    }

    @Test
    public void testStringMinLength() {
        Assert.assertEquals(minLength, ((StringColumnStatistics) columnStats).getMinLength());
    }

    @Test
    public void testStringLongestString() {
        Assert.assertEquals(longestString, ((StringColumnStatistics) columnStats).getLongestString());
    }

    @Test
    public void testStringShortestString() {
        Assert.assertEquals(shortestString, ((StringColumnStatistics) columnStats).getShortestString());
    }

    @Test
    public void testStringEmptyCount() {
        Assert.assertEquals(emptyCount, ((StringColumnStatistics) columnStats).getEmptyCount());
    }

    @Test
    public void testStringPercEmptyValues() {
        assertEquals(percEmptyValues, ((StringColumnStatistics) columnStats).getPercEmptyValues(), epsilon);
    }

    @Test
    public void testStringMinStringCaseSensitive() {
        Assert.assertEquals(minStringCase, ((StringColumnStatistics) columnStats).getMinStringCase());
    }

    @Test
    public void testStringMaxStringCaseSensitive() {
        Assert.assertEquals(maxStringCase, ((StringColumnStatistics) columnStats).getMaxStringCase());
    }

    @Test
    public void testStringMinStringCaseInsensitive() {
        Assert.assertEquals(minStringICase, ((StringColumnStatistics) columnStats).getMinStringICase());
    }

    @Test
    public void testStringMaxStringCaseInsensitive() {
        Assert.assertEquals(maxStringICase, ((StringColumnStatistics) columnStats).getMaxStringICase());
    }
}


text:
adminNav.push({
  route: 'searchLogs',
  label: 'Search Logs'
});

Meteor.startup(function () {

  Router.onBeforeAction(Router._filters.isAdmin, {only: ['logs']});

  Router.map(function() {

    // Search

    this.route('search', {
      path: '/search/:limit?',
      controller: PostsListController
    });

    // Search Logs

    this.route('searchLogs', {
      path: '/logs/:limit?',
      waitOn: function () {
        var limit = this.params.limit || 100;
        if(Meteor.isClient) {
          Session.set('logsLimit', limit);
        }
        return Meteor.subscribe('searches', limit);
      },
      data: function () {
        return Searches.find({}, {sort: {timestamp: -1}});
      },
      fastRender: true
    });

  });

});


text:
#ifndef _HPDF_ANNOTATION_H
#define _HPDF_ANNOTATION_H

#include "hpdf_objects.h"

#ifdef __cplusplus
extern "C" {
#endif

/*----------------------------------------------------------------------------*/
/*------ HPDF_Annotation -----------------------------------------------------*/

HPDF_Annotation HPDF_Annotation_New(HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_AnnotType type, HPDF_Rect rect);

HPDF_Annotation HPDF_LinkAnnot_New(HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_Rect rect, HPDF_Destination dst);

HPDF_Annotation HPDF_URILinkAnnot_New(HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_Rect rect, const char* uri);

HPDF_Annotation HPDF_3DAnnot_New(HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_Rect rect, HPDF_U3D u3d);

HPDF_Annotation HPDF_MarkupAnnot_New(HPDF_MMgr mmgr,
                                     HPDF_Xref xref,
                                     HPDF_Rect rect,
                                     const char* text,
                                     HPDF_Encoder encoder,
                                     HPDF_AnnotType subtype);

HPDF_Annotation HPDF_PopupAnnot_New(HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_Rect rect, HPDF_Annotation parent);

HPDF_Annotation HPDF_StampAnnot_New(HPDF_MMgr mmgr,
                                    HPDF_Xref xref,
                                    HPDF_Rect rect,
                                    HPDF_StampAnnotName name,
                                    const char* text,
                                    HPDF_Encoder encoder);

HPDF_Annotation
    HPDF_ProjectionAnnot_New(HPDF_MMgr mmgr, HPDF_Xref xref, HPDF_Rect rect, const char* text, HPDF_Encoder encoder);

HPDF_BOOL
HPDF_Annotation_Validate(HPDF_Annotation annot);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _HPDF_ANNOTATION_H */


text:
#include <shiny/shiny_fwd.hpp>

#include <lion/assets.hpp>

#include <atma/intrusive_ptr.hpp>

#include <typeindex>

// device-interop, no strings attached
namespace shiny
{
	struct device_interop_t : atma::ref_counted
	{
		virtual auto sizeof_host_resource() const -> size_t = 0;
	};
}

// component, weirdly has the renderer????
namespace shiny
{
	struct component_t : lion::asset_t
	{
		component_t(lion::path_t const& path, renderer_ptr const& rndr)
			: lion::asset_t(path)
			, rndr_{rndr}
		{}

		virtual ~component_t()
		{}

		virtual auto sizeof_host_resource() const -> size_t = 0;

		auto renderer() const -> renderer_ptr const& { return rndr_; }

	private:
		renderer_ptr rndr_;
	};
}

// resource, this has a lot going on
namespace shiny
{
	struct resource_t : device_interop_t
	{
		resource_t(renderer_ptr const& rndr, resource_type_t rt, resource_usage_mask_t ru, resource_storage_t rs, size_t element_stride, size_t element_count)
			: rndr_{rndr}
			, resource_type_{rt}
			, resource_usage_{ru}
			, resource_storage_{rs}
			, element_stride_{element_stride}
			, element_count_{element_count}
		{}

		virtual ~resource_t()
		{}

		auto renderer() const -> renderer_ptr const& { return rndr_; }
		auto resource_type() const -> resource_type_t { return resource_type_; }
		auto resource_usage() const -> resource_usage_mask_t { return resource_usage_; }
		auto resource_storage() const -> resource_storage_t { return resource_storage_; }
		auto elements_stride() const -> size_t { return element_stride_; }
		auto elements_count() const -> size_t { return element_count_; }
		auto resource_size() const -> size_t { return element_stride_ * element_count_; }

	private:
		renderer_ptr rndr_;
		resource_type_t resource_type_ = resource_type_t::unknown;
		resource_usage_mask_t resource_usage_;
		resource_storage_t resource_storage_ = resource_storage_t::unknown;
		size_t element_stride_ = 0;
		size_t element_count_ = 0;

		template <typename R, typename T> friend struct device_pin_ptr;
	};
}

namespace shiny
{
	template <typename R, typename T>
	struct device_pin_ptr
	{
		using device_type = atma::transfer_const_t<std::remove_reference_t<decltype(*std::declval<R>())>, T>;

		device_pin_ptr()
		{}

		explicit device_pin_ptr(R const& r)
			: r_{r}
		{}

		device_pin_ptr(device_pin_ptr const& rhs)
			: r_{rhs.r_}
		{}

		device_pin_ptr(device_pin_ptr&& rhs)
			: r_{std::move(rhs.r_)}
		{}

		auto operator = (device_pin_ptr<R,T> const& rhs) -> device_pin_ptr<R,T>&
		{
			r_ = rhs.r_;
			return *this;
		}

		auto operator = (device_pin_ptr<R,T>&& rhs) -> device_pin_ptr<R,T>&
		{
			r_ = std::move(rhs.r_);
			return *this;
		}

		operator bool () const {
			return r_;
		}

		auto operator ! () const -> bool {
			return !r_;
		}

		auto operator -> () const -> device_type*
		{
			using intermediary_t = atma::transfer_const_t<device_type, char>;
			return r_ ? reinterpret_cast<device_type*>(reinterpret_cast<intermediary_t*>(r_.operator -> ()) + r_->sizeof_host_resource()) : nullptr;
		}

		auto operator * () const -> T&
		{
			ATMA_ASSERT(r_, "dereferencing nullptr");
			return *operator->();
		}

		static auto unsafe_access(R const& r) -> device_type*
		{
			using intermediary_t = atma::transfer_const_t<device_type, char>;
			return r ? reinterpret_cast<device_type*>(reinterpret_cast<intermediary_t*>(r.operator -> ()) + r->sizeof_host_resource()) : nullptr;
		}

	private:
		R r_;
	};

	template <typename T>
	inline auto device_pin(resource_ptr const& r)
	{
		return device_pin_ptr<resource_ptr, T>{r};
	}

	template <typename T>
	inline auto device_pin(resource_cptr const& r)
	{
		return device_pin_ptr<resource_cptr, T>{r};
	}

	template <typename T, typename R>
	inline auto device_unsafe_access(R const& r)
	{
		return device_pin_ptr<R, T>::unsafe_access(r);
	}
}

namespace shiny
{
	template <typename Interface, typename Concrete>
	struct device_bridge_t
		: Interface
	{
		device_bridge_t(Interface&& i, Concrete&& c)
			: Interface{std::move(i)}
			, concrete_{std::move(c)}
		{}

		// helpful if host & device constructors are identical
		template <typename... Args>
		device_bridge_t(Args&&... args)
			: Interface{std::forward<Args>(args)...}
			, concrete_{std::forward<Args>(args)...}
		{}

	protected:
		Concrete concrete_;
	};
}


text:
"""Namespace Manager Module."""

# WARNING: This file is externally viewable by our users.  All comments from
# this file will be stripped.  The docstrings will NOT.  Do not put sensitive
# information in docstrings.  If you must communicate internal information in
# this source file, please place them in comments only.

from namespace_manager import *


text:
class Admin::TaxonRelationshipsController < Admin::StandardAuthorizationController

  belongs_to :taxon_concept
  before_filter :load_taxon_relationship_types, :only => [:index, :create]
  before_filter :load_search, :except => [:create, :update, :destroy]
  layout 'taxon_concepts'

  def index
    index! do
      @form_taxonomies = Taxonomy.order(:name). # for Inter-taxonomic relationships
        where('id <> ?', @taxon_concept.taxonomy_id)
      @inverse_taxon_relationships = TaxonRelationship.
        where(:other_taxon_concept_id => @taxon_concept.id,
          :taxon_relationship_type_id => @taxon_relationship_type.id).
          page(params[:page])
    end
  end

  def create
    # The following line makes sure that we are creating the correct taxon_relationship
    # As we are using the *belongs_to* in this controller *inherit_resources* would
    # create the new taxon_relationship through the parent object like so:
    # => @taxon_concept.taxon_relationships.create, We don't want this
    # we want it to use the information that comes from the form in the params hash.
    # We still want the @taxon_concept variable to be instantiated, so we keep using
    # the *belongs_to* helper for that.
    @taxon_relationship = TaxonRelationship.new(params[:taxon_relationship])

    create! do |success, failure|
      success.js { render 'create' }
      failure.js {
        @taxonomies = Taxonomy.order(:name). # for Inter-taxonomic relationships
          where('id <> ?', TaxonConcept.find(params[:taxon_relationship][:taxon_concept_id]).
          try(:taxonomy_id))
        render 'admin/simple_crud/new'
      }
    end
  end

  def destroy
    # The following line makes sure that the action will find and destroy the taxon_relationship
    # based solely on the id sent in the params hash. If we do not do this the *belongs_to* helper
    # will cause *inherit_resources* to try to find the taxon_relationship in the parent object's
    # taxon relationships: @taxon_concept.taxon_relationships.find(params[:id]), and it won't find
    # it if that @taxon_concept is the *other_taxon_concept_id* in the taxon_relationship and not
    # the *taxon_concept_id*.
    @taxon_relationship = TaxonRelationship.find(params[:id])
    type = @taxon_relationship.taxon_relationship_type.name
    destroy! do |success, failure|
      success.html { redirect_to collection_url(:type => type), :notice => 'Operation succeeded' }
    end
  end

  protected

  def load_taxon_relationship_types
    @taxon_relationship_type =
      if params[:taxon_relationship]
        TaxonRelationshipType.find(params[:taxon_relationship][:taxon_relationship_type_id])
      else
        TaxonRelationshipType.find_by_name(params[:type] || TaxonRelationshipType::EQUAL_TO)
      end
    @taxon_relationship_types = TaxonRelationshipType.order(:name).
      intertaxonomic
  end

  def collection
    @taxon_relationships ||= end_of_association_chain.
      joins(:taxon_relationship_type).
      where(:"taxon_relationship_types.name" => @taxon_relationship_type.name).
      page(params[:page])
  end
end