text:
package com.ibm.bi.dml.utils;

public class Timer
{

	long start;
	double sofar;

	public Timer() {
		start = 0 ;
		sofar = 0.0;
	}

	public void start() {
		start = System.nanoTime();
		sofar = 0.0;
	}

	public double stop() {
		double duration = sofar + (System.nanoTime()-start)*1e-6;
		sofar = 0.0;
		start = 0;
		return duration;
	}

	public double nanostop() {
		double duration = sofar + (System.nanoTime()-start);
		sofar = 0.0;
		start = 0;
		return duration;
	}

	public double pause() {
		sofar += (System.nanoTime()-start)*1e-6;
		return sofar;
	}

	public void resume() {
		start = System.nanoTime();
	}

}


text:
@interface KTLeftViewController ()
{
    UIButton* btn;
}
@end

@implementation KTLeftViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self login];

    btn = [UIButton buttonWithType:UIButtonTypeSystem];
    [btn setFrame:CGRectMake(10, 100, 100, 100)];
    [btn setTitle:@"登录" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];

}

- (void)login{
    NSString* loginURL = [NSString stringWithFormat:@"http://api.ktkt.com/v1/user/login"];

    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];

    [params setObject:@"15003125615" forKey:@"name"];
    [params setObject:@"123456" forKey:@"pass"];
    [params setObject:@"mobile" forKey:@"origin"];

    [KTNetManager postWithKTKTURL:loginURL params:params success:^(id json) {
        if (json) {
            [KTUserInfo doLoginWithUserInfo:json];
            KTLog(@"login==%@",[KTUserInfo getUserId]);

            [self refreshButton];

        }
    } failure:^(NSError *error) {

    }];
}
- (void)refreshButton{

    if ([KTUserInfo sharedUserInfo].isLogin) {

        [btn setTitle:@"logout" forState:UIControlStateNormal];
        [btn removeTarget:self action:@selector(login) forControlEvents:UIControlEventTouchUpInside];
        [btn addTarget:self action:@selector(logout) forControlEvents:UIControlEventTouchUpInside];
    }else{

        [btn setTitle:@"login" forState:UIControlStateNormal];
        [btn removeTarget:self action:@selector(logout) forControlEvents:UIControlEventTouchUpInside];
        [btn addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchUpInside];
    }
}
- (void)logout{
    [KTUserInfo doLogout];
    KTLog(@"login==%@",[KTUserInfo getUserId]);

    [self refreshButton];
}

@end

redpajama_set_name: RedPajamaGithub


text:
layout: post
microblog: true
category: photo
date: '2011-12-19T14:05:42'
title: ""
slug: '11121912140542'
location: 'Westville Chelsea'
mf-photo:
  - https://cdn.ericalba.com/blog-images/_ig-photos/photos/201112/6caaab031079dc43d28d8bead7ce3122.jpg
---
Grilled Lemon Chicken w/Asparagus & Parmesan and Zucchini, Mozzarella, Cherry tomatoes, spinach

<img src="https://cdn.ericalba.com/blog-images/_ig-photos/photos/201112/6caaab031079dc43d28d8bead7ce3122.jpg" />


text:
#include "arch/isa_traits.hh"
#include "arch/remote_gdb.hh"
#include "arch/utility.hh"
#include "base/loader/object_file.hh"
#include "base/loader/symtab.hh"
#include "base/trace.hh"
#include "cpu/thread_context.hh"
#include "config/full_system.hh"
#include "config/the_isa.hh"
#include "mem/mem_object.hh"
#include "mem/physical.hh"
#include "sim/byteswap.hh"
#include "sim/system.hh"
#include "sim/debug.hh"

#if FULL_SYSTEM
#include "arch/vtophys.hh"
#include "kern/kernel_stats.hh"
#else
#include "params/System.hh"
#endif

using namespace std;
using namespace TheISA;

vector<System *> System::systemList;

int System::numSystemsRunning = 0;

System::System(Params *p)
    : SimObject(p), physmem(p->physmem), _numContexts(0),
#if FULL_SYSTEM
      init_param(p->init_param),
      functionalPort(p->name + "-fport"),
      virtPort(p->name + "-vport"),
#else
      page_ptr(0),
      next_PID(0),
#endif
      memoryMode(p->mem_mode), _params(p)
{
    // add self to global system list
    systemList.push_back(this);

#if FULL_SYSTEM
    kernelSymtab = new SymbolTable;
    if (!debugSymbolTable)
        debugSymbolTable = new SymbolTable;

    /**
     * Get a functional port to memory
     */
    Port *mem_port;
    mem_port = physmem->getPort("functional");
    functionalPort.setPeer(mem_port);
    mem_port->setPeer(&functionalPort);

    mem_port = physmem->getPort("functional");
    virtPort.setPeer(mem_port);
    mem_port->setPeer(&virtPort);

    /**
     * Load the kernel code into memory
     */
    if (params()->kernel == "") {
        inform("No kernel set for full system simulation. Assuming you know what"
                " you're doing...\n");
    } else {
        // Load kernel code
        kernel = createObjectFile(params()->kernel);
        inform("kernel located at: %s", params()->kernel);

        if (kernel == NULL)
            fatal("Could not load kernel file %s", params()->kernel);

        // Load program sections into memory
        kernel->loadSections(&functionalPort, LoadAddrMask);

        // setup entry points
        kernelStart = kernel->textBase();
        kernelEnd = kernel->bssBase() + kernel->bssSize();
        kernelEntry = kernel->entryPoint();

        // load symbols
        if (!kernel->loadGlobalSymbols(kernelSymtab))
            fatal("could not load kernel symbols\n");

        if (!kernel->loadLocalSymbols(kernelSymtab))
            fatal("could not load kernel local symbols\n");

        if (!kernel->loadGlobalSymbols(debugSymbolTable))
            fatal("could not load kernel symbols\n");

        if (!kernel->loadLocalSymbols(debugSymbolTable))
            fatal("could not load kernel local symbols\n");

        DPRINTF(Loader, "Kernel start = %#x\n", kernelStart);
        DPRINTF(Loader, "Kernel end   = %#x\n", kernelEnd);
        DPRINTF(Loader, "Kernel entry = %#x\n", kernelEntry);
        DPRINTF(Loader, "Kernel loaded...\n");
    }
#endif // FULL_SYSTEM

    // increment the number of running systms
    numSystemsRunning++;
}

System::~System()
{
#if FULL_SYSTEM
    delete kernelSymtab;
    delete kernel;
#else
    panic("System::fixFuncEventAddr needs to be rewritten "
          "to work with syscall emulation");
#endif // FULL_SYSTEM}
}

int rgdb_wait = -1;
int rgdb_enable = true;

void
System::setMemoryMode(Enums::MemoryMode mode)
{
    assert(getState() == Drained);
    memoryMode = mode;
}

bool System::breakpoint()
{
    if (remoteGDB.size())
        return remoteGDB[0]->breakpoint();
    return false;
}

int
System::registerThreadContext(ThreadContext *tc, int assigned)
{
    int id;
    if (assigned == -1) {
        for (id = 0; id < threadContexts.size(); id++) {
            if (!threadContexts[id])
                break;
        }

        if (threadContexts.size() <= id)
            threadContexts.resize(id + 1);
    } else {
        if (threadContexts.size() <= assigned)
            threadContexts.resize(assigned + 1);
        id = assigned;
    }

    if (threadContexts[id])
        fatal("Cannot have two CPUs with the same id (%d)\n", id);

    threadContexts[id] = tc;
    _numContexts++;

    int port = getRemoteGDBPort();
    if (rgdb_enable && port) {
        RemoteGDB *rgdb = new RemoteGDB(this, tc);
        GDBListener *gdbl = new GDBListener(rgdb, port + id);
        gdbl->listen();
        /**
         * Uncommenting this line waits for a remote debugger to
         * connect to the simulator before continuing.
         */
        if (rgdb_wait != -1 && rgdb_wait == id)
            gdbl->accept();

        if (remoteGDB.size() <= id) {
            remoteGDB.resize(id + 1);
        }

        remoteGDB[id] = rgdb;
    }

    return id;
}

int
System::numRunningContexts()
{
    int running = 0;
    for (int i = 0; i < _numContexts; ++i) {
        if (threadContexts[i]->status() != ThreadContext::Halted)
            ++running;
    }
    return running;
}

void
System::startup()
{
#if FULL_SYSTEM
    int i;
    for (i = 0; i < threadContexts.size(); i++)
        TheISA::startupCPU(threadContexts[i], i);
#endif
}

void
System::replaceThreadContext(ThreadContext *tc, int context_id)
{
    if (context_id >= threadContexts.size()) {
        panic("replaceThreadContext: bad id, %d >= %d\n",
              context_id, threadContexts.size());
    }

    threadContexts[context_id] = tc;
    if (context_id < remoteGDB.size())
        remoteGDB[context_id]->replaceThreadContext(tc);
}

#if !FULL_SYSTEM
Addr
System::new_page()
{
    Addr return_addr = page_ptr << LogVMPageSize;
    ++page_ptr;
    if (return_addr >= physmem->size())
        fatal("Out of memory, please increase size of physical memory.");
    return return_addr;
}

Addr
System::memSize()
{
    return physmem->size();
}

Addr
System::freeMemSize()
{
   return physmem->size() - (page_ptr << LogVMPageSize);
}

#endif

void
System::serialize(ostream &os)
{
#if FULL_SYSTEM
    kernelSymtab->serialize("kernel_symtab", os);
#else // !FULL_SYSTEM
    SERIALIZE_SCALAR(page_ptr);
#endif
}

void
System::unserialize(Checkpoint *cp, const string &section)
{
#if FULL_SYSTEM
    kernelSymtab->unserialize("kernel_symtab", cp, section);
#else // !FULL_SYSTEM
    UNSERIALIZE_SCALAR(page_ptr);
#endif
}

void
System::printSystems()
{
    vector<System *>::iterator i = systemList.begin();
    vector<System *>::iterator end = systemList.end();
    for (; i != end; ++i) {
        System *sys = *i;
        cerr << "System " << sys->name() << ": " << hex << sys << endl;
    }
}

