text:
layout: documentation
title: "UrlEncoded Middleware"
permalink: /middleware/url-encoded
hide: true
prev_name: Authentication Middleware
prev_link: ./authentication
next_name: JSON Request Middleware
next_link: ./json-request
top_name: Back to Middleware
top_link: ./list
---

The `UrlEncoded` middleware converts a `Faraday::Request#body` hash of key/value pairs into a url-encoded request body.
The middleware also automatically sets the `Content-Type` header to `application/x-www-form-urlencoded`.
The way parameters are serialized can be [customized][customize].

### Example Usage

```ruby
conn = Faraday.new(...) do |f|
  f.request :url_encoded
  ...
end

conn.post('/', { a: 1, b: 2 })
# POST with
# Content-Type: application/x-www-form-urlencoded
# Body: a=1&b=2
```

Complex structures can also be passed

```ruby
conn.post('/', { a: [1, 3], b: { c: 2, d: 4} })
# POST with
# Content-Type: application/x-www-form-urlencoded
# Body: a%5B%5D=1&a%5B%5D=3&b%5Bc%5D=2&b%5Bd%5D=4
```

[customize]: ../usage/customize#changing-how-parameters-are-serialized


text:
import factory
from koalixcrm.crm.models import Project
from koalixcrm.crm.factories.factory_project_status import StartedProjectStatusFactory
from koalixcrm.djangoUserExtension.factories.factory_template_set import StandardTemplateSetFactory
from koalixcrm.crm.factories.factory_user import StaffUserFactory
from koalixcrm.crm.factories.factory_currency import StandardCurrencyFactory

class StandardProjectFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = Project
        django_get_or_create = ('project_name',)

    project_manager = factory.SubFactory(StaffUserFactory)
    project_name = "This is a Test Project"
    description = "This is description of a test Project"
    project_status = factory.SubFactory(StartedProjectStatusFactory)
    default_template_set = factory.SubFactory(StandardTemplateSetFactory)
    default_currency = factory.SubFactory(StandardCurrencyFactory)
    date_of_creation = "2018-05-01"
    last_modification = "2018-05-02"
    last_modified_by = factory.SubFactory(StaffUserFactory)

redpajama_set_name: RedPajamaGithub


text:
<sect1 id="zend.view.introduction">
    <title>Pendahuluan</title>

    <para>
        Zend_View adalah class yang dapat Anda gunakan untuk bekerja dengan
        bagian "view" dari pola model-view-controller. Yaitu untuk menjaga
        view script terpisah dari model dan controller script. Zend_View
        menyediakan sebuah sistem pembantu (helpers), output filters dan
        variable escaping.
    </para>

    <para>
        Zend_View is template system agnostic; you may use PHP as
        your template language, or create instances of other
        template systems and manipulate them within your view
        script.
    </para>

    <para>
        Essentially, using Zend_View happens in two major steps:

        1.  Your controller script creates an instance of
        Zend_View and assigns variables to that instance.

        2. The controller tells the Zend_View to render a particular
        view, thereby handing control over the view script, which
        generates the view output.
    </para>

    <sect2 id="zend.view.introduction.controller">
        <title>Controller Script</title>

        <para>
            As a simple example, let us say your controller has a list
            of book data that it wants to have rendered by a view.  The
            controller script might look something like this:
        </para>

        <programlisting role="php"><![CDATA[<?php
// use a model to get the data for book authors and titles.
$data = array(
    array(
        'author' => 'Hernando de Soto',
        'title' => 'The Mystery of Capitalism'
    ),
    array(
        'author' => 'Henry Hazlitt',
        'title' => 'Economics in One Lesson'
    ),
    array(
        'author' => 'Milton Friedman',
        'title' => 'Free to Choose'
    )
);

// now assign the book data to a Zend_View instance
Zend_Loader::loadClass('Zend_View');
$view = new Zend_View();
$view->books = $data;

// and render a view script called "booklist.php"
echo $view->render('booklist.php');]]>
        </programlisting>

    </sect2>

    <sect2 id="zend.view.introduction.view">

        <title>View Script</title>

        <para>
            Now we need the associated view script, "booklist.php".
            This is a PHP script like any other, with one exception:  it
            executes inside the scope of the Zend_View instance, which
            means that references to $this point to the Zend_View
            instance properties and methods.  (Variables assigned to the
            instance by the controller are public properties of the
            Zend_View instance.)  Thus, a very basic view script could
            look like this:
        </para>

        <programlisting role="php"><![CDATA[<?php if ($this->books): ?>

            Author
            Title

        <?php foreach ($this->books as $key => $val): ?>

            <?php echo $this->escape($val['author']) ?>
            <?php echo $this->escape($val['title']) ?>

        <?php endforeach; ?>

<?php else: ?>

There are no books to display.

<?php endif;]]>
        </programlisting>

        <para>
            Note how we use the "escape()" method to apply output
            escaping to variables.
        </para>

    </sect2>

    <sect2 id="zend.view.introduction.options">
        <title>Options</title>

        <para>
            Zend_View has several options that may be set to
            configure the behaviour of your view scripts.
        </para>

        <itemizedlist>
            <listitem>
                <para>
                    basePath: indicate a base path from which to set
                    the script, helper, and filter path. It assumes a directory
                    structure of:
                </para>

                <programlisting role="php"><![CDATA[
base/path/
    helpers/
    filters/
    scripts/]]>
                </programlisting>

                <para>
                    This may be set via setBasePath(),
                    addBasePath(), or the basePath
                    option to the constructor.
                </para>
            </listitem>

            <listitem><para>
                encoding: indicate the character encoding to use
                with htmlentities(),
                htmlspecialchars(), and other operations. Defaults
                to ISO-8859-1 (latin1). May be set via
                setEncoding() or the encoding option
                to the constructor.
            </para></listitem>

            <listitem><para>
                escape: indicate a callback to be used by
                escape(). May be set via setEscape()
                or the escape option to the constructor.
            </para></listitem>

            <listitem><para>
                filter: indicate a filter to use after rendering
                a view script. May be set via setFilter(),
                addFilter(), or the filter option to
                the constructor.
            </para></listitem>

            <listitem><para>
                strictVars: force Zend_View to emit
                notices and warnings when uninitialized view variables are
                accessed. This may be set by calling
                strictVars(true) or passing the
                strictVars option to the constructor.
            </para></listitem>
        </itemizedlist>
    </sect2>

    <sect2 id="zend.view.introduction.accessors">
        <title>Utility Accessors</title>

        <para>
            Typically, you'll only ever need to call on assign(),
            render(), or one of the methods for setting/adding
            filter, helper, and script paths. However, if you wish to extend
            Zend_View yourself, or need access to some of its
            internals, a number of accessors exist:
        </para>

        <itemizedlist>
            <listitem>
                <para>
                    getVars() will return all assigned variables.
                </para>
            </listitem>

            <listitem>
                <para>
                    clearVars() will clear all assigned variables;
                    useful when you wish to re-use a view object, but want to
                    control what variables are available..
                </para>
            </listitem>

            <listitem>
                <para>
                    getScriptPath($script) will retrieve the
                    resolved path to a given view script.
                </para>
            </listitem>

            <listitem>
                <para>
                    getScriptPaths() will retrieve all registered
                    script paths.
                </para>
            </listitem>

            <listitem>
                <para>
                    getHelperPath($helper) will retrieve the
                    resolved path to the named helper class.
                </para>
            </listitem>

            <listitem>
                <para>
                    getHelperPaths() will retrieve all registered
                    helper paths.
                </para>
            </listitem>

            <listitem>
                <para>
                    getFilterPath($filter) will retrieve the
                    resolved path to the named filter class.
                </para>
            </listitem>

            <listitem>
                <para>
                    getFilterPaths() will retrieve all registered
                    filter paths.
                </para>
            </listitem>
        </itemizedlist>
    </sect2>
</sect1>


text:
package org.jf.smalidea;

import com.intellij.lexer.LexerBase;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import org.antlr.runtime.CommonToken;
import org.jetbrains.annotations.NotNull;
import org.jf.smali.smaliFlexLexer;
import org.jf.smali.smaliParser;
import org.jf.util.BlankReader;

public class SmaliLexer extends LexerBase {
    private final smaliFlexLexer lexer = new smaliFlexLexer(BlankReader.INSTANCE);
    private CommonToken token = null;
    private int state = 0;
    private int endOffset;
    private CharSequence text;

    public SmaliLexer() {
        super();
        lexer.setSuppressErrors(true);
    }

