text:
package org.osgi.service.dal;

import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
import java.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import org.osgi.framework.Filter;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.InvalidSyntaxException;

/**
 * A bundle's authority to perform specific privileged administrative operations
 * on the devices. The method {@link Device#remove()} is protected with
 * {@link #REMOVE} permission action.
 *

 * The name of the permission is a filter based. See OSGi Core Specification,
 * Filter Based Permissions. The filter gives an access to all device service
 * properties. Filter attribute names are processed in a case sensitive manner.
 */
public class DevicePermission extends BasicPermission {

	private static final long		serialVersionUID	= -3020753566295420906L;

	/** A permission action to remove the device. */
	public static final String		REMOVE				= "remove";

	/**
	 * If the permission was built with filter, this filed contains LDAP filter
	 * used for matching.
	 */
	private transient Filter		filter;

	/**
	 * Initialized when the device permission is built with device instance.
	 * Such permissions are used only for security checks.
	 */
	transient Device				device;

	/**
	 * Device properties are initialized on the first request.
	 */
	private transient Dictionary	deviceProperties;

	/**
	 * Creates a new {@code DevicePermission} with the given filter and actions.
	 * The constructor must only be used to create a permission that is going to
	 * be checked.
	 *

	 * A filter example: (dal.device.hardware.vendor=acme)
	 *

	 * An action: remove
	 *
	 * @param filter A filter expression that can use any device service
	 *        property. The filter attribute names are processed in a case
	 *        insensitive manner. A special value of "*" can be used to match
	 *        all devices.
	 * @param action {@link #REMOVE} action.
	 *
	 * @throws IllegalArgumentException If the filter syntax is not correct or
	 *         invalid action is specified.
	 * @throws NullPointerException If the filter or action is null.
	 */
	public DevicePermission(String filter, String action) {
		super(filter);
		this.filter = parseFilter(filter);
		validateAction(action);
	}

	/**
	 * Creates a new {@code DevicePermission} with the given device and actions.
	 * The permission must be used for the security checks like:
	 *

	 * {@code securityManager.checkPermission(new DevicePermission(this, "remove"))}
	 * . The permissions constructed by this constructor must not be added to
	 * the {@code DevicePermission} permission collections.
	 *
	 * @param device The device that needs to be checked for a permission.
	 * @param action {@link #REMOVE} action.
	 *
	 * @throws IllegalArgumentException If an invalid action is specified.
	 * @throws NullPointerException If the device or action is null.
	 */
	public DevicePermission(Device device, String action) {
		super(createPermissionName(device));
		validateAction(action);
		this.device = device;
	}

	/**
	 * Two {@code DevicePermission} instances are equal if:
	 *

	 *
Represents the same filter and action.

	 *
Represents the same device (in respect to device unique identifier)
	 * and action.

	 *

	 *
	 * @param obj The object being compared for equality with this object.
	 *
	 * @return {@code true} if two permissions are equal, {@code false}
	 *         otherwise.
	 */
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!(obj instanceof DevicePermission)) {
			return false;
		}
		DevicePermission dp = (DevicePermission) obj;
		return (((null == this.device) && (null == dp.device)) ||
				((null != this.device) && (null != dp.device))) &&
				(getName().equals(dp.getName()));
	}

	/**
	 * Returns the hash code value for this object.
	 *
	 * @return Hash code value for this object.
	 */
	public int hashCode() {
		return 31 * 17 + getName().hashCode() +
				((null != this.device) ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode());
	}

	/**
	 * Returns the canonical string representation of {@link #REMOVE} action.
	 *
	 * @return The canonical string representation of the actions.
	 */
	public String getActions() {
		return REMOVE;
	}

	/**
	 * Determines if the specified permission is implied by this object. The
	 * method will return {@code false} if the specified permission was not
	 * constructed by {@link #DevicePermission(Device, String)}.
	 *
	 * Returns {@code true} if the specified permission is a
	 * {@code DevicePermission} and this permission filter matches the specified
	 * permission device properties.
	 *
	 * @param p The permission to be implied. It must be constructed by
	 *        {@link #DevicePermission(Device, String)}.
	 *
	 * @return {@code true} if the specified permission is implied by this
	 *         permission, {@code false} otherwise.
	 *
	 * @throws IllegalArgumentException If the specified permission is not
	 *         constructed by {@link #DevicePermission(Device, String)}.
	 */
	public boolean implies(Permission p) {
		if (!(p instanceof DevicePermission)) {
			return false;
		}
		if (null != this.device) {
			return false; // this filter can match other permission device
		}
		DevicePermission requested = (DevicePermission) p;
		if (null == requested.device) {
			return false; // this filter can match other permission device
		}
		return implyDevicePermission(requested);
	}

	/**
	 * Returns a new {@code PermissionCollection} suitable for storing
	 * {@code DevicePermission} instances.
	 *
	 * @return A new {@code PermissionCollection} instance.
	 */
	public PermissionCollection newPermissionCollection() {
		return new DevicePermissionCollection();
	}

	/**
	 * Called when the permission state is saved to a stream. Permissions with
	 * device instance cannot be serialized.
	 */
	private void writeObject(java.io.ObjectOutputStream s) throws NotSerializableException {
		if (null != this.device) {
			throw new NotSerializableException("Device permission with a device instance cannot be serialized.");
		}
	}

	/**
	 * Called to restore the permission state from the stream.
	 */
	private void readObject(java.io.ObjectInputStream s) {
		this.filter = parseFilter(getName());
	}

	boolean implyDevicePermission(DevicePermission dp) {
		if (null == this.filter) {
			return true; // it's "*"
		}
		Dictionary devicePropertiesLocal = dp.getDeviceProperties();
		if (null == devicePropertiesLocal) {
			return false;
		}
		return this.filter.matchCase(devicePropertiesLocal);
	}

	private Dictionary getDeviceProperties() {
		if (null != this.deviceProperties) {
			return this.deviceProperties;
		}
		if (null == this.device) {
			return null;
		}
		String[] devicePropKeys = this.device.getServicePropertyKeys();
		Dictionary devicePropertiesLocal = new Hashtable(devicePropKeys.length, 1F);
		for (int i = 0; i < devicePropKeys.length; i++) {
			Object currentDevicePropValue = this.device.getServiceProperty(devicePropKeys[i]);
			if (null != currentDevicePropValue) {
				devicePropertiesLocal.put(devicePropKeys[i], currentDevicePropValue);
			}
		}
		this.deviceProperties = devicePropertiesLocal;
		return this.deviceProperties;
	}

	private static String createPermissionName(Device device) {
		if (null == device) {
			throw new NullPointerException("The device cannot be null.");
		}
		final String deviceUID;
		try {
			deviceUID = (String) device.getServiceProperty(Device.SERVICE_UID);
		} catch (ClassCastException cce) {
			throw new IllegalArgumentException("The device UID must be string.");
		}
		if (null == deviceUID) {
			throw new IllegalArgumentException("There is no device UID.");
		}
		return '(' + Device.SERVICE_UID + '=' + device.getServiceProperty(Device.SERVICE_UID) + ')';
	}

	private static void validateAction(String action) {
		if (null == action) {
			throw new NullPointerException("The action is null.");
		}
		if (!REMOVE.equals(action)) {
			throw new IllegalArgumentException("The action must be: " + action);
		}
	}

	private static Filter parseFilter(String filter) {
		if ((1 == filter.length()) && ("*".equals(filter))) {
			return null;
		}
		try {
			return FrameworkUtil.createFilter(filter);
		} catch (InvalidSyntaxException ise) {
			IllegalArgumentException iae = new IllegalArgumentException("The filter is invalid: " + filter);
			iae.initCause(ise);
			throw iae;
		}
	}
}

/**
 * Device permission collection stores permissions, which are built with a
 * filter. Permissions with device instance are not accepted.
 */
final class DevicePermissionCollection extends PermissionCollection {

	private static final long	serialVersionUID	= 2631804209616986690L;

	/**
	 * The permission name is used as a key, the permission is used as a value.
	 */
	private transient Map		/* String, DevicePermission */permissions;

	/**
	 * {@code true} means that "*" has been added to the collection.
	 */
	private transient boolean	implyAll;

	/**
	 * Creates an empty device permission collection.
	 */
	public DevicePermissionCollection() {
		this.permissions = new HashMap();
	}

	/**
	 * Adds a device permission to this device permission collection. Only
	 * device permissions with filters are accepted.
	 *
	 * @param permission The {@code DevicePermission} object to add.
	 * @throws IllegalArgumentException If the specified permission is not an
	 *         {@code DevicePermission} instance or was constructed with a
	 *         {@code Device} object.
	 * @throws SecurityException If this {@code DevicePermissionCollection}
	 *         object has been marked read-only.
	 */
	public void add(Permission permission) {
		if (!(permission instanceof DevicePermission)) {
			throw new IllegalArgumentException("Device permission is expected: " + permission);
		}
		if (isReadOnly()) {
			throw new SecurityException("The device permission collection is read-only.");
		}
		final DevicePermission dp = (DevicePermission) permission;
		if (null != dp.device) {
			throw new IllegalArgumentException("Only device permissions with filter can be added: " + dp);
		}
		final String name = dp.getName();
		synchronized (this) {
			this.permissions.put(name, dp);
			if (!implyAll && ("*".equals(name))) {
				implyAll = true;
			}
		}
	}

	/**
	 * Determines if the specified permissions implies the permissions expressed
	 * in {@code permission} argument.
	 *
	 * @param permission The device permission object to compare with the
	 *        {@code DevicePermission} objects in this collection.
	 * @return {@code true} if {@code permission} is implied by an
	 *         {@code DevicePermission} in this collection, {@code false}
	 *         otherwise.
	 */
	public boolean implies(Permission permission) {
		if (!(permission instanceof DevicePermission)) {
			return false;
		}
		DevicePermission requested = (DevicePermission) permission;
		if (null == requested.device) {
			return false; // the requested must have device instance

		}
		final Collection perms;
		synchronized (this) {
			if (this.implyAll) {
				return true;
			}
			perms = this.permissions.values();
		}
		for (Iterator permsIter = perms.iterator(); permsIter.hasNext();/* empty */) {
			final DevicePermission currentDevicePerm = (DevicePermission) permsIter.next();
			if (currentDevicePerm.implyDevicePermission(requested)) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Returns an enumeration of all {@code DevicePermission} objects in the
	 * collection.
	 *
	 * @return Enumeration of all {@code DevicePermission} objects.
	 */
	public synchronized Enumeration elements() {
		return Collections.enumeration(
				new ArrayList(this.permissions.values()));
	}

	private static final ObjectStreamField[]	serialPersistentFields	= {
																		new ObjectStreamField("permissions", HashMap.class),
																		new ObjectStreamField("implyAll", Boolean.TYPE)};

	private synchronized void writeObject(ObjectOutputStream out) throws IOException {
		ObjectOutputStream.PutField pfields = out.putFields();
		pfields.put("permissions", this.permissions);
		pfields.put("implyAll", this.implyAll);
		out.writeFields();
	}

	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
		ObjectInputStream.GetField gfields = in.readFields();
		this.permissions = (HashMap) gfields.get("permissions", null);
		this.implyAll = gfields.get("implyAll", false);
	}
}


text:
import React from 'react'
import {Modal} from 'react-bootstrap'
import FlowDiagram from 'components/FlowDiagram'
import ReportForm from 'components/ReportForm'
import formatter from 'utils/formatter.js'
import './style.scss'

/** 显示待办、经办、办结、关注事项的表格*/

class TaskTable extends React.Component {
  static propTypes = {
    // tasks: React.PropTypes.arrayOf(React.PropTypes.shape({
    //   subject: React.PropTypes.string.isRequired,
    //   businessKey: React.PropTypes.string.isRequired,
    //   processDefinitionId: React.PropTypes.string.isRequired,
    //   processDefinitionName: React.PropTypes.string,
    //   taskName: React.PropTypes.string,
    //   url: React.PropTypes.string.isRequired,
    //   processInstanceId:React.PropTypes.string.isRequired,
    //   createTime: React.PropTypes.number,
    //   currentActivityName:React.PropTypes.string,
    //   currentAssigneeName:React.PropTypes.string,
    //   startUserName:React.PropTypes.string.isRequired
    // })),

    onTaskChange: React.PropTypes.func,

    taskType: React.PropTypes.string
  }