void
printSystems()
{
    System::printSystems();
}

const char *System::MemoryModeStrings[3] = {"invalid", "atomic",
    "timing"};

#if !FULL_SYSTEM

System *
SystemParams::create()
{
    return new System(this);
}

#endif


text:
const series = require('../')
const test = require('tape')

test('empty tasks array', function (t) {
  t.plan(1)

  series([], function (err) {
    t.error(err)
  })
})

test('empty tasks array and no callback', function (t) {
  series([])
  t.pass('did not throw')
  t.end()
})


text:
define('bforms-editable', [
    'jquery',
    'bforms-extensions',
    'jquery-ui-core',
    'bforms-initUI',
    'bforms-ajax'
], function () {

    var Editable = function (opt) {
        this.options = opt;
        this._init();
    };

    Editable.prototype.options = {
        uniqueName: null,
        isGroup: true,
        toggles: true,
        editFirst: false,
        editOnly: false,
        headerSelector: 'h3',
        headerSelectorTrigger: 'open-editable',
        saveClass: 'btn-success',
        cancelClass: 'btn-danger',
        readOnlySelector: '.bs-readonly',
        editorSelector: 'form',
        editModeSelector: 'bs-edit_mode',
        url: null,
        additionalData: {},
        editSuccessHandler: null,
        initPlugins: null
    };

    Editable.prototype._init = function () {

        if (this.element.hasClass('bs-editable_applied')) {
            return;
        }

        if (!this.options.uniqueName) {
            this.options.uniqueName = this.element.attr('id');
        }

        if (!this.options.uniqueName) {
            throw 'editable needs a unique name or the element on which it is aplied has to have an id attr';
        }

        if (!this.options.url) {
            throw 'url must have a value';
        }

        this._initSelectors();

        this._addDelegates();

        if (this.options.toggles) {
            this.element.find(this.options.headerSelector).addClass('editable');
        }

        this._createControls();

        if (typeof this.options.initPlugins === 'function') {
            this.options.initPlugins.call(this);
        }

        if (this.options.editFirst || this.options.editOnly) {
            this._switchToEditable();
        }

        var promise = this.element.bsInitUI();

        promise.done($.proxy(function() {
            this._trigger('afterFormInit', {
                editable: this,
                $element: this.element
            });
        }, this));

        this.element.addClass('bs-editable_applied');
    };

    Editable.prototype._initSelectors = function () {

        this.$readOnly = this.element.find(this.options.readOnlySelector);
        this.$editor = this.element.find(this.options.editorSelector);
        this.$header = this.element.find(this.options.headerSelector);

    };

    Editable.prototype._addDelegates = function () {
        if (this.options.toggles) {
            this.$header.on('click', $.proxy(this._evOnHeaderClick, this));
        }
    };

    Editable.prototype.initValidation = function () {
        if (this.$editor.length) {
            $.validator.unobtrusive.parse(this.$editor);
            this.$editor.validate();
        }
    };

    Editable.prototype._createControls = function () {

        if (this.options.editOnly || this.options.toggles) {

            var $save = $('').addClass(this.options.saveClass)
                                    .addClass('btn')
                                    .html(' ')
                                    .attr('href', '#')
                                    .on('click', $.proxy(this._evOnSaveClick, this));

            if (this.options.toggles) {
                var $cancel = $('').addClass(this.options.cancelClass)
                                        .addClass('btn')
                                        .html(' ')
                                        .attr('href', '#')
                                        .on('click', $.proxy(this._evOnCancelClick, this));
            }

            this.$controls = $('').addClass('controls')
                                              .append($save)
                                              .append($cancel)
                                              .appendTo(this.$header)
                                              .hide();
        }

    };

    Editable.prototype._evOnHeaderClick = function (e) {
        e.preventDefault();

        var $me = $(e.currentTarget);
        var $meTrigger = $(e.target);

        //check if i'm already in edit mode
        if ($me.data('editmode') || ( !$meTrigger.hasClass(this.options.headerSelectorTrigger) && e.currentTarget != e.target) ) {
            return;
        }

        this._switchToEditable();
    };

    Editable.prototype._evOnSaveClick = function (e) {

        e.preventDefault();

        var $me = $(e.currentTarget);

        // validate form
        var $form = this.$editor;
        if ($form.length > 0) {

            // validate form
            $.validator.unobtrusive.parse($form);

            var validatedForm = $form.validate();

            validatedForm.settings.partialNameSearch = true;

            // return if not falid form
            if (!$form.valid())
                return;
        }

        // parse data
        var data = this.options.prefix ?
            $form.parseForm(this.options.prefix) : $form.parseForm();

        // add aditional data
        $.extend(true, data, this.options.additionalData);

        this._trigger('beforeSaveAjax', 0, data);

        // add part type
        data.Type = this.element.data('type');

        var ajaxOptions = {
            name: this.options.uniqueName,
            url: this.options.url,
            data: data,
            callbackData: {
                sent: data
            },
            context: this,
            success: $.proxy(this._saveAjaxSuccess, this),
            error: $.proxy(this._saveAjaxError, this),
            validationError: $.proxy(this._saveAjaxValidationError, this),
            loadingElement: this.element,
            loadingClass: 'loading'
        };

        $.bforms.ajax(ajaxOptions);

    };

    Editable.prototype._saveAjaxValidationError = function (data, callbackData) {
        if (data) {
            var validatedForm = this.$editor.data('validator');
            validatedForm.showErrors(data.Errors,true);
        }
    };

    Editable.prototype._saveAjaxSuccess = function (data, callbackData) {

        if (typeof this.options.editSuccessHandler === 'function') {
            this.options.editSuccessHandler.call(this, data);
        }

        if (this.options.editOnly) {
            return;
        }

        //replace read-only part
        this.$readOnly.html($(data.Html).html());

        this._switchToReadOnly();

    };

    Editable.prototype._saveAjaxError = function (data) {
        if (data.Message) {
            var validatedForm = this.$editor.data('validator');
            validatedForm.showSummaryError(data.Message);
        }
    };

    Editable.prototype._evOnCancelClick = function (e) {

        e.preventDefault();

        this._switchToReadOnly();

    };

    Editable.prototype._switchToEditable = function () {

        // hide read only part
        this.$readOnly.hide();
        // show form
        this.$editor.show();
        //show controls
        this.$controls.show();

        this.$header.data('editmode', true);

        this.$header.removeClass('editable');

    };

    Editable.prototype._switchToReadOnly = function () {

        // show read only part
        this.$readOnly.show();
        // hide form
        this.$editor.hide();
        //hide controls
        this.$controls.hide();

        this.$header.data('editmode', false);

        this.$header.addClass('editable');

    };

    Editable.prototype._destroy = function () {

        this.element.removeClass('bs-editable_applied');

    };

    $.widget('bforms.bsEditable', Editable.prototype);

    return Editable;

});


text:
layout: page
title: Bautista Family Reunion
date: 2016-05-24
author: Joshua Wang
tags: weekly links, java
status: published
summary: Nulla id consectetur arcu, sed sollicitudin turpis. Suspendisse.
banner: images/banner/people.jpg
booking:
  startDate: 07/16/2016
  endDate: 07/20/2016
  ctyhocn: CLKOKHX
  groupCode: BFR
published: true
---
Morbi feugiat fringilla neque, sed porta justo porta eget. Sed fermentum sed lacus eu auctor. Morbi non dui porta, molestie nulla sit amet, ullamcorper neque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut blandit lorem sed mauris laoreet ultricies. Morbi vitae mollis tellus. Fusce non consectetur magna. Donec bibendum, sem vel condimentum tincidunt, nisi enim varius neque, quis dignissim nibh arcu a lacus. Morbi vitae scelerisque sem.

* Phasellus congue felis nec sem venenatis varius
* Maecenas vulputate ante et neque faucibus, non commodo magna pulvinar
* Nulla interdum mi ullamcorper, ullamcorper felis a, venenatis dui.

Quisque mi odio, varius vitae enim nec, euismod ultricies enim. Ut eget eros gravida, euismod diam eu, efficitur risus. Donec ullamcorper magna sit amet nunc tristique iaculis. Donec molestie egestas tortor ac laoreet. Vestibulum quis interdum ante, porttitor consequat metus. Donec rhoncus sed augue id tempor. Donec et nunc sollicitudin, elementum ante quis, imperdiet diam. Curabitur metus elit, convallis nec rhoncus at, ullamcorper ac eros. Aenean laoreet viverra leo. Praesent condimentum scelerisque tellus, porttitor porta dolor laoreet at. Ut a turpis ac nulla posuere accumsan in ac nunc.


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Vaste Pl. Rotsheesters 97. 1924

#### Original name
null

### Remarks
null


text:
{% extends "admin/filer/change_form.html" %}
{% load i18n admin_modify admin_urls admin_static %}

{% block extrastyle %}{{ block.super }}

{% endblock %}