    @Override public void start(@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) {
        text = buffer;
        lexer.reset(buffer, startOffset, endOffset, initialState);
        this.endOffset = endOffset;
        this.token = null;
        this.state = 0;
    }

    @NotNull @Override public CharSequence getTokenSequence() {
        return getTokenText();
    }

    @NotNull @Override public String getTokenText() {
        ensureToken();
        return token.getText();
    }

    @Override
    public int getState() {
        ensureToken();
        return state;
    }

    @Override
    public IElementType getTokenType() {
        ensureToken();
        return mapTokenTypeToElementType(token.getType());
    }

    private IElementType mapTokenTypeToElementType(int tokenType) {
        if (tokenType == smaliParser.WHITE_SPACE) {
            return TokenType.WHITE_SPACE;
        }
        if (tokenType == smaliParser.INVALID_TOKEN) {
            return TokenType.BAD_CHARACTER;
        }
        if (tokenType == smaliParser.EOF) {
            return null;
        }
        return SmaliTokens.getElementType(tokenType);
    }

    @Override
    public int getTokenStart() {
        ensureToken();
        return token.getStartIndex();
    }

    @Override
    public int getTokenEnd() {
        ensureToken();
        return token.getStopIndex()+1;
    }

    @Override
    public void advance() {
        token = null;
        state = 0;
    }

    @NotNull @Override public CharSequence getBufferSequence() {
        return text;
    }

    @Override
    public int getBufferEnd() {
        return endOffset;
    }

    private void ensureToken() {
        if (token == null) {
            token = (CommonToken)lexer.nextToken();
            state = lexer.yystate();
        }
        assert token != null;
    }
}


text:
@interface AGViewController () <AGEmojiKeyboardViewDelegate, AGEmojiKeyboardViewDataSource>

@property (nonatomic) IBOutlet UITextView *textView;

@end

@implementation AGViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  AGEmojiKeyboardView *emojiKeyboardView = [[AGEmojiKeyboardView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 216) dataSource:self];
  emojiKeyboardView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
  emojiKeyboardView.delegate = self;
  self.textView.inputView = emojiKeyboardView;
}

- (void)emojiKeyBoardView:(AGEmojiKeyboardView *)emojiKeyBoardView didUseEmoji:(NSString *)emoji {
  self.textView.text = [self.textView.text stringByAppendingString:emoji];
}

- (void)emojiKeyBoardViewDidPressBackSpace:(AGEmojiKeyboardView *)emojiKeyBoardView {

}

- (UIColor *)randomColor {
  return [UIColor colorWithRed:drand48()
                         green:drand48()
                          blue:drand48()
                         alpha:drand48()];
}

- (UIImage *)randomImage {
  CGSize size = CGSizeMake(30, 10);
  UIGraphicsBeginImageContextWithOptions(size , NO, 0);

  CGContextRef context = UIGraphicsGetCurrentContext();
  UIColor *fillColor = [self randomColor];
  CGContextSetFillColorWithColor(context, [fillColor CGColor]);
  CGRect rect = CGRectMake(0, 0, size.width, size.height);
  CGContextFillRect(context, rect);

  fillColor = [self randomColor];
  CGContextSetFillColorWithColor(context, [fillColor CGColor]);
  CGFloat xxx = 3;
  rect = CGRectMake(xxx, xxx, size.width - 2 * xxx, size.height - 2 * xxx);
  CGContextFillRect(context, rect);

  UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  return img;
}