  constructor (props, context) {
    super(props, context)

    this.state = {
      showFlowDiagram: false,
      showReportForm: false,
      reporting: false
    }
  }

  hideFlowDiagram = () => {
    this.setState({showFlowDiagram: false})
  }

  hideReportForm = () => {
    this.setState({showReportForm: false, reporting: false})
  }

  showMask = () => {
    this.setState({reporting: true})
  }

  generateActions = (businessKey, task) => {
    let taskType = this.props.taskType
    var dom = '流程图'
    if (taskType === 'historyTask') {
      dom += '打印'
    }
    return dom
  }

  generateSubject (subject, task) {
    var url = task.url
    let path = url.split('?')[0]

    // 对url进行二次处理,强行转成react的url
    if (path === '/payment2/examinePayment') {
      url = url.replace('/payment2/examinePayment', '/contract/payment/examine')
    } else if (path === '/payment2/paymentDetails') {
      url = url.replace('/payment2/paymentDetails', '/contract/payment/details')
    } else if (path === '/payment2/fillPayment') {
      url = url.replace('/payment2/fillPayment', '/contract/payment/edit')
    } else if (path === '/payment2/printPayment') {
      url = url.replace('/payment2/printPayment', '/contract/payment/print')
    } else if (path === '/payment2/examineGuarantee') {
      url = url.replace('/payment2/examineGuarantee', '/contract/guarantee/examine')
    } else if (path === '/payment2/guaranteeDetails') {
      url = url.replace('/payment2/guaranteeDetails', '/contract/guarantee/details')
    } else if (path === '/payment2/applyGuarantee') {
      url = url.replace('/payment2/applyGuarantee', '/contract/guarantee/apply')
    } else if (path === '/payment2/printGuarantee') {
      url = url.replace('/payment2/printGuarantee', '/contract/guarantee/print')
    }

    return '' + subject + ''
  }

  getOptions (taskType) {
    const TASK_TABLE_OPTION = {
      classes: 'table table-striped table-hover table-no-bordered',
      pagination: 'true',
      sidePagination: 'server',
      // sidePagination: 'client',
      search: 'true',
      onLoadSuccess: this.props.onTaskChange
    }

    if (taskType === 'todoTask') {
      return Object.assign({
        url: '/qdp/payment/bpm/task/query/todoTask?' + new Date().getTime(),
        sortName: 'createTime',
        sortOrder: 'desc',
        columns: [{
          title: '主题',
          halign: 'center',
          field: 'subject',
          formatter: this.generateSubject,
          searchable: true
        }, {
          title: '发起人',
          halign: 'center',
          field: 'startUserName',
          searchable: false
        }, {
          title: '当前环节',
          halign: 'center',
          field: 'taskName',
          searchable: false
        }, {
          title: '开始时间',
          halign: 'center',
          field: 'createTime',
          formatter: formatter.formatTime,
          sortable: true,
          searchable: false
        }, {
          title: '操作',
          halign: 'center',
          formatter: this.generateActions,
          field: 'businessKey',
          searchable: false
        }]
      }, TASK_TABLE_OPTION)
    } else if (taskType === 'passTask') {
      return Object.assign({
        url: '/qdp/payment/bpm/task/query/passTask?' + new Date().getTime(),
        sortName: 'createTime',
        sortOrder: 'desc',
        columns: [{
          title: '主题',
          halign: 'center',
          field: 'subject',
          formatter: this.generateSubject
        }, {
          title: '发起人',
          halign: 'center',
          field: 'startUserName',
          searchable: false
        }, {
          title: '当前环节',
          halign: 'center',
          field: 'currentActivityName',
          searchable: false
        }, {
          title: '当前处理人',
          halign: 'center',
          field: 'currentAssigneeName',
          searchable: false
        }, {
          title: '开始时间',
          halign: 'center',
          field: 'createTime',
          formatter: formatter.formatTime,
          sortable: true,
          searchable: false
        }, {
          title: '操作',
          halign: 'center',
          formatter: this.generateActions,
          field: 'businessKey',
          searchable: false
        }]
      }, TASK_TABLE_OPTION)
    } else if (taskType === 'historyTask') {
      return Object.assign({
        url: '/qdp/payment/bpm/task/query/historyTask?' + new Date().getTime(),
        sortName: 'endTime',
        sortOrder: 'desc',
        columns: [{
          title: '主题',
          halign: 'center',
          field: 'subject',
          formatter: this.generateSubject
        }, {
          title: '发起人',
          halign: 'center',
          field: 'startUserName',
          searchable: false
        }, {
          title: '开始时间',
          halign: 'center',
          field: 'startTime',
          formatter: formatter.formatTime,
          sortable: true,
          searchable: false
        }, {
          title: '结束时间',
          halign: 'center',
          field: 'endTime',
          formatter: formatter.formatTime,
          sortable: true,
          searchable: false
        }, {
          title: '操作',
          halign: 'center',
          formatter: this.generateActions,
          field: 'businessKey',
          searchable: false
        }]
      }, TASK_TABLE_OPTION)
    } else if (taskType === 'participantTask') {
      return Object.assign({
        url: '/qdp/payment/bpm/task/query/participantTask?' + new Date().getTime(),
        sortName: 'startTime',
        sortOrder: 'desc',
        columns: [{
          title: '主题',
          halign: 'center',
          field: 'subject',
          formatter: this.generateSubject
        }, {
          title: '发起人',
          halign: 'center',
          field: 'startUserName',
          searchable: false
        }, {
          title: '当前环节',
          halign: 'center',
          field: 'currentActivityName',
          searchable: false
        }, {
          title: '当前处理人',
          halign: 'center',
          field: 'currentAssigneeName',
          searchable: false
        }, {
          title: '开始时间',
          halign: 'center',
          field: 'startTime',
          formatter: formatter.formatTime,
          sortable: true,
          searchable: false
        }, {
          title: '操作',
          halign: 'center',
          formatter: this.generateActions,
          field: 'businessKey',
          searchable: false
        }]
      }, TASK_TABLE_OPTION)
    } else {
      return {}
    }
  }

  componentWillMount () {
    $.extend($.fn.bootstrapTable.defaults, {
      formatSearch () {
        return '主题'
      }
    })
  }

  componentWillReceiveProps (nextProps) {
    if (nextProps.taskType !== this.props.taskType) {
      $(this.refs.table).bootstrapTable('destroy')
      $(this.refs.table).bootstrapTable(this.getOptions(nextProps.taskType))
    }
  }

  componentDidMount () {
    setTimeout(function () {
      $(this.refs.table).bootstrapTable(this.getOptions(this.props.taskType))
    }.bind(this), 300)

    $(document).on('click', '.flow-diagram-btn', function (e) {
      this.setState({
        processInstanceId: $(e.target).data('processinstanceid') + '',
        processDefinitionId: $(e.target).data('processdefinitionid'),
        showFlowDiagram: true
      })
    }.bind(this))

    $(document).on('click', '.print-report-btn', function (e) {
      console.log('print-report!')
      this.setState({
        showReportForm: true,
        reportType: $(e.target).data('reportype'),
        processDefinitionId: $(e.target).data('processdefinitionid'),
        businessId: $(e.target).data('businessid')
      })
    }.bind(this))
  }

  render () {
    // console.log('taskTable:render')
    return (

        <Modal bsSize='large' show={this.state.showFlowDiagram} onHide={this.hideFlowDiagram}>
          <Modal.Header closeButton>
            <Modal.Title>流程图</Modal.Title>
          </Modal.Header>
          <Modal.Body>
            <FlowDiagram processInstanceId={this.state.processInstanceId}
              processDefinitionId={this.state.processDefinitionId} />
          </Modal.Body>
        </Modal>
        <Modal bsSize='large' show={this.state.showReportForm} onHide={this.hideReportForm}>
          <Modal.Header closeButton>
            <Modal.Title>选择打印参数</Modal.Title>
          </Modal.Header>
          <Modal.Body>
            <ReportForm onReport={this.showMask}
              reportType={this.state.reportType} processDefinitionId={this.state.processDefinitionId}
              businessId={this.state.businessId} onClickCancel={this.hideReportForm} />
          </Modal.Body>
        </Modal>

    )
  }
}

TaskTable.defaultProps = {
  tasks: [],
  taskType: 'todoTask'
}

export default TaskTable

redpajama_set_name: RedPajamaGithub


text:
'use strict';
var express = require('express');
var fs = require('fs');
var router = express.Router();

router.get('/', function(req, res, next) {
    req.debug("Cron Get /");
    if (global.app.cron !== undefined) {
        req.debug("CronJob Defined");
        global.app.cron(req, function(err) {
            if (err !== undefined && err !== null) {
                req.error("Error Running Cronjob");
                req.error(err);
                res.send(500, { success: false, error: err });
                return
            }
            req.debug("Cronjob Ran Successfully");
            return res.send({ success: true });
        });
    } else {
        req.debug("CronJob Not Defined");
        return res.send({ success: true });
    }
});
module.exports = router;


text:
title: Administration
menu:
  enterprise_1_0:
    weight: 50
---

## [Logs](/enterprise/v1.0/administration/logs/)

## [Upgrading from Previous Versions](/enterprise/v1.0/administration/upgrading/)


text:
{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Hadoop.Protos.RefreshAuthorizationPolicyProtocolProtos.RefreshAuthorizationPolicyProtocolService
       (RefreshAuthorizationPolicyProtocolService, refreshAuthorizationPolicyProtocolService, RefreshServiceAcl, refreshServiceAcl)
       where
import Prelude ((+), (/), (.))
import qualified Prelude as Prelude'
import qualified Data.Typeable as Prelude'
import qualified Data.Data as Prelude'
import qualified Text.ProtocolBuffers.Header as P'
import qualified Hadoop.Protos.RefreshAuthorizationPolicyProtocolProtos.RefreshServiceAclRequestProto
       as RefreshAuthorizationPolicyProtocolProtos (RefreshServiceAclRequestProto)
import qualified Hadoop.Protos.RefreshAuthorizationPolicyProtocolProtos.RefreshServiceAclResponseProto
       as RefreshAuthorizationPolicyProtocolProtos (RefreshServiceAclResponseProto)

type RefreshAuthorizationPolicyProtocolService = P'.Service '[RefreshServiceAcl]

refreshAuthorizationPolicyProtocolService :: RefreshAuthorizationPolicyProtocolService
refreshAuthorizationPolicyProtocolService = P'.Service

type RefreshServiceAcl =
     P'.Method ".hadoop.common.RefreshAuthorizationPolicyProtocolService.refreshServiceAcl"
      RefreshAuthorizationPolicyProtocolProtos.RefreshServiceAclRequestProto
      RefreshAuthorizationPolicyProtocolProtos.RefreshServiceAclResponseProto

refreshServiceAcl :: RefreshServiceAcl
refreshServiceAcl = P'.Method


text:
.class public Lcom/android/systemui/wallpaper/KeyguardImageWallpaper$KeyguardEffectViewVignetting;
.super Ljava/lang/Object;
.source "KeyguardImageWallpaper.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/systemui/wallpaper/KeyguardImageWallpaper;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "KeyguardEffectViewVignetting"
.end annotation


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

<title>Feed (apache-nutch 2.3.1 API)</title>
<meta name="date" content="2016-01-10">
<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.apache.nutch.metadata

Interface Feed

All Known Implementing Classes:

Metadata, SpellCheckedMetadata

public interface Feed

A collection of Feed property names extracted by the ROME library.

Author:

mattmann, dogacan

Field Summary

Fields

Modifier and Type
Field and Description

static String
FEED

static String
FEED_AUTHOR

static String
FEED_PUBLISHED

static String
FEED_TAGS

static String
FEED_UPDATED

Field Detail

FEED_AUTHOR

static final String FEED_AUTHOR

See Also:

Constant Field Values

FEED_TAGS

static final String FEED_TAGS

See Also:

Constant Field Values

FEED_PUBLISHED

static final String FEED_PUBLISHED

See Also:

Constant Field Values

FEED_UPDATED

static final String FEED_UPDATED

See Also:

Constant Field Values

FEED

static final String FEED

See Also:

Constant Field Values

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

Copyright © 2015 The Apache Software Foundation


text:
/* Danish initialisation for the jQuery UI month picker plugin. */
/* Based on the initialisation for the jQuery UI date picker plugin. */
/* Written by Jan Christensen ( deletestuff@gmail.com). */
(function ($) {

$.monthpicker.regional['da'] = {
	closeText: 'Luk',
	prevText: '<Forrige',
	nextText: 'Næste>',
	currentText: 'Idag',
	monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
	'Juli','August','September','Oktober','November','December'],
	monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
	'Jul','Aug','Sep','Okt','Nov','Dec'],
	dateFormat: 'mm-yy',
	isRTL: false,
	yearSuffix: ''};
$.monthpicker.setDefaults($.monthpicker.regional['da']);

})(jQuery);