{% block object-tools %}
{% if change %}{% if not is_popup %}

    {#
{% trans "Export" %}
#}

{% trans "History" %}

  {% if has_absolute_url %}
{% trans "View on site" %}
{% endif%}

{% endif %}{% endif %}
{% endblock %}

{% block file_sidebar %}

    {% trans "Full size preview" %}

{{ block.super }}
{% endblock %}


text:
<?php

/**  */
namespace Applications\Entity;

use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Core\Entity\AbstractEntity;

/**
 * Holds various attributes like "send me a carbon copy" or "i accept the privacy policy".
 *
 * @author Mathias Gelhausen <gelhausen@cross-solution.de>
 * @author Carsten Bleek <bleek@cross-solution.de>
 *
 * @ODM\EmbeddedDocument
 */
class Attributes extends AbstractEntity
{
    /**
     * Flag wether privacy policy is accepted or not.
     *
     * @var boolean
     * @ODM\Field(type="boolean")
     */
    protected $privacyPolicy;

    /**
     * Flag wether to send a carbon copy or not.
     *
     * @var boolean
     * @ODM\Field(type="boolean")
     */
    protected $carbonCopy;

    /**
     * Sets wether the privacy policy is accepted.
     *
     * @param bool $flag
     *
     * @return self
     */
    public function setAcceptedPrivacyPolicy($flag)
    {
        $this->privacyPolicy = (bool) $flag;
        return $this;
    }

    /**
     * Returns wether the privacy policy is accepted.
     *
     * @return bool
     */
    public function getAcceptedPrivacyPolicy()
    {
        return $this->privacyPolicy;
    }

    /**
     *
     *
     * @param $flag
     *
     * @return self
     */
    public function setSendCarbonCopy($flag)
    {
        $this->carbonCopy = (bool) $flag;
        return $this;
    }

    public function getSendCarbonCopy()
    {
        return $this->carbonCopy;
    }
}


text:
package codedeploy

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/defaults"
	"github.com/aws/aws-sdk-go/aws/service"
	"github.com/aws/aws-sdk-go/internal/protocol/jsonrpc"
	"github.com/aws/aws-sdk-go/internal/signer/v4"
)

// Overview This is the AWS CodeDeploy API Reference. This guide provides descriptions
// of the AWS CodeDeploy APIs. For additional information, see the AWS CodeDeploy
// User Guide (http://docs.aws.amazon.com/codedeploy/latest/userguide).
//
// Using the APIs You can use the AWS CodeDeploy APIs to work with the following
// items:
//
//   Applications are unique identifiers that AWS CodeDeploy uses to ensure
// that the correct combinations of revisions, deployment configurations, and
// deployment groups are being referenced during deployments.
//
// You can use the AWS CodeDeploy APIs to create, delete, get, list, and update
// applications.
//
//   Deployment configurations are sets of deployment rules and deployment
// success and failure conditions that AWS CodeDeploy uses during deployments.
//
// You can use the AWS CodeDeploy APIs to create, delete, get, and list deployment
// configurations.
//
//   Deployment groups are groups of instances to which application revisions
// can be deployed.
//
// You can use the AWS CodeDeploy APIs to create, delete, get, list, and update
// deployment groups.
//
//   Instances represent Amazon EC2 instances to which application revisions
// are deployed. Instances are identified by their Amazon EC2 tags or Auto Scaling
// group names. Instances belong to deployment groups.
//
// You can use the AWS CodeDeploy APIs to get and list instances.
//
//   Deployments represent the process of deploying revisions to instances.
//
// You can use the AWS CodeDeploy APIs to create, get, list, and stop deployments.
//
//   Application revisions are archive files that are stored in Amazon S3 buckets
// or GitHub repositories. These revisions contain source content (such as source
// code, web pages, executable files, any deployment scripts, and similar) along
// with an Application Specification file (AppSpec file). (The AppSpec file
// is unique to AWS CodeDeploy; it defines a series of deployment actions that
// you want AWS CodeDeploy to execute.) An application revision is uniquely
// identified by its Amazon S3 object key and its ETag, version, or both (for
// application revisions that are stored in Amazon S3 buckets) or by its repository
// name and commit ID (for applications revisions that are stored in GitHub
// repositories). Application revisions are deployed through deployment groups.
//
// You can use the AWS CodeDeploy APIs to get, list, and register application
// revisions.
type CodeDeploy struct {
	*service.Service
}

// Used for custom service initialization logic
var initService func(*service.Service)

// Used for custom request initialization logic
var initRequest func(*service.Request)

// New returns a new CodeDeploy client.
func New(config *aws.Config) *CodeDeploy {
	service := &service.Service{
		Config:       defaults.DefaultConfig.Merge(config),
		ServiceName:  "codedeploy",
		APIVersion:   "2014-10-06",
		JSONVersion:  "1.1",
		TargetPrefix: "CodeDeploy_20141006",
	}
	service.Initialize()

	// Handlers
	service.Handlers.Sign.PushBack(v4.Sign)
	service.Handlers.Build.PushBack(jsonrpc.Build)
	service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
	service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
	service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)

	// Run custom service initialization if present
	if initService != nil {
		initService(service)
	}

	return &CodeDeploy{service}
}

// newRequest creates a new request for a CodeDeploy operation and runs any
// custom request initialization.
func (c *CodeDeploy) newRequest(op *service.Operation, params, data interface{}) *service.Request {
	req := service.NewRequest(c.Service, op, params, data)

	// Run custom request initialization if present
	if initRequest != nil {
		initRequest(req)
	}

	return req
}


text:
package org.jboss.weld.tests.annotatedType.interceptors;

import java.io.Serializable;

@SuppressWarnings("serial")
public class Box implements Serializable {

    @BoxBinding
    public boolean isIntercepted() {
        return false;
    }
}


text:
'use strict';

angular.module('CentralDogmaAdmin')
    .directive('aceEditor',
               function () {
                 return {
                   template: '

' +
                             '
' +
                             '  <select class="form-control input-sm"' +
                             '          ng-model="theme"' +
                             '          ng-options="t.theme as t.caption group by t.type for t in availableThemes"' +
                             '          ng-change="updatePrefs()"></select>' +
                             '  <select class="form-control input-sm"' +
                             '          ng-model="keyboardHandler"' +
                             '          ng-options="h.value as h.name for h in availableKeyboardHandlers"' +
                             '          ng-change="updatePrefs()"></select>' +
                             '
',
                   restrict: 'E',
                   scope: {
                     'editorClass': '@class',
                     'path': '=pathNgModel',
                     'content': '=contentNgModel',
                     'readonly': '=',
                     'callback': '&'
                   },
                   controller: function ($scope, $timeout, $translate, localStorageService) {

                     // Load the theme list.
                     $scope.availableThemes = angular.copy(window.ace.require('ace/ext/themelist').themes);
                     $scope.defaultTheme = 'ace/theme/eclipse';

                     // Localize the theme type caption:
                     $translate('entities.light_themes').then(function (translated) {
                       for (var i in $scope.availableThemes) {
                         var t = $scope.availableThemes[i];
                         if (!t.isDark) {
                           t.type = translated;
                         }
                       }
                     });
                     $translate('entities.dark_themes').then(function (translated) {
                       for (var i in $scope.availableThemes) {
                         var t = $scope.availableThemes[i];
                         if (t.isDark) {
                           t.type = translated;
                         }
                       }
                     });

                     // Define the keyboard handler list.
                     $scope.availableKeyboardHandlers = [
                       { 'name': 'Ace',
                         'value': 'default' },
                       { 'name': 'Vim',
                         'value': 'ace/keyboard/vim' },
                       { 'name': 'Emacs',
                         'value': 'ace/keyboard/emacs' }
                     ];
                     $scope.defaultKeyboardHandler = $scope.availableKeyboardHandlers[0].value;

                     // Add '(Default)' to the theme and keyboard handler captions.
                     $translate('entities.default_theme').then(function (translated) {
                       for (var i in $scope.availableThemes) {
                         var t = $scope.availableThemes[i];
                         if (t.theme === $scope.defaultTheme) {
                           t.caption = t.caption + " (" + translated + ')';
                         }
                       }

                       for (var i in $scope.availableKeyboardHandlers) {
                         var h = $scope.availableKeyboardHandlers[i];
                         if (h.value === $scope.defaultKeyboardHandler) {
                           h.name = h.name + " (" + translated + ')';
                           break;
                         }
                       }
                     });

                     var KEY_ACE_PREFS = 'acePrefs';

                     // Configure the editor with the preferred theme and keyboard handler.
                     $scope.aceLoaded = function (editor) {
                       $scope.editor = editor;

                       editor.$blockScrolling = Infinity;
                       editor.setShowInvisibles(true);
                       editor.setAnimatedScroll(true);
                       editor.setShowFoldWidgets(true);
                       editor.setShowPrintMargin(true);
                       editor.setPrintMarginColumn(112);

                       $scope.loadPrefs(editor);

                       var options = {
                         showGutter: true,
                         showLineNumbers: true
                       };

                       if ($scope.readonly) {
                         editor.setReadOnly(true);
                       } else {
                         options.enableBasicAutocompletion = true;
                         options.enableLiveAutocompletion = true;
                       }

                       editor.setOptions(options);

                       var session = editor.getSession();
                       session.setUseWrapMode(true);
                       session.setUseSoftTabs(true);
                       session.setNewLineMode('unix');

                       var callback = $scope.callback;
                       if (typeof callback === 'function') {
                         callback = callback();
                         if (typeof callback === 'function') {
                           callback(editor);
                         }
                       }
                     };

                     // Auto-detect the edit mode and tab size from the file path.
                     $scope.$watch('path', function (value) {
                       if (typeof $scope.editor === 'undefined' || typeof value !== 'string') {
                         return;
                       }

                       var session = $scope.editor.getSession();
                       var modelist = window.ace.require('ace/ext/modelist');
                       var mode = modelist.getModeForPath(value).mode;
                       session.setMode(mode);
                       if (mode === 'ace/mode/json') {
                         session.setTabSize(2);
                       } else {
                         session.setTabSize(4);
                       }
                     });

                     // Loads the preferred theme and keyboard handler.
                     $scope.loadPrefs = function (editor) {
                       var prefs = localStorageService.get(KEY_ACE_PREFS);

                       if (typeof prefs !== 'object' || prefs === null ||
                           typeof prefs.theme !== 'string' ||
                           typeof prefs.keyboardHandler !== 'string') {
                         prefs = {
                           theme: $scope.defaultTheme,
                           keyboardHandler: $scope.defaultKeyboardHandler
                         };
                       }

                       var themeSet = false;
                       for (var i in $scope.availableThemes) {
                         var t = $scope.availableThemes[i];
                         if (prefs.theme === t.theme) {
                           editor.setTheme(prefs.theme);
                           $scope.theme = prefs.theme;
                           themeSet = true;
                           break;
                         }
                       }

                       if (!themeSet) {
                         editor.setTheme($scope.defaultTheme);
                         $scope.theme = $scope.defaultTheme;
                       }

                       var keyboardHandlerSet = false;
                       if (prefs.keyboardHandler !== 'default') {
                         for (var i in $scope.availableKeyboardHandlers) {
                           var h = $scope.availableKeyboardHandlers[i];
                           if (prefs.keyboardHandler === h.value) {
                             editor.setKeyboardHandler(prefs.keyboardHandler);
                             $scope.keyboardHandler = prefs.keyboardHandler;
                             keyboardHandlerSet = true;
                             break;
                           }
                         }
                       }

                       if (!keyboardHandlerSet) {
                         editor.setKeyboardHandler(editor.commands);
                         $scope.keyboardHandler = $scope.defaultKeyboardHandler;
                       }
                     };

                     // Update and save the preferred theme and keyboard handler.
                     $scope.updatePrefs = function () {
                       if (typeof $scope.editor === 'undefined') {
                         return;
                       }

                       var editor = $scope.editor;
                       var theme = $scope.theme;
                       editor.setTheme(theme);

                       var keyboardHandler = $scope.keyboardHandler;
                       if (keyboardHandler === $scope.defaultKeyboardHandler) {
                         editor.setKeyboardHandler(editor.commands);
                       } else {
                         editor.setKeyboardHandler(keyboardHandler);
                       }

                       localStorageService.set(KEY_ACE_PREFS,
                                               { theme: theme, keyboardHandler: keyboardHandler });
                     };
                   }
                 };
               });