- (UIImage *)emojiKeyboardView:(AGEmojiKeyboardView *)emojiKeyboardView imageForSelectedCategory:(AGEmojiKeyboardViewCategoryImage)category {
  UIImage *img = [self randomImage];
  [img imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  return img;
}

- (UIImage *)emojiKeyboardView:(AGEmojiKeyboardView *)emojiKeyboardView imageForNonSelectedCategory:(AGEmojiKeyboardViewCategoryImage)category {
  UIImage *img = [self randomImage];
  [img imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  return img;
}

- (UIImage *)backSpaceButtonImageForEmojiKeyboardView:(AGEmojiKeyboardView *)emojiKeyboardView {
  UIImage *img = [self randomImage];
  [img imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  return img;
}

@end


text:
trait WithAssoc {
    type AssocType;
}

trait WithParam<A> {}

type Return<A> = impl WithAssoc<AssocType = impl WithParam<A>>;

struct MyParam;
impl<A> WithParam<A> for MyParam {}

struct MyStruct;

impl WithAssoc for MyStruct {
    type AssocType = MyParam;
}

fn my_fun<A>() -> Return<A> {
    MyStruct
}

fn my_other_fn<A>() -> impl WithAssoc<AssocType = impl WithParam<A>> {
    MyStruct
}

fn main() {}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:id="@+id/RootView" >

    <!--
    The frame layout is here since we will be showing either
    the empty view or the list view.
    -->

    <FrameLayout
        android:id="@+id/list_show"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <ListView
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:drawSelectorOnTop="false"
            android:visibility="visible" />

        <!-- Here is the view to show if the list is emtpy -->

        <TextView
            android:id="@+id/empty"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="No items."
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:visibility="gone" />
    </FrameLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <ProgressBar
            android:id="@+id/load"
            style="?android:attr/progressBarStyleLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:visibility="gone" />
    </RelativeLayout>
</RelativeLayout>


text:
package opennlp.tools.cmdline.namefind;

import java.io.File;

import opennlp.tools.cmdline.ArgumentParser.OptionalParameter;
import opennlp.tools.cmdline.ArgumentParser.ParameterDescription;
import opennlp.tools.cmdline.params.BasicTrainingParams;

/**
 * TrainingParameters for Name Finder.
 *
 * Note: Do not use this class, internal use only!
 */
interface TrainingParams extends BasicTrainingParams {

  @ParameterDescription(valueName = "modelType", description = "The type of the token name finder model")
  @OptionalParameter(defaultValue = "default")
  String getType();

  @ParameterDescription(valueName = "resourcesDir", description = "The resources directory")
  @OptionalParameter
  File getResources();

  @ParameterDescription(valueName = "featuregenFile", description = "The feature generator descriptor file")
  @OptionalParameter
  File getFeaturegen();

  @OptionalParameter
  @ParameterDescription(valueName = "types", description = "name types to use for training")
  String getNameTypes();

  @OptionalParameter(defaultValue = "opennlp.tools.namefind.BioCodec")
  @ParameterDescription(valueName = "codec", description = "sequence codec used to code name spans")
  String getSequenceCodec();

  @ParameterDescription(valueName = "factoryName", description = "A sub-class of TokenNameFinderFactory")
  @OptionalParameter
  String getFactory();
}


text:
import React from 'react';
import ReactDOM from 'react-dom';
import MonkeyUi from '../../lib/monkeyui.js';
var Form = MonkeyUi.Form;
var Input = MonkeyUi.Input;
var Checkbox = MonkeyUi.Checkbox;
var Button = MonkeyUi.Button;
var Select = MonkeyUi.Select
var Radio = MonkeyUi.Radio;
var Tooltip = MonkeyUi.Tooltip;
var Icon = MonkeyUi.Icon;
var Popover = MonkeyUi.Popover;
const RadioGroup = Radio.Group;
const FormItem = Form.Item;

const content = (

内容

内容

);

const NormalLoginForm = Form.create()(React.createClass({
  handleSubmit(e) {
    e.preventDefault();
    console.log('收到表单值:', this.props.form.getFieldsValue());
  },

  render() {
    const { getFieldProps } = this.props.form;
    const formItemLayout = {
      labelCol: { span: 6 },
      wrapperCol: { span: 14 },
    };
    return (

            <Form horizontal onSubmit={this.handleSubmit}>
        <FormItem
          {...formItemLayout}
          label="用户名"
        >

大眼萌 minion

        </FormItem>
        <FormItem
          {...formItemLayout}
          label="密码"
        >
          <Input type="password" {...getFieldProps('pass', { initialValue: '' })} placeholder="请输入密码" />
        </FormItem>
        <FormItem
          {...formItemLayout}
          label="您的性别"
        >
          <RadioGroup {...getFieldProps('gender', { initialValue: 'female' })}>
            <Radio value="male">男的</Radio>
            <Radio value="female">女的</Radio>
          </RadioGroup>
        </FormItem>
        <FormItem
          {...formItemLayout}
          label="备注"
          help="随便写点什么"
        >
          <Input type="textarea" placeholder="随便写" {...getFieldProps('remark', { initialValue: '' })} />
        </FormItem>
        <FormItem
          {...formItemLayout}
          label={卖身华府 <Tooltip title="我为秋香"><Icon type="question-circle-o" /></Tooltip>}
        >
          <Checkbox {...getFieldProps('agreement', { initialValue: false, valuePropName: 'checked' })}>同意</Checkbox>
        </FormItem>
        <FormItem wrapperCol={{ span: 16, offset: 6 }} style={{ marginTop: 24 }}>
          <Button type="primary" htmlType="submit">确定</Button>
        </FormItem>
      </Form>

        <Popover content={content} title="标题">
          <Button type="primary">弹出卡片</Button>
        </Popover>

    );
  },
}));

export default NormalLoginForm;


text:
package com.taptrack.tcmptappy2.commandfamilies.type4.responses;

import com.taptrack.tcmptappy2.MalformedPayloadException;
import com.taptrack.tcmptappy2.commandfamilies.type4.TestUtils;

import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Random;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

public class Type4DetectedResponseTest {
    Random random = new Random();

    @Test
    public void testGeneratePayloads() {
        byte[] uid7 = new byte[7];
        byte[] uid10 = new byte[10];
        byte[] uid4 = new byte[4];
        byte[] ats = new byte[3];
        byte[] noats = new byte[0];
        random.nextBytes(uid7);
        random.nextBytes(uid10);
        random.nextBytes(uid4);
        random.nextBytes(ats);

        rungenerateTest(uid4, ats);
        rungenerateTest(uid4, noats);

        rungenerateTest(uid7,ats);
        rungenerateTest(uid7,noats);

        rungenerateTest(uid10,ats);
        rungenerateTest(uid10,noats);
    }

    private void rungenerateTest(byte[] uid, byte[] ats) {
        Type4DetectedResponse response = new Type4DetectedResponse(uid,ats);
        byte[] payloadBytes = response.getPayload();

        byte[] desiredBytes = generatePayload(uid,ats);

        assertArrayEquals(payloadBytes, desiredBytes);
    }

    private byte[] generatePayload(byte[] uid, byte[] ats) {
        ByteArrayOutputStream desiredStream = new ByteArrayOutputStream(uid.length+ats.length+1);
        desiredStream.write((byte)uid.length);
        try {
            desiredStream.write(uid);
            desiredStream.write(ats);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return desiredStream.toByteArray();
    }

    @Test
    public void testFromPayloads() throws Exception {
        byte[] uid7 = new byte[7];
        byte[] uid10 = new byte[10];
        byte[] uid4 = new byte[4];
        byte[] ats = new byte[3];
        byte[] noats = new byte[0];
        random.nextBytes(uid7);
        random.nextBytes(uid10);
        random.nextBytes(uid4);
        random.nextBytes(ats);

        //with ats
        testFromPayload(uid4, ats);
        testFromPayload(uid7, ats);
        testFromPayload(uid10, ats);
        //without ats
        testFromPayload(uid4, noats);
        testFromPayload(uid7,noats);
        testFromPayload(uid10,noats);
    }

    private void testFromPayload(byte[] uid, byte[] ats) {
        byte[] payload = generatePayload(uid,ats);
        try {
            Type4DetectedResponse response = new Type4DetectedResponse();
            response.parsePayload(payload);
            assertArrayEquals(
                    String.format("Comparing UIDs, expected %s, received %s",
                            TestUtils.bytesToHex(uid),
                            TestUtils.bytesToHex(response.getUid())),
                    response.getUid(),uid);
            assertArrayEquals(
                    String.format("Comparing ATSs, expected %s, received %s",
                            TestUtils.bytesToHex(ats),
                            TestUtils.bytesToHex(response.getAts())),
                    response.getAts(), ats);
        } catch (MalformedPayloadException e) {
            fail(String.format("Payload improper format, " +
                    "attempting to parse UID: %s, ATS %s " +
                    "from payload %s",
                    TestUtils.bytesToHex(uid),
                    TestUtils.bytesToHex(ats),
                    TestUtils.bytesToHex(payload)));
        }
    }

    @Test
    public void testGetCommandCode() throws Exception {
        Type4DetectedResponse response = new Type4DetectedResponse();
        assertEquals(response.getCommandCode(),0x01);
    }

    @Test
    public void testGetCommandFamily() throws Exception {
        Type4DetectedResponse response = new Type4DetectedResponse();
        assertArrayEquals(response.getCommandFamily(), new byte[]{0x00, 0x04});
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <color name="primary">#E91E63</color>
    <color name="textColorPrimary">#FFFFFF</color>
    <color name="primary_dark">#C2185B</color>

</resources>


text:
This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This text should be in the second column.

This text should be in the second column.

This text should be in the second column.

This text should be in the second column.

This text should be in the first column.

This text should be in the first column.

This text should be in the first column.

This text should be in the first column.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.

This is some text.


text:
<!--
Description: feed tagline
Expect:      not bozo and feed['tagline'] == 'Example Atom'
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
  <tagline>Example Atom</tagline>
</feed>


text:
module NumbersAndWords
  module Strategies
    module FiguresConverter
      module Languages
        class De < Base
          include Families::Latin

          def print_words
            1 < complex_part.count ? print_megs_words : @strings.flatten.reverse.join('')
          end

          def print_megs_words
            [print_megs, print_other].select(&:present?).join ' '
          end

          def complex_number_to_words
            (1..@figures.capacity_count).map { |capacity|
              @current_capacity = capacity
              capacity_iteration
            }
          end

          def ones
            super(:postfix => postfix)
          end

          def postfix
            case (@current_capacity ||= 0)
            when 1 then :combine
            when 0 then :default
            else :gender
            end
          end

          def megs
            super({:number => @figures.number_in_capacity(@current_capacity)})
          end

          private

          def print_megs
            complex_part[1..-1].map { |el|
              [el[1..-1].to_a.reverse.join(''), el.first].join(' ')
            }.select(&:present?).reverse.join(' ')
          end

          def print_other
            [print_thousands, simple_part.reverse.join('')].join('')
          end

          def print_thousands
            complex_part.first.reverse.join('')
          end

          def simple_part
            @strings.select { |f| !f.is_a?(Array) }
          end

          def complex_part
            @strings - simple_part
          end
        end
      end
    end
  end
end


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

#ifndef DISRUPTORC_H
#define DISRUPTORC_H

#include "disruptor_types.h"

#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef HAVE_CONFIG_H
    #include "ac_config.h"
#endif

/*
 * Hints to the compiler whether an expression is likely to be true or
 * not
 */
#ifdef LIKELY__
#undef LIKELY__
#endif
#define LIKELY__(expr__) (__builtin_expect(((expr__) ? 1 : 0), 1))

#ifdef UNLIKELY__
#undef UNLIKELY__
#endif
#define UNLIKELY__(expr__) (__builtin_expect(((expr__) ? 1 : 0), 0))

/*
 * Cacheline padded timeout value.
 * Not intended for use elsewhere.
 */
struct yield_t__ {
        struct timespec timeout;
        uint8_t padding[(CACHE_LINE_SIZE > sizeof(struct timespec)) ? (CACHE_LINE_SIZE - sizeof(struct timespec)) : (sizeof(struct timespec) % CACHE_LINE_SIZE)];
} __attribute__((aligned(CACHE_LINE_SIZE)));
static const struct yield_t__ timeout__ = { {0, 1}, { 0 } };

/*
 * An entry processor cursor spot that has this value is not used and
 * thereby vacant.
 */
#define VACANT__ (UINT_FAST64_MAX)

/*
 * Cacheline padded elements of ring.
 */
#define DEFINE_ENTRY_TYPE(content_type__, entry_type_name__)                                                                                \
    struct entry_type_name__ {                                                                                \
            content_type__ content;                                                                                \
            uint8_t padding[(CACHE_LINE_SIZE > sizeof(content_type__)) ? (CACHE_LINE_SIZE - sizeof(content_type__)) : (sizeof(uint_fast64_t) % CACHE_LINE_SIZE)]; \
    } __attribute__((aligned(CACHE_LINE_SIZE)))

/*
 * Entry processors may read up to and including max_read_cursor, but
 * no futher.
 *
 * Entry publishers may write from (but excluding) max_read_cursor and
 * up to and including max_write_cursor, but no futher.
 *
 * entry_capacity__ MUST be a power of two.
 */
#define DEFINE_RING_BUFFER_TYPE(entry_processor_capacity__, entry_capacity__, entry_type_name__, ring_buffer_type_name__) \
    struct ring_buffer_type_name__ {                                                                                \
            struct count_t reduced_size;                                                                                \
            struct cursor_t slowest_entry_processor;                                                                      \
            struct cursor_t max_read_cursor;                                                                              \
            struct cursor_t write_cursor;                                                                                \
            struct cursor_t entry_processor_cursors[entry_processor_capacity__];                                          \
            struct entry_type_name__ buffer[entry_capacity__];                                                            \
    } __attribute__((aligned(PAGE_SIZE)))

/*
 * This function returns a properly aligned ring buffer or NULL.
 */
#define DEFINE_RING_BUFFER_MALLOC(ring_buffer_type_name__, ring_buffer_prefix__...)                              \
static struct ring_buffer_type_name__ *                                                                          \
ring_buffer_prefix__ ## ring_buffer_malloc(void)                                                                 \
{                                                                                \
        struct ring_buffer_type_name__ *retv = NULL;                                                             \
                                                                                \
        return (posix_memalign((void**)&retv, PAGE_SIZE, sizeof(struct ring_buffer_type_name__)) ? NULL : retv); \
}

/*
 * This function must always be invoked on a ring buffer before it is
 * put into use.
 */
#define DEFINE_RING_BUFFER_INIT(entry_capacity__, ring_buffer_type_name__, ring_buffer_prefix__...) \
static void                                                                                \
ring_buffer_prefix__ ## ring_buffer_init(struct ring_buffer_type_name__ * const ring_buffer)        \
{                                                                                \
        unsigned int n;                                                                             \
                                                                                \
        memset((void*)ring_buffer, 0, sizeof(struct ring_buffer_type_name__));                      \
        for (n = 0; n < sizeof(ring_buffer->entry_processor_cursors)/sizeof(struct cursor_t); ++n)  \
                ring_buffer->entry_processor_cursors[n].sequence = VACANT__;                        \
        __atomic_store_n(&ring_buffer->reduced_size.count, entry_capacity__ - 1, __ATOMIC_SEQ_CST); \
}

/*
 * This function returns a const pointer to an entry in the ring
 * buffer.
 *
 * We are using that A % B = A & (B - 1), iff B = 2^n for some n, to
 * get the index in the ring buffer corresponding to the cursor.
 *
 * This is the reason behind the requirement that the size of the ring
 * buffer MUST be a power of two, and is why the reduced_size is the
 * actual size minus 1.
 */
#define DEFINE_RING_BUFFER_SHOW_ENTRY_FUNCTION(entry_type_name__, ring_buffer_type_name__, ring_buffer_prefix__...) \
static inline const struct entry_type_name__*                                                                       \
ring_buffer_prefix__ ## ring_buffer_show_entry(const struct ring_buffer_type_name__ * const ring_buffer,            \
                                               const struct cursor_t * const cursor)                                \
{                                                                                \
        return &ring_buffer->buffer[ring_buffer->reduced_size.count & cursor->sequence];                            \
}

/*
 * This function returns a non-const pointer to an entry in the ring
 * buffer.
 *
 * See above for the implementation details.
 */
#define DEFINE_RING_BUFFER_ACQUIRE_ENTRY_FUNCTION(entry_type_name__, ring_buffer_type_name__, ring_buffer_prefix__...) \
static inline struct entry_type_name__*                                                                                \
ring_buffer_prefix__ ## ring_buffer_acquire_entry(struct ring_buffer_type_name__ * const ring_buffer,                  \
                                                  const struct cursor_t * const cursor)                                \
{                                                                                \
        return &ring_buffer->buffer[ring_buffer->reduced_size.count & cursor->sequence];                               \
}

/*
 * Entry Processors must register before starting to process entries.
 *
 * They must furthermore update their spot, as identified by the
 * number returned when registering, in the entry_processor_cursors
 * array with the sequence number of the entry that they are currently
 * processing.
 */
#define DEFINE_ENTRY_PROCESSOR_BARRIER_REGISTER_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)                                 \
static inline uint_fast64_t                                                                                \
ring_buffer_prefix__ ## entry_processor_barrier_register(struct ring_buffer_type_name__ * const ring_buffer,                               \
                                                         struct count_t * const entry_processor_number)                                    \
{                                                                                \
        unsigned int n;                                                                                \
        uint_fast64_t vacant = VACANT__;                                                                                \
                                                                                \
        do {                                                                                \
                for (n = 0; n < sizeof(ring_buffer->entry_processor_cursors)/sizeof(struct cursor_t); ++n) {                               \
                        if (__atomic_compare_exchange_n(&ring_buffer->entry_processor_cursors[n].sequence,                                 \
                                                        &vacant,                                                                           \
                                                        __atomic_load_n(&ring_buffer->slowest_entry_processor.sequence, __ATOMIC_CONSUME), \
                                                        1,                                                                                \
                                                        __ATOMIC_RELEASE,                                                                  \
                                                        __ATOMIC_RELAXED)) {                                                               \
                                entry_processor_number->count = n;                                                                         \
                                goto out;                                                                                \
                        }                                                                                \
                        vacant = VACANT__;                                                                                \
                }                                                                                \
        } while (1);                                                                                \
out:                                                                                \
        if (!ring_buffer->entry_processor_cursors[entry_processor_number->count].sequence) {                                               \
                __atomic_store_n(&ring_buffer->entry_processor_cursors[entry_processor_number->count].sequence, 1, __ATOMIC_RELEASE);      \
                return 1;                                                                                \
        }                                                                                \
        return ring_buffer->entry_processor_cursors[entry_processor_number->count].sequence;                                               \
}

/*
 * Entry Processors must unregister to free up their spot in the entry
 * processor array in the ring buffer, so that other processors can
 * hook on.
 */
#define DEFINE_ENTRY_PROCESSOR_BARRIER_UNREGISTER_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)                         \
static inline void                                                                                \
ring_buffer_prefix__ ## entry_processor_barrier_unregister(struct ring_buffer_type_name__ * const ring_buffer,                       \
                                                           const struct count_t * const entry_processor_number)                      \
{                                                                                \
        __atomic_store_n(&ring_buffer->entry_processor_cursors[entry_processor_number->count].sequence, VACANT__, __ATOMIC_RELEASE); \
}

/*
 * Entry Processors must read their spot in the
 * entry_processor_cursors array, by way of the register function, to
 * know with which sequence number to begin.
 */
#define DEFINE_ENTRY_PROCESSOR_BARRIER_WAITFOR_BLOCKING_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)            \
static inline void                                                                                \
ring_buffer_prefix__ ## entry_processor_barrier_wait_for_blocking(const struct ring_buffer_type_name__ * const ring_buffer,   \
                                                                  struct cursor_t * __restrict__ const cursor)                \
{                                                                                \
        const struct cursor_t incur = { cursor->sequence, { 0 } };                                                            \
                                                                                \
        while (incur.sequence > __atomic_load_n(&ring_buffer->max_read_cursor.sequence, __ATOMIC_RELAXED))                    \
                nanosleep(&timeout__.timeout, NULL);                                                                          \
                                                                                \
        cursor->sequence = __atomic_load_n(&ring_buffer->max_read_cursor.sequence, __ATOMIC_ACQUIRE);                         \
}

/*
 * Entry Processors must read their spot in the
 * entry_processor_cursors array, by way of the register function, to
 * know with which sequence number to begin.
 */
#define DEFINE_ENTRY_PROCESSOR_BARRIER_WAITFOR_NONBLOCKING_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)          \
static inline int                                                                                \
ring_buffer_prefix__ ## entry_processor_barrier_wait_for_nonblocking(const struct ring_buffer_type_name__ * const ring_buffer, \
                                                                     struct cursor_t * __restrict__ const cursor)              \
{                                                                                \
        const struct cursor_t incur = { cursor->sequence, { 0 } };                                                             \
                                                                                \
        while (incur.sequence > __atomic_load_n(&ring_buffer->max_read_cursor.sequence, __ATOMIC_RELAXED))                     \
                return 0;                                                                                \
                                                                                \
        cursor->sequence = __atomic_load_n(&ring_buffer->max_read_cursor.sequence, __ATOMIC_ACQUIRE);                          \
                                                                                \
        return 1;                                                                                \
}