text:
<!DOCTYPE html>

  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <title>yepnope.js test suite</title>
  <link rel="stylesheet" href="css/mocha.css" type="text/css" />


text:
<?php
/**
 * Zlib
 */

namespace LanguageStatement\UtilComponent\Compress;

class Zlib
{
    public static $config=[
        'zlib.output_compression',//Whether to transparently compress pages.
        'zlib.output_compression_level',//Compression level used for transparent output compression
        'zlib.output_handler',//You cannot specify additional output handlers if zlib.
    ];

    public static $constants=[
        'FORCE_GZIP',//
        'FORCE_DEFLATE',//
        // Available as of PHP 7.0.0.
        'ZLIB_ENCODING_RAW',//DEFLATE algorithm as per RFC 1951.
        'ZLIB_ENCODING_DEFLATE',//ZLIB compression algorithm as per RFC 1950.
        'ZLIB_ENCODING_GZIP',//GZIP algorithm as per RFC 1952.
        'ZLIB_FILTERED',//
        'ZLIB_HUFFMAN_ONLY',//
        'ZLIB_FIXED',//
        'ZLIB_RLE',//
        'ZLIB_DEFAULT_STRATEGY',//
        'ZLIB_BLOCK',//
        'ZLIB_NO_FLUSH',//
        'ZLIB_PARTIAL_FLUSH',//
        'ZLIB_SYNC_FLUSH',//
        'ZLIB_FULL_FLUSH',//
        'ZLIB_FINISH',//
    ];

    // inflate deflate
    public static function deflate_init($encoding,$options=[]){return deflate_init($encoding,$options);}//Initialize an incremental deflate context
    public static function deflate_add($context,$data,$flush_mode){return deflate_add($context,$data,$flush_mode);}//Incrementally deflate data
    public static function inflate_init($encoding,$options=[]){return inflate_init($encoding,$options);}//Initialize an incremental inflate context
    public static function inflate_add($context,$encoded_data,$flush_mode){return inflate_add($context,$encoded_data,$flush_mode);}//Incrementally inflate encoded data
    public static function gzdeflate($data,$level=-1,$encoding=ZLIB_ENCODING_RAW){return gzdeflate($data,$level,$encoding);}//Deflate a string
    public static function gzinflate($data,$length=0){return gzinflate($data,$length);}//Inflate a deflated string
    //
    public static function gzencode($data,$level=-1,$encoding_mode=FORCE_GZIP){return gzencode($data,$level,$encoding_mode);}//Create a gzip compressed string
    public static function gzdecode($data,$length){return gzdecode($data,$length);}//Decodes a gzip compressed string
    public static function zlib_decode($data,$max_decoded_len){return zlib_decode($data,$max_decoded_len);}//Uncompress any raw/gzip/zlib encoded data
    public static function zlib_encode($data,$encoding,$level=-1){return zlib_encode($data,$encoding,$level);}//Compress data with the specified encoding
    //
    public static function gzcompress($data,$level=-1,$encoding=ZLIB_ENCODING_DEFLATE){return gzcompress($data,$level,$encoding);}//Compress a string
    public static function gzuncompress($data,$length=0){return gzuncompress($data,$length);}// Uncompress a compressed string
    //
    public static function readgzfile($filename,$use_include_path=0){return readgzfile($filename,$use_include_path);}//Reads a file, decompresses it and writes it to standard output.
    // pointer
    public static function gzopen($filename,$mode,$use_include_path=0){return gzopen($filename,$mode,$use_include_path);}//Open gz-file

    public static function gzread($zp,$length){return gzread($zp,$length);}// Binary-safe gz-file read
    public static function gzgets($zp,$length){return gzgets($zp,$length);}//Get line from file pointer
    public static function gzgetss($zp,$length,$allowable_tags){return gzgetss($zp,$length,$allowable_tags);}//Get line from gz-file pointer and strip HTML tags
    public static function gzgetc($zp){return gzgetc($zp);}//Get character from gz-file pointer
    public static function gzpassthru($zp){return gzpassthru($zp);} //Output all remaining data on a gz-file pointer

    public static function gzputs($zp,$string,$length){return gzwrite($zp,$string,$length);}//别名 gzwrite()
    public static function gzwrite($zp,$string,$length){return gzwrite($zp,$string,$length);}//Binary-safe gz-file write

    public static function gzrewind($zp){return gzrewind($zp);}//Rewind the position of a gz-file pointer
    public static function gztell($zp){return gztell($zp);}//Tell gz-file pointer read/write position
    public static function gzeof($zp){return gzeof($zp);}//Test for EOF on a gz-file pointer
    public static function gzseek($zp,$offset,$whence=SEEK_SET){return gzseek($zp,$offset,$whence);}//Seek on a gz-file pointer

    public static function gzclose($zp){return gzclose($zp);}//Close an open gz-file pointer

    public static function gzfile($filename,$use_include_path=0){return gzfile($filename,$use_include_path);}//Read entire gz-file into an array
    public static function zlib_get_coding_type(){return zlib_get_coding_type();}//Returns the coding type used for output compression
}


text:
#include <kernel.h>
#include <string.h>
#include <misc/printk.h>
#include <misc/rb.h>
#include <kernel_structs.h>
#include <sys_io.h>
#include <ksched.h>
#include <syscall.h>
#include <syscall_handler.h>
#include <device.h>
#include <init.h>
#include <stdbool.h>

#define LOG_LEVEL CONFIG_KERNEL_LOG_LEVEL
#include <logging/log.h>
LOG_MODULE_DECLARE(kernel);

/* The originally synchronization strategy made heavy use of recursive
 * irq_locking, which ports poorly to spinlocks which are
 * non-recursive.  Rather than try to redesign as part of
 * spinlockification, this uses multiple locks to preserve the
 * original semantics exactly.  The locks are named for the data they
 * protect where possible, or just for the code that uses them where
 * not.
 */
#ifdef CONFIG_DYNAMIC_OBJECTS
static struct k_spinlock lists_lock;       /* kobj rbtree/dlist */
static struct k_spinlock objfree_lock;     /* k_object_free */
#endif
static struct k_spinlock obj_lock;         /* kobj struct data */
static struct k_spinlock ucopy_lock;       /* copy to/from userspace */
static struct k_spinlock ucopy_outer_lock; /* code that calls copies */

#if defined(CONFIG_NETWORKING) && defined (CONFIG_DYNAMIC_OBJECTS)
/* Used by auto-generated obj_size_get() switch body, as we need to
 * know the size of struct net_context
 */
#include <net/net_context.h>
#endif

#define MAX_THREAD_BITS		(CONFIG_MAX_THREAD_BYTES * 8)

#ifdef CONFIG_DYNAMIC_OBJECTS
extern u8_t _thread_idx_map[CONFIG_MAX_THREAD_BYTES];
#endif

static void clear_perms_cb(struct _k_object *ko, void *ctx_ptr);

const char *otype_to_str(enum k_objects otype)
{
	const char *ret;
	/* -fdata-sections doesn't work right except in very very recent
	 * GCC and these literal strings would appear in the binary even if
	 * otype_to_str was omitted by the linker
	 */
#ifdef CONFIG_PRINTK
	switch (otype) {
	/* otype-to-str.h is generated automatically during build by
	 * gen_kobject_list.py
	 */
#include <otype-to-str.h>
	default:
		ret = "?";
		break;
	}
#else
	ARG_UNUSED(otype);
	return NULL;
#endif
	return ret;
}

struct perm_ctx {
	int parent_id;
	int child_id;
	struct k_thread *parent;
};

#ifdef CONFIG_DYNAMIC_OBJECTS
struct dyn_obj {
	struct _k_object kobj;
	sys_dnode_t obj_list;
	struct rbnode node; /* must be immediately before data member */
	u8_t data[]; /* The object itself */
};

extern struct _k_object *_k_object_gperf_find(void *obj);
extern void _k_object_gperf_wordlist_foreach(_wordlist_cb_func_t func,
					     void *context);

static bool node_lessthan(struct rbnode *a, struct rbnode *b);

/*
 * Red/black tree of allocated kernel objects, for reasonably fast lookups
 * based on object pointer values.
 */
static struct rbtree obj_rb_tree = {
	.lessthan_fn = node_lessthan
};

/*
 * Linked list of allocated kernel objects, for iteration over all allocated
 * objects (and potentially deleting them during iteration).
 */
static sys_dlist_t obj_list = SYS_DLIST_STATIC_INIT(&obj_list);

/*
 * TODO: Write some hash table code that will replace both obj_rb_tree
 * and obj_list.
 */

static size_t obj_size_get(enum k_objects otype)
{
	size_t ret;

	switch (otype) {
#include <otype-to-size.h>
	default:
		ret = sizeof(struct device);
		break;
	}

	return ret;
}

static bool node_lessthan(struct rbnode *a, struct rbnode *b)
{
	return a < b;
}

static inline struct dyn_obj *node_to_dyn_obj(struct rbnode *node)
{
	return CONTAINER_OF(node, struct dyn_obj, node);
}

static struct dyn_obj *dyn_object_find(void *obj)
{
	struct rbnode *node;
	struct dyn_obj *ret;

	/* For any dynamically allocated kernel object, the object
	 * pointer is just a member of the conatining struct dyn_obj,
	 * so just a little arithmetic is necessary to locate the
	 * corresponding struct rbnode
	 */
	node = (struct rbnode *)((char *)obj - sizeof(struct rbnode));

	k_spinlock_key_t key = k_spin_lock(&lists_lock);
	if (rb_contains(&obj_rb_tree, node)) {
		ret = node_to_dyn_obj(node);
	} else {
		ret = NULL;
	}
	k_spin_unlock(&lists_lock, key);

	return ret;
}

/**
 * @internal
 *
 * @brief Allocate a new thread index for a new thread.
 *
 * This finds an unused thread index that can be assigned to a new
 * thread. If too many threads have been allocated, the kernel will
 * run out of indexes and this function will fail.
 *
 * Note that if an unused index is found, that index will be marked as
 * used after return of this function.
 *
 * @param tidx The new thread index if successful
 *
 * @return true if successful, false if failed
 **/
static bool _thread_idx_alloc(u32_t *tidx)
{
	int i;
	int idx;
	int base;

	base = 0;
	for (i = 0; i < CONFIG_MAX_THREAD_BYTES; i++) {
		idx = find_lsb_set(_thread_idx_map[i]);

		if (idx != 0) {
			*tidx = base + (idx - 1);

			sys_bitfield_clear_bit((mem_addr_t)_thread_idx_map,
					       *tidx);

			/* Clear permission from all objects */
			_k_object_wordlist_foreach(clear_perms_cb,
						   (void *)*tidx);

			return true;
		}

		base += 8;
	}

	return false;
}