text:
package ua.com.fielden.platform.serialisation.api;

import java.util.List;

/**
 * A contract that should be implemented in order to provide serialiser implementations with classes to be registered for serialisation.
 *
 * @author TG Team
 *
 */
public interface ISerialisationClassProvider {
    List<Class<?>> classes();
}


text:
package org.umlg.sqlg.step;

import com.google.common.base.Preconditions;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.SackStep;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import org.umlg.sqlg.sql.parse.ReplacedStep;
import org.umlg.sqlg.sql.parse.ReplacedStepTree;
import org.umlg.sqlg.sql.parse.SchemaTableTree;
import org.umlg.sqlg.strategy.Emit;
import org.umlg.sqlg.strategy.SqlgComparatorHolder;
import org.umlg.sqlg.structure.SqlgCompiledResultIterator;
import org.umlg.sqlg.structure.SqlgElement;
import org.umlg.sqlg.structure.SqlgGraph;
import org.umlg.sqlg.structure.traverser.SqlgTraverserGenerator;
import org.umlg.sqlg.util.SqlgTraversalUtil;

import java.util.*;

/**
 * Date: 2015/02/20
 * Time: 9:54 PM
 */
@SuppressWarnings("unchecked")
public class SqlgGraphStep<S, E extends SqlgElement> extends GraphStep implements SqlgStep, TraversalParent {

    private final SqlgGraph sqlgGraph;

    private final List<ReplacedStep<?, ?>> replacedSteps = new ArrayList<>();
    private ReplacedStepTree replacedStepTree;

    private Emit<E> toEmit = null;
    private Iterator<List<Emit<E>>> elementIter;

    private final List<Emit<E>> traversers = new ArrayList<>();
    private ListIterator<Emit<E>> traversersLstIter;

    private Traverser.Admin<S> previousHead;

    private ReplacedStep<?, ?> lastReplacedStep;
    private long rangeCount = 0;
    private boolean eagerLoad = false;
    private boolean isForMultipleQueries = false;

    /**
     * This is a jippo of sorts.
     * Sqlg always uses SqlgTraverser which extends B_LP_O_P_S_SE_SL_Traverser.
     * This means the path is included in hashCode and equals which buggers up ...sack() gremlins.
     * So for traversals with a sack this indicates to ignore the path in the hasCode and equals.
     */
    private final boolean requiresSack;
    private final boolean requiresOneBulk;

    @SuppressWarnings("unchecked")
    public SqlgGraphStep(final SqlgGraph sqlgGraph, final Traversal.Admin traversal, final Class<E> returnClass, final boolean isStart, final Object... ids) {
        super(traversal, returnClass, isStart, ids);
        this.sqlgGraph = sqlgGraph;
        this.requiresSack = TraversalHelper.hasStepOfAssignableClass(SackStep.class, traversal);
        this.requiresOneBulk = SqlgTraversalUtil.hasOneBulkRequirement(traversal);
    }

    @SuppressWarnings("unchecked")
    @Override
    protected Traverser.Admin<E> processNextStart() {
        while (true) {
            if (this.traversersLstIter != null && this.traversersLstIter.hasNext()) {
                Emit<E> emit = this.traversersLstIter.next();
                this.labels = emit.getLabels();
                if (applyRange(emit)) {
                    continue;
                }
                return emit.getTraverser();
            }
            if (!this.eagerLoad && (this.elementIter != null)) {
                if (this.elementIter.hasNext()) {
                    this.traversers.clear();
                    internalLoad();
                    this.traversersLstIter = this.traversers.listIterator();
                }
            }
            if (this.traversersLstIter != null && this.traversersLstIter.hasNext()) {
                Emit<E> emit = this.traversersLstIter.next();
                this.labels = emit.getLabels();
                if (applyRange(emit)) {
                    continue;
                }
                return emit.getTraverser();
            } else {
                if (!this.isStart) {
                    this.previousHead = this.starts.next();
                } else {
                    if (this.done) {
                        throw FastNoSuchElementException.instance();
                    }
                    this.done = true;
                }
                this.elementIter = elements();
                if (this.eagerLoad) {
                    eagerLoad();
                    Collections.sort(this.traversers);
                    this.traversersLstIter = this.traversers.listIterator();
                }
                this.lastReplacedStep = this.replacedSteps.get(this.replacedSteps.size() - 1);
            }
        }
    }

    private boolean applyRange(Emit<E> emit) {
        if (this.lastReplacedStep.hasRange() && this.lastReplacedStep.applyInStep() && this.lastReplacedStep.getDepth() == emit.getReplacedStepDepth()) {
            if (this.lastReplacedStep.getSqlgRangeHolder().hasRange()) {
                if (this.lastReplacedStep.getSqlgRangeHolder().getRange().isBefore(this.rangeCount + 1)) {
                    throw FastNoSuchElementException.instance();
                }
                if (this.lastReplacedStep.getSqlgRangeHolder().getRange().isAfter(this.rangeCount)) {
                    this.rangeCount++;
                    return true;
                }
            } else {
                Preconditions.checkState(this.lastReplacedStep.getSqlgRangeHolder().hasSkip(), "If not a range query then it must be a skip.");
                if (this.rangeCount < this.lastReplacedStep.getSqlgRangeHolder().getSkip()) {
                    this.rangeCount++;
                    return true;
                }
            }
            this.rangeCount++;
        }
        return false;
    }

    @Override
    public void setEagerLoad(boolean eager) {
        this.eagerLoad = eager;
    }

    @Override
    public boolean isEagerLoad() {
        return this.eagerLoad;
    }

    //B_LP_O_P_S_SE_SL_Traverser
    private void eagerLoad() {
        this.traversers.clear();
        while (this.elementIter.hasNext()) {
            internalLoad();
        }
    }

    private void internalLoad() {
        List<Emit<E>> emits = this.elementIter.next();
        Traverser.Admin<E> traverser = null;
        boolean first = true;
        List<SqlgComparatorHolder> emitComparators = new ArrayList<>();
        for (Emit<E> emit : emits) {
            if (!emit.isFake()) {
                this.toEmit = emit;
                E e = emit.getElement();
                this.labels = emit.getLabels();
                if (!isStart && previousHead != null && traverser == null) {
                    first = false;
                    traverser = previousHead.split(e, this);
                } else if (first) {
                    first = false;
                    traverser = SqlgTraverserGenerator.instance().generate(e, this, 1L, this.requiresSack, this.requiresOneBulk);
                } else {
                    traverser = traverser.split(e, this);
                }
                emitComparators.add(this.toEmit.getSqlgComparatorHolder());
            }
        }
        this.toEmit.setSqlgComparatorHolders(emitComparators);
        this.toEmit.setTraverser(traverser);
        this.toEmit.evaluateElementValueTraversal(0, traverser);
        this.traversers.add(this.toEmit);
        if (this.toEmit.isRepeat() && !this.toEmit.isRepeated()) {
            this.toEmit.setRepeated(true);
            this.traversers.add(this.toEmit);
        }
    }

    @Override
    public void reset() {
        super.reset();
        this.previousHead = null;
    }

    @Override
    public Set<TraverserRequirement> getRequirements() {
        return this.getSelfAndChildRequirements(TraverserRequirement.PATH, TraverserRequirement.SIDE_EFFECTS, TraverserRequirement.ONE_BULK);
    }