/*
 * Entry Processors must tell the ring buffer how far they are done
 * reading the entries.
 */
#define DEFINE_ENTRY_PROCESSOR_BARRIER_RELEASEENTRY_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)                               \
static inline void                                                                                \
ring_buffer_prefix__ ## entry_processor_barrier_release_entry(struct ring_buffer_type_name__ * const ring_buffer,                            \
                                                              const struct count_t * __restrict__ const entry_processor_number,              \
                                                              const struct cursor_t * __restrict__ const cursor)                             \
{                                                                                \
        __atomic_store_n(&ring_buffer->entry_processor_cursors[entry_processor_number->count].sequence, cursor->sequence, __ATOMIC_RELAXED); \
}

/*
 * Entry Publishers must call this function to get an entry to write
 * into.  I have found that __ATOMIC_ACQUIRE (in the __atomic_load_n)
 * is actually faster than __ATOMIC_RELAXED contrary to what I would
 * expect. Mayby other entry types will show otherwise.
 *
 * It is actually faster (at least on my machine) to do "x = 1 +
 * fetch_add(, 1)" instead of "x = add_fetch(, 1)".
 */
#define DEFINE_ENTRY_PUBLISHER_NEXTENTRY_BLOCKING_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)                       \
static inline __attribute__((always_inline)) void                                                                                \
ring_buffer_prefix__ ## publisher_next_entry_blocking(struct ring_buffer_type_name__ * const ring_buffer,                          \
                                                           struct cursor_t * __restrict__ const cursor)                            \
{                                                                                \
        unsigned int n;                                                                                \
        struct cursor_t seq;                                                                                \
        struct cursor_t slowest_reader;                                                                                \
        const struct cursor_t incur = { 1 + __atomic_fetch_add(&ring_buffer->write_cursor.sequence, 1, __ATOMIC_RELAXED), { 0 } }; \
                                                                                \
        cursor->sequence = incur.sequence;                                                                                \
        do {                                                                                \
                slowest_reader.sequence = VACANT__;                                                                                \
                for (n = 0; n < sizeof(ring_buffer->entry_processor_cursors)/sizeof(struct cursor_t); ++n) {                       \
                        seq.sequence = __atomic_load_n(&ring_buffer->entry_processor_cursors[n].sequence, __ATOMIC_RELAXED);       \
                        if (seq.sequence < slowest_reader.sequence)                                                                \
                                slowest_reader.sequence = seq.sequence;                                                            \
                }                                                                                \
                if (UNLIKELY__(VACANT__ == slowest_reader.sequence))                                                               \
                        slowest_reader.sequence = incur.sequence - (ring_buffer->reduced_size.count & incur.sequence);             \
                __atomic_store_n(&ring_buffer->slowest_entry_processor.sequence, slowest_reader.sequence, __ATOMIC_RELAXED);       \
                if (LIKELY__((incur.sequence - slowest_reader.sequence) <= ring_buffer->reduced_size.count))                       \
                        return;                                                                                \
                nanosleep(&timeout__.timeout, NULL);                                                                               \
        } while (1);                                                                                \
}