/**
 * @internal
 *
 * @brief Free a thread index.
 *
 * This frees a thread index so it can be used by another
 * thread.
 *
 * @param tidx The thread index to be freed
 **/
static void _thread_idx_free(u32_t tidx)
{
	/* To prevent leaked permission when index is recycled */
	_k_object_wordlist_foreach(clear_perms_cb, (void *)tidx);

	sys_bitfield_set_bit((mem_addr_t)_thread_idx_map, tidx);
}

void *_impl_k_object_alloc(enum k_objects otype)
{
	struct dyn_obj *dyn_obj;
	u32_t tidx;

	/* Stacks are not supported, we don't yet have mem pool APIs
	 * to request memory that is aligned
	 */
	__ASSERT(otype > K_OBJ_ANY && otype < K_OBJ_LAST &&
		 otype != K_OBJ__THREAD_STACK_ELEMENT,
		 "bad object type requested");

	dyn_obj = z_thread_malloc(sizeof(*dyn_obj) + obj_size_get(otype));
	if (dyn_obj == NULL) {
		LOG_WRN("could not allocate kernel object");
		return NULL;
	}

	dyn_obj->kobj.name = (char *)&dyn_obj->data;
	dyn_obj->kobj.type = otype;
	dyn_obj->kobj.flags = K_OBJ_FLAG_ALLOC;
	(void)memset(dyn_obj->kobj.perms, 0, CONFIG_MAX_THREAD_BYTES);

	/* Need to grab a new thread index for k_thread */
	if (otype == K_OBJ_THREAD) {
		if (!_thread_idx_alloc(&tidx)) {
			k_free(dyn_obj);
			return NULL;
		}

		dyn_obj->kobj.data = tidx;
	}

	/* The allocating thread implicitly gets permission on kernel objects
	 * that it allocates
	 */
	_thread_perms_set(&dyn_obj->kobj, _current);

	k_spinlock_key_t key = k_spin_lock(&lists_lock);

	rb_insert(&obj_rb_tree, &dyn_obj->node);
	sys_dlist_append(&obj_list, &dyn_obj->obj_list);
	k_spin_unlock(&lists_lock, key);

	return dyn_obj->kobj.name;
}

void k_object_free(void *obj)
{
	struct dyn_obj *dyn_obj;

	/* This function is intentionally not exposed to user mode.
	 * There's currently no robust way to track that an object isn't
	 * being used by some other thread
	 */

	k_spinlock_key_t key = k_spin_lock(&objfree_lock);

	dyn_obj = dyn_object_find(obj);
	if (dyn_obj != NULL) {
		rb_remove(&obj_rb_tree, &dyn_obj->node);
		sys_dlist_remove(&dyn_obj->obj_list);

		if (dyn_obj->kobj.type == K_OBJ_THREAD) {
			_thread_idx_free(dyn_obj->kobj.data);
		}
	}
	k_spin_unlock(&objfree_lock, key);

	if (dyn_obj != NULL) {
		k_free(dyn_obj);
	}
}

struct _k_object *_k_object_find(void *obj)
{
	struct _k_object *ret;

	ret = _k_object_gperf_find(obj);

	if (ret == NULL) {
		struct dyn_obj *dynamic_obj;

		dynamic_obj = dyn_object_find(obj);
		if (dynamic_obj != NULL) {
			ret = &dynamic_obj->kobj;
		}
	}

	return ret;
}

void _k_object_wordlist_foreach(_wordlist_cb_func_t func, void *context)
{
	struct dyn_obj *obj, *next;

	_k_object_gperf_wordlist_foreach(func, context);

	k_spinlock_key_t key = k_spin_lock(&lists_lock);

	SYS_DLIST_FOR_EACH_CONTAINER_SAFE(&obj_list, obj, next, obj_list) {
		func(&obj->kobj, context);
	}
	k_spin_unlock(&lists_lock, key);
}
#endif /* CONFIG_DYNAMIC_OBJECTS */

static int thread_index_get(struct k_thread *t)
{
	struct _k_object *ko;

	ko = _k_object_find(t);

	if (ko == NULL) {
		return -1;
	}

	return ko->data;
}

static void unref_check(struct _k_object *ko, int index)
{
	k_spinlock_key_t key = k_spin_lock(&obj_lock);

	sys_bitfield_clear_bit((mem_addr_t)&ko->perms, index);

#ifdef CONFIG_DYNAMIC_OBJECTS
	struct dyn_obj *dyn_obj =
			CONTAINER_OF(ko, struct dyn_obj, kobj);

	if ((ko->flags & K_OBJ_FLAG_ALLOC) == 0) {
		goto out;
	}

	for (int i = 0; i < CONFIG_MAX_THREAD_BYTES; i++) {
		if (ko->perms[i] != 0) {
			goto out;
		}
	}

	/* This object has no more references. Some objects may have
	 * dynamically allocated resources, require cleanup, or need to be
	 * marked as uninitailized when all references are gone. What
	 * specifically needs to happen depends on the object type.
	 */
	switch (ko->type) {
	case K_OBJ_PIPE:
		k_pipe_cleanup((struct k_pipe *)ko->name);
		break;
	case K_OBJ_MSGQ:
		k_msgq_cleanup((struct k_msgq *)ko->name);
		break;
	case K_OBJ_STACK:
		k_stack_cleanup((struct k_stack *)ko->name);
		break;
	default:
		/* Nothing to do */
		break;
	}

	rb_remove(&obj_rb_tree, &dyn_obj->node);
	sys_dlist_remove(&dyn_obj->obj_list);
	k_free(dyn_obj);
out:
#endif
	k_spin_unlock(&obj_lock, key);
}

static void wordlist_cb(struct _k_object *ko, void *ctx_ptr)
{
	struct perm_ctx *ctx = (struct perm_ctx *)ctx_ptr;

	if (sys_bitfield_test_bit((mem_addr_t)&ko->perms, ctx->parent_id) &&
				  (struct k_thread *)ko->name != ctx->parent) {
		sys_bitfield_set_bit((mem_addr_t)&ko->perms, ctx->child_id);
	}
}

void _thread_perms_inherit(struct k_thread *parent, struct k_thread *child)
{
	struct perm_ctx ctx = {
		thread_index_get(parent),
		thread_index_get(child),
		parent
	};

	if ((ctx.parent_id != -1) && (ctx.child_id != -1)) {
		_k_object_wordlist_foreach(wordlist_cb, &ctx);
	}
}

void _thread_perms_set(struct _k_object *ko, struct k_thread *thread)
{
	int index = thread_index_get(thread);

	if (index != -1) {
		sys_bitfield_set_bit((mem_addr_t)&ko->perms, index);
	}
}

void _thread_perms_clear(struct _k_object *ko, struct k_thread *thread)
{
	int index = thread_index_get(thread);

	if (index != -1) {
		sys_bitfield_clear_bit((mem_addr_t)&ko->perms, index);
		unref_check(ko, index);
	}
}

static void clear_perms_cb(struct _k_object *ko, void *ctx_ptr)
{
	int id = (int)ctx_ptr;

	unref_check(ko, id);
}

void _thread_perms_all_clear(struct k_thread *thread)
{
	int index = thread_index_get(thread);

	if (index != -1) {
		_k_object_wordlist_foreach(clear_perms_cb, (void *)index);
	}
}

static int thread_perms_test(struct _k_object *ko)
{
	int index;

	if ((ko->flags & K_OBJ_FLAG_PUBLIC) != 0) {
		return 1;
	}

	index = thread_index_get(_current);
	if (index != -1) {
		return sys_bitfield_test_bit((mem_addr_t)&ko->perms, index);
	}
	return 0;
}

static void dump_permission_error(struct _k_object *ko)
{
	int index = thread_index_get(_current);
	printk("thread %p (%d) does not have permission on %s %p [",
	       _current, index,
	       otype_to_str(ko->type), ko->name);
	for (int i = CONFIG_MAX_THREAD_BYTES - 1; i >= 0; i--) {
		printk("%02x", ko->perms[i]);
	}
	printk("]\n");
}

void _dump_object_error(int retval, void *obj, struct _k_object *ko,
			enum k_objects otype)
{
	switch (retval) {
	case -EBADF:
		printk("%p is not a valid %s\n", obj, otype_to_str(otype));
		break;
	case -EPERM:
		dump_permission_error(ko);
		break;
	case -EINVAL:
		printk("%p used before initialization\n", obj);
		break;
	case -EADDRINUSE:
		printk("%p %s in use\n", obj, otype_to_str(otype));
		break;
	default:
		/* Not handled error */
		break;
	}
}

void _impl_k_object_access_grant(void *object, struct k_thread *thread)
{
	struct _k_object *ko = _k_object_find(object);

	if (ko != NULL) {
		_thread_perms_set(ko, thread);
	}
}

void k_object_access_revoke(void *object, struct k_thread *thread)
{
	struct _k_object *ko = _k_object_find(object);

	if (ko != NULL) {
		_thread_perms_clear(ko, thread);
	}
}

void _impl_k_object_release(void *object)
{
	k_object_access_revoke(object, _current);
}

void k_object_access_all_grant(void *object)
{
	struct _k_object *ko = _k_object_find(object);

	if (ko != NULL) {
		ko->flags |= K_OBJ_FLAG_PUBLIC;
	}
}

int _k_object_validate(struct _k_object *ko, enum k_objects otype,
		       enum _obj_init_check init)
{
	if (unlikely((ko == NULL) ||
		(otype != K_OBJ_ANY && ko->type != otype))) {
		return -EBADF;
	}

	/* Manipulation of any kernel objects by a user thread requires that
	 * thread be granted access first, even for uninitialized objects
	 */
	if (unlikely(!thread_perms_test(ko))) {
		return -EPERM;
	}

	/* Initialization state checks. _OBJ_INIT_ANY, we don't care */
	if (likely(init == _OBJ_INIT_TRUE)) {
		/* Object MUST be intialized */
		if (unlikely(!(ko->flags & K_OBJ_FLAG_INITIALIZED))) {
			return -EINVAL;
		}
	} else if (init < _OBJ_INIT_TRUE) { /* _OBJ_INIT_FALSE case */
		/* Object MUST NOT be initialized */
		if (unlikely(ko->flags & K_OBJ_FLAG_INITIALIZED)) {
			return -EADDRINUSE;
		}
	} else {
		/* _OBJ_INIT_ANY */
	}

	return 0;
}

void _k_object_init(void *obj)
{
	struct _k_object *ko;

	/* By the time we get here, if the caller was from userspace, all the
	 * necessary checks have been done in _k_object_validate(), which takes
	 * place before the object is initialized.
	 *
	 * This function runs after the object has been initialized and
	 * finalizes it
	 */

	ko = _k_object_find(obj);
	if (ko == NULL) {
		/* Supervisor threads can ignore rules about kernel objects
		 * and may declare them on stacks, etc. Such objects will never
		 * be usable from userspace, but we shouldn't explode.
		 */
		return;
	}

	/* Allows non-initialization system calls to be made on this object */
	ko->flags |= K_OBJ_FLAG_INITIALIZED;
}

void _k_object_recycle(void *obj)
{
	struct _k_object *ko = _k_object_find(obj);

	if (ko != NULL) {
		(void)memset(ko->perms, 0, sizeof(ko->perms));
		_thread_perms_set(ko, k_current_get());
		ko->flags |= K_OBJ_FLAG_INITIALIZED;
	}
}

void _k_object_uninit(void *obj)
{
	struct _k_object *ko;

	/* See comments in _k_object_init() */
	ko = _k_object_find(obj);
	if (ko == NULL) {
		return;
	}

	ko->flags &= ~K_OBJ_FLAG_INITIALIZED;
}