    private Iterator<List<Emit<E>>> elements() {
        this.sqlgGraph.tx().readWrite();
        if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().getBatchManager().isStreaming()) {
            throw new IllegalStateException("streaming is in progress, first flush or commit before querying.");
        }
        Preconditions.checkState(this.replacedSteps.size() > 0, "There must be at least one replacedStep");
        Preconditions.checkState(this.replacedSteps.get(0).isGraphStep(), "The first step must a SqlgGraphStep");
        Set<SchemaTableTree> rootSchemaTableTrees = prepare();
        return new SqlgCompiledResultIterator<>(this.sqlgGraph, rootSchemaTableTrees);
    }

    private Set<SchemaTableTree> prepare() {
        this.replacedStepTree.maybeAddLabelToLeafNodes();
        Set<SchemaTableTree> rootSchemaTableTrees = parseForStrategy();
        //If the order is over multiple tables then the resultSet will be completely loaded into memory and then sorted.
        if (this.replacedStepTree.hasOrderBy()) {
            if (isForMultipleQueries() || !this.replacedStepTree.orderByIsOrder() || this.replacedStepTree.orderByIsBeforeLeftJoin()) {
                setEagerLoad(true);
                //Remove the dbComparators
                for (SchemaTableTree rootSchemaTableTree : rootSchemaTableTrees) {
                    rootSchemaTableTree.removeDbComparators();
                    rootSchemaTableTree.loadEager();
                }
            } else {
                //This is only needed for test assertions at the moment.
                this.replacedStepTree.applyComparatorsOnDb();
            }
        }
        //If a range follows an order that needs to be done in memory then do not apply the range on the db.
        //range is always the last step as sqlg does not optimize beyond a range step.
        if (this.replacedStepTree.hasRange()) {
            if (this.replacedStepTree.hasOrderBy()) {
                if (isForMultipleQueries()) {
                    this.replacedStepTree.doNotApplyRangeOnDb();
                    setEagerLoad(true);
                } else {
                    this.replacedStepTree.doNotApplyInStep();
                }
            } else {
                if (!isForMultipleQueries()) {
                    //In this case the range is only applied on the db.
                    this.replacedStepTree.doNotApplyInStep();
                } else {
                    this.replacedStepTree.doNotApplyRangeOnDb();
                }
            }
        }
        return rootSchemaTableTrees;
    }

    @Override
    public List<ReplacedStep<?, ?>> getReplacedSteps() {
        return this.replacedSteps;
    }

    @SuppressWarnings("Duplicates")
    @Override
    public ReplacedStepTree.TreeNode addReplacedStep(ReplacedStep<?, ?> replacedStep) {
        //depth is + 1 because there is always a root node who's depth is 0
        replacedStep.setDepth(this.replacedSteps.size());
        this.replacedSteps.add(replacedStep);
        if (this.replacedStepTree == null) {
            //the first root node
            this.replacedStepTree = new ReplacedStepTree(replacedStep);
        } else {
            this.replacedStepTree.addReplacedStep(replacedStep);
        }
        return this.replacedStepTree.getCurrentTreeNodeNode();
    }

    private Set<SchemaTableTree> parseForStrategy() {
        this.isForMultipleQueries = false;
        Preconditions.checkState(this.replacedSteps.size() > 0, "There must be at least one replacedStep");
        Preconditions.checkState(this.replacedSteps.get(0).isGraphStep(), "The first step must a SqlgGraphStep");
        Set<SchemaTableTree> rootSchemaTableTrees = this.sqlgGraph.getGremlinParser().parse(this.replacedStepTree);
        if (rootSchemaTableTrees.size() > 1) {
            this.isForMultipleQueries = true;
            for (SchemaTableTree rootSchemaTableTree : rootSchemaTableTrees) {
                rootSchemaTableTree.resetColumnAliasMaps();
            }
        } else {
            for (SchemaTableTree rootSchemaTableTree : rootSchemaTableTrees) {
                try {
                    //TODO this really sucks, constructsql should not query, but alas it does for P.within and temp table jol
                    if (this.sqlgGraph.tx().isOpen() && this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().getBatchManager().isStreaming()) {
                        throw new IllegalStateException("streaming is in progress, first flush or commit before querying.");
                    }
                    //Regular
                    List<LinkedList<SchemaTableTree>> distinctQueries = rootSchemaTableTree.constructDistinctQueries();
                    this.isForMultipleQueries = distinctQueries.size() > 1;
                    if (this.isForMultipleQueries) {
                        break;
                    }
                } finally {
                    rootSchemaTableTree.resetColumnAliasMaps();
                }
            }
        }
        return rootSchemaTableTrees;
    }

    @Override
    public boolean isForMultipleQueries() {
        return this.isForMultipleQueries;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode() ^ this.returnClass.hashCode();
        for (final Object id : this.ids) {
            result ^= id.hashCode();
        }
        return result;
    }

}


text:
<?php

/**
 * @see Zend_Controller_Router_Route
 */
require_once 'Zend/Controller/Router/Route.php';

/**
 * Router using $_SERVER['HTTP_HOST']...
 *
 * This router can be used for routing subdomains; however, it does have limitations
 * as it cannot generate full urls or match urls that do not have the subdomain
 * in the HTTP_HOST
 *
 * @author Geoffrey Tran
 * @license http://www.zym-project.com/license New BSD License
 * @category Zym
 * @package Zym_Controller
 * @subpackage Router_Route
 * @copyright  Copyright (c) 2008 Zym. (http://www.zym-project.com/)
 */
class Zym_Controller_Router_Route_HttpHost extends Zend_Controller_Router_Route
{
    /**
     * Domain namespace separator
     *
     */
    const DOMAIN_SEPARATOR = '.';

    /**
     * Domain wildcaard character
     *
     */
    const DOMAIN_WILDCARD  = '*';

    /**
     * Host port separator
     */
    const PORT_SEPARATOR   = ':';

    /**
     * Host cache
     *
     * @var array
     */
    protected $_host            = array();

    /**
     * Host parts
     *
     * @var array
     */
    protected $_hostParts       = array();

    /**
     * Host vars
     *
     * @var array
     */
    protected $_hostVars        = array();

    /**
     * Host count part
     *
     * @var integer
     */
    protected $_hostStaticCount = 0;

    /**
     * Holds the cache for match()
     *
     * Allows skipping of the match process if a route was pre-determined to
     * fail
     *
     * @var array
     */
    protected static $_matchCache = array();

    /**
     * Route allowing matching of the HTTP_HOST
     *
     * $host => ':user.*.*' would match SpotSec.Foo.Com
     *
     * @param string $host
     * @param string $route
     * @param array $defaults
     * @param array $reqs
     */
    public function __construct($host, $route, array $defaults = array(), array $reqs = array())
    {
        $host = trim($host, $this->_urlDelimiter);

        if (!empty($host)) {
            // Separate foo.com into array('com', 'foo')
            $domains = array_reverse(explode(self::DOMAIN_SEPARATOR, $host));

            // Parse out url variables
            foreach ($domains as $pos => $part) {
                // Check if :var
                if (substr($part, 0, 1) == $this->_urlVariable) {
                    $name  = substr($part, 1);
                    $regex = isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex;

                    // Set to be evaluated later
                    $this->_hostParts[$pos] = array('name' => $name, 'regex' => $regex);
                    $this->_hostVars[]      = $name;
                } else {
                    $this->_hostParts[$pos] = array('regex' => $part);

                    // Increment if not a *.*
                    if ($part !== self::DOMAIN_WILDCARD) {
                        $this->_hostStaticCount++;
                    }
                }
            }
        }

        parent::__construct($route, $defaults, $reqs);
    }

    /**
     * Instantiates the route based on Zend_Config
     *
     * @param Zend_Config $config
     * @return Zym_Controller_Router_HttpHost
     */
    public static function getInstance(Zend_Config $config)
    {
        $reqs = ($config->reqs instanceof Zend_Config) ? $config->reqs->toArray() : array();
        $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
        return new self($config->host, $config->route, $defs, $reqs);
    }

    /**
     * Matches a user submitted path with parts defined by a map. Assigns and
     * returns an array of variables on a successful match.
     *
     * @param string Path used to match against this routing map
     * @return array|false An array of assigned values or a false on a mismatch
     */
    public function match($path)
    {
        if (!count($this->_host)) {
            // We need a host
            if (!isset($_SERVER['HTTP_HOST'])) {
                return false;
            }

            // Get host
            $requestHost = trim($_SERVER['HTTP_HOST']);

            // Assign host and remove any :42 port indicators
            $requestHost = preg_replace('/' . self::PORT_SEPARATOR . '\d+/', '', $requestHost);
            $this->_host = array_reverse(explode(self::DOMAIN_SEPARATOR, $requestHost));

        }

        // If cache checked, continue match
        $matchKey = serialize($this->_hostParts);
        if (isset(self::$_matchCache[$matchKey]) && self::$_matchCache[$matchKey] === true) {
            return parent::match($path);
        } else if (isset(self::$_matchCache[$matchKey]) && self::$_matchCache[$matchKey] === false) {
            return false;
        }

        $hostStaticCount = 0;

        if (!empty($requestHost)) {
            $defaults = $this->_defaults;

            if (count($defaults)) {
                $unique = array_combine(array_keys($defaults), array_fill(0, count($defaults), true));
            } else {
                $unique = array();
            }

            foreach ($this->_host as $pos => $part) {
                // Make sure required parts exist (eg foo.com -> foo and com)
                if (!isset($this->_hostParts[$pos])) {
                    self::$_matchCache[$matchKey] = false;
                    return false;
                }

                // Don't match if wildcard
                if ($this->_hostParts[$pos]['regex'] === self::DOMAIN_WILDCARD) {
                    continue;
                }

                $hostPart = $this->_hostParts[$pos];
                $name     = isset($hostPart['name']) ? $hostPart['name'] : null;

                if ($name === null) {
                    if ($hostPart['regex'] != $part) {
                        self::$_matchCache[$matchKey] = false;
                        return false;
                    }
                } else if ($hostPart['regex'] === null) {
                    if (strlen($part) == 0) {
                        self::$_matchCache[$matchKey] = false;
                        return false;
                    }
                } else {
                    $regex = $this->_regexDelimiter . '^' . $hostPart['regex'] . '$' . $this->_regexDelimiter . 'iu';
                    if (!preg_match($regex, $part)) {
                        self::$_matchCache[$matchKey] = false;
                        return false;
                    }
                }

                if ($name !== null) {
                    // It's a variable. Setting a value
                    $this->_values[$name] = $part;
                    $unique[$name] = true;
                } else {
                    $hostStaticCount++;
                }
            }
        }

        $return = $this->_values + $this->_defaults;

        // Check if all static mappings have been met
        if ($this->_hostStaticCount != $hostStaticCount) {
            self::$_matchCache[$matchKey] = false;
            return false;
        }

        // Check if all map variables have been initialized
        foreach ($this->_hostVars as $var) {
            if (!array_key_exists($var, $return)) {
                self::$_matchCache[$matchKey] = false;
                return false;
            }
        }

        // Set route match cache
        self::$_matchCache[$matchKey] = true;

        return array_merge($return, parent::match($path));
    }