/*
 * Like the blocking version. Returns 1 (one) if a new entry was
 * acquired, 0 (zero) otherwise.
 */
#define DEFINE_ENTRY_PUBLISHER_NEXTENTRY_NONBLOCKING_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)                                             \
static inline int                                                                                \
ring_buffer_prefix__ ## publisher_next_entry_nonblocking(struct ring_buffer_type_name__ * const ring_buffer,                                                \
                                                              struct cursor_t * __restrict__ const cursor)                                                  \
{                                                                                \
        unsigned int n;                                                                                \
        struct cursor_t seq;                                                                                \
        struct cursor_t slowest_reader;                                                                                \
        const struct cursor_t incur = { 1 + __atomic_load_n(&ring_buffer->write_cursor.sequence, __ATOMIC_RELAXED), { 0 } };                                \
                                                                                \
        cursor->sequence = incur.sequence;                                                                                \
        slowest_reader.sequence = VACANT__;                                                                                \
        for (n = 0; n < sizeof(ring_buffer->entry_processor_cursors)/sizeof(struct cursor_t); ++n) {                                                        \
                seq.sequence = __atomic_load_n(&ring_buffer->entry_processor_cursors[n].sequence, __ATOMIC_RELAXED);                                        \
                if (seq.sequence < slowest_reader.sequence)                                                                                \
                        slowest_reader.sequence = seq.sequence;                                                                                \
        }                                                                                \
        if (UNLIKELY__(VACANT__ == slowest_reader.sequence))                                                                                \
                slowest_reader.sequence = incur.sequence - (ring_buffer->reduced_size.count & incur.sequence);                                              \
        __atomic_store_n(&ring_buffer->slowest_entry_processor.sequence, slowest_reader.sequence, __ATOMIC_RELAXED);                                        \
        if (LIKELY__((incur.sequence - slowest_reader.sequence) <= ring_buffer->reduced_size.count)) {                                                      \
                seq.sequence = incur.sequence - 1;                                                                                \
                if (__atomic_compare_exchange_n(&ring_buffer->write_cursor.sequence, &seq.sequence, incur.sequence, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED)) \
                        return 1;                                                                                \
        }                                                                                \
        return 0;                                                                                \
}

/*
 * Entry Publishers must call this function to commit the entry to the
 * entry processors. Blocks until the entry has been committed.
 */
#define DEFINE_ENTRY_PUBLISHER_COMMITENTRY_BLOCKING_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)      \
static inline __attribute__((always_inline)) void                                                                   \
ring_buffer_prefix__ ## publisher_commit_entry_blocking(struct ring_buffer_type_name__ * const ring_buffer,         \
                                                             const struct cursor_t * __restrict__ const cursor)     \
{                                                                                \
        const uint_fast64_t required_read_sequence = cursor->sequence - 1;                                          \
                                                                                \
        while (__atomic_load_n(&ring_buffer->max_read_cursor.sequence, __ATOMIC_RELAXED) != required_read_sequence) \
                nanosleep(&timeout__.timeout, NULL);                                                                \
                                                                                \
        __atomic_fetch_add(&ring_buffer->max_read_cursor.sequence, 1, __ATOMIC_RELEASE);                            \
}

/*
 * Entry Publishers must call this function to commit the entry to the
 * entry processors. Returns 1 (one) if the entry has been commited, 0
 * (zero) otherwise.
 */
#define DEFINE_ENTRY_PUBLISHER_COMMITENTRY_NONBLOCKING_FUNCTION(ring_buffer_type_name__, ring_buffer_prefix__...)     \
static inline int                                                                                \
ring_buffer_prefix__ ## publisher_commit_entry_nonblocking(struct ring_buffer_type_name__ * const ring_buffer,        \
                                                                const struct cursor_t * __restrict__ const cursor)    \
{                                                                                \
        const uint_fast64_t required_read_sequence = cursor->sequence - 1;                                            \
                                                                                \
        if (__atomic_load_n(&ring_buffer->max_read_cursor.sequence, __ATOMIC_RELAXED) != required_read_sequence)      \
                return 0;                                                                                \
                                                                                \
        __atomic_fetch_add(&ring_buffer->max_read_cursor.sequence, 1, __ATOMIC_RELEASE);                              \
                                                                                \
        return 1;                                                                                \
}

#endif //  DISRUPTORC_H


text:
package main

import (
	"fmt"
)

type SimpleLibraryResponse struct {
	book                                    *Book
	registeredCopyCount, availableCopyCount int
	err                                     error
}

func (r *SimpleLibraryResponse) GetBook() (fmt.Stringer, error) {
	return r.book, r.err
}

func (r *SimpleLibraryResponse) GetAvailability() (int, int) {
	return r.availableCopyCount, r.registeredCopyCount
}


text:
<?php

class Pas_View_Helper_TwfyImage extends Zend_View_Helper_Abstract {

    /** The cache object
     * @access public
     * @var \Zend_Cache
     */
    protected $_cache;

    /** The api key for twfy
     * @access protected
     * @var string
     */
    protected $_twfykey;

    /** The config object
     * @access protected
     * @var \Zend_Config
     */
    protected $_config;

    /** Construct the cache, config and retrieve the api key
     * @access public
     * @return void
     */
    public function __construct() {
        $this->_cache = Zend_Registry::get('cache');
        $this->_config = Zend_Registry::get('config');
        $this->_twfykey = $this->_config->webservice->twfy->apikey;
    }

    /** Retrieve the URL's content via curl
     * @access public
     * @param string $url
     *
     */
    public function get($url) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $output = curl_exec($ch);
        curl_close($ch);
        return $output;
    }

    /** Call the they work for you api, caches response
     * @access public
     * @param integer $id The MP or Lord's ID number
     * @return array
     */

    public function callapi($id) {
        if (!($this->_cache->test('mptwfy'.$id))) {
            $twfy = 'http://www.theyworkforyou.com/api/getPerson?key='
            . $this->_twfykey . '&id=' . $id . '&output=js';
            $data = json_decode($this->get($twfy));
            $this->_cache->save($data);
        } else {
            $data = $this->_cache->load('mptwfy'.$id);
        }
        return $data;
    }

    /** Create the image
     * @access public
     * @param integer $id The MP or Lord's ID number
     * @return string
     */
    public function twfyImage($id = null) {
        if (isset($id)) {
        $data = $this->callapi($id);
            return $this->buildHtml($data);
        } else {
            return false;
        }
    }

    /** Build the HTML for return
     * @param array $data
     * @return string The html to display
     */
    public function buildHtml($data) {
        if (!is_null($data['0']->image)) {
            $html = '<img src="http://www.theyworkforyou.com/';
            $html .= $data['0']->image . '" class="flow" alt="Profile picture for ';
            $html .= $data['0']->full_name . '" height="' . $data['0']->image_height;
            $html .= '" width="' . $data['0']->image_width . '"/>';
        }
        return $html;
    }
}