/*
 * Copy to/from helper functions used in syscall handlers
 */
void *z_user_alloc_from_copy(void *src, size_t size)
{
	void *dst = NULL;
	k_spinlock_key_t key = k_spin_lock(&ucopy_lock);

	/* Does the caller in user mode have access to read this memory? */
	if (Z_SYSCALL_MEMORY_READ(src, size)) {
		goto out_err;
	}

	dst = z_thread_malloc(size);
	if (dst == NULL) {
		printk("out of thread resource pool memory (%zu)", size);
		goto out_err;
	}

	(void)memcpy(dst, src, size);
out_err:
	k_spin_unlock(&ucopy_lock, key);
	return dst;
}

static int user_copy(void *dst, void *src, size_t size, bool to_user)
{
	int ret = EFAULT;
	k_spinlock_key_t key = k_spin_lock(&ucopy_lock);

	/* Does the caller in user mode have access to this memory? */
	if (to_user ? Z_SYSCALL_MEMORY_WRITE(dst, size) :
			Z_SYSCALL_MEMORY_READ(src, size)) {
		goto out_err;
	}

	(void)memcpy(dst, src, size);
	ret = 0;
out_err:
	k_spin_unlock(&ucopy_lock, key);
	return ret;
}

int z_user_from_copy(void *dst, void *src, size_t size)
{
	return user_copy(dst, src, size, false);
}

int z_user_to_copy(void *dst, void *src, size_t size)
{
	return user_copy(dst, src, size, true);
}

char *z_user_string_alloc_copy(char *src, size_t maxlen)
{
	unsigned long actual_len;
	int err;
	char *ret = NULL;
	k_spinlock_key_t key = k_spin_lock(&ucopy_outer_lock);

	actual_len = z_user_string_nlen(src, maxlen, &err);
	if (err != 0) {
		goto out;
	}
	if (actual_len == maxlen) {
		/* Not NULL terminated */
		printk("string too long %p (%lu)\n", src, actual_len);
		goto out;
	}
	if (__builtin_uaddl_overflow(actual_len, 1, &actual_len)) {
		printk("overflow\n");
		goto out;
	}

	ret = z_user_alloc_from_copy(src, actual_len);
out:
	k_spin_unlock(&ucopy_outer_lock, key);
	return ret;
}

int z_user_string_copy(char *dst, char *src, size_t maxlen)
{
	unsigned long actual_len;
	int ret, err;
	k_spinlock_key_t key = k_spin_lock(&ucopy_outer_lock);

	actual_len = z_user_string_nlen(src, maxlen, &err);
	if (err != 0) {
		ret = EFAULT;
		goto out;
	}
	if (actual_len == maxlen) {
		/* Not NULL terminated */
		printk("string too long %p (%lu)\n", src, actual_len);
		ret = EINVAL;
		goto out;
	}
	if (__builtin_uaddl_overflow(actual_len, 1, &actual_len)) {
		printk("overflow\n");
		ret = EINVAL;
		goto out;
	}

	ret = z_user_from_copy(dst, src, actual_len);
out:
	k_spin_unlock(&ucopy_outer_lock, key);
	return ret;
}

/*
 * Default handlers if otherwise unimplemented
 */

static u32_t handler_bad_syscall(u32_t bad_id, u32_t arg2, u32_t arg3,
				  u32_t arg4, u32_t arg5, u32_t arg6, void *ssf)
{
	printk("Bad system call id %u invoked\n", bad_id);
	_arch_syscall_oops(ssf);
	CODE_UNREACHABLE;
}

static u32_t handler_no_syscall(u32_t arg1, u32_t arg2, u32_t arg3,
				 u32_t arg4, u32_t arg5, u32_t arg6, void *ssf)
{
	printk("Unimplemented system call\n");
	_arch_syscall_oops(ssf);
	CODE_UNREACHABLE;
}

#include <syscall_dispatch.c>


text:
package org.togglz.core.manager;

import java.util.Collections;
import java.util.List;
import java.util.Set;

import org.togglz.core.Feature;
import org.togglz.core.activation.ActivationStrategyProvider;
import org.togglz.core.metadata.EmptyFeatureMetaData;
import org.togglz.core.metadata.FeatureMetaData;
import org.togglz.core.repository.FeatureState;
import org.togglz.core.repository.StateRepository;
import org.togglz.core.spi.ActivationStrategy;
import org.togglz.core.spi.FeatureProvider;
import org.togglz.core.user.FeatureUser;
import org.togglz.core.user.UserProvider;
import org.togglz.core.util.Validate;

/**
 * Default implementation of {@link FeatureManager}
 *
 * @author Christian Kaltepoth
 *
 */
public class DefaultFeatureManager implements FeatureManager {

    private final String name;
    private final StateRepository stateRepository;
    private final UserProvider userProvider;
    private final FeatureProvider featureProvider;
    private final ActivationStrategyProvider strategyProvider;

    DefaultFeatureManager(String name, FeatureProvider featureProvider, StateRepository stateRepository,
        UserProvider userProvider, ActivationStrategyProvider activationStrategyProvider) {
        this.name = name;
        this.featureProvider = featureProvider;
        this.stateRepository = stateRepository;
        this.userProvider = userProvider;
        this.strategyProvider = activationStrategyProvider;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public Set<Feature> getFeatures() {
        return Collections.unmodifiableSet(featureProvider.getFeatures());
    }

    @Override
    public FeatureMetaData getMetaData(Feature feature) {
        Validate.notNull(feature, "feature is required");
        FeatureMetaData metadata = featureProvider.getMetaData(feature);
        if (metadata != null) {
            return metadata;
        }
        return new EmptyFeatureMetaData(feature);
    }

    @Override
    public boolean isActive(Feature feature) {

        Validate.notNull(feature, "feature is required");

        FeatureState state = stateRepository.getFeatureState(feature);

        if (state == null) {
            state = getMetaData(feature).getDefaultFeatureState();
        }

        if (state.isEnabled()) {

            // if no strategy is selected, the decision is simple
            String strategyId = state.getStrategyId();
            if (strategyId == null || strategyId.isEmpty()) {
                return true;
            }

            FeatureUser user = userProvider.getCurrentUser();

            // check the selected strategy
            for (ActivationStrategy strategy : strategyProvider.getActivationStrategies()) {
                if (strategy.getId().equalsIgnoreCase(strategyId)) {
                    return strategy.isActive(state, user);
                }
            }
        }

        // if the strategy was not found, the feature should be off
        return false;

    }

    @Override
    public FeatureState getFeatureState(Feature feature) {
        Validate.notNull(feature, "feature is required");
        FeatureState state = stateRepository.getFeatureState(feature);
        if (state == null) {
            state = getMetaData(feature).getDefaultFeatureState();
        }
        return state;
    }

    @Override
    public void setFeatureState(FeatureState state) {
        Validate.notNull(state, "state is required");
        stateRepository.setFeatureState(state);
    }

    @Override
    public List<ActivationStrategy> getActivationStrategies() {
        return strategyProvider.getActivationStrategies();
    }

    @Override
    public void enable(Feature feature) {
        stateRepository.setFeatureState(new FeatureState(feature, true));
    }

    @Override
    public void disable(Feature feature) {
        stateRepository.setFeatureState(new FeatureState(feature, false));
    }

    @Override
    public FeatureUser getCurrentFeatureUser() {
        return userProvider.getCurrentUser();
    }

    @Override
    public String toString() {
        return "DefaultFeatureManager[" + getName() + "]";
    }

}


text:
package com.salesforce.dva.argus.ws.resources;

import com.salesforce.dva.argus.entity.Annotation;
import com.salesforce.dva.argus.entity.MetatagsRecord;
import com.salesforce.dva.argus.entity.Metric;
import com.salesforce.dva.argus.entity.PrincipalUser;
import com.salesforce.dva.argus.service.CollectionService;
import com.salesforce.dva.argus.system.SystemAssert;
import com.salesforce.dva.argus.ws.annotation.Description;
import com.salesforce.dva.argus.ws.dto.AnnotationDto;
import com.salesforce.dva.argus.ws.dto.MetricDto;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

/**
 * Provides methods to collect annotation events and metric data.
 *
 * @author  Bhinav Sura (bsura@salesforce.com)
 */
@Path("/collection")
@Description("Provides methods to collect annotation events and metric data.")
public class CollectionResources extends AbstractResource {

    //~ Instance fields ******************************************************************************************************************************

    private CollectionService _collectionService = system.getServiceFactory().getCollectionService();

    //~ Methods **************************************************************************************************************************************

    /**
     * Submits externally collected metric data.
     *
     * @param   req         The HTTP request.
     * @param   metricDtos  The metric DTOs to submit.
     *
     * @return  The number of metrics that were submitted, and the number of errors encountered.
     */
    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/metrics")
    @Description("Submits externally collected metric data.")
    public Map<String, Object> submitMetrics(@Context HttpServletRequest req, final List<MetricDto> metricDtos) {
        PrincipalUser remoteUser = getRemoteUser(req);

        SystemAssert.requireArgument(metricDtos != null, "Cannot submit null timeseries metrics list.");

        List<Metric> legalMetrics = new ArrayList<>();
        List<MetricDto> illegalMetrics = new ArrayList<>();
        List<String> errorMessages = new ArrayList<>();

        for (MetricDto metricDto : metricDtos) {
            try {
                Metric metric = new Metric(metricDto.getScope(), metricDto.getMetric());
                metric.setTags(metricDto.getTags());
                if (metricDto.getMetatags() != null) {
                    metric.setMetatagsRecord(new MetatagsRecord(metricDto.getMetatags(), metricDto.getMetatagsKey()));
                }

                copyProperties(metric, metricDto);
                legalMetrics.add(metric);
            } catch (Exception e) {
                illegalMetrics.add(metricDto);
                errorMessages.add(e.getMessage());
            }
        }
        _collectionService.submitMetrics(remoteUser, legalMetrics);

        Map<String, Object> result = new HashMap<>();

        result.put("Success", legalMetrics.size() + " metrics");
        result.put("Error", illegalMetrics.size() + " metrics");
        result.put("Error Messages", errorMessages);
        return result;
    }