    /**
     * Assembles user submitted parameters forming a URL path defined by this route
     *
     * We cannot generate http://subdomain.domain.com/ due to the fact
     * that the url helper adds the baseUrl in front of it... *sigh*
     *
     * @todo figure out a workaround
     *
     * @param  array $data An array of variable and value pairs used as parameters
     * @param  boolean $reset Whether or not to set route defaults with those provided in $data
     * @return string Route path with user submitted parameters
     */
    public function assemble($data = array(), $reset = false)
    {
        return parent::assemble($data, $reset);
    }

    /**
     * __sleep()
     *
     * Runs before serialization
     *
     */
    public function __sleep()
    {
        // Remove $this->_host because the request may be different if this route is cached
        $this->_host = array();
    }
}


text:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.omnibox.suggestions.basic;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.ColorInt;

import org.chromium.chrome.browser.omnibox.R;
import org.chromium.chrome.browser.omnibox.styles.OmniboxResourceProvider;
import org.chromium.chrome.browser.omnibox.suggestions.SuggestionCommonProperties;
import org.chromium.chrome.browser.omnibox.suggestions.base.SuggestionSpannable;
import org.chromium.chrome.browser.ui.theme.BrandedColorScheme;
import org.chromium.ui.modelutil.PropertyKey;
import org.chromium.ui.modelutil.PropertyModel;

/** Properties associated with the basic suggestion view. */
public class SuggestionViewViewBinder {
    /** @see PropertyModelChangeProcessor.ViewBinder#bind(Object, Object, Object) */
    public static void bind(PropertyModel model, View view, PropertyKey propertyKey) {
        if (propertyKey == SuggestionViewProperties.TEXT_LINE_1_TEXT) {
            TextView tv = view.findViewById(R.id.line_1);
            tv.setText(model.get(SuggestionViewProperties.TEXT_LINE_1_TEXT));
        } else if (propertyKey == SuggestionCommonProperties.COLOR_SCHEME) {
            updateSuggestionTextColor(view, model);
        } else if (propertyKey == SuggestionViewProperties.IS_SEARCH_SUGGESTION) {
            updateSuggestionTextColor(view, model);
            // https://crbug.com/609680: ensure URLs are always composed LTR and that their
            // components are not re-ordered.
            final boolean isSearch = model.get(SuggestionViewProperties.IS_SEARCH_SUGGESTION);
            final TextView tv = view.findViewById(R.id.line_2);
            tv.setTextDirection(
                    isSearch ? TextView.TEXT_DIRECTION_INHERIT : TextView.TEXT_DIRECTION_LTR);
        } else if (propertyKey == SuggestionViewProperties.TEXT_LINE_2_TEXT) {
            TextView tv = view.findViewById(R.id.line_2);
            final SuggestionSpannable span = model.get(SuggestionViewProperties.TEXT_LINE_2_TEXT);
            if (!TextUtils.isEmpty(span)) {
                tv.setText(span);
                tv.setVisibility(View.VISIBLE);
            } else {
                tv.setVisibility(View.GONE);
            }
        } else if (propertyKey == SuggestionViewProperties.ALLOW_WRAP_AROUND) {
            final boolean allowWrapAround = model.get(SuggestionViewProperties.ALLOW_WRAP_AROUND);
            TextView tv = view.findViewById(R.id.line_1);
            tv.setMaxLines(allowWrapAround ? 2 : 1);
        }
    }

    private static void updateSuggestionTextColor(View view, PropertyModel model) {
        final boolean isSearch = model.get(SuggestionViewProperties.IS_SEARCH_SUGGESTION);
        final @BrandedColorScheme int brandedColorScheme =
                model.get(SuggestionCommonProperties.COLOR_SCHEME);
        final TextView line1 = view.findViewById(R.id.line_1);
        final TextView line2 = view.findViewById(R.id.line_2);

        final Context context = view.getContext();
        final @ColorInt int color1 =
                OmniboxResourceProvider.getSuggestionPrimaryTextColor(context, brandedColorScheme);
        line1.setTextColor(color1);

        final @ColorInt int color2 = isSearch
                ? OmniboxResourceProvider.getSuggestionSecondaryTextColor(
                        context, brandedColorScheme)
                : OmniboxResourceProvider.getSuggestionUrlTextColor(context, brandedColorScheme);
        line2.setTextColor(color2);
    }
}


text:
package com.agileEAP.workflow.engine;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.xml.bind.JAXBException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.agileEAP.data.PageDataResult;
import com.agileEAP.data.RequestPageData;
import com.agileEAP.security.entity.Operator;
import com.agileEAP.security.service.ShiroDbRealm.ShiroUser;
import com.agileEAP.workflow.definition.Activity;
import com.agileEAP.workflow.definition.ProcessDefine;
import com.agileEAP.workflow.engine.enums.ActivityInstStatus;
import com.agileEAP.workflow.engine.enums.ProcessInstStatus;
import com.agileEAP.workflow.engine.enums.WorkItemStatus;
import com.agileEAP.workflow.engine.utility.WFUtil;
import com.agileEAP.workflow.entity.ActivityInst;
import com.agileEAP.workflow.entity.Participant;
import com.agileEAP.workflow.entity.ProcessDef;
import com.agileEAP.workflow.entity.ProcessInst;
import com.agileEAP.workflow.entity.TraceLog;
import com.agileEAP.workflow.entity.TransControl;
import com.agileEAP.workflow.entity.Transition;
import com.agileEAP.workflow.entity.WorkItem;
import com.agileEAP.workflow.repository.ActivityInstRepository;
import com.agileEAP.workflow.repository.ParticipantRepository;
import com.agileEAP.workflow.repository.ProcessDefRepository;
import com.agileEAP.workflow.repository.ProcessInstRepository;
import com.agileEAP.workflow.repository.TraceLogRepository;
import com.agileEAP.workflow.repository.TransControlRepository;
import com.agileEAP.workflow.repository.TransitionRepository;
import com.agileEAP.workflow.repository.WorkItemRepository;
import com.agileEAP.workflow.viewModel.TransitionModel;

@Transactional
@Component("workflowPersistence")
public class WorkflowPersistence implements IWorkflowPersistence {
	private final Logger logger = LoggerFactory
			.getLogger(WorkflowPersistence.class);

	@Autowired
	private ProcessDefRepository processDefRepository;
	@Autowired
	private ProcessInstRepository processInstRepository;
	@Autowired
	private ActivityInstRepository activityInstRepository;
	@Autowired
	private WorkItemRepository workItemRepository;
	@Autowired
	private TraceLogRepository traceLogRepository;
	@Autowired
	private ParticipantRepository participantRepository;
	@Autowired
	private TransitionRepository transitionRepository;
	@Autowired
	private TransControlRepository transControlRepository;

	/**
	 * 获取工作流定义
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @return
	 * @throws JAXBException
	 */
	@Override
	public ProcessDefine GetProcessDefine(String processDefID) {
		ProcessDef processDef = processDefRepository.get(processDefID);

		return ProcessDefine.parseFromJson(processDef.getContent());
	}

	/**
	 * 获取工作流某个活动
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @param activityDefID
	 *            活动定义ID
	 * @return
	 */
	@Override
	public Activity GetActivity(String processDefID, String activityDefID) {
		return WFUtil.getActivity(GetProcessDefine(processDefID)
				.getActivities(), activityDefID);
	}

	/**
	 * 获取流程所有定义活动
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @return
	 */
	@Override
	public java.util.List<Activity> GetActivities(String processDefID) {
		return GetProcessDefine(processDefID).getActivities();
	}

	/**
	 * 获取流程初始活动
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @return
	 */
	@Override
	public Activity GetStartActivity(String processDefID) {
		return GetProcessDefine(processDefID).getStartActivity();
	}

	/**
	 * 获取活动所有的入口活动
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @param activityID
	 *            活动ID
	 * @return
	 */
	@Override
	public List<Activity> GetInActivities(String processDefID, String activityID) {
		ProcessDefine processDefine = GetProcessDefine(processDefID);
		List<Activity> inActivities = new ArrayList<Activity>();
		for (Activity activity : processDefine.getActivities()) {
			for (com.agileEAP.workflow.definition.Transition transition : processDefine
					.getTransitions()) {
				if (transition.getDestActivity().equals(activityID)
						&& transition.getSrcActivity().equals(activity.getID())) {
					inActivities.add(activity);
				}
			}
		}

		return inActivities;
	}

	/**
	 * 获取活动所有的出口活动
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @param activityID
	 *            活动ID
	 * @return
	 */
	@Override
	public java.util.List<Activity> GetOutActivities(String processDefID,
			String activityID) {
		ProcessDefine processDefine = GetProcessDefine(processDefID);

		List<Activity> outActivities = new ArrayList<Activity>();
		for (Activity activity : processDefine.getActivities()) {
			for (com.agileEAP.workflow.definition.Transition transition : processDefine
					.getTransitions()) {
				if (transition.getSrcActivity().equals(activityID)
						&& transition.getDestActivity()
								.equals(activity.getID())) {
					outActivities.add(activity);
				}
			}
		}

		return outActivities;
	}

	/**
	 * 获取活动之间的迁移
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @param srcActivityID
	 *            源活动ID
	 * @param destActivityID
	 *            目标活动ID
	 * @return
	 */
	@Override
	public com.agileEAP.workflow.definition.Transition GetTransition(
			String processDefID, String srcActivityID, String destActivityID) {
		for (com.agileEAP.workflow.definition.Transition transition : GetProcessDefine(
				processDefID).getTransitions()) {
			if (transition.getSrcActivity().equals(srcActivityID)
					&& transition.getDestActivity().equals(destActivityID)) {
				return transition;
			}
		}

		return null;
	}

	/**
	 * 获取活动所有的入口迁移
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @param activityDefID
	 *            活动ID
	 * @return
	 */
	@Override
	public List<com.agileEAP.workflow.definition.Transition> GetInTransitions(
			String processDefID, String activityDefID) {
		List<com.agileEAP.workflow.definition.Transition> inTransitions = new ArrayList<com.agileEAP.workflow.definition.Transition>();
		for (com.agileEAP.workflow.definition.Transition transition : GetProcessDefine(
				processDefID).getTransitions()) {
			if (transition.getDestActivity().equals(activityDefID)) {
				inTransitions.add(transition);
			}
		}

		return inTransitions;
	}