text:
package test.drinkwater.core.model.forStore;

public interface ISimpleDataStoreDependentService {
    String getStoreInfo();
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Xunit;
using System.Configuration;
using System.DirectoryServices;
using System.Reflection;
using System.Web;

namespace System.Security.Permissions.Tests
{
    public class PermissionTests
    {
        [Fact]
        public static void AspNetHostingPermissionCallMethods()
        {
            AspNetHostingPermission ap = new AspNetHostingPermission(new PermissionState());
            AspNetHostingPermissionLevel level = ap.Level;
            IPermission other = new AspNetHostingPermission(level);
            bool isunrestricted = ap.IsUnrestricted();
            other = ap.Copy();
            other = ap.Union(other);
            other = ap.Intersect(other);
            bool isSubsetOf = ap.IsSubsetOf(other);
            SecurityElement se = ap.ToXml();
            ap.FromXml(se);
        }

        [Fact]
        public static void AspNetHostingPermissionAttributeCallMethods()
        {
            var apa = new AspNetHostingPermissionAttribute(new SecurityAction());
            AspNetHostingPermissionLevel level = apa.Level;
            IPermission ip = apa.CreatePermission();
        }

        [Fact]
        public static void ConfigurationPermissionCallMethods()
        {
            ConfigurationPermission cp = new ConfigurationPermission(new PermissionState());
            bool isunrestricted = cp.IsUnrestricted();
            IPermission other = cp.Copy();
            other = cp.Union(other);
            other = cp.Intersect(other);
            bool isSubsetOf = cp.IsSubsetOf(other);
            SecurityElement se = cp.ToXml();
            cp.FromXml(se);
        }

        [Fact]
        public static void ConfigurationPermissionAttributeCallMethods()
        {
            var cpa = new ConfigurationPermissionAttribute(new SecurityAction());
            IPermission ip = cpa.CreatePermission();
        }

        [Fact]
        public static void DataProtectionPermissionCallMethods()
        {
            DataProtectionPermission dp = new DataProtectionPermission(new PermissionState());
            bool isunrestricted = dp.IsUnrestricted();
            DataProtectionPermissionFlags flags = dp.Flags;
            IPermission other = new DataProtectionPermission(flags);
            other = dp.Copy();
            other = dp.Union(other);
            other = dp.Intersect(other);
            bool isSubsetOf = dp.IsSubsetOf(other);
            SecurityElement se = dp.ToXml();
            dp.FromXml(se);
        }

        [Fact]
        public static void DataProtectionPermissionAttributeCallMethods()
        {
            var dpa = new DataProtectionPermissionAttribute(new SecurityAction());
            DataProtectionPermissionFlags flags = dpa.Flags;
            bool protectData = dpa.ProtectData;
            bool unprotectData = dpa.UnprotectData;
            bool protectMemory = dpa.ProtectMemory;
            bool unprotectMemory = dpa.UnprotectMemory;
            IPermission ip = dpa.CreatePermission();
        }

        [Fact]
        public static void EnvironmentPermissionCallMethods()
        {
            EnvironmentPermission ep = new EnvironmentPermission(new Permissions.EnvironmentPermissionAccess(), "testpath");
            ep.AddPathList(new Permissions.EnvironmentPermissionAccess(), "testpath");
            string path = ep.GetPathList(new Permissions.EnvironmentPermissionAccess());
            bool isunrestricted = ep.IsUnrestricted();
            ep.SetPathList(new Permissions.EnvironmentPermissionAccess(), "testpath2");
            SecurityElement se = new SecurityElement("");
            ep.FromXml(se);
            se = ep.ToXml();
        }

        [Fact]
        public static void EnvironmentPermissionsAttributeCallMethods()
        {
            EnvironmentPermissionAttribute epa = new EnvironmentPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = epa.CreatePermission();
        }

        [Fact]
        public static void FileDialogPermissionCallMethods()
        {
            FileDialogPermission fdp = new FileDialogPermission(new Permissions.FileDialogPermissionAccess());
            IPermission ip = fdp.Copy();
            IPermission ip2 = fdp.Intersect(ip);
            bool issubset = fdp.IsSubsetOf(ip);
            bool isunrestricted = fdp.IsUnrestricted();
            IPermission ip3 = fdp.Union(ip2);
            SecurityElement se = new SecurityElement("");
            fdp.FromXml(se);
            se = fdp.ToXml();
        }

        [Fact]
        public static void FileDialogPermissionAttributeCallMethods()
        {
            FileDialogPermissionAttribute fspa = new FileDialogPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = fspa.CreatePermission();
        }

        [Fact]
        public static void FileIOPermissionCallMethods()
        {
            FileIOPermissionAccess fiopa = new Permissions.FileIOPermissionAccess();
            FileIOPermission fiop = new FileIOPermission(fiopa, "testpath");
            FileIOPermission fiop2 = new FileIOPermission(new Permissions.PermissionState());
            fiop.AddPathList(fiopa, "testpath");
            fiop.AddPathList(fiopa, new string[1] { "testpath" });
            IPermission ip = fiop.Copy();
            fiop.Equals(new object());
            int hash = fiop.GetHashCode();
            string[] pathlist = fiop.GetPathList(fiopa);
            IPermission ip2 = fiop.Intersect(ip);
            fiop.IsSubsetOf(ip);
            bool isunrestricted = fiop.IsUnrestricted();
            fiop.SetPathList(fiopa, "testpath");
            fiop.SetPathList(fiopa, new string[1] { "testpath" });
            IPermission ip3 = fiop.Union(ip);
            SecurityElement se = new SecurityElement("");
            fiop.FromXml(se);
            se = fiop.ToXml();
        }

        [Fact]
        public static void GacIdentityPermissionCallMethods()
        {
            GacIdentityPermission gip = new GacIdentityPermission();
            IPermission ip = gip.Copy();
            IPermission ip2 = gip.Intersect(ip);
            bool issubset = gip.IsSubsetOf(ip);
            IPermission ip3 = gip.Union(ip2);
            SecurityElement se = new SecurityElement("");
            gip.FromXml(se);
            se = gip.ToXml();
        }

        [Fact]
        public static void GacIdentityPermissionAttributeCallMethods()
        {
            GacIdentityPermissionAttribute gipa = new GacIdentityPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = gipa.CreatePermission();
        }

        [Fact]
        public static void PrincipalPermissionCallMethods()
        {
            PrincipalPermission pp = new PrincipalPermission(new Permissions.PermissionState());
            PrincipalPermission pp2 = new PrincipalPermission("name", "role");
            PrincipalPermission pp3 = new PrincipalPermission("name", "role", true);
            IPermission ip = pp.Copy();
            bool testbool = pp.Equals(new object());
            int testint = pp.GetHashCode();
            IPermission ip2 = pp.Intersect(ip);
            testbool = pp.IsSubsetOf(ip);
            testbool = pp.IsUnrestricted();
            string teststring = pp.ToString();
            ip2 = pp.Union(ip);
            pp.ToXml();
        }

        [Fact]
        public static void PrincipalPermissionAttributeCallMethods()
        {
            PrincipalPermissionAttribute ppa = new PrincipalPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = ppa.CreatePermission();
        }

        [Fact]
        public static void PublisherIdentityPermissionCallMethods()
        {
            PublisherIdentityPermission pip = new PublisherIdentityPermission(new System.Security.Cryptography.X509Certificates.X509Certificate());
            PublisherIdentityPermission pip2 = new PublisherIdentityPermission(new Permissions.PermissionState());
            IPermission ip = pip.Copy();
            IPermission ip2 = pip.Intersect(ip);
            bool testbool = pip.IsSubsetOf(ip);
            ip2 = pip.Union(ip);
            SecurityElement se = new SecurityElement("");
            pip.FromXml(se);
            se = pip.ToXml();
        }

        [Fact]
        public static void PublisherIdentityPermissionAttributeCallMethods()
        {
            PublisherIdentityPermissionAttribute pipa = new PublisherIdentityPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = pipa.CreatePermission();
        }