    /**
     * Submits externally collected annotation data.
     *
     * @param   req             The HTTP request.
     * @param   annotationDtos  The annotation DTOs to submit.
     *
     * @return  The number of annotations that were submitted, and the number of errors encountered.
     */
    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/annotations")
    @Description("Submits externally collected annotation data.")
    public Map<String, Object> submitAnnotations(@Context HttpServletRequest req, final List<AnnotationDto> annotationDtos) {
        PrincipalUser remoteUser = getRemoteUser(req);

        SystemAssert.requireArgument(annotationDtos != null, "Cannot submit null annotations list.");

        List<Annotation> legalAnnotations = new ArrayList<>();
        List<AnnotationDto> illegalAnnotations = new ArrayList<>();
        List<String> errorMessages = new ArrayList<>();

        for (AnnotationDto annotationDto : annotationDtos) {
            try {
                Annotation annotation = new Annotation(annotationDto.getSource(), annotationDto.getId(), annotationDto.getType(),
                    annotationDto.getScope(), annotationDto.getMetric(), annotationDto.getTimestamp());

                copyProperties(annotation, annotationDto);
                legalAnnotations.add(annotation);
            } catch (Exception e) {
                illegalAnnotations.add(annotationDto);
                errorMessages.add(e.getMessage());
            }
        }
        _collectionService.submitAnnotations(remoteUser, legalAnnotations);

        Map<String, Object> result = new HashMap<>();

        result.put("Success", legalAnnotations.size() + " annotations");
        result.put("Error", illegalAnnotations.size() + " annotations");
        result.put("Error Messages", errorMessages);
        return result;
    }
}
/* Copyright (c) 2016, Salesforce.com, Inc.  All rights reserved. */


text:
/*
---
name: ART.Box
description: Base Box for other widgets to inherit from
requires: [ART.Sheet, ART.Widget, ART/ART.Rectangle]
provides: ART.Box
...
*/

(function(){

var Box = ART.Box = new Class({

	Extends: ART.Widget,

	name: 'box',

	options: {},

	initialize: function(options){
		this.parent(options);

		this.shadowLayer = new ART.Rectangle;
		this.borderLayer = new ART.Rectangle;
		this.reflectionLayer = new ART.Rectangle;
		this.backgroundLayer = new ART.Rectangle;
		this.canvas.grab(this.shadowLayer, this.borderLayer, this.reflectionLayer, this.backgroundLayer);
	},

	draw: function(newSheet){
		var sheet = this.parent(newSheet),
		    cs = this.currentSheet;
		var boxChanged = !!(sheet.width || sheet.height || sheet.padding || sheet.borderRadius || sheet.pill);

		if (boxChanged && cs.width != null && cs.height != null) this._drawBox(cs);

		if (sheet.shadowColor) this.shadowLayer.fill.apply(this.shadowLayer, $splat(cs.shadowColor));
		if (sheet.borderColor) this.borderLayer.fill.apply(this.borderLayer, $splat(cs.borderColor));
		if (sheet.reflectionColor) this.reflectionLayer.fill.apply(this.reflectionLayer, $splat(cs.reflectionColor));
		if (sheet.backgroundColor) this.backgroundLayer.fill.apply(this.backgroundLayer, $splat(cs.backgroundColor));

		this.boxChanged = boxChanged;

		return sheet;
	},

	_drawBox: function(cs) {
		this.resize(cs.width, cs.height + 1);

		if (!cs.pill){
			var brt = cs.borderRadius[0], brr = cs.borderRadius[1];
			var brb = cs.borderRadius[2], brl = cs.borderRadius[3];
		}

		var pill = ((cs.width < cs.height) ? cs.width : cs.height) / 2;
		this.shadowLayer.draw(cs.width, cs.height, cs.pill ? pill : cs.borderRadius).translate(0, 1);
		this.borderLayer.draw(cs.width, cs.height, cs.pill ? pill : cs.borderRadius);
		this.reflectionLayer.draw(cs.width - 2, cs.height - 2, cs.pill ? pill - 1 : [brt - 1, brr - 1, brb - 1, brl - 1]).translate(1, 1);
		this.backgroundLayer.draw(cs.width - 2, cs.height - 3, cs.pill ? pill - 1 : [brt - 1, brr - 1, brb - 1, brl - 1]).translate(1, 2);
	}

});

})();


text:
package main

import (
	"fmt"
	"log"
	"os"
	"strings"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/ec2"
)

// This example will list instances with a filter
//
// Usage:
// filter_ec2_by_tag <name_filter>
func main() {
	sess, err := session.NewSession()
	if err != nil {
		log.Fatalf("failed to create session %v\n", err)
	}

	nameFilter := os.Args[1]
	awsRegion := "us-east-1"
	svc := ec2.New(sess, &aws.Config{Region: aws.String(awsRegion)})
	fmt.Printf("listing instances with tag %v in: %v\n", nameFilter, awsRegion)
	params := &ec2.DescribeInstancesInput{
		Filters: []*ec2.Filter{
			{
				Name: aws.String("tag:Name"),
				Values: []*string{
					aws.String(strings.Join([]string{"*", nameFilter, "*"}, "")),
				},
			},
		},
	}
	resp, err := svc.DescribeInstances(params)
	if err != nil {
		fmt.Println("there was an error listing instances in", awsRegion, err.Error())
		log.Fatal(err.Error())
	}
	fmt.Printf("%+v\n", *resp)
}


text:
#include "SuperOutputTest.h"
#include "SuperFunctionData.h"
#include "SuperStackNode.h"

namespace SuperProfiler
{
	SuperOutputTest::SuperOutputTest() : root("ROOT"), maxDepth(0), totalRunTime(0)
	{
	}

	SuperOutputTest::~SuperOutputTest()
	{
	}

	void SuperOutputTest::OutputFunctionData(SuperFuncDataList & funcData, double totalRunTime)
	{
		//First, sort the function list
		SortByTime(funcData, true);

		this->totalRunTime = totalRunTime;

		SuperFuncDataList::iterator iter;
		for (iter = funcData.begin(); iter != funcData.end(); iter++)
		{
			//The copy is needed in case the actual string has been deleted
			funcTimeList[(*iter)->GetNameCopy()] = (*iter)->GetTotalTime();
			funcCallAmountList[(*iter)->GetNameCopy()] = (*iter)->GetTotalNumTimesCalled();
		}
	}

	void SuperOutputTest::OutputCallTree(SuperStackNode * stack)
	{
		Record(stack, root);

		FindMaxDepth(stack, 0);
	}

	void SuperOutputTest::Record(SuperStackNode * stack, SuperOutputTestCallNode & currNode)
	{
		currNode.SetCallAmount(stack->GetNumTimesCalled());
		currNode.SetRunTime(stack->GetTotalTime());
		currNode.SetAvgRunTime(stack->GetAverageTime());

		size_t numChildren = stack->GetNumChildren();
		for (size_t i = 0; i < numChildren; i++)
		{
			SuperStackNode * childNode = stack->GetChild(i);
			//The copy is needed in case the actual string has been deleted
			SuperOutputTestCallNode * newNode = new SuperOutputTestCallNode(childNode->GetFuncData()->GetNameCopy());
			currNode.AddChild(newNode);
			Record(childNode, *newNode);
		}
	}

	void SuperOutputTest::FindMaxDepth(SuperStackNode * currNode, size_t currDepth)
	{
		if (currDepth > maxDepth)
		{
			maxDepth = currDepth;
		}

		size_t numChildren = currNode->GetNumChildren();
		for (size_t i = 0; i < numChildren; i++)
		{
			SuperStackNode * childNode = currNode->GetChild(i);
			FindMaxDepth(childNode, currDepth + 1);
		}
	}

	size_t SuperOutputTest::GetMaxDepth(void)
	{
		return maxDepth;
	}

	double SuperOutputTest::GetTotalRunTime(void) const
	{
		return totalRunTime;
	}

	double SuperOutputTest::GetFunctionRunTime(const std::string & functionName) const
	{
		SuperFuncTimeList::const_iterator foundIter = funcTimeList.find(functionName);
		if (foundIter != funcTimeList.end())
		{
			return foundIter->second;
		}
		//Did not find the function, -1 is an invalid time
		return -1;
	}

	size_t SuperOutputTest::GetFunctionCallAmount(const std::string & functionName) const
	{
		SuperFuncCallAmountList::const_iterator foundIter = funcCallAmountList.find(functionName);
		if (foundIter != funcCallAmountList.end())
		{
			return foundIter->second;
		}
		//Did not find the function
		return 0;
	}

	SuperOutputTest::SuperOutputTestCallNode & SuperOutputTest::GetCallTree(void)
	{
		return root;
	}

	SuperOutputTest::SuperOutputTestCallNode::SuperOutputTestCallNode(const std::string & setName) : name(setName), callAmount(0),
																									 runTime(0), avgRunTime(0)
	{
	}

	SuperOutputTest::SuperOutputTestCallNode::~SuperOutputTestCallNode()
	{
		//Clean up children
		CallNodeList::iterator iter;
		for (iter = functions.begin(); iter != functions.end(); iter++)
		{
			delete (*iter);
		}
		functions.clear();
	}

	const std::string SuperOutputTest::SuperOutputTestCallNode::GetName(void) const
	{
		return name;
	}

	void SuperOutputTest::SuperOutputTestCallNode::SetCallAmount(size_t setAmount)
	{
		callAmount = setAmount;
	}

	size_t SuperOutputTest::SuperOutputTestCallNode::GetCallAmount(void) const
	{
		return callAmount;
	}

	void SuperOutputTest::SuperOutputTestCallNode::SetRunTime(double setTime)
	{
		runTime = setTime;
	}

	double SuperOutputTest::SuperOutputTestCallNode::GetRunTime(void) const
	{
		return runTime;
	}

	void SuperOutputTest::SuperOutputTestCallNode::SetAvgRunTime(double setTime)
	{
		avgRunTime = setTime;
	}

	double SuperOutputTest::SuperOutputTestCallNode::GetAvgRunTime(void) const
	{
		return avgRunTime;
	}

	void SuperOutputTest::SuperOutputTestCallNode::AddChild(SuperOutputTestCallNode * addChild)
	{
		functions.push_back(addChild);
	}

	SuperOutputTest::SuperOutputTestCallNode * SuperOutputTest::SuperOutputTestCallNode::GetFunction(const std::string & funcName)
	{
		CallNodeList::iterator iter;
		for (iter = functions.begin(); iter != functions.end(); iter++)
		{
			if ((*iter)->GetName() == funcName)
			{
				return (*iter);
			}
		}

		return NULL;
	}
}


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

<test-schema xmlns="http://www.example.org/test-schema">
	<invalid-element />
</test-schema>


text:
SYNONYM

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

#### Published in
Revis. gen. pl. (Leipzig) 3: 471 (1898)

#### Original name
Puccinia verbesinae Schwein., 1822

### Remarks
null


text:
package quickfix.fix50.component;
import quickfix.FieldNotFound;

import quickfix.Group;

public class LinesOfTextGrp extends quickfix.MessageComponent
{

  static final long serialVersionUID = 20050617;
  public static final String MSGTYPE = "";

  private int[] componentFields = {  };
  protected int[] getFields() { return componentFields; }
  private int[] componentGroups = { 33,  };
  protected int[] getGroupFields() { return componentGroups; }

  public LinesOfTextGrp()
  {
    super();
  }

  public void set(quickfix.field.NoLinesOfText value)
  {
    setField(value);
  }

  public quickfix.field.NoLinesOfText get(quickfix.field.NoLinesOfText  value) throws FieldNotFound
  {
    getField(value);
    return value;
  }

  public quickfix.field.NoLinesOfText getNoLinesOfText() throws FieldNotFound
  {
    quickfix.field.NoLinesOfText value = new quickfix.field.NoLinesOfText();
    getField(value);
    return value;
  }

  public boolean isSet(quickfix.field.NoLinesOfText field)
  {
    return isSetField(field);
  }

  public boolean isSetNoLinesOfText()
  {
    return isSetField(33);
  }

  public static class NoLinesOfText extends Group {
    static final long serialVersionUID = 20050617;
    public NoLinesOfText() {
        super(33, 58,
            new int[] {58, 354, 355,  0 } );
    }

  public void set(quickfix.field.Text value)
  {
    setField(value);
  }

  public quickfix.field.Text get(quickfix.field.Text  value) throws FieldNotFound
  {
    getField(value);
    return value;
  }

  public quickfix.field.Text getText() throws FieldNotFound
  {
    quickfix.field.Text value = new quickfix.field.Text();
    getField(value);
    return value;
  }

  public boolean isSet(quickfix.field.Text field)
  {
    return isSetField(field);
  }

  public boolean isSetText()
  {
    return isSetField(58);
  }

  public void set(quickfix.field.EncodedTextLen value)
  {
    setField(value);
  }

  public quickfix.field.EncodedTextLen get(quickfix.field.EncodedTextLen  value) throws FieldNotFound
  {
    getField(value);
    return value;
  }

  public quickfix.field.EncodedTextLen getEncodedTextLen() throws FieldNotFound
  {
    quickfix.field.EncodedTextLen value = new quickfix.field.EncodedTextLen();
    getField(value);
    return value;
  }

  public boolean isSet(quickfix.field.EncodedTextLen field)
  {
    return isSetField(field);
  }

  public boolean isSetEncodedTextLen()
  {
    return isSetField(354);
  }

  public void set(quickfix.field.EncodedText value)
  {
    setField(value);
  }

  public quickfix.field.EncodedText get(quickfix.field.EncodedText  value) throws FieldNotFound
  {
    getField(value);
    return value;
  }