	/**
	 * 获取活动所有的入口迁移
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @param activityDefID
	 *            活动ID
	 * @return
	 */
	@Override
	public List<com.agileEAP.workflow.definition.Transition> GetOutTransitions(
			String processDefID, String activityDefID) {
		List<com.agileEAP.workflow.definition.Transition> outTransitions = new ArrayList<com.agileEAP.workflow.definition.Transition>();
		for (com.agileEAP.workflow.definition.Transition transition : GetProcessDefine(
				processDefID).getTransitions()) {
			if (transition.getSrcActivity().equals(activityDefID)) {
				outTransitions.add(transition);
			}
		}

		return outTransitions;
	}

	/**
	 * 获取流程实例
	 *
	 * @param processInstID
	 *            流程实例ID
	 * @return
	 */
	@Override
	public ProcessInst GetProcessInst(String processInstID) {
		return processInstRepository.get(processInstID);
	}

	/**
	 * 获取某个活动实例
	 *
	 * @param activityInstID
	 *            活动实例ID
	 * @return
	 */
	@Override
	public ActivityInst GetActivityInst(String activityInstID) {
		return activityInstRepository.get(activityInstID);
	}

	/**
	 * 获取某个流程活动的所有活动实例
	 *
	 * @param processInstID
	 *            流程实例ID
	 * @return
	 */
	@Override
	public List<ActivityInst> GetActivityInsts(String processInstID,
			String activityDefID) {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("processInstID", processInstID);
		parameters.put("activityDefID", activityDefID);
		parameters.put("rollbackFlag", (short) 0);

		return activityInstRepository.search(parameters);
	}

	/**
	 * 获取某个流程活动的所有活动实例
	 *
	 * @param processInstID
	 *            流程实例ID
	 * @return
	 */
	@Override
	public List<ActivityInst> GetActivityInsts(String processInstID,
			String activityDefID, ActivityInstStatus actInstStatus) {
		List<ActivityInst> activityInsts = new ArrayList<ActivityInst>();
		for (ActivityInst ai : GetActivityInsts(processInstID, activityDefID)) {
			if (ai.getCurrentState() == (short) actInstStatus.getValue()) {
				activityInsts.add(ai);
			}
		}

		return activityInsts;
	}

	/**
	 * 获取某流程正在运行的活动实例
	 *
	 * @param processInstID
	 *            流程实例ID
	 * @return
	 */
	@Override
	public List<ActivityInst> GetRunningActInsts(String processInstID) {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("processInstID", processInstID);
		parameters.put("currentState",
				(short) ActivityInstStatus.Running.getValue());

		return activityInstRepository.search(parameters);
	}

	/**
	 * 获取某个工作项
	 *
	 * @param workItemID
	 *            工作项ID
	 * @return
	 */
	@Override
	public WorkItem GetWorkItem(String workItemID) {
		return workItemRepository.get(workItemID);
	}

	/**
	 * 获取某个流程实例的所有活动实例
	 *
	 * @param processInstID
	 *            流程实例ID
	 * @return
	 */
	@Override
	public java.util.List<ActivityInst> GetActivityInsts(String processInstID) {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("processInstID", processInstID);

		return activityInstRepository.search(parameters);
	}

	/**
	 * 获取某个活动实例的所有工作项
	 *
	 * @param activityInstID
	 *            活动实例ID
	 * @return
	 */
	@Override
	public java.util.List<WorkItem> GetWorkItems(String activityInstID) {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("activityInstID", activityInstID);

		return workItemRepository.search(parameters);
	}

	/**
	 * 获取待办工作项列表
	 *
	 * @param userID
	 *            用户ID
	 * @param parameters
	 *            参数
	 * @param pageInfo
	 *            分页信息
	 * @return
	 */
	@Override
	public PageDataResult GetMyWorkItems(String userId,
			java.util.Map<String, Object> parameters, String orderby,
			RequestPageData pageInfo, boolean includeAuto) {
		if (parameters == null) {
			parameters = new java.util.HashMap<String, Object>();
		}
		ShiroUser user = WFUtil.getUser();
		parameters.put("orderby", orderby);
		parameters.put("page", pageInfo.getPage());
		parameters.put("pageSize", pageInfo.getPageSize());
		parameters.putAll(parameters);
		PageDataResult pageDataResult = new PageDataResult();
		if (user.IsAdmin()) {
			pageDataResult.setTotal(workItemRepository.count(parameters));
			pageDataResult.setData(workItemRepository.searchByPage(parameters));
			return pageDataResult;
		}

		parameters.put("userId", userId);
		parameters.put("includeAuto", includeAuto);

		pageDataResult
				.setTotal(workItemRepository.countMyWorkItems(parameters));
		pageDataResult.setData(workItemRepository
				.getMyWorkItemsByPage(parameters));

		return pageDataResult;

		/*
		 * String includesql = includeAuto ? "or Type=5 " : "";
		 *
		 * DatabaseType databaseType = UnitOfWork.CurrentDatabaseType; if
		 * (databaseType == DatabaseType.MySQL) {
		 *
		 * System.Data.DataTable dt =
		 * repository.<WorkItem>ExecuteDataTable(String
		 * .format("select a.* from WF_WorkItem a " + "\r\n" +
		 * "inner join  WF_Participant p on a.ID=p.WorkItemID" + "\r\n" +
		 * "where ((p.ParticipantID='%1$s' or" + "\r\n" +
		 * " 		p.ParticipantID in(select  RoleID from OM_ObjectRole r where r.ObjectID='%1$s')"
		 * + "\r\n" +
		 * " 		or p.ParticipantID in (select OrgID from OM_EmployeeOrg o where o.EmployeeID='%1$s')) %2$s) and 1=1 "
		 * , userID, includesql), parameters, (sortCommand != null) ?
		 * sortCommand : "order by CreateTime desc", pageInfo);
		 *
		 *
		 * PageOfList<WorkItem> tempVar = new PageOfList<WorkItem>();
		 * tempVar.ItemList = dt.<WorkItem>ToList(); tempVar.PageInfo =
		 * pageInfo; return tempVar; } else { parameters.SafeAdd(userID, new
		 * Condition(String.format("(ID in" + "\r\n" +
		 * "                                (select WorkItemID from WF_Participant p where p.ParticipantID='%1$s' or"
		 * + "\r\n" +
		 * "                                 exists(select ObjectID from OM_ObjectRole r where r.ObjectID='%1$s' and r.RoleID=p.ParticipantID) or"
		 * + "\r\n" +
		 * "                                 exists(select ID from OM_EmployeeOrg o where o.EmployeeID='%1$s' and o.OrgID=p.ParticipantID)) %2$s)"
		 * , userID, includesql)));
		 *
		 *
		 * return repository.<WorkItem>FindAll(parameters, (sortCommand != null)
		 * ? sortCommand : "order by CreateTime desc", pageInfo); }
		 */
	}

	/**
	 * 修改工作项状态
	 *
	 * @param workItemID
	 *            工作项ID
	 * @param status
	 *            工作项状态
	 */
	@Override
	public void UpdateWorkItemStatus(String workItemID, WorkItemStatus status) {
		WorkItem workItem = workItemRepository.get(workItemID);

		if (workItem == null) {
			logger.warn("UpdateWorkItemStatus error workitem is null");
			return;
		}

		workItem.setCurrentState((short) status.getValue());
		workItemRepository.update(workItem);
	}

	/**
	 * 修改活动状态
	 *
	 * @param activityInstID
	 *            活动实例ID
	 * @param status
	 *            活动状态
	 */
	@Override
	public void UpdateActivityInstStatus(String activityInstID,
			ActivityInstStatus status) {
		ActivityInst activityInst = activityInstRepository.get(activityInstID);

		if (activityInst == null) {
			logger.warn("UpdateActivityInstStatus error activityInst is null");
			return;
		}

		activityInst.setCurrentState((short) status.getValue());
		activityInstRepository.update(activityInst);
	}

	/**
	 * 修改流程状态
	 *
	 * @param processInstID
	 *            流程实例ID
	 * @param status
	 *            流程状态
	 */
	@Override
	public void UpdateProcessInstStatus(String processInstID,
			ProcessInstStatus status) {
		ProcessInst instance = processInstRepository.get(processInstID);

		if (instance == null) {
			logger.warn("UpdateActivityInstStatus error activityInst is null");
			return;
		}

		instance.setCurrentState((short) status.getValue());
		processInstRepository.update(instance);
	}

	/**
	 * 获取活动参与者
	 *
	 * @param processDefID
	 *            流程定义ID
	 * @param activityDefID
	 *            活动定义ID
	 * @return
	 */
	@Override
	public String GetParticipant(String processDefID, String activityDefID) {
		return "";
		// ManualActivity ma = GetActivity(processDefID, activityDefID) as
		// ManualActivity;

		// //if
		// (ma.Participant.ParticipantType.Cast<ParticipantType>(ParticipantType.Person)
		// == ParticipantType.Person)
		// //{

		// //}
		// return string.Join(",", ma.Participant.Participantors.Select(p =>
		// p.ID).ToArray());
	}

	@Override
	public void SaveTraceLog(TraceLog traceLog) {
		traceLogRepository.save(traceLog);
	}

	@Override
	public void SaveWorkItem(WorkItem workItem) {
		workItemRepository.save(workItem);
	}

	@Override
	public void UpdateWorkItem(WorkItem workItem) {
		workItemRepository.update(workItem);
	}

	@Override
	public void UpdateActivityInst(ActivityInst activityInst) {
		activityInstRepository.update(activityInst);
	}

	@Override
	public void SaveParticipant(Participant participant) {
		participantRepository.save(participant);
	}

	@Override
	public void SaveActivityInst(ActivityInst activityInst) {
		activityInstRepository.save(activityInst);
	}