        [Fact]
        public static void ReflectionPermissionCallMethods()
        {
            ReflectionPermission rp = new ReflectionPermission(new Permissions.PermissionState());
            ReflectionPermission rp2 = new ReflectionPermission(new Permissions.ReflectionPermissionFlag());
            IPermission ip = rp.Copy();
            IPermission ip2 = rp.Intersect(ip);
            bool testbool = rp.IsSubsetOf(ip);
            testbool = rp.IsUnrestricted();
            ip2 = rp.Union(ip);
            SecurityElement se = new SecurityElement("");
            rp.FromXml(se);
            se = rp.ToXml();
        }

        [Fact]
        public static void ReflectionPermissionAttributeCallMethods()
        {
            ReflectionPermissionAttribute rpa = new ReflectionPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = rpa.CreatePermission();
        }

        [Fact]
        public static void RegistryPermissionCallMethods()
        {
            Permissions.RegistryPermissionAccess rpa = new Permissions.RegistryPermissionAccess();
            RegistryPermission rp = new RegistryPermission(new Permissions.PermissionState());
            RegistryPermission rp2 = new RegistryPermission(rpa, new System.Security.AccessControl.AccessControlActions(), "testpath");
            RegistryPermission rp3 = new RegistryPermission(rpa, "testpath");
            rp.AddPathList(rpa, "testpath");
            IPermission ip = rp.Copy();
            string path = rp.GetPathList(rpa);
            IPermission ip2 = rp.Intersect(ip);
            bool testbool = rp.IsSubsetOf(ip);
            testbool = rp.IsUnrestricted();
            rp.SetPathList(rpa, "testpath");
            ip2 = rp.Union(ip);
            SecurityElement se = new SecurityElement("");
            rp.FromXml(se);
            se = rp.ToXml();
        }

        [Fact]
        public static void RegistryPermissionAttributeCallMethods()
        {
            RegistryPermissionAttribute rpa = new RegistryPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = rpa.CreatePermission();
        }

        [Fact]
        public static void SecurityPermissionCallMethods()
        {
            SecurityPermission sp = new SecurityPermission(new Permissions.PermissionState());
            SecurityPermission sp2 = new SecurityPermission(new Permissions.SecurityPermissionFlag());
            IPermission ip = sp.Copy();
            IPermission ip2 = sp.Intersect(ip);
            bool testbool = sp.IsSubsetOf(ip);
            testbool = sp.IsUnrestricted();
            ip2 = sp.Union(ip);
            SecurityElement se = new SecurityElement("");
            sp.FromXml(se);
            se = sp.ToXml();
        }

        [Fact]
        public static void SecurityPermissionAttributeCallMethods()
        {
            SecurityPermissionAttribute spa = new SecurityPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = spa.CreatePermission();
        }

        [Fact]
        public static void SiteIdentityPermissionCallMethods()
        {
            SiteIdentityPermission sip = new SiteIdentityPermission(new Permissions.PermissionState());
            SiteIdentityPermission sip2 = new SiteIdentityPermission("testsite");
            IPermission ip = sip.Copy();
            IPermission ip2 = sip.Intersect(ip);
            bool testbool = sip.IsSubsetOf(ip);
            ip2 = sip.Union(ip);
            SecurityElement se = new SecurityElement("");
            sip.FromXml(se);
            se = sip.ToXml();
        }

        [Fact]
        public static void SiteIdentityPermissionAttributeCallMethods()
        {
            SiteIdentityPermissionAttribute sipa = new SiteIdentityPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = sipa.CreatePermission();
        }

        [Fact]
        public static void StrongNameIdentityPermissionCallMethods()
        {
            StrongNameIdentityPermission snip = new StrongNameIdentityPermission(new Permissions.PermissionState());
            StrongNameIdentityPermission snip2 = new StrongNameIdentityPermission(new Permissions.StrongNamePublicKeyBlob(new byte[1]), "test", new Version(1, 2));
            IPermission ip = snip.Copy();
            IPermission ip2 = snip.Intersect(ip);
            bool testbool = snip.IsSubsetOf(ip);
            ip2 = snip.Union(ip);
            SecurityElement se = new SecurityElement("");
            snip.FromXml(se);
            se = snip.ToXml();
        }

        [Fact]
        public static void StrongNameIdentityPermissionAttributeCallMethods()
        {
            StrongNameIdentityPermissionAttribute snipa = new StrongNameIdentityPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = snipa.CreatePermission();
        }

        [Fact]
        public static void StrongNamePublicKeyBlobTests()
        {
            StrongNamePublicKeyBlob snpkb = new StrongNamePublicKeyBlob(new byte[1]);
            bool testbool = snpkb.Equals(new object());
            int hash = snpkb.GetHashCode();
            string teststring = snpkb.ToString();
        }

        [Fact]
        public static void TypeDescriptorPermissionCallMethods()
        {
            TypeDescriptorPermission tdp = new TypeDescriptorPermission(new PermissionState());
            TypeDescriptorPermission tdp2 = new TypeDescriptorPermission(new TypeDescriptorPermissionFlags());
            IPermission ip = tdp.Copy();
            IPermission ip2 = tdp.Intersect(ip);
            bool testbool = tdp.IsSubsetOf(ip);
            testbool = tdp.IsUnrestricted();
            ip2 = tdp.Union(ip);
            SecurityElement se = new SecurityElement("");
            tdp.FromXml(se);
            se = tdp.ToXml();
        }

        [Fact]
        public static void UIPermissionCallMethods()
        {
            UIPermission uip = new UIPermission(new PermissionState());
            UIPermission uip2 = new UIPermission(new UIPermissionClipboard());
            UIPermission uip3 = new UIPermission(new UIPermissionWindow());
            UIPermission uip4 = new UIPermission(new UIPermissionWindow(), new UIPermissionClipboard());
            IPermission ip = uip.Copy();
            IPermission ip2 = uip.Intersect(ip);
            bool testbool = uip.IsSubsetOf(ip);
            testbool = uip.IsUnrestricted();
            ip2 = uip.Union(ip);
            SecurityElement se = new SecurityElement("");
            uip.FromXml(se);
            se = uip.ToXml();
        }

        [Fact]
        public static void UIPermissionAttributeCallMethods()
        {
            UIPermissionAttribute uipa = new UIPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = uipa.CreatePermission();
        }

        [Fact]
        public static void UrlIdentityPermissionCallMethods()
        {
            UrlIdentityPermission uip = new UrlIdentityPermission(new PermissionState());
            UrlIdentityPermission uip2 = new UrlIdentityPermission("testsite");
            IPermission ip = uip.Copy();
            IPermission ip2 = uip.Intersect(ip);
            bool testbool = uip.IsSubsetOf(ip);
            ip2 = uip.Union(ip);
            SecurityElement se = new SecurityElement("");
            uip.FromXml(se);
            se = uip.ToXml();
        }

        [Fact]
        public static void UrlIdentityPermissionAttributeCallMethods()
        {
            UrlIdentityPermissionAttribute uipa = new UrlIdentityPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = uipa.CreatePermission();
        }

        [Fact]
        public static void ZoneIdentityPermissionCallMethods()
        {
            ZoneIdentityPermission zip = new ZoneIdentityPermission(new PermissionState());
            ZoneIdentityPermission zip2 = new ZoneIdentityPermission(new SecurityZone());
            IPermission ip = zip.Copy();
            IPermission ip2 = zip.Intersect(ip);
            bool testbool = zip.IsSubsetOf(ip);
            SecurityElement se = new SecurityElement("");
            zip.FromXml(se);
            se = zip.ToXml();
        }