  public quickfix.field.EncodedText getEncodedText() throws FieldNotFound
  {
    quickfix.field.EncodedText value = new quickfix.field.EncodedText();
    getField(value);
    return value;
  }

  public boolean isSet(quickfix.field.EncodedText field)
  {
    return isSetField(field);
  }

  public boolean isSetEncodedText()
  {
    return isSetField(355);
  }

  }

}


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

<title>ServantActivatorOperations (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="org.omg.PortableServer.ServantActivatorOperations interface">
<meta name="keywords" content="incarnate()">
<meta name="keywords" content="etherealize()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.omg.PortableServer

Interface ServantActivatorOperations

All Superinterfaces:

ServantManagerOperations

All Known Subinterfaces:

ServantActivator

All Known Implementing Classes:

_ServantActivatorStub, ServantActivatorPOA

public interface ServantActivatorOperations
extends ServantManagerOperations

When the POA has the RETAIN policy it uses servant
 managers that are ServantActivators.

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

void
etherealize(byte[] oid,
           POA adapter,
           Servant serv,
           boolean cleanup_in_progress,
           boolean remaining_activations)

This operation is invoked whenever a servant for
 an object is deactivated, assuming the POA has
 the USE_SERVANT_MANAGER and RETAIN policies.

Servant
incarnate(byte[] oid,
         POA adapter)

This operation is invoked by the POA whenever the
 POA receives a request for an object that is not
 currently active, assuming the POA has the
 USE_SERVANT_MANAGER and RETAIN policies.

Method Detail

incarnate

Servant incarnate(byte[] oid,
                  POA adapter)
           throws ForwardRequest

This operation is invoked by the POA whenever the
 POA receives a request for an object that is not
 currently active, assuming the POA has the
 USE_SERVANT_MANAGER and RETAIN policies.

Parameters:

oid - object Id associated with the object on
            the request was made.

adapter - object reference for the POA in which
                the object is being activated.

Returns:

Servant corresponding to oid is created or
         located by the user supplied servant manager.

Throws:

ForwardRequest - to indicate to the ORB
            that it is responsible for delivering
            the current request and subsequent
            requests to the object denoted in the
            forward_reference member of the exception.

etherealize

void etherealize(byte[] oid,
                 POA adapter,
                 Servant serv,
                 boolean cleanup_in_progress,
                 boolean remaining_activations)

This operation is invoked whenever a servant for
 an object is deactivated, assuming the POA has
 the USE_SERVANT_MANAGER and RETAIN policies.

Parameters:

oid - object Id associated with the object
            being deactivated.

adapter - object reference for the POA in which
                the object was active.

serv - contains reference to the servant
        associated with the object being deactivated.

cleanup_in_progress - if TRUE indicates that
        destroy or deactivate is called with
        etherealize_objects param of TRUE.  FALSE
        indicates that etherealize was called due to
        other reasons.

remaining_activations - indicates whether the
        Servant Manager can destroy a servant.  If
        set to TRUE, the Servant Manager should wait
        until all invocations in progress have
        completed.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
package com.fzb.blog.util;

import com.fzb.common.util.IOUtil;
import org.apache.log4j.Logger;

import java.io.IOException;
import java.net.Socket;

public class PluginSocketThread extends Thread {

    private static final Logger LOGGER = Logger.getLogger(PluginSocketThread.class);
    private int port;
    private String host;

    private boolean stop;

    public PluginSocketThread(String host, int port) {
        this.host = host;
        this.port = port;
    }

    @Override
    public void run() {
        Socket socket;
        while (true) {
            try {
                Thread.sleep(1000);
                socket = new Socket(host, port);
                break;
            } catch (Exception e) {
                //LOGGER.warn("plugin exception stop ", e);
            }
        }
        try {
            IOUtil.getByteByInputStream(socket.getInputStream());
            stop = true;
        } catch (IOException e) {
            LOGGER.warn("plugin exception stop ", e);
        }
    }

    public boolean isStop() {
        return stop;
    }
}


text:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.							  */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
/*----------------------------------------------------------------------------*/

#include "Module.h"
#include "AnalogModule.h"
#include "DigitalModule.h"
//#include "SolenoidModule.h"

Module* Module::m_modules[kMaxModules] = {NULL};

/**
 * Constructor.
 *
 * @param type The type of module represented.
 * @param number The module index within the module type.
 */
Module::Module(nLoadOut::tModuleType type, UINT8 number)
	: m_moduleType (type)
	, m_moduleNumber (number)
{
	m_modules[ToIndex(type, number)] = this;
}

/**
 * Destructor.
 */
Module::~Module()
{
}

/**
 * Static module singleton factory.
 *
 * @param type The type of module represented.
 * @param number The module index within the module type.
 */
Module* Module::GetModule(nLoadOut::tModuleType type, UINT8 number)
{
	if (m_modules[ToIndex(type, number)] == NULL)
	{
		switch(type)
		{
		case nLoadOut::kModuleType_Analog:
			new AnalogModule(number);
			break;
		case nLoadOut::kModuleType_Digital:
			new DigitalModule(number);
			break;
/*
		case nLoadOut::kModuleType_Solenoid:
			new SolenoidModule(number);
			break;
*/
		default:
		    return NULL;
		}
	}
	return m_modules[ToIndex(type, number)];
}

/**
 * Create an index into the m_modules array based on type and number
 *
 * @param type The type of module represented.
 * @param number The module index within the module type.
 * @return The index into m_modules.
 */
UINT8 Module::ToIndex(nLoadOut::tModuleType type, UINT8 number)
{
	if (number == 0 || number > kMaxModuleNumber) return 0;
	if (type < nLoadOut::kModuleType_Analog || type > nLoadOut::kModuleType_Solenoid) return 0;
	return (type * kMaxModuleNumber) + (number - 1);
}


text:
package router

import (
	"math"
	"time"
)

const (
	Port                = 6783
	HTTPPort            = Port + 1
	MaxUDPPacketSize    = 65535
	ChannelSize         = 16
	TCPHeartbeat        = 30 * time.Second
	GossipInterval      = 30 * time.Second
	MaxDuration         = time.Duration(math.MaxInt64)
	MaxTCPMsgSize       = 10 * 1024 * 1024
	FastHeartbeat       = 500 * time.Millisecond
	SlowHeartbeat       = 10 * time.Second
	MaxMissedHeartbeats = 6
	HeartbeatTimeout    = MaxMissedHeartbeats * SlowHeartbeat
)


text: Compass.add_project_configuration('..\..\..\classic\theme-classic\sass\config.rb')


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Placodium alphoplacum f. muscicola Tomin

### Remarks
null


text:
class FluxboxWindow;
class WinButtonTheme;

namespace FbTk{
class Color;
template <class T> class ThemeProxy;
}

/// draws and handles basic window button graphic
class WinButton:public FbTk::Button, public FbTk::SignalTracker {
public:
    /// draw type for the button
    enum Type {
        MAXIMIZE,
        MINIMIZE,
        SHADE,
        STICK,
        CLOSE,
        MENUICON,
        LEFT_HALF,
        RIGHT_HALF
    };

    WinButton(FluxboxWindow &listen_to,
              FbTk::ThemeProxy<WinButtonTheme> &theme,
              FbTk::ThemeProxy<WinButtonTheme> &pressed,
              Type buttontype, const FbTk::FbWindow &parent, int x, int y,
              unsigned int width, unsigned int height);
    /// override for drawing
    void exposeEvent(XExposeEvent &event);
    void buttonReleaseEvent(XButtonEvent &event);
    void setBackgroundPixmap(Pixmap pm);
    void setPressedPixmap(Pixmap pm);
    void setBackgroundColor(const FbTk::Color &color);
    void setPressedColor(const FbTk::Color &color);

    Pixmap getBackgroundPixmap() const { return getPixmap(m_theme); }
    Pixmap getPressedPixmap() const { return getPixmap(m_pressed_theme); }
    /// override for redrawing
    void clear();
    void updateAll();
private:
    void drawType();
    Pixmap getPixmap(const FbTk::ThemeProxy<WinButtonTheme> &) const;
    Type m_type; ///< the button type
    FluxboxWindow &m_listen_to;
    FbTk::ThemeProxy<WinButtonTheme> &m_theme, &m_pressed_theme;

    FbTk::FbPixmap m_icon_pixmap;
    FbTk::FbPixmap m_icon_mask;

    bool overrode_bg, overrode_pressed;
};

#endif // WINBUTTON_HH


text:
namespace juce
{

ModifierKeys ModifierKeys::currentModifiers;

ModifierKeys::ModifierKeys (int rawFlags) noexcept               : flags (rawFlags)    {}

int ModifierKeys::getNumMouseButtonsDown() const noexcept
{
    int num = 0;

    if (isLeftButtonDown())     ++num;
    if (isRightButtonDown())    ++num;
    if (isMiddleButtonDown())   ++num;

    return num;
}

ModifierKeys ModifierKeys::getCurrentModifiersRealtime() noexcept
{
    return ComponentPeer::getCurrentModifiersRealtime();
}

} // namespace juce


text:
package jp.plen.scenography.views.adapters;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;

import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;

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

import jp.plen.rx.binding.Property;
import jp.plen.rx.subscriptions.SubscriptionMap;
import jp.plen.scenography.R;
import jp.plen.scenography.models.entities.PlenCodeUnit;
import jp.plen.scenography.models.entities.PlenMotion;
import jp.plen.scenography.models.entities.PlenProgram;
import jp.plen.scenography.views.PlenCodeUnitView;
import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.subscriptions.CompositeSubscription;
import rx.subscriptions.Subscriptions;

/**
 * PlenProgramView用のListAdapter
 */
@EBean
public class PlenProgramAdapter extends BaseAdapter implements Subscription {
    private static final String TAG = PlenProgramAdapter.class.getSimpleName();
    @Nullable private static final BlankRow BLANK_ROW = new BlankRow();
    private final List<PlenCodeUnit> mItems = new ArrayList<>();
    private final CompositeSubscription mSubscriptions = new CompositeSubscription();
    private final SubscriptionMap<Object> mSubscriptionMap = new SubscriptionMap<>();
    private final Property<Map<Integer, PlenMotion>> mMotionMap = Property.create();
    private final Property<List<PlenCodeUnit>> mSequence = Property.create();
    @NonNull private final LayoutInflater mLayoutInflater;
    @RootContext Context mContext;

    public PlenProgramAdapter(@NonNull Context context) {
        mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    @NonNull
    public Property<List<PlenCodeUnit>> sequence() {
        return mSequence;
    }

    @NonNull
    public Subscription bind(@NonNull Observable<PlenProgram> program) {
        return Subscriptions.from(
                mMotionMap.bind(program
                        .map(PlenProgram::getMotionMap)
                        .filter(map -> !mMotionMap.get().map(map::equals).orElse(false))),
                mSequence.bind(program
                        .map(PlenProgram::getSequence)
                        .filter(seq -> !seq.equals(stageWithoutBlankRow()))));
    }

    @Override
    public int getCount() {
        return mItems.size();
    }

    @Override
    public PlenCodeUnit getItem(int position) {
        return mItems.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Nullable
    @Override
    public View getView(int position, @Nullable View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = mLayoutInflater.inflate(R.layout.item_plen_program, parent, false);
        }
        bindView(position, (PlenCodeUnitView) convertView);
        return convertView;
    }

    public int positionOfBlankRow() {
        int position = mItems.indexOf(BLANK_ROW);
        return position != ListView.INVALID_POSITION ? position : ListView.INVALID_POSITION;
    }

    public void moveBlankRowToLast() {
        mItems.remove(BLANK_ROW);
        mItems.add(BLANK_ROW);
        notifyDataSetChanged();
    }

    public void moveBlankRow(int position) {
        if (positionOfBlankRow() == position) return;
        mItems.remove(BLANK_ROW);
        mItems.add(position, BLANK_ROW);
        notifyDataSetChanged();
    }

    public void removeBlankRow() {
        if (!mItems.contains(BLANK_ROW)) return;
        mItems.remove(BLANK_ROW);
        notifyDataSetChanged();
    }

    public void replaceByBlankRow(int position) {
        if (isBlankRow(mItems.get(position))) return;
        mItems.remove(BLANK_ROW);
        mItems.set(position, BLANK_ROW);
        notifyDataSetChanged();
        commit();
    }

    public void dropToBlankRow(@NonNull PlenCodeUnit unit) {
        if (!mItems.contains(BLANK_ROW)) return;
        mItems.add(positionOfBlankRow(), unit);
        mItems.remove(BLANK_ROW);
        notifyDataSetChanged();
        commit();
    }

    public void setUnit(int location, PlenCodeUnit unit) {
        if (Objects.equals(unit, mItems.get(location))) return;
        mItems.set(location, unit);
        notifyDataSetChanged();
        commit();
    }

    @Override
    public void unsubscribe() {
        mSubscriptions.unsubscribe();
    }

    @Override
    public boolean isUnsubscribed() {
        return mSubscriptions.isUnsubscribed();
    }

    private List<PlenCodeUnit> stageWithoutBlankRow() {
        return Observable.from(mItems).filter(u -> !isBlankRow(u)).toList().toBlocking().single();
    }

    private void commit() {
        mSequence.set(stageWithoutBlankRow());
    }

    private void bindView(int position, @NonNull PlenCodeUnitView view) {
        mSubscriptionMap.remove(view);
        mSubscriptionMap.remove(position);
        PlenCodeUnit unit = getItem(position);
        if (isBlankRow(unit)) {
            view.bindBlankRow();
            return;
        }

        Subscription subscription = Subscriptions.from(
                view.bind(mMotionMap.asObservable().map(m -> m.get(unit.getMotionId())),
                        Observable.just(unit.getLoopCount())),
                view.programUnit().asObservable()
                        .skipWhile(u -> !Objects.equals(u, unit))
                        .subscribe(u -> setUnit(position, u)));
        mSubscriptionMap.put(view, subscription);
        mSubscriptionMap.put(position, subscription);
    }

    private boolean isBlankRow(@Nullable PlenCodeUnit unit) {
        return unit instanceof BlankRow;
    }

    @AfterInject
    void afterInject() {
        initSubscriptions();
    }

    private void initSubscriptions() {
        mSubscriptions.clear();
        mSubscriptionMap.clear();
        mSubscriptions.add(mSubscriptionMap);

        Observable
                .combineLatest(
                        mMotionMap.asObservable(),
                        mSequence.asObservable(),
                        (map, seq) -> seq)
                .observeOn(AndroidSchedulers.mainThread())
                .doOnNext(seq -> {
                    if (!seq.equals(stageWithoutBlankRow())) {
                        mItems.clear();
                        mItems.addAll(seq);
                    }
                    notifyDataSetChanged();
                })
                .subscribe();
    }

    private static class BlankRow extends PlenCodeUnit {
        private static final long serialVersionUID = -7485794770680714919L;

        public BlankRow() {
            super(-1, -1);
        }

        @Override
        public boolean equals(Object o) {
            return this == o;
        }
    }
}


text:
<!DOCTYPE html>

        <meta charset="UTF-8" />
        <meta name="robots" content="index, follow, all" />
        <title>Thelia\Core\Template\Loop\BaseSpecificModule | </title>
                    <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css">

Classes

Namespaces

Interfaces

Traits

Index

Class

Thelia\Core\Template\Loop\BaseSpecificModule

abstract     class
    BaseSpecificModule        extends BaseI18nLoop        implements
        PropelSearchLoopInterface

Methods

                    ModelCriteria

                    buildModelCriteria()

this method returns a Propel ModelCriteria

Details

at line 69

                    public            ModelCriteria
    buildModelCriteria()

this method returns a Propel ModelCriteria

Return Value

            ModelCriteria

        Generated by Sami, the API Documentation Generator.


text:
var q = require('q');

function validateVersionRequirement(ctx, versions, providedVersion) {
    if (providedVersion) {
        ctx.semverUtils.assert(providedVersion);
    }

    // The one version that has to be equal, if no version was provided
    var theVersion;
    for (var key in versions) {
        if (providedVersion) {
            // If the provided version is already used -> fail
            if (versions[key].equals(ctx.semver(providedVersion))) {
                throw new Error('The provided version ' + providedVersion.toString() + ' is already used by the component \'' + key + '\'');
            }

            // If the provided version is smaller then a version that is already used -> fail
            if (versions[key].compare(ctx.semver(providedVersion)) > 0) {
                throw new Error('The provided version ' + providedVersion.toString() + ' is smaller then the version of the component \'' + key + '#' + versions[key] + '\'');
            }
        } else {
            if (!theVersion) {
                theVersion = versions[key];
            } else {
                if (!versions[key].equals(theVersion)) {
                    throw new Error('If no version is provided, then all components must have already the same version! Use --' + ctx.CMD_OPTIONS.ALL + ' and --' + ctx.CMD_OPTIONS.VERSION +
                    ' this time in order to synchronize the versions');
                }
            }
        }
    }
}

module.exports.execute = function (ctx) {
    var promises = [];

    ctx._.each(ctx.availableBowerComponents, function (component) {
        this.push(ctx.bowerUtils.determineCurrentVersion(component));

    }, promises);

    return q.all(promises).then(function (res) {
        var bcArray = ctx._.values(ctx.availableBowerComponents);
        var versions = {};
        for (var i = 0; i < bcArray.length; i++) {
            versions[bcArray[i].name] = res[i];
            ctx.debug(bcArray[i].name + ': ' + res[i]);
        }

        var providedVersion = ctx.cmdOption(ctx.CMD_OPTIONS.VERSION);

        validateVersionRequirement(ctx, versions, providedVersion);

        var chain = bcArray.reduce(function (previous, item) {
            return previous.then(function() {
                return ctx.releaseHelper.release(item);
            });
        }, q.resolve());

        return chain;
    });
};


text:
Ruby binding to NetApp Manageability SDK.

[![Gem Version](https://badge.fury.io/rb/net_app_manageability.svg)](http://badge.fury.io/rb/net_app_manageability)
[![Code Climate](http://img.shields.io/codeclimate/github/ManageIQ/net_app_manageability.svg)](https://codeclimate.com/github/ManageIQ/net_app_manageability)
[![Dependency Status](https://gemnasium.com/ManageIQ/net_app_manageability.svg)](https://gemnasium.com/ManageIQ/net_app_manageability)

## Installation

First, install the NetApp Manageability SDK.

- This is only provided by NetApp directly.  For the next steps, we will assume these files are located in `$INSTALL_DIR`.

- Create symlinks for libssl and libcrypto, if necessary.

  ```sh
  ln -s libssl.so $INSTALL_DIR/lib/linux-64/libssl.so.0.9.8
  ln -s libcrypto.so $INSTALL_DIR/lib/linux-64/libcrypto.so.0.9.8
  ```

Next, if using bundler

- Add this line to your application's Gemfile:

  ```ruby
  gem 'net_app_manageability'
  ```

- If the NetApp Manageability SDK is not available on the normal compile paths, then execute:

  ```sh
  bundle config build.net_app_manageability --with-netapp-manageability-sdk-include=$INSTALL_DIR/include --with-netapp-manageability-sdk-lib=$INSTALL_DIR/lib/linux-64
  ```

- And finally execute:

  ```sh
  bundle
  ```

Otherwise, if not using bundler

- If the NetApp Manageability SDK is not available on the normal compile paths, then execute:

  ```sh
  gem install net_app_manageability --with-netapp-manageability-sdk-include=$INSTALL_DIR/include --with-netapp-manageability-sdk-lib=$INSTALL_DIR/lib/linux-64
  ```

- Otherwise execute:

  ```sh
  gem install net_app_manageability
  ```

## Usage

For examples of usage, see the [examples](examples).

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to compile the gem and run the tests.  If you want to just compile the gem, use `rake compile`.  If the NetApp Manageability SDK is not accessible via the normal compile paths, you make have to pass those locations to `rake compile` as follows:

    rake compile -- --with-netapp-manageability-sdk-include=$INSTALL_DIR/include --with-netapp-manageability-sdk-lib=$INSTALL_DIR/lib/linux-64

You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ManageIQ/net_app_manageability.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
package org.apache.oodt.cas.pushpull.config;

//OODT imports
import org.apache.oodt.cas.pushpull.filerestrictions.Parser;

//JDK imports
import java.io.File;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.regex.Pattern;

/**
 *
 * @author bfoster
 * @version $Revision$
 *
 *
Describe your class here
.
 */
public class PropFilesInfo {

    private File localDir;

    private boolean deleteOnSuccess;

    private File successLoc;

    private File failLoc;

    private LinkedList<RegExpAndParser> patterns;

    private HashMap<File, Parser> fileToParserMap;

    private DownloadInfo di;

    public PropFilesInfo(File localDir) {
        this.localDir = localDir;
        patterns = new LinkedList<RegExpAndParser>();
    }

    public void setDownloadInfo(DownloadInfo di,
            HashMap<File, Parser> fileToParserMap) {
        this.di = di;
        this.fileToParserMap = fileToParserMap;
    }

    public LinkedList<File> getDownloadInfoPropFiles() {
        LinkedList<File> returnList = new LinkedList<File>();
        for (Entry<File, Parser> entry : this.fileToParserMap.entrySet())
            returnList.add(entry.getKey());
        return returnList;
    }

    public void setAfterUseEffects(File successLoc, File failLoc) {
        this.successLoc = successLoc;
        this.failLoc = failLoc;
    }

    public void addPropFiles(String regExp, Parser parser) {
        patterns.add(new RegExpAndParser(regExp, parser));
    }

    public Parser getParserForFile(File propFile) {
        Parser parser = this.fileToParserMap == null ? null
                : this.fileToParserMap.get(propFile);
        if (parser == null)
            parser = this.getParserForFilename(propFile.getName());
        return parser;
    }

    public Parser getParserForFilename(String propFilename) {
        for (RegExpAndParser pattern : patterns) {
            if (pattern.isAcceptedByPattern(propFilename))
                return pattern.getParser();
        }
        return null;
    }

    public boolean needsToBeDownloaded() {
        return di != null;
    }

    public DownloadInfo getDownloadInfo() {
        return this.di;
    }

    public File getFinalDestination(boolean success) {
        return success ? this.getOnSuccessDir() : this.getOnFailDir();
    }

    public File getOnSuccessDir() {
        return (this.successLoc == null) ? this.localDir : this.successLoc;
    }

    public File getOnFailDir() {
        return (this.failLoc == null) ? this.localDir : this.failLoc;
    }

    public File getLocalDir() {
        return this.localDir;
    }

    public void setDeleteOnSuccess(boolean deleteOnSuccess) {
        this.deleteOnSuccess = deleteOnSuccess;
    }

    public boolean getDeleteOnSuccess() {
      return deleteOnSuccess;
    }

    public String toString() {
        return "PropFilesInfo\n" + "   " + "Local directory: " + this.localDir
                + "\n" + "   " + "Patterns: " + this.patterns + "\n" + "   "
                + "Delete on success: " + this.deleteOnSuccess + "\n" + "   "
                + "Move to directory on success: " + this.successLoc + "\n"
                + "   " + "Move to directory on fail: " + this.failLoc + "\n"
                + "   " + this.di + "\n";
    }

    private class RegExpAndParser {
        private String pattern;

        private Parser parser;

        public RegExpAndParser(String pattern, Parser parser) {
            this.pattern = pattern;
            this.parser = parser;
        }

        public boolean isAcceptedByPattern(String filename) {
            return Pattern.matches(pattern, filename);
        }

        public Parser getParser() {
            return this.parser;
        }

        public String getPattern() {
            return this.pattern;
        }
    }

}