	@Override
	public void SaveTransition(Transition transition) {
		transitionRepository.save(transition);
	}

	@Override
	public void SaveTransControl(TransControl transControl) {
		transControlRepository.save(transControl);
	}

	@Override
	public void SaveOrUpdateActivityInst(ActivityInst activityInst) {
		if (activityInstRepository.get(activityInst.getId()) != null) {
			activityInstRepository.update(activityInst);
		} else {
			activityInstRepository.save(activityInst);
		}
	}

	@Override
	public ProcessDef GetProcessDef(String processDefID) {
		return processDefRepository.get(processDefID);
	}

	@Override
	public void SaveProcessInst(ProcessInst processInst) {
		processInstRepository.save(processInst);
	}

	@Override
	public void SaveProcessDef(ProcessDef processDef) {
		processDefRepository.save(processDef);
	}

	@Override
	public void UpdateProcessInst(ProcessInst processInst) {
		processInstRepository.update(processInst);
	}

	@Override
	public List<WorkItem> getWorkItems(Map<String, Object> parameters) {
		return workItemRepository.search(parameters);
	}

	@Override
	public void UpdateWorkItemStatus(String processInstID,
			WorkItemStatus oldStatus, WorkItemStatus newStatus) {
		WorkItem workItem = new WorkItem();
		workItem.setCurrentState((short) newStatus.getValue());

		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("processInstID", processInstID);
		parameters.put("currentState", (short) oldStatus.getValue());

		workItemRepository.updateByWhere(workItem, parameters);
	}

	@Override
	public void UpdateActivityInstStatus(String processInstID,
			ActivityInstStatus oldStatus, ActivityInstStatus newStatus) {
		ActivityInst activityInst = new ActivityInst();
		activityInst.setCurrentState((short) newStatus.getValue());

		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("processInstID", processInstID);
		parameters.put("currentState", (short) oldStatus.getValue());

		activityInstRepository.updateByWhere(activityInst, parameters);
	}

	@Override
	public void DeleteProcessInst(String processInstID) {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("ProcessInstID", processInstID);

		transControlRepository.deleteByWhere(parameters);
		transitionRepository.deleteByWhere(parameters);
		workItemRepository.deleteByWhere(parameters);
		activityInstRepository.deleteByWhere(parameters);
		processInstRepository.delete(processInstID);
	}

	@Override
	public void DeleteWorkItem(String workItemID) {
		workItemRepository.delete(workItemID);
	}

	@Override
	public List<Operator> GetWorkItemParticipant(String workItemID) {
		return workItemRepository.getWorkItemParticipant(workItemID);
	}

	/**
	 * 获取活动实例列表
	 *
	 * @param parameters
	 *            参数
	 * @return
	 */
	@Override
	public List<ActivityInst> ActivityInsts(Map<String, Object> parameters) {
		return activityInstRepository.search(parameters);
	}

	/**
	 * 获取流程实例迁移记录
	 *
	 * @param processInstID
	 *            流程实例ID
	 * @return
	 */
	@Override
	public List<TransitionModel> GetProcessInstTransitions(String processInstID) {
		return processInstRepository.getProcessInstTransitions(processInstID);
	}
}


text:
/*
 * $Id$
 */

/*

Copyright (c) 2000-2009 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
STANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of Stanford University shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Stanford University.

*/

package org.lockss.plugin.psychiatryonline;

import java.io.*;

import org.apache.oro.text.regex.*;
import org.lockss.daemon.PluginException;
import org.lockss.extractor.GoslingHtmlLinkExtractor;
import org.lockss.plugin.*;
import org.lockss.util.*;

public class PsychiatryOnlineHtmlLinkExtractor extends GoslingHtmlLinkExtractor {

  public PsychiatryOnlineHtmlLinkExtractor() {
    super();
  }

  @Override
  protected String extractLinkFromTag(StringBuffer link,
                                      ArchivalUnit au,
                                      Callback cb)
      throws IOException {
    char ch = link.charAt(0);
    if ((ch == 'a' || ch == 'A') && Character.isWhitespace(link.charAt(1))) {
      // <a href="...">
      String href = getAttributeValue(HREF, link);
      if (href == null) {
        return null;
      }

      PatternMatcher matcher = RegexpUtil.getMatcher();

      // javascript:windowReference(str1, str2)
      Pattern windowReferencePattern = getWindowReferencePattern();
      if (windowReferencePattern != null && matcher.contains(href, windowReferencePattern)) {
        String windowReferenceLink = interpretWindowReferenceMatch(matcher.getMatch());
        if (logger.isDebug3()) {
          logger.debug3("AU: "
                        + au.getName()
                        + ", windowReference match: "
                        + windowReferenceLink);
        }
        return windowReferenceLink;
      }

    }

    return super.extractLinkFromTag(link, au, cb);
  }

  @Override
  public void extractUrls(ArchivalUnit au,
                          InputStream in,
                          String encoding,
                          String srcUrl,
                          Callback cb)
      throws IOException {
    try {
      FilterFactory filter = new PsychiatryOnlineHtmlFilterFactory();
      InputStream filtered = filter.createFilteredInputStream(au, in, encoding);
      super.extractUrls(au, filtered, encoding, srcUrl, cb);
    }
    catch (PluginException pe) {
      // Use new IOException constructor in Java 6
      IOException ioe = new IOException();
      ioe.initCause(pe);
      throw ioe;
    }
  }

  protected static Logger logger = Logger.getLogger("PsychiatryOnlineHtmlLinkExtractor");

//  protected static final Pattern WINDOW_REFERENCE_PATTERN = RegexpUtil.uncheckedCompile("javascript.*:.*windowReference.*\\([^']*'(?:\\.|[^'\\\\])*'.*,[^']*'(\\.|[^'\\\\])*'.*\\).*;",
//      Perl5Compiler.READ_ONLY_MASK);

  protected static final Pattern WINDOW_REFERENCE_PATTERN = RegexpUtil.uncheckedCompile("javascript[^:]*:.*windowReference[^(]*\\([^']*'(?:[^']*)'[^,]*,[^']*'([^']*)'[^)]*\\)[^;]*;",
                                                                                Perl5Compiler.READ_ONLY_MASK);

  public static Pattern getWindowReferencePattern() {
    return WINDOW_REFERENCE_PATTERN;
  }

  public static String interpretWindowReferenceMatch(MatchResult windowReferenceMatch) {
    if ((windowReferenceMatch.groups() - 1) != 1) {
      logger.warning("Internal inconsistency: windowReference match '"
                     + windowReferenceMatch.toString()
                     + "' has "
                     + (windowReferenceMatch.groups() - 1)
                     + " proper subgroups; expected 1");
      if ((windowReferenceMatch.groups() - 1) < 1) {
        return null;
      }
    }
    return windowReferenceMatch.group(1);
  }

}


text:
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)

    #include <boost/proto/context/detail/preprocessed/default_eval.hpp>

#elif !defined(BOOST_PP_IS_ITERATING)

    #define BOOST_PROTO_DEFAULT_EVAL_SHIFTED(Z, M, DATA)                                            \
        BOOST_PROTO_DEFAULT_EVAL(Z, BOOST_PP_ADD(M, 2), DATA)                                       \
        /**/

    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
        #pragma wave option(preserve: 2, line: 0, output: "preprocessed/default_eval.hpp")
    #endif

    ///////////////////////////////////////////////////////////////////////////////
    /// \file default_eval.hpp
    /// Contains specializations of the default_eval\<\> class template.
    //
    //  Copyright 2008 Eric Niebler. Distributed under the Boost
    //  Software License, Version 1.0. (See accompanying file
    //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
        #pragma wave option(preserve: 1)
    #endif

    #define BOOST_PP_ITERATION_PARAMS_1                                                             \
        (3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/default_eval.hpp>))
    #include BOOST_PP_ITERATE()

    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
        #pragma wave option(output: null)
    #endif

    #undef BOOST_PROTO_DEFAULT_EVAL_SHIFTED

#else

    #define N BOOST_PP_ITERATION()

    template<typename Expr, typename Context>
    struct default_eval<Expr, Context, proto::tag::function, N>
    {
        typedef
            typename proto::detail::result_of_fixup<
                BOOST_PROTO_DEFAULT_EVAL_TYPE(~, 0, Expr)
            >::type
        function_type;

        typedef
            typename BOOST_PROTO_RESULT_OF<
                function_type(BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr))
            >::type
        result_type;

        result_type operator ()(Expr &expr, Context &context) const
        {
            return this->invoke(expr, context, is_member_function_pointer<function_type>());
        }

    private:
        result_type invoke(Expr &expr, Context &context, mpl::false_) const
        {
            return BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)(
                BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL, expr)
            );
        }

        result_type invoke(Expr &expr, Context &context, mpl::true_) const
        {
            BOOST_PROTO_USE_GET_POINTER();
            typedef typename detail::classtypeof<function_type>::type class_type;
            return (
                BOOST_PROTO_GET_POINTER(class_type, BOOST_PROTO_DEFAULT_EVAL(~, 1, expr)) ->*
                BOOST_PROTO_DEFAULT_EVAL(~, 0, expr)
            )(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), BOOST_PROTO_DEFAULT_EVAL_SHIFTED, expr));
        }
    };

    #undef N

#endif


text:
FROM gcr.io/google-appengine/debian9:latest

RUN set -eux \
    && apt-get update \
    && apt-get install python-pip -y \
    && pip install jinja2


text:
<?php
require_once 'PHPUnit/Framework.php';

require_once 'exceptions/PPConnectionException.php';

/**
 * Test class for PPConnectionException.
 *
 */
class PPConnectionExceptionTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var PPConnectionException
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new PPConnectionException('http://testURL', 'test message');
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * @test
     */
    public function testGetUrl()
    {
    	$this->assertEquals('http://testURL',$this->object->getUrl());
    }
    /**
     * @test
     */
 public function testPPConnectionException()
    {
    	$this->setExpectedException('PPConnectionException');
    	throw new PPConnectionException('http://testURL','Test msg PPConnectionException');

    }
}
?>