        [Fact]
        public static void ZoneIdentityPermissionAttributeCallMethods()
        {
            ZoneIdentityPermissionAttribute zipa = new ZoneIdentityPermissionAttribute(new Permissions.SecurityAction());
            IPermission ip = zipa.CreatePermission();
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>HierarchyBuilderGroupingBased (ARX GUI Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.deidentifier.arx.aggregates

Class HierarchyBuilderGroupingBased<T>

java.lang.Object

org.deidentifier.arx.aggregates.HierarchyBuilder<T>

org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased<T>

Type Parameters:

T -

All Implemented Interfaces:

java.io.Serializable

Direct Known Subclasses:

HierarchyBuilderIntervalBased, HierarchyBuilderOrderBased

public abstract class HierarchyBuilderGroupingBased<T>
extends HierarchyBuilder<T>
implements java.io.Serializable

This abstract base class enables building hierarchies for categorical and non-categorical values.

See Also:

Serialized Form

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

protected static class
HierarchyBuilderGroupingBased.AbstractGroup

A group representation to be used by subclasses.

static class
HierarchyBuilderGroupingBased.Group<U>

This class represents a fanout parameter.

static class
HierarchyBuilderGroupingBased.Level<U>

This class represents a level in the hierarchy.

Nested classes/interfaces inherited from class org.deidentifier.arx.aggregates.HierarchyBuilder

HierarchyBuilder.Type

Field Summary

Fields

Modifier and Type
Field and Description

protected AggregateFunction<T>
function

The default aggregate function, might be null.

Constructor Summary

Constructors

Modifier
Constructor and Description

protected
HierarchyBuilderGroupingBased(HierarchyBuilder.Type type,
                             DataType<T> datatype)

Creates a new instance for the given data type.

Method Summary

Methods

Modifier and Type
Method and Description

AttributeType.Hierarchy
build()

Creates a new hierarchy, based on the predefined specification.

AttributeType.Hierarchy
build(java.lang.String[] data)

Creates a new hierarchy, based on the predefined specification.

protected java.lang.String[]
getData()

Returns the data array.

DataType<T>
getDataType()

Returns the data type.

AggregateFunction<T>
getDefaultFunction()

Returns the default aggregate function.

HierarchyBuilderGroupingBased.Level<T>
getLevel(int level)

Returns the given level.

java.util.List<HierarchyBuilderGroupingBased.Level<T>>
getLevels()

Returns all currently defined levels.

protected HierarchyBuilderGroupingBased.AbstractGroup[][]
getPreparedGroups()

Returns the prepared groups for recursion.

java.lang.String
isValid()

Returns whether the current configuration is valid.

int[]
prepare(java.lang.String[] data)

Prepares the builder.

protected abstract HierarchyBuilderGroupingBased.AbstractGroup[][]
prepareGroups()

Tells the implementing class to prepare the generalization process.

void
setAggregateFunction(AggregateFunction<T> function)

Sets the default aggregate function to be used by all fanouts.

protected void
setData(java.lang.String[] data)

Sets the data array.

protected void
setLevels(java.util.List<HierarchyBuilderGroupingBased.Level<T>> levels)

Sets the groups on higher levels of the hierarchy.

protected void
setPrepared(boolean prepared)

Is this builder prepared allready.

Methods inherited from class org.deidentifier.arx.aggregates.HierarchyBuilder

create, create, getType, save, save

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

function

protected AggregateFunction<T> function

The default aggregate function, might be null.

Constructor Detail

HierarchyBuilderGroupingBased

protected HierarchyBuilderGroupingBased(HierarchyBuilder.Type type,
                             DataType<T> datatype)

Creates a new instance for the given data type.

Parameters:

type -

datatype -

Method Detail

build

public AttributeType.Hierarchy build()

Creates a new hierarchy, based on the predefined specification.

Specified by:

build in class HierarchyBuilder<T>

Returns:

build

public AttributeType.Hierarchy build(java.lang.String[] data)

Creates a new hierarchy, based on the predefined specification.

Specified by:

build in class HierarchyBuilder<T>

Parameters:

data -

Returns:

getDataType

public DataType<T> getDataType()

Returns the data type.

Returns:

getDefaultFunction

public AggregateFunction<T> getDefaultFunction()

Returns the default aggregate function.

Returns:

getLevel

public HierarchyBuilderGroupingBased.Level<T> getLevel(int level)

Returns the given level.

Parameters:

level -

Returns:

getLevels

public java.util.List<HierarchyBuilderGroupingBased.Level<T>> getLevels()

Returns all currently defined levels.

Returns:

isValid

public java.lang.String isValid()

Returns whether the current configuration is valid. Returns null, if so, an error message
 if not.

Returns:

prepare

public int[] prepare(java.lang.String[] data)

Prepares the builder. Returns a list of the number of equivalence classes per level

Specified by:

prepare in class HierarchyBuilder<T>

Parameters:

data -

Returns:

setAggregateFunction

public void setAggregateFunction(AggregateFunction<T> function)

Sets the default aggregate function to be used by all fanouts.

Parameters:

function -

getData

protected java.lang.String[] getData()

Returns the data array.

Returns:

getPreparedGroups

protected HierarchyBuilderGroupingBased.AbstractGroup[][] getPreparedGroups()

Returns the prepared groups for recursion.

Returns:

prepareGroups

protected abstract HierarchyBuilderGroupingBased.AbstractGroup[][] prepareGroups()

Tells the implementing class to prepare the generalization process.

Returns:

setData

protected void setData(java.lang.String[] data)

Sets the data array.

Parameters:

data -

setLevels

protected void setLevels(java.util.List<HierarchyBuilderGroupingBased.Level<T>> levels)

Sets the groups on higher levels of the hierarchy.

Parameters:

levels -

setPrepared

protected void setPrepared(boolean prepared)

Is this builder prepared allready.

Parameters:

prepared -

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package com.codesod.example.jpa.nplusone.dto;

import java.time.OffsetDateTime;

/**
 * @author MD Sayem Ahmed
 */
public class PurchaseOrderDTO {
    private final String id;
    private final OffsetDateTime orderDate;

    public PurchaseOrderDTO(String id, OffsetDateTime orderDate) {
        this.id = id;
        this.orderDate = orderDate;
    }

    public String getId() {
        return id;
    }

    public OffsetDateTime getOrderDate() {
        return orderDate;
    }
}


text:
import { describe, it } from 'flow-typed-test';
import logger from 'heroku-logger';

const Logger = require('heroku-logger').Logger;

describe('heroku-logger', () => {
  it('can log basic messages', () => {
    logger.info('Starting server', { port: 4000 });
    logger.error('Invalid `type` argument', { argument: 'type', value: 'number' });
    logger.warn(new Error('test'));

    // $FlowExpectedError[incompatible-call] needs a message
    logger.info();
  });

  it('can create new instance', () => {
    const log = new Logger({
      color: true,
      delimiter: ',',
      level: 'info',
      prefix: '#',
      readable: false,
    });

    log.info('message', { key: 'value' });
    log.error('error!', { code: 400 });

    // $FlowExpectedError[prop-missing] only accepts specific properties
    new Logger({
      color: true,
      delimiter: ',',
      level: 'info',
      prefix: '#',
      readable: false,
      random: 'blah',
    });
  });

  it('logs with level passed', () => {
    logger.log('info', 'message');
    logger.log('info', 'message', { key: 'value' });

    // $FlowExpectedError[incompatible-call] Needs to have at least level plus message
    logger.log();
    // $FlowExpectedError[incompatible-call] Needs to have at least level plus message
    logger.log('info');
    // $FlowExpectedError[incompatible-call] Needs to be passed a level
    logger.log('test', { key: 'value '});
  });

  it('clones', () => {
    const log = new logger.Logger({
      color: true,
      delimiter: ',',
      level: 'info',
      prefix: '#',
      readable: false,
    });
    const clone = log.clone({
      delimiter: '#',
    });
    log.clone({
      delimiter: '#',
      // $FlowExpectedError[incompatible-call] has same type checks as Logger constructor
      color: 'black',
    });
  })
});


text:
paramiko.SSHClient.close
========================

.. currentmodule:: paramiko

.. automethod:: SSHClient.close


text:
package org.hibernate.test.type.descriptor.java;

import org.hibernate.type.descriptor.java.BooleanTypeDescriptor;

/**
 * @author Steve Ebersole
 */
public class BooleanDescriptorTest extends AbstractDescriptorTest<Boolean> {
	final Boolean original = Boolean.TRUE;
	final Boolean copy = new Boolean( true );
	final Boolean different = Boolean.FALSE;

	public BooleanDescriptorTest() {
		super( BooleanTypeDescriptor.INSTANCE );
	}

	@Override
	protected Data<Boolean> getTestData() {
		return new Data<Boolean>( original, copy, different );
	}

	@Override
	protected boolean shouldBeMutable() {
		return false;
	}
}


text:
package mks.dms.model;

import mks.dms.dao.entity.Request;

/**
 * Using member "request" to store the search condition: In case search condition of a field is multi values, the string
 * of values are separated by a common. Ex, search request of type "Task or Rule", the value of field
 * request.requesttypeCd = "Task,Rule"
 *
 * @author ThachLN
 */
public class SearchRequestConditionModel {

    /** . */
    private Request request;

    /**
     * Get value of request.
     *
     * @return the request
     */
    public Request getRequest() {
        return request;
    }

    /**
     * Set the value for request.
     *
     * @param request the request to set
     */
    public void setRequest(Request request) {
        this.request = request;
    }
}