text:
#ifndef _NIFLIB_KEY_H_
#define _NIFLIB_KEY_H_

#include <iostream>
#include <iomanip>
#include <vector>
#include <math.h>
#include "gen/enums.h"

namespace Niflib
{
	using namespace std;

	/*! Stores an animation key and the time in the animation that it takes affect. It is a template class so it can hold any kind of data as different objects key different sorts of information to the animation timeline.*/
	template <class T>
	struct Key
	{
		float time; /*!< The time on the animation timeline that this keyframe takes affect. */
		T data; /*!< The data being keyed to the timeline. */
		T forward_tangent; /*!< A piece of data of the same type as is being keyed to the time line used as the forward tangent in quadratic interpolation.  Ignored if key type is set as something else. */
		T backward_tangent; /*!< A piece of data of the same type as is being keyed to the time line used as the backward tangent in quadratic interpolation.  Ignored if key type is set as something else. */
		float tension; /*!< The amount of tension to use in tension, bias, continuity interpolation.  Ignored if key type is something else.*/
		float bias; /*!< The amount of bias to use in tension, bias, continuity interpolation.  Ignored if key type is something else.*/
		float continuity; /*!< The amount of continuity to use in tension, bias, continuity interpolation.  Ignored if key type is something else.*/
	};

	template <class T>
	ostream & operator<<(ostream & out, Key<T> const & val)
	{
		return out << "Time:  " << val.time << endl
			<< "Data:  " << val.data << endl
			<< "Forward Tangent:  " << val.forward_tangent << endl
			<< "Backward Tangent:  " << val.backward_tangent << endl
			<< "Bias:  " << val.bias << endl
			<< "Continuity:  " << val.continuity << endl;
	}

	/*!
	 * A function to normalize the key times in a vector of keys to be in seconds,
	 * effectivly setting phase to zero and frequency to 1.
	 * \param[in/out] keys The vector of keys to be normalized.
	 * \param[in] phase The phase shift to remove during normalization.
	 * \param[in] frequency The original frequency of the keys which will be
	 * normalized to 1.
	 */
	template <class T>
	void NormalizeKeyVector(vector< Key<T> > & keys, float phase, float frequency)
	{
		for(size_t i = 0; i < keys.size(); ++i)
		{
			keys[i].time = (keys[i].time - phase) / frequency;
		}
	}

	/*!
	 * A function to extract key values for a certain amount of time.  Values will be
	 * duplicated if necessary when cycle_type is CYCLE_LOOP or CYCLE_REVERSE.
	 */
	template <class T>
	vector< Key<T> > ExtractKeySlice(const vector< Key<T> > & keys, float slice_start, float slice_stop, float keys_start, float keys_stop, CycleType cycle = CYCLE_CLAMP)
	{
		vector< Key<T> > out;

		//Get first set of keys
		for(size_t i = 0; i < keys.size(); ++i)
		{
			if(keys[i].time >= slice_start && keys[i].time <= slice_stop)
			{
				out.push_back(keys[i]);
			}
		}

		//Get additional keys based on cycle type.
		if(cycle == CYCLE_LOOP || cycle == CYCLE_REVERSE)
		{
			float c = floor(slice_start / (keys_stop - keys_start)) + 1.0f;
			bool reverse = false;
			bool failed = false;
			while(failed == false)
			{
				if(cycle == CYCLE_REVERSE)
				{
					if(reverse == false)
					{
						reverse = true;
					}
					else
					{
						reverse = false;
					}
				}

				int first, last, vec;
				if(reverse == true)
				{
					first = int(keys.size()) - 1;
					last = -1;
					vec = -1;
				}
				else
				{
					first = 0;
					last = int(keys.size());
					vec = 1;
				}

				for(int i = first; i != last; i += vec)
				{
					float time = keys[i].time;
					time = keys_start + (keys_stop - time) + c * (keys_stop - keys_start);

					if(time >= slice_start && time <= slice_stop)
					{
						bool add_key = true;
						size_t prev_key = out.size() - 1;
						if(out.size() > 0 && out[prev_key].time == keys[i].time)
						{
							add_key = false;
						}
						if(add_key == true)
						{
							out.push_back(keys[i]);
						}
					}
					else
					{
						failed = true;
						break;
					}
				}
				c += 1.0;
			}
		}

		return out;
	}
} //end namespace Niflib

#endif


text:
package org.keycloak.representations.idm.authorization;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * @author Pedro Igor
 */
public class PolicyRepresentation {

    private String id;
    private String name;
    private String description;
    private String type;
    private Logic logic = Logic.POSITIVE;
    private DecisionStrategy decisionStrategy = DecisionStrategy.UNANIMOUS;
    private Map<String, String> config = new HashMap();

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public DecisionStrategy getDecisionStrategy() {
        return this.decisionStrategy;
    }

    public void setDecisionStrategy(DecisionStrategy decisionStrategy) {
        this.decisionStrategy = decisionStrategy;
    }

    public Logic getLogic() {
        return logic;
    }

    public void setLogic(Logic logic) {
        this.logic = logic;
    }

    public Map<String, String> getConfig() {
        return this.config;
    }

    public void setConfig(Map<String, String> config) {
        this.config = config;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        final PolicyRepresentation policy = (PolicyRepresentation) o;
        return Objects.equals(getId(), policy.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId());
    }
}

redpajama_set_name: RedPajamaGithub


text:
<title>Ogre::D3D9RenderTexture Class Reference - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="doxygen.css">
<link type="text/css" rel="stylesheet" href="tabs.css">

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Directories

Class List

Class Index

Class Hierarchy

Class Members

Ogre

D3D9RenderTexture

Public Types |
Public Member Functions |
Protected Types |
Protected Member Functions |
Protected Attributes

Ogre::D3D9RenderTexture Class Reference

RenderTexture implementation for D3D9.
 More...

#include <OgreD3D9Texture.h>

Inheritance diagram for Ogre::D3D9RenderTexture:

<map name="Ogre_1_1D3D9RenderTexture_inherit__map" id="Ogre_1_1D3D9RenderTexture_inherit__map">
<area shape="rect" id="node2" href="classOgre_1_1RenderTexture.html" title="This class represents a RenderTarget that renders to a Texture." alt="" coords="23,160,167,189"/><area shape="rect" id="node4" href="classOgre_1_1RenderTarget.html" title="A 'canvas' which can receive the results of a rendering operation." alt="" coords="27,83,163,112"/><area shape="rect" id="node6" href="classOgre_1_1AllocatedObject.html" title="Superclass for all objects that wish to use custom memory allocators when their new / delete operator..." alt="" coords="37,5,152,35"/></map>
[legend]

List of all members.

Public Types

enum  	StatFlags {

  SF_NONE =  0,
SF_FPS =  1,
SF_AVG_FPS =  2,
SF_BEST_FPS =  4,

  SF_WORST_FPS =  8,
SF_TRIANGLE_COUNT =  16,
SF_ALL =  0xFFFF

 }

enum  	FrameBuffer { FB_FRONT,
FB_BACK,
FB_AUTO
 }

Public Member Functions

 	D3D9RenderTexture (const String &name, D3D9HardwarePixelBuffer *buffer, bool writeGamma, uint fsaa)

 	~D3D9RenderTexture ()

virtual void 	update (bool swap)

 	Tells the target to update it's contents.

virtual void 	getCustomAttribute (const String &name, void *pData)

 	Gets a custom (maybe platform-specific) attribute.

bool 	requiresTextureFlipping () const

void 	swapBuffers (bool waitForVSync=true)

 	Override needed to deal with FSAA.

virtual void 	copyContentsToMemory (const PixelBox &dst, FrameBuffer buffer)

 	Copies the current contents of the render target to a pixelbox.

PixelFormat 	suggestPixelFormat () const

 	Suggests a pixel format to use for extracting the data in this target, when calling copyContentsToMemory.

virtual const String & 	getName (void) const

 	Retrieve target's name.

virtual void 	getMetrics (unsigned int &width, unsigned int &height, unsigned int &colourDepth)

 	Retrieve information about the render target.

virtual unsigned int 	getWidth (void) const

virtual unsigned int 	getHeight (void) const

virtual unsigned int 	getColourDepth (void) const

void 	setDepthBufferPool (uint16 poolId)

 	Sets the pool ID this RenderTarget should query from.

uint16 	getDepthBufferPool () const

DepthBuffer * 	getDepthBuffer () const

virtual bool 	attachDepthBuffer (DepthBuffer *depthBuffer)

virtual void 	detachDepthBuffer ()

virtual void 	_detachDepthBuffer ()

 	Detaches DepthBuffer without notifying it from the detach.

virtual Viewport * 	addViewport (Camera *cam, int ZOrder=0, float left=0.0f, float top=0.0f, float width=1.0f, float height=1.0f)

 	Adds a viewport to the rendering target.

virtual unsigned short 	getNumViewports (void) const

 	Returns the number of viewports attached to this target.

virtual Viewport * 	getViewport (unsigned short index)

 	Retrieves a pointer to the viewport with the given index.

virtual Viewport * 	getViewportByZOrder (int ZOrder)

 	Retrieves a pointer to the viewport with the given zorder.

virtual bool 	hasViewportWithZOrder (int ZOrder)

 	Returns true if and only if a viewport exists at the given ZOrder.

virtual void 	removeViewport (int ZOrder)

 	Removes a viewport at a given ZOrder.

virtual void 	removeAllViewports (void)

 	Removes all viewports on this target.

virtual void 	getStatistics (float &lastFPS, float &avgFPS, float &bestFPS, float &worstFPS) const

 	Retieves details of current rendering performance.

virtual const FrameStats & 	getStatistics (void) const

virtual float 	getLastFPS () const

 	Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered.

virtual float 	getAverageFPS () const

 	Individual stats access - gets the average frames per second (FPS) since call to Root::startRendering.

virtual float 	getBestFPS () const

 	Individual stats access - gets the best frames per second (FPS) since call to Root::startRendering.

virtual float 	getWorstFPS () const

 	Individual stats access - gets the worst frames per second (FPS) since call to Root::startRendering.

virtual float 	getBestFrameTime () const

 	Individual stats access - gets the best frame time.

virtual float 	getWorstFrameTime () const

 	Individual stats access - gets the worst frame time.

virtual void 	resetStatistics (void)

 	Resets saved frame-rate statistices.

virtual void 	addListener (RenderTargetListener *listener)

 	Add a listener to this RenderTarget which will be called back before & after rendering.

virtual void 	removeListener (RenderTargetListener *listener)

 	Removes a RenderTargetListener previously registered using addListener.

virtual void 	removeAllListeners (void)

 	Removes all listeners from this instance.

virtual void 	setPriority (uchar priority)

 	Sets the priority of this render target in relation to the others.

virtual uchar 	getPriority () const

 	Gets the priority of a render target.

virtual bool 	isActive () const

 	Used to retrieve or set the active state of the render target.

virtual void 	setActive (bool state)

 	Used to set the active state of the render target.

virtual void 	setAutoUpdated (bool autoupdate)

 	Sets whether this target should be automatically updated if Ogre's rendering loop or Root::_updateAllRenderTargets is being used.

virtual bool 	isAutoUpdated (void) const

 	Gets whether this target is automatically updated if Ogre's rendering loop or Root::_updateAllRenderTargets is being used.

void 	writeContentsToFile (const String &filename)

 	Writes the current contents of the render target to the named file.

virtual String 	writeContentsToTimestampedFile (const String &filenamePrefix, const String &filenameSuffix)

 	Writes the current contents of the render target to the (PREFIX)(time-stamp)(SUFFIX) file.

virtual size_t 	getTriangleCount (void) const

 	Gets the number of triangles rendered in the last update() call.

virtual size_t 	getBatchCount (void) const

 	Gets the number of batches rendered in the last update() call.

virtual void 	_notifyCameraRemoved (const Camera *cam)

 	Utility method to notify a render target that a camera has been removed, incase it was referring to it as a viewer.

virtual bool 	isPrimary (void) const

 	Indicates whether this target is the primary window.

virtual bool 	isHardwareGammaEnabled () const

 	Indicates whether on rendering, linear colour space is converted to sRGB gamma colour space.

virtual uint 	getFSAA () const

 	Indicates whether multisampling is performed on rendering and at what level.

virtual const String & 	getFSAAHint () const

 	Gets the FSAA hint (.

virtual Impl * 	_getImpl ()

 	Get rendersystem specific interface for this RenderTarget.

virtual void 	_beginUpdate ()

 	Method for manual management of rendering : fires 'preRenderTargetUpdate' and initialises statistics etc.

virtual void 	_updateViewport (int zorder, bool updateStatistics=true)

 	Method for manual management of rendering - renders the given viewport (even if it is not autoupdated)

virtual void 	_updateViewport (Viewport *viewport, bool updateStatistics=true)

 	Method for manual management of rendering - renders the given viewport (even if it is not autoupdated)

virtual void 	_updateAutoUpdatedViewports (bool updateStatistics=true)

 	Method for manual management of rendering - renders only viewports that are auto updated.

virtual void 	_endUpdate ()

 	Method for manual management of rendering - finishes statistics calculation and fires 'postRenderTargetUpdate'.

void * 	operator new (size_t sz, const char *file, int line, const char *func)

 	operator new, with debug line info

void * 	operator new (size_t sz)

void * 	operator new (size_t sz, void *ptr)

 	placement operator new

void * 	operator new[] (size_t sz, const char *file, int line, const char *func)

 	array operator new, with debug line info

void * 	operator new[] (size_t sz)

void 	operator delete (void *ptr)

void 	operator delete (void *ptr, void *)

void 	operator delete (void *ptr, const char *, int, const char *)

void 	operator delete[] (void *ptr)

void 	operator delete[] (void *ptr, const char *, int, const char *)

Protected Types

typedef map< int, Viewport * >

::type 	ViewportList

typedef vector

< RenderTargetListener * >

::type 	RenderTargetListenerList

Protected Member Functions

void 	updateStats (void)

virtual void 	firePreUpdate (void)

 	internal method for firing events

virtual void 	firePostUpdate (void)

 	internal method for firing events

virtual void 	fireViewportPreUpdate (Viewport *vp)

 	internal method for firing events

virtual void 	fireViewportPostUpdate (Viewport *vp)

 	internal method for firing events

virtual void 	fireViewportAdded (Viewport *vp)

 	internal method for firing events

virtual void 	fireViewportRemoved (Viewport *vp)

 	internal method for firing events

virtual void 	updateImpl ()

 	Internal implementation of update()

Protected Attributes

HardwarePixelBuffer * 	mBuffer

size_t 	mZOffset

String 	mName

 	The name of this target.

uchar 	mPriority

 	The priority of the render target.

unsigned int 	mWidth

unsigned int 	mHeight

unsigned int 	mColourDepth

uint16 	mDepthBufferPoolId

DepthBuffer * 	mDepthBuffer

FrameStats 	mStats

Timer * 	mTimer

unsigned long 	mLastSecond

unsigned long 	mLastTime

size_t 	mFrameCount

bool 	mActive

bool 	mAutoUpdate

bool 	mHwGamma

uint 	mFSAA

String 	mFSAAHint

ViewportList 	mViewportList

 	List of viewports, map on Z-order.

RenderTargetListenerList 	mListeners

Detailed Description

RenderTexture implementation for D3D9.

Definition at line 308 of file OgreD3D9Texture.h.

Member Typedef Documentation

          typedef vector<RenderTargetListener*>::type Ogre::RenderTarget::RenderTargetListenerList [protected, inherited]

Definition at line 509 of file OgreRenderTarget.h.

          typedef map<int, Viewport*>::type Ogre::RenderTarget::ViewportList [protected, inherited]

Definition at line 505 of file OgreRenderTarget.h.

Member Enumeration Documentation

          enum Ogre::RenderTarget::FrameBuffer [inherited]

Enumerator:

FB_FRONT

FB_BACK

FB_AUTO

Definition at line 90 of file OgreRenderTarget.h.

          enum Ogre::RenderTarget::StatFlags [inherited]

Enumerator:

SF_NONE

SF_FPS

SF_AVG_FPS

SF_BEST_FPS

SF_WORST_FPS

SF_TRIANGLE_COUNT

SF_ALL

Definition at line 67 of file OgreRenderTarget.h.

Constructor & Destructor Documentation

          Ogre::D3D9RenderTexture::D3D9RenderTexture
          (
          const String &
          name,

          D3D9HardwarePixelBuffer *
          buffer,

          bool
          writeGamma,

          uint
          fsaa

          )

          Ogre::D3D9RenderTexture::~D3D9RenderTexture
          (
          	)

Definition at line 312 of file OgreD3D9Texture.h.

Member Function Documentation

          virtual void Ogre::RenderTarget::_beginUpdate
          (
          	)
           [virtual, inherited]

Method for manual management of rendering : fires 'preRenderTargetUpdate' and initialises statistics etc.

Remarks:

_beginUpdate resets statistics and fires 'preRenderTargetUpdate'.

_updateViewport renders the given viewport (even if it is not autoupdated), fires preViewportUpdate and postViewportUpdate and manages statistics.

_updateAutoUpdatedViewports renders only viewports that are auto updated, fires preViewportUpdate and postViewportUpdate and manages statistics.

_endUpdate() ends statistics calculation and fires postRenderTargetUpdate.

you can use it like this for example :

			renderTarget->_beginUpdate();
			renderTarget->_updateViewport(1); // which is not auto updated
			renderTarget->_updateViewport(2); // which is not auto updated
			renderTarget->_updateAutoUpdatedViewports();
			renderTarget->_endUpdate();
			renderTarget->swapBuffers(true);

 Please note that in that case, the zorder may not work as you expect, since you are responsible for calling _updateViewport in the correct order.

Reimplemented in Ogre::D3D9RenderWindow, Ogre::EAGLWindow, and Ogre::EAGL2Window.

          virtual void Ogre::RenderTarget::_detachDepthBuffer
          (
          	)
           [virtual, inherited]

Detaches DepthBuffer without notifying it from the detach.

Useful when called from the DepthBuffer while it iterates through attached RenderTargets (

See also:

DepthBuffer::_setPoolId())

Reimplemented in Ogre::GLFBORenderTexture, Ogre::GLESFBORenderTexture, Ogre::GLES2FBORenderTexture, Ogre::GLESFBOMultiRenderTarget, Ogre::GLES2FBOMultiRenderTarget, and Ogre::GLFBOMultiRenderTarget.

          virtual void Ogre::RenderTarget::_endUpdate
          (
          	)
           [virtual, inherited]

Method for manual management of rendering - finishes statistics calculation and fires 'postRenderTargetUpdate'.

Remarks:

You should call it after a _beginUpdate

See also:

_beginUpdate for more details.

Reimplemented in Ogre::D3D9RenderWindow.

          virtual Impl* Ogre::RenderTarget::_getImpl
          (
          	)
           [virtual, inherited]

Get rendersystem specific interface for this RenderTarget.

This is used by the RenderSystem to (un)bind this target, and to get specific information like surfaces and framebuffer objects.

          virtual void Ogre::RenderTarget::_notifyCameraRemoved
          (
          const Camera *
          cam	)
           [virtual, inherited]

Utility method to notify a render target that a camera has been removed, incase it was referring to it as a viewer.

          virtual void Ogre::RenderTarget::_updateAutoUpdatedViewports
          (
          bool
          updateStatistics = true	)
           [virtual, inherited]

Method for manual management of rendering - renders only viewports that are auto updated.

Remarks:

This also fires preViewportUpdate and postViewportUpdate, and manages statistics. You should call it between _beginUpdate() and _endUpdate(). See _beginUpdate for more details.

Parameters:

updateStatistics	Whether you want to update statistics or not.

See also:

_beginUpdate()

          virtual void Ogre::RenderTarget::_updateViewport
          (
          int
          zorder,

          bool
          updateStatistics = true

          )
          	 [virtual, inherited]

Method for manual management of rendering - renders the given viewport (even if it is not autoupdated)

Remarks:

This also fires preViewportUpdate and postViewportUpdate, and manages statistics. You should call it between _beginUpdate() and _endUpdate().

See also:

_beginUpdate for more details.

Parameters:

zorder	The zorder of the viewport to update.

updateStatistics	Whether you want to update statistics or not.

          virtual void Ogre::RenderTarget::_updateViewport
          (
          Viewport *
          viewport,

          bool
          updateStatistics = true

          )
          	 [virtual, inherited]

Method for manual management of rendering - renders the given viewport (even if it is not autoupdated)

Remarks:

This also fires preViewportUpdate and postViewportUpdate, and manages statistics if needed. You should call it between _beginUpdate() and _endUpdate().

See also:

_beginUpdate for more details.

Parameters:

viewport	The viewport you want to update, it must be bound to the rendertarget.

updateStatistics	Whether you want to update statistics or not.

Reimplemented in Ogre::D3D9RenderWindow.

          virtual void Ogre::RenderTarget::addListener
          (
          RenderTargetListener *
          listener	)
           [virtual, inherited]

Add a listener to this RenderTarget which will be called back before & after rendering.

Remarks:

If you want notifications before and after a target is updated by the system, use this method to register your own custom RenderTargetListener class. This is useful for potentially adding your own manual rendering commands before and after the 'normal' system rendering.

NB this should not be used for frame-based scene updates, use Root::addFrameListener for that.

          virtual Viewport* Ogre::RenderTarget::addViewport
          (
          Camera *
          cam,

          int
          ZOrder = 0,

          float
          left = 0.0f,

          float
          top = 0.0f,

          float
          width = 1.0f,

          float
          height = 1.0f

          )
          	 [virtual, inherited]

Adds a viewport to the rendering target.

Remarks:

A viewport is the rectangle into which rendering output is sent. This method adds a viewport to the render target, rendering from the supplied camera. The rest of the parameters are only required if you wish to add more than one viewport to a single rendering target. Note that size information passed to this method is passed as a parametric, i.e. it is relative rather than absolute. This is to allow viewports to automatically resize along with the target.

Parameters:

cam	The camera from which the viewport contents will be rendered (mandatory)

ZOrder	The relative order of the viewport with others on the target (allows overlapping viewports i.e. picture-in-picture). Higher ZOrders are on top of lower ones. The actual number is irrelevant, only the relative ZOrder matters (you can leave gaps in the numbering)

left	The relative position of the left of the viewport on the target, as a value between 0 and 1.

top	The relative position of the top of the viewport on the target, as a value between 0 and 1.

width	The relative width of the viewport on the target, as a value between 0 and 1.

height	The relative height of the viewport on the target, as a value between 0 and 1.

          virtual bool Ogre::RenderTarget::attachDepthBuffer
          (
          DepthBuffer *
          depthBuffer	)
           [virtual, inherited]

Reimplemented in Ogre::GLFBORenderTexture, Ogre::GLESFBORenderTexture, Ogre::GLES2FBORenderTexture, Ogre::GLESFBOMultiRenderTarget, Ogre::GLES2FBOMultiRenderTarget, and Ogre::GLFBOMultiRenderTarget.

          virtual void Ogre::RenderTexture::copyContentsToMemory
          (
          const PixelBox &
          dst,

          FrameBuffer
          buffer

          )
          	 [virtual, inherited]

Copies the current contents of the render target to a pixelbox.

Remarks:

See suggestPixelFormat for a tip as to the best pixel format to extract into, although you can use whatever format you like and the results will be converted.

Implements Ogre::RenderTarget.

          virtual void Ogre::RenderTarget::detachDepthBuffer
          (
          	)
           [virtual, inherited]

Reimplemented in Ogre::GLFBORenderTexture, Ogre::GLESFBORenderTexture, Ogre::GLES2FBORenderTexture, Ogre::GLESFBOMultiRenderTarget, Ogre::GLES2FBOMultiRenderTarget, and Ogre::GLFBOMultiRenderTarget.

          virtual void Ogre::RenderTarget::firePostUpdate
          (
          void
          	)
           [protected, virtual, inherited]

internal method for firing events

          virtual void Ogre::RenderTarget::firePreUpdate
          (
          void
          	)
           [protected, virtual, inherited]

internal method for firing events

          virtual void Ogre::RenderTarget::fireViewportAdded
          (
          Viewport *
          vp	)
           [protected, virtual, inherited]

internal method for firing events

          virtual void Ogre::RenderTarget::fireViewportPostUpdate
          (
          Viewport *
          vp	)
           [protected, virtual, inherited]

internal method for firing events

          virtual void Ogre::RenderTarget::fireViewportPreUpdate
          (
          Viewport *
          vp	)
           [protected, virtual, inherited]

internal method for firing events

          virtual void Ogre::RenderTarget::fireViewportRemoved
          (
          Viewport *
          vp	)
           [protected, virtual, inherited]

internal method for firing events

          virtual float Ogre::RenderTarget::getAverageFPS
          (
          	)
           const [virtual, inherited]

Individual stats access - gets the average frames per second (FPS) since call to Root::startRendering.

          virtual size_t Ogre::RenderTarget::getBatchCount
          (
          void
          	)
           const [virtual, inherited]

Gets the number of batches rendered in the last update() call.

          virtual float Ogre::RenderTarget::getBestFPS
          (
          	)
           const [virtual, inherited]

Individual stats access - gets the best frames per second (FPS) since call to Root::startRendering.

          virtual float Ogre::RenderTarget::getBestFrameTime
          (
          	)
           const [virtual, inherited]

Individual stats access - gets the best frame time.

          virtual unsigned int Ogre::RenderTarget::getColourDepth
          (
          void
          	)
           const [virtual, inherited]

          virtual void Ogre::D3D9RenderTexture::getCustomAttribute
          (
          const String &
          name,

          void *
          pData

          )
          	 [virtual]

Gets a custom (maybe platform-specific) attribute.

Remarks:

This is a nasty way of satisfying any API's need to see platform-specific details. It horrid, but D3D needs this kind of info. At least it's abstracted.

Parameters:

name	The name of the attribute.

pData	Pointer to memory of the right kind of structure to receive the info.

Reimplemented from Ogre::RenderTarget.

          DepthBuffer* Ogre::RenderTarget::getDepthBuffer
          (
          	)
           const [inherited]

          uint16 Ogre::RenderTarget::getDepthBufferPool
          (
          	)
           const [inherited]

          virtual uint Ogre::RenderTarget::getFSAA
          (
          	)
           const [virtual, inherited]

Indicates whether multisampling is performed on rendering and at what level.

Definition at line 390 of file OgreRenderTarget.h.

          virtual const String& Ogre::RenderTarget::getFSAAHint
          (
          	)
           const [virtual, inherited]

Gets the FSAA hint (.

See also:

Root::createRenderWindow)

Definition at line 394 of file OgreRenderTarget.h.

          virtual unsigned int Ogre::RenderTarget::getHeight
          (
          void
          	)
           const [virtual, inherited]

          virtual float Ogre::RenderTarget::getLastFPS
          (
          	)
           const [virtual, inherited]

Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered.

          virtual void Ogre::RenderTarget::getMetrics
          (
          unsigned int &
          width,

          unsigned int &
          height,

          unsigned int &
          colourDepth

          )
          	 [virtual, inherited]

Retrieve information about the render target.

          virtual const String& Ogre::RenderTarget::getName
          (
          void
          	)
           const [virtual, inherited]

Retrieve target's name.

          virtual unsigned short Ogre::RenderTarget::getNumViewports
          (
          void
          	)
           const [virtual, inherited]

Returns the number of viewports attached to this target.

          virtual uchar Ogre::RenderTarget::getPriority
          (
          	)
           const [virtual, inherited]

Gets the priority of a render target.

Definition at line 314 of file OgreRenderTarget.h.

          virtual void Ogre::RenderTarget::getStatistics
          (
          float &
          lastFPS,

          float &
          avgFPS,

          float &
          bestFPS,

          float &
          worstFPS

          )
          	 const [virtual, inherited]

Retieves details of current rendering performance.

Remarks:

If the user application wishes to do it's own performance display, or use performance for some other means, this method allows it to retrieve the statistics.

Parameters:

lastFPS	Pointer to a float to receive the number of frames per second (FPS) based on the last frame rendered.

avgFPS	Pointer to a float to receive the FPS rating based on an average of all the frames rendered since rendering began (the call to Root::startRendering).

bestFPS	Pointer to a float to receive the best FPS rating that has been achieved since rendering began.

worstFPS	Pointer to a float to receive the worst FPS rating seen so far.

          virtual const FrameStats& Ogre::RenderTarget::getStatistics
          (
          void
          	)
           const [virtual, inherited]

          virtual size_t Ogre::RenderTarget::getTriangleCount
          (
          void
          	)
           const [virtual, inherited]

Gets the number of triangles rendered in the last update() call.

          virtual Viewport* Ogre::RenderTarget::getViewport
          (
          unsigned short
          index	)
           [virtual, inherited]

Retrieves a pointer to the viewport with the given index.

          virtual Viewport* Ogre::RenderTarget::getViewportByZOrder
          (
          int
          ZOrder	)
           [virtual, inherited]

Retrieves a pointer to the viewport with the given zorder.

Remarks:

throws if not found.

          virtual unsigned int Ogre::RenderTarget::getWidth
          (
          void
          	)
           const [virtual, inherited]

          virtual float Ogre::RenderTarget::getWorstFPS
          (
          	)
           const [virtual, inherited]

Individual stats access - gets the worst frames per second (FPS) since call to Root::startRendering.

          virtual float Ogre::RenderTarget::getWorstFrameTime
          (
          	)
           const [virtual, inherited]

Individual stats access - gets the worst frame time.

          virtual bool Ogre::RenderTarget::hasViewportWithZOrder
          (
          int
          ZOrder	)
           [virtual, inherited]

Returns true if and only if a viewport exists at the given ZOrder.

          virtual bool Ogre::RenderTarget::isActive
          (
          	)
           const [virtual, inherited]

Used to retrieve or set the active state of the render target.

Reimplemented in Ogre::RenderWindow, Ogre::GTKWindow, Ogre::SDLWindow, Ogre::D3D9RenderWindow, Ogre::OSXCarbonWindow, Ogre::OSXWindow, and Ogre::Win32Window.

          virtual bool Ogre::RenderTarget::isAutoUpdated
          (
          void
          	)
           const [virtual, inherited]

Gets whether this target is automatically updated if Ogre's rendering loop or Root::_updateAllRenderTargets is being used.

          virtual bool Ogre::RenderTarget::isHardwareGammaEnabled
          (
          	)
           const [virtual, inherited]

Indicates whether on rendering, linear colour space is converted to sRGB gamma colour space.

This is the exact opposite conversion of what is indicated by Texture::isHardwareGammaEnabled, and can only be enabled on creation of the render target. For render windows, it's enabled through the 'gamma' creation misc parameter. For textures, it is enabled through the hwGamma parameter to the create call.

Definition at line 386 of file OgreRenderTarget.h.

          virtual bool Ogre::RenderTarget::isPrimary
          (
          void
          	)
           const [virtual, inherited]

Indicates whether this target is the primary window.

The primary window is special in that it is destroyed when ogre is shut down, and cannot be destroyed directly. This is the case because it holds the context for vertex, index buffers and textures.

Reimplemented in Ogre::RenderWindow.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete
          (
          void *
          ptr	)
           [inherited]

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete
          (
          void *
          ptr,

          void *

          )
          	 [inherited]

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete
          (
          void *
          ptr,

          const char *
          ,

          int
          ,

          const char *

          )
          	 [inherited]

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete[]
          (
          void *
          ptr	)
           [inherited]

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void Ogre::AllocatedObject< Alloc >::operator delete[]
          (
          void *
          ptr,

          const char *
          ,

          int
          ,

          const char *

          )
          	 [inherited]

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new
          (
          size_t
          sz,

          const char *
          file,

          int
          line,

          const char *
          func

          )
          	 [inherited]

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new
          (
          size_t
          sz	)
           [inherited]

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new
          (
          size_t
          sz,

          void *
          ptr

          )
          	 [inherited]

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new[]
          (
          size_t
          sz,

          const char *
          file,

          int
          line,

          const char *
          func

          )
          	 [inherited]

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

          void* Ogre::AllocatedObject< Alloc >::operator new[]
          (
          size_t
          sz	)
           [inherited]

Definition at line 90 of file OgreMemoryAllocatedObject.h.

          virtual void Ogre::RenderTarget::removeAllListeners
          (
          void
          	)
           [virtual, inherited]

Removes all listeners from this instance.

          virtual void Ogre::RenderTarget::removeAllViewports
          (
          void
          	)
           [virtual, inherited]

Removes all viewports on this target.

          virtual void Ogre::RenderTarget::removeListener
          (
          RenderTargetListener *
          listener	)
           [virtual, inherited]

Removes a RenderTargetListener previously registered using addListener.

          virtual void Ogre::RenderTarget::removeViewport
          (
          int
          ZOrder	)
           [virtual, inherited]

Removes a viewport at a given ZOrder.

          bool Ogre::D3D9RenderTexture::requiresTextureFlipping
          (
          void
          	)
           const [virtual]

Implements Ogre::RenderTarget.

Definition at line 318 of file OgreD3D9Texture.h.

          virtual void Ogre::RenderTarget::resetStatistics
          (
          void
          	)
           [virtual, inherited]

Resets saved frame-rate statistices.

          virtual void Ogre::RenderTarget::setActive
          (
          bool
          state	)
           [virtual, inherited]

Used to set the active state of the render target.

Reimplemented in Ogre::Win32Window.

          virtual void Ogre::RenderTarget::setAutoUpdated
          (
          bool
          autoupdate	)
           [virtual, inherited]

Sets whether this target should be automatically updated if Ogre's rendering loop or Root::_updateAllRenderTargets is being used.

Remarks:

By default, if you use Ogre's own rendering loop (Root::startRendering) or call Root::_updateAllRenderTargets, all render targets are updated automatically. This method allows you to control that behaviour, if for example you have a render target which you only want to update periodically.

Parameters:

autoupdate	If true, the render target is updated during the automatic render loop or when Root::_updateAllRenderTargets is called. If false, the target is only updated when its update() method is called explicitly.

          void Ogre::RenderTarget::setDepthBufferPool
          (
          uint16
          poolId	)
           [inherited]

Sets the pool ID this RenderTarget should query from.

Default value is POOL_DEFAULT. Set to POOL_NO_DEPTH to avoid using a DepthBuffer (or manually controlling it)

See also:

DepthBuffer

Remarks:

Changing the pool Id will cause the current depth buffer to be detached unless the old id and the new one are the same

          virtual void Ogre::RenderTarget::setPriority
          (
          uchar
          priority	)
           [virtual, inherited]

Sets the priority of this render target in relation to the others.

Remarks:

This can be used in order to schedule render target updates. Lower priorities will be rendered first. Note that the priority must be set at the time the render target is attached to the render system, changes afterwards will not affect the ordering.

Definition at line 312 of file OgreRenderTarget.h.

          PixelFormat Ogre::RenderTexture::suggestPixelFormat
          (
          	)
           const [virtual, inherited]

Suggests a pixel format to use for extracting the data in this target, when calling copyContentsToMemory.

Reimplemented from Ogre::RenderTarget.

          void Ogre::D3D9RenderTexture::swapBuffers
          (
          bool
          waitForVSync = true	)
           [virtual]

Override needed to deal with FSAA.

Reimplemented from Ogre::RenderTarget.

          virtual void Ogre::D3D9RenderTexture::update
          (
          bool
          swapBuffers	)
           [virtual]

Tells the target to update it's contents.

Remarks:

If OGRE is not running in an automatic rendering loop (started using Root::startRendering), the user of the library is responsible for asking each render target to refresh. This is the method used to do this. It automatically re-renders the contents of the target using whatever cameras have been pointed at it (using Camera::setRenderTarget).

This allows OGRE to be used in multi-windowed utilities and for contents to be refreshed only when required, rather than constantly as with the automatic rendering loop.

Parameters:

swapBuffers	For targets that support double-buffering, if set to true, the target will immediately swap it's buffers after update. Otherwise, the buffers are not swapped, and you have to call swapBuffers yourself sometime later. You might want to do this on some rendersystems which pause for queued rendering commands to complete before accepting swap buffers calls - so you could do other CPU tasks whilst the queued commands complete. Or, you might do this if you want custom control over your windows, such as for externally created windows.

Reimplemented from Ogre::RenderTarget.

          virtual void Ogre::RenderTarget::updateImpl
          (
          	)
           [protected, virtual, inherited]

Internal implementation of update()

          void Ogre::RenderTarget::updateStats
          (
          void
          	)
           [protected, inherited]

          void Ogre::RenderTarget::writeContentsToFile
          (
          const String &
          filename	)
           [inherited]

Writes the current contents of the render target to the named file.

          virtual String Ogre::RenderTarget::writeContentsToTimestampedFile
          (
          const String &
          filenamePrefix,

          const String &
          filenameSuffix

          )
          	 [virtual, inherited]

Writes the current contents of the render target to the (PREFIX)(time-stamp)(SUFFIX) file.

Returns:

the name of the file used.

Member Data Documentation

          bool Ogre::RenderTarget::mActive [protected, inherited]

Reimplemented in Ogre::OSXCarbonWindow, and Ogre::SDLWindow.

Definition at line 495 of file OgreRenderTarget.h.

          bool Ogre::RenderTarget::mAutoUpdate [protected, inherited]

Definition at line 496 of file OgreRenderTarget.h.

          HardwarePixelBuffer* Ogre::RenderTexture::mBuffer [protected, inherited]

Definition at line 58 of file OgreRenderTexture.h.

          unsigned int Ogre::RenderTarget::mColourDepth [protected, inherited]

Definition at line 483 of file OgreRenderTarget.h.

          DepthBuffer* Ogre::RenderTarget::mDepthBuffer [protected, inherited]

Definition at line 485 of file OgreRenderTarget.h.

          uint16 Ogre::RenderTarget::mDepthBufferPoolId [protected, inherited]

Definition at line 484 of file OgreRenderTarget.h.

          size_t Ogre::RenderTarget::mFrameCount [protected, inherited]

Definition at line 493 of file OgreRenderTarget.h.

          uint Ogre::RenderTarget::mFSAA [protected, inherited]

Definition at line 500 of file OgreRenderTarget.h.

          String Ogre::RenderTarget::mFSAAHint [protected, inherited]

Definition at line 501 of file OgreRenderTarget.h.

          unsigned int Ogre::RenderTarget::mHeight [protected, inherited]

Definition at line 482 of file OgreRenderTarget.h.

          bool Ogre::RenderTarget::mHwGamma [protected, inherited]

Definition at line 498 of file OgreRenderTarget.h.

          unsigned long Ogre::RenderTarget::mLastSecond [protected, inherited]

Definition at line 491 of file OgreRenderTarget.h.

          unsigned long Ogre::RenderTarget::mLastTime [protected, inherited]

Definition at line 492 of file OgreRenderTarget.h.

          RenderTargetListenerList Ogre::RenderTarget::mListeners [protected, inherited]

Definition at line 510 of file OgreRenderTarget.h.

          String Ogre::RenderTarget::mName [protected, inherited]

The name of this target.

Definition at line 477 of file OgreRenderTarget.h.

          uchar Ogre::RenderTarget::mPriority [protected, inherited]

The priority of the render target.

Definition at line 479 of file OgreRenderTarget.h.

          FrameStats Ogre::RenderTarget::mStats [protected, inherited]

Definition at line 488 of file OgreRenderTarget.h.

          Timer* Ogre::RenderTarget::mTimer [protected, inherited]

Definition at line 490 of file OgreRenderTarget.h.

          ViewportList Ogre::RenderTarget::mViewportList [protected, inherited]

List of viewports, map on Z-order.

Definition at line 507 of file OgreRenderTarget.h.

          unsigned int Ogre::RenderTarget::mWidth [protected, inherited]

Definition at line 481 of file OgreRenderTarget.h.

          size_t Ogre::RenderTexture::mZOffset [protected, inherited]

Definition at line 59 of file OgreRenderTexture.h.

The documentation for this class was generated from the following file:

OgreD3D9Texture.h

Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Last modified Sun Sep 2 2012 07:27:50


text:
package jef.net.ftpserver.ftplet;

/**
 * Type safe enum for describing the structure
 *
 * @author Apache MINA Project
 */
public enum Structure {

    /**
     * File structure
     */
    FILE;

    /**
     * Parses the argument value from the STRU command into the type safe class
     *
     * @param argument
     *            The argument value from the STRU command. Not case sensitive
     * @return The appropriate structure
     * @throws IllegalArgumentException
     *             If the structure is unknown
     */

    public static Structure parseArgument(char argument) {
        switch (argument) {
        case 'F':
        case 'f':
            return FILE;
        default:
            throw new IllegalArgumentException("Unknown structure: " + argument);
        }
    }
}


text:
//-----------------------------------------------------------------------
// <copyright file="NFCElement.cs">
//     Copyright (C) 2015-2015 lvsheng.huang <https://github.com/ketoo/NFrame>
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NFrame
{
	class NFCElement : NFIElement
	{
        public NFCElement()
        {
            mxPropertyManager = new NFCPropertyManager(new NFGUID());
        }

        public override NFIPropertyManager GetPropertyManager()
        {
            return mxPropertyManager;
        }

        public override Int64 QueryInt(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);
            if (null != xProperty)
            {
                return xProperty.QueryInt();
            }

            return 0;
        }

        public override float QueryFloat(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);
            if (null != xProperty)
            {
                return xProperty.QueryFloat();
            }

            return 0f;
        }

        public override double QueryDouble(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);
            if (null != xProperty)
            {
                return xProperty.QueryDouble();
            }

            return 0.0;
        }

        public override string QueryString(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);
            if (null != xProperty)
            {
                return xProperty.QueryString();
            }

            return NFIDataList.NULL_STRING;
        }

        public override NFGUID QueryObject(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);
            if (null != xProperty)
            {
                return xProperty.QueryObject();
            }

            return NFIDataList.NULL_OBJECT;
        }

        private NFIPropertyManager mxPropertyManager;
	}
}


text:
import { Metadata_artwork } from "v2/__generated__/Metadata_artwork.graphql"
import React from "react"
import { createFragmentContainer, graphql } from "react-relay"
import { DetailsFragmentContainer as Details } from "./Details"
import { Box, BoxProps, Link } from "@artsy/palette"

export interface MetadataProps extends BoxProps {
  artwork: Metadata_artwork
  extended?: boolean
  hidePartnerName?: boolean
  hideArtistName?: boolean
  hideSaleInfo?: boolean
  className?: string
}

export class Metadata extends React.Component<MetadataProps> {
  static defaultProps = {
    extended: true,
    mt: 1,
  }

  render() {
    const {
      artwork,
      className,
      extended,
      hidePartnerName,
      hideArtistName,
      hideSaleInfo,
      ...boxProps
    } = this.props

    return (
      <Link href={artwork.href} underlineBehavior="none">
        <Box textAlign="left" className={className} {...(boxProps as any)}>
          <Details
            includeLinks={false}
            artwork={artwork}
            hideSaleInfo={hideSaleInfo}
            hidePartnerName={hidePartnerName}
            hideArtistName={hideArtistName}
          />
        </Box>
      </Link>
    )
  }
}

export default createFragmentContainer(Metadata, {
  artwork: graphql`
    fragment Metadata_artwork on Artwork {
      ...Details_artwork
      ...Contact_artwork
      href
    }
  `,
})


text:
<?php

namespace Eddmash\PowerOrm\Console\Command;

use Eddmash\PowerOrm\BaseOrm;
use Eddmash\PowerOrm\Components\AppComponent;
use Eddmash\PowerOrm\Components\AppInterface;
use Eddmash\PowerOrm\Exception\CommandError;
use Eddmash\PowerOrm\Exception\ComponentException;
use Eddmash\PowerOrm\Helpers\FileHandler;
use Eddmash\PowerOrm\Migration\FormatFileContent;
use Eddmash\PowerOrm\Model\Model;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class MakeModel extends BaseCommand
{
    public $help = 'Generate a model class.';

    protected function configure()
    {
        $this->setName($this->guessCommandName())
            ->setDescription($this->help)
            ->setHelp($this->help)
            ->addArgument(
                'appname',
                InputArgument::REQUIRED,
                'The name application to which generated model will belong.'
            )
            ->addArgument(
                'modelname',
                InputArgument::REQUIRED,
                'The name of the model to generate.'
            )
            ->addOption(
                'extends',
                'e',
                InputOption::VALUE_OPTIONAL,
                'Model generated model will extend.in the form `appname:modelname` '.
                'e.g. app:user or school:teacher'
            )
            ->addOption(
                'force',
                'f',
                null,
                'force overwrite if model already exists.'
            );
    }

    /**@inheritdoc */
    public function handle(InputInterface $input, OutputInterface $output)
    {
        $appName = $input->getArgument('appname');
        $orginalModelName = $input->getArgument('modelname');
        $orginalModelName = $modelName = ucfirst($orginalModelName);
        $extends = $input->getOption('extends');
        $force = $input->getOption('force');

        $extendComponent = null;

        if (!$extends) {
            $extendNamespace = Model::class;
            $extendModelName = basename(str_replace('\\', '/', Model::class));
        } else {
            $extends = explode(':', $extends);
            if (1 == count($extends)) {
                throw new CommandError('extends should be in the form of `appname:modelname`'.
                    ' e.g. app:user or school:teacher');
            }
            /* @var $extendComponent AppComponent */
            list($extendAppName, $extendModelName) = $extends;
            try {
                $extendComponent = BaseOrm::getInstance()->getComponent($extendAppName);
                if (!$extendComponent instanceof AppInterface) {
                    throw new CommandError(
                        sprintf('%s does not implement AppInterface, it needs to be an AppComponent',
                            $extendAppName));
                }
            } catch (ComponentException $e) {
                throw new CommandError($e->getMessage());
            }
            $extendModelFolder = basename($extendComponent->getModelsPath());
            $extendNamespace = ltrim(sprintf("%s\%s", $extendComponent->getNamespace(), $extendModelFolder), '\\');
        }

        /* @var $component AppComponent */
        try {
            $component = BaseOrm::getInstance()->getComponent($appName);
            if (!$component instanceof AppInterface) {
                throw new CommandError(
                    sprintf('%s does not implement AppInterface, it needs to be an AppComponent',
                        $appName));
            }
        } catch (ComponentException $e) {
            throw new CommandError($e->getMessage());
        }

        $path = $component->getModelsPath();

        if (!file_exists($path)) {
            throw new CommandError(sprintf("directory '%s' does not exist", $path));
        }

        $modelFolder = basename($path);
        $namespace = ltrim(sprintf("%s\%s", $component->getNamespace(), $modelFolder), '\\');

        $modelFile = $this->getModelFile($namespace, $modelName, $extendNamespace, $extendModelName);

        $fileName = rtrim(sprintf('%s.php', $modelName), '\\');

        $filePath = realpath($path.DIRECTORY_SEPARATOR.$fileName);

        if (file_exists($filePath) && !$force) {
            throw new CommandError(sprintf("Models '%s' already exists, use -f option to overwrite", $filePath));
        }

        $handler = new FileHandler($path, $fileName);

        if ($handler->write($modelFile)) {
            $output->write(sprintf("Models '%s' created at '%s' ".PHP_EOL, $orginalModelName, $path));
        }
    }

    private function getModelFile($namespace, $modelName, $extendNamespace, $extendModel)
    {
        $extendNamespace = $extendNamespace === $namespace ? '' : $extendNamespace;
        $content = FormatFileContent::createObject();

        $content->addItem('<?php'.PHP_EOL);
        $content->addItem(PHP_EOL.sprintf(
                '/** Model file generated at %s on %s by PowerOrm(%s)*/',
                date('h:m:i'),
                date('D, jS F Y'),
                POWERORM_VERSION
            ).PHP_EOL);

        if ($namespace) {
            $content->addItem(sprintf('namespace %s;', $namespace).PHP_EOL);
        }

        if ($extendNamespace) {
            $content->addItem(sprintf('use %s;', $extendNamespace).PHP_EOL);
        }

        $content->addItem('/**');
        $content->addItem(sprintf('* Class %s', $modelName));
        $content->addItem('*/');
        $content->addItem(sprintf('class %s extends %s', ucfirst($modelName), ucfirst($extendModel)));
        $content->addItem('{');
        $content->addIndent();
        $content->addItem('public function unboundFields()');
        $content->addItem('{');

        $content->addIndent();
        $content->addItem('return [];');
        $content->reduceIndent();

        $content->addItem('}'.PHP_EOL);
        $content->reduceIndent();
        $content->addItem('}');

        return $content->toString();
    }
}


text:
set -e

npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist
echo "=> Prepare run app."

if [ -d /bundle ]; then
  echo "=> unzip /bundle."
  cd /bundle
  tar xzf *.tar.gz
  rm *.tar.gz
  cd /bundle/bundle/programs/server/
 # mkdir /bundle/bundle/programs/server/node_modules
  # mv /opt/node_modules_node-gyp /bundle/bundle/programs/server/node_modules/
  # fix cloneCurrentTree problem
  rm npm-shrinkwrap.json
  # echo "=> [zhaoic] fix fibers"
  # npm uninstall fibers
  # npm install fibers
  echo "=> npm install."
  npm install --unsafe-perm
  cd /bundle/bundle/
elif [[ $BUNDLE_URL ]]; then
  echo "=> unzip url bundle."
  cd /tmp
  curl -L -o bundle.tar.gz $BUNDLE_URL
  tar xzf bundle.tar.gz
  cd /tmp/bundle/programs/server/
  npm install --unsafe-perm
  cd /tmp/bundle/
elif [ -d /built_app ]; then
  echo "=> /bundle_app."
  cd /built_app
else
  echo "=> You don't have an meteor app to run in this image."
  exit 1
fi

if [[ $REBUILD_NPM_MODULES ]]; then
  if [ -f /opt/meteord/rebuild_npm_modules.sh ]; then
    echo "rebuild_npm_modules.sh."
    cd programs/server
    bash /opt/meteord/rebuild_npm_modules.sh
    cd ../../
  else
    echo "=> Use meteorhacks/meteord:bin-build for binary bulding."
    exit 1
  fi
fi

# Set a delay to wait to start meteor container
if [[ $DELAY ]]; then
  echo "Delaying startup for $DELAY seconds"
  sleep $DELAY
fi

# Honour already existing PORT setup
export PORT=${PORT:-80}

echo "=> Starting meteor app on port:$PORT"
node main.js


text:
<?php

//zend viewer http://devzone.zend.com/article/3412
class Zend_View_Helper_Voselector extends Zend_View_Helper_Abstract {

    //flush all messages pending to be displayed
    public function voselector($vo_id)
    {
        $out = "";
        $model = new VO();
        $vos = $model->fetchAll();
        $out .= "<select name=\"metadata_vo\" class=\"span12\">";
        $out .= "<option value=\"\">(not set)</option>";
        foreach($vos as $vo) {
            $key=$vo->id;
            $value=$vo->name;
            $selected = "";
            if($vo_id == $key) $selected = "selected=selected";
            $out .= "<option value=\"$key\" $selected>$value</option>";
        }
        $out .= "</select>";
        return $out;
    }
}


text:
Debug

       <form name="commandform">

CLIP API Debugger

URL:

            <input name="commandurl" type="text" size="60" value="http://<?= $_cfg["BridgeIP"] ."/api/".$_cfg["BridgeHash"]?>">

                <button type="button" onclick="getHTML('GET')">GET</button>
                <button type="button" onclick="getHTML('PUT')">PUT</button>
                <button type="button" onclick="getHTML('POST')">POST</button>
                <button type="button" onclick="getHTML('DELETE')">DELETE</button>

Message Body:

            <textarea name="messagebody" rows="10" cols="100"></textarea>

Command Response:

            <textarea name="response" rows="25" cols="100"></textarea>
        </form>


text:
package com.amazonaws.services.glue.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PutResourcePolicyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * Contains the policy document to set, in JSON format.
     *

     */
    private String policyInJson;
    /**
     *

     * The hash value returned when the previous policy was set using PutResourcePolicy. Its purpose is to
     * prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has been set.
     *

     */
    private String policyHashCondition;
    /**
     *

     * A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used to
     * create a new policy. If a value of NONE or a null value is used, the call will not depend on the
     * existence of a policy.
     *

     */
    private String policyExistsCondition;

    /**
     *

     * Contains the policy document to set, in JSON format.
     *

     *
     * @param policyInJson
     *        Contains the policy document to set, in JSON format.
     */

    public void setPolicyInJson(String policyInJson) {
        this.policyInJson = policyInJson;
    }

    /**
     *

     * Contains the policy document to set, in JSON format.
     *

     *
     * @return Contains the policy document to set, in JSON format.
     */

    public String getPolicyInJson() {
        return this.policyInJson;
    }

    /**
     *

     * Contains the policy document to set, in JSON format.
     *

     *
     * @param policyInJson
     *        Contains the policy document to set, in JSON format.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PutResourcePolicyRequest withPolicyInJson(String policyInJson) {
        setPolicyInJson(policyInJson);
        return this;
    }

    /**
     *

     * The hash value returned when the previous policy was set using PutResourcePolicy. Its purpose is to
     * prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has been set.
     *

     *
     * @param policyHashCondition
     *        The hash value returned when the previous policy was set using PutResourcePolicy. Its purpose
     *        is to prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has
     *        been set.
     */

    public void setPolicyHashCondition(String policyHashCondition) {
        this.policyHashCondition = policyHashCondition;
    }

    /**
     *

     * The hash value returned when the previous policy was set using PutResourcePolicy. Its purpose is to
     * prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has been set.
     *

     *
     * @return The hash value returned when the previous policy was set using PutResourcePolicy. Its
     *         purpose is to prevent concurrent modifications of a policy. Do not use this parameter if no previous
     *         policy has been set.
     */

    public String getPolicyHashCondition() {
        return this.policyHashCondition;
    }

    /**
     *

     * The hash value returned when the previous policy was set using PutResourcePolicy. Its purpose is to
     * prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has been set.
     *

     *
     * @param policyHashCondition
     *        The hash value returned when the previous policy was set using PutResourcePolicy. Its purpose
     *        is to prevent concurrent modifications of a policy. Do not use this parameter if no previous policy has
     *        been set.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PutResourcePolicyRequest withPolicyHashCondition(String policyHashCondition) {
        setPolicyHashCondition(policyHashCondition);
        return this;
    }

    /**
     *

     * A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used to
     * create a new policy. If a value of NONE or a null value is used, the call will not depend on the
     * existence of a policy.
     *

     *
     * @param policyExistsCondition
     *        A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used
     *        to create a new policy. If a value of NONE or a null value is used, the call will not depend
     *        on the existence of a policy.
     * @see ExistCondition
     */

    public void setPolicyExistsCondition(String policyExistsCondition) {
        this.policyExistsCondition = policyExistsCondition;
    }

    /**
     *

     * A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used to
     * create a new policy. If a value of NONE or a null value is used, the call will not depend on the
     * existence of a policy.
     *

     *
     * @return A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used
     *         to create a new policy. If a value of NONE or a null value is used, the call will not depend
     *         on the existence of a policy.
     * @see ExistCondition
     */

    public String getPolicyExistsCondition() {
        return this.policyExistsCondition;
    }

    /**
     *

     * A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used to
     * create a new policy. If a value of NONE or a null value is used, the call will not depend on the
     * existence of a policy.
     *

     *
     * @param policyExistsCondition
     *        A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used
     *        to create a new policy. If a value of NONE or a null value is used, the call will not depend
     *        on the existence of a policy.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ExistCondition
     */

    public PutResourcePolicyRequest withPolicyExistsCondition(String policyExistsCondition) {
        setPolicyExistsCondition(policyExistsCondition);
        return this;
    }

    /**
     *

     * A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used to
     * create a new policy. If a value of NONE or a null value is used, the call will not depend on the
     * existence of a policy.
     *

     *
     * @param policyExistsCondition
     *        A value of MUST_EXIST is used to update a policy. A value of NOT_EXIST is used
     *        to create a new policy. If a value of NONE or a null value is used, the call will not depend
     *        on the existence of a policy.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ExistCondition
     */

    public PutResourcePolicyRequest withPolicyExistsCondition(ExistCondition policyExistsCondition) {
        this.policyExistsCondition = policyExistsCondition.toString();
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getPolicyInJson() != null)
            sb.append("PolicyInJson: ").append(getPolicyInJson()).append(",");
        if (getPolicyHashCondition() != null)
            sb.append("PolicyHashCondition: ").append(getPolicyHashCondition()).append(",");
        if (getPolicyExistsCondition() != null)
            sb.append("PolicyExistsCondition: ").append(getPolicyExistsCondition());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof PutResourcePolicyRequest == false)
            return false;
        PutResourcePolicyRequest other = (PutResourcePolicyRequest) obj;
        if (other.getPolicyInJson() == null ^ this.getPolicyInJson() == null)
            return false;
        if (other.getPolicyInJson() != null && other.getPolicyInJson().equals(this.getPolicyInJson()) == false)
            return false;
        if (other.getPolicyHashCondition() == null ^ this.getPolicyHashCondition() == null)
            return false;
        if (other.getPolicyHashCondition() != null && other.getPolicyHashCondition().equals(this.getPolicyHashCondition()) == false)
            return false;
        if (other.getPolicyExistsCondition() == null ^ this.getPolicyExistsCondition() == null)
            return false;
        if (other.getPolicyExistsCondition() != null && other.getPolicyExistsCondition().equals(this.getPolicyExistsCondition()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getPolicyInJson() == null) ? 0 : getPolicyInJson().hashCode());
        hashCode = prime * hashCode + ((getPolicyHashCondition() == null) ? 0 : getPolicyHashCondition().hashCode());
        hashCode = prime * hashCode + ((getPolicyExistsCondition() == null) ? 0 : getPolicyExistsCondition().hashCode());
        return hashCode;
    }

    @Override
    public PutResourcePolicyRequest clone() {
        return (PutResourcePolicyRequest) super.clone();
    }

}


text:
#include "redblack.h"
#include <stdlib.h>
#include "fatal.h"

/* START: fig12_14.txt */
        typedef enum ColorType { Red, Black } ColorType;

        struct RedBlackNode
        {
            ElementType  Element;
            RedBlackTree Left;
            RedBlackTree Right;
            ColorType    Color;
        };

        static Position NullNode = NULL;  /* Needs initialization */

        /* Initialization procedure */
        RedBlackTree
        Initialize( void )
        {
            RedBlackTree T;

            if( NullNode == NULL )
            {
                NullNode = malloc( sizeof( struct RedBlackNode ) );
                if( NullNode == NULL )
                    FatalError( "Out of space!!!" );
                NullNode->Left = NullNode->Right = NullNode;
                NullNode->Color = Black;
                NullNode->Element = 12345;
            }

            /* Create the header node */
            T = malloc( sizeof( struct RedBlackNode ) );
            if( T == NULL )
                FatalError( "Out of space!!!" );
            T->Element = NegInfinity;
            T->Left = T->Right = NullNode;
            T->Color = Black;

            return T;
        }
/* END */

        void
        Output( ElementType Element )
        {
            printf( "%d\n", Element );
        }

/* START: fig12_13.txt */
        /* Print the tree, watch out for NullNode, */
        /* and skip header */

        static void
        DoPrint( RedBlackTree T )
        {
            if( T != NullNode )
            {
                DoPrint( T->Left );
                Output( T->Element );
                DoPrint( T->Right );
            }
        }

        void
        PrintTree( RedBlackTree T )
        {
            DoPrint( T->Right );
        }
/* END */

        static RedBlackTree
        MakeEmptyRec( RedBlackTree T )
        {
            if( T != NullNode )
            {
                MakeEmptyRec( T->Left );
                MakeEmptyRec( T->Right );
                free( T );
            }
            return NullNode;
        }

        RedBlackTree
        MakeEmpty( RedBlackTree T )
        {
            T->Right = MakeEmptyRec( T->Right );
            return T;
        }

        Position
        Find( ElementType X, RedBlackTree T )
        {
            if( T == NullNode )
                return NullNode;
            if( X < T->Element )
                return Find( X, T->Left );
            else
            if( X > T->Element )
                return Find( X, T->Right );
            else
                return T;
        }

        Position
        FindMin( RedBlackTree T )
        {
            T = T->Right;
            while( T->Left != NullNode )
                T = T->Left;

            return T;
        }

        Position
        FindMax( RedBlackTree T )
        {
            while( T->Right != NullNode )
                T = T->Right;

            return T;
        }

        /* This function can be called only if K2 has a left child */
        /* Perform a rotate between a node (K2) and its left child */
        /* Update heights, then return new root */

        static Position
        SingleRotateWithLeft( Position K2 )
        {
            Position K1;

            K1 = K2->Left;
            K2->Left = K1->Right;
            K1->Right = K2;

            return K1;  /* New root */
        }

        /* This function can be called only if K1 has a right child */
        /* Perform a rotate between a node (K1) and its right child */
        /* Update heights, then return new root */

        static Position
        SingleRotateWithRight( Position K1 )
        {
            Position K2;

            K2 = K1->Right;
            K1->Right = K2->Left;
            K2->Left = K1;

            return K2;  /* New root */
        }

/* START: fig12_15.txt */
        /* Perform a rotation at node X */
        /* (whose parent is passed as a parameter) */
        /* The child is deduced by examining Item */

        static Position
        Rotate( ElementType Item, Position Parent )
        {

            if( Item < Parent->Element )
                return Parent->Left = Item < Parent->Left->Element ?
                    SingleRotateWithLeft( Parent->Left ) :
                    SingleRotateWithRight( Parent->Left );
            else
                return Parent->Right = Item < Parent->Right->Element ?
                    SingleRotateWithLeft( Parent->Right ) :
                    SingleRotateWithRight( Parent->Right );
        }
/* END */

/* START: fig12_16.txt */
        static Position X, P, GP, GGP;

        static
        void HandleReorient( ElementType Item, RedBlackTree T )
        {
            X->Color = Red;        /* Do the color flip */
            X->Left->Color = Black;
            X->Right->Color = Black;

            if( P->Color == Red )  /* Have to rotate */
            {
                GP->Color = Red;
                if( (Item < GP->Element) != (Item < P->Element) )
                    P = Rotate( Item, GP );  /* Start double rotate */
                X = Rotate( Item, GGP );
                X->Color = Black;
            }
            T->Right->Color = Black;  /* Make root black */
        }

        RedBlackTree
        Insert( ElementType Item, RedBlackTree T )
        {
            X = P = GP = T;
            NullNode->Element = Item;
            while( X->Element != Item )  /* Descend down the tree */
            {
                GGP = GP; GP = P; P = X;
                if( Item < X->Element )
                    X = X->Left;
                else
                    X = X->Right;
                if( X->Left->Color == Red && X->Right->Color == Red )
                    HandleReorient( Item, T );
            }

            if( X != NullNode )
                return NullNode;  /* Duplicate */

            X = malloc( sizeof( struct RedBlackNode ) );
            if( X == NULL )
                FatalError( "Out of space!!!" );
            X->Element = Item;
            X->Left = X->Right = NullNode;

            if( Item < P->Element )  /* Attach to its parent */
                P->Left = X;
            else
                P->Right = X;
            HandleReorient( Item, T ); /* Color it red; maybe rotate */

            return T;
        }
/* END */

        RedBlackTree
        Remove( ElementType Item, RedBlackTree T )
        {
            printf( "Remove is unimplemented\n" );
            if( Item )
                return T;
            return T;
        }

        ElementType
        Retrieve( Position P )
        {
            return P->Element;
        }


text:
namespace omaha {

namespace {

const CString kPv = _T("1.3.99.0");
const CString kLang = _T("en");
const CString kBrandCode = _T("GOOG");
const CString kClientId = _T("testclientid");
const CString kIid = _T("{7C0B6E56-B24B-436b-A960-A6EA201E886D}");

}  // namespace

class PingEventDownloadMetricsTest : public testing::Test {
 protected:
  void SetUpRegistry() {
    const TCHAR* const kOmahaUserClientStatePath =
        _T("HKCU\\Software\\") PATH_COMPANY_NAME
        _T("\\") PRODUCT_NAME
        _T("\\ClientState\\") GOOPDATE_APP_ID;

    RegKey::DeleteKey(kOmahaUserClientStatePath);
    EXPECT_HRESULT_SUCCEEDED(RegKey::SetValue(kOmahaUserClientStatePath,
                                              kRegValueProductVersion,
                                              kPv));
    EXPECT_HRESULT_SUCCEEDED(RegKey::SetValue(kOmahaUserClientStatePath,
                                              kRegValueLanguage,
                                              kLang));
    EXPECT_HRESULT_SUCCEEDED(RegKey::SetValue(kOmahaUserClientStatePath,
                                              kRegValueBrandCode,
                                              kBrandCode));
    EXPECT_HRESULT_SUCCEEDED(RegKey::SetValue(kOmahaUserClientStatePath,
                                              kRegValueClientId,
                                              kClientId));
    EXPECT_HRESULT_SUCCEEDED(RegKey::SetValue(kOmahaUserClientStatePath,
                                              kRegValueInstallationId,
                                              kIid));
  }
};

TEST_F(PingEventDownloadMetricsTest, BuildPing) {
  SetUpRegistry();

  DownloadMetrics download_metrics;
  download_metrics.url = _T("http:\\\\host\\path");
  download_metrics.downloader = DownloadMetrics::kWinHttp;
  download_metrics.error = 5;
  download_metrics.downloaded_bytes = 10;
  download_metrics.total_bytes = 0x100000000;
  download_metrics.download_time_ms = 1000;

  PingEventPtr ping_event(
      new PingEventDownloadMetrics(true,
                                   PingEvent::EVENT_RESULT_ERROR,
                                   download_metrics));

  Ping ping(false, _T("unittest"), _T("InstallSource_Foo"));
  std::vector<CString> apps;
  apps.push_back(GOOPDATE_APP_ID);
  ping.LoadAppDataFromRegistry(apps);
  ping.BuildAppsPing(ping_event);

  CString expected_ping_request_substring;
  expected_ping_request_substring =
      _T("<app appid=\"") GOOPDATE_APP_ID _T("\" ")
      _T("version=\"1.3.99.0\" nextversion=\"\" lang=\"en\" brand=\"GOOG\" ")
      _T("client=\"testclientid\" ")
      _T("iid=\"{7C0B6E56-B24B-436b-A960-A6EA201E886D}\">")
      _T("<event eventtype=\"14\" eventresult=\"0\" errorcode=\"5\" ")
      _T("extracode1=\"0\" downloader=\"winhttp\" url=\"http:\\\\host\\path\" ")
      _T("downloaded=\"10\" total=\"4294967296\" download_time_ms=\"1000\"/>")
      _T("</app>");

  CString actual_ping_request;
  ping.BuildRequestString(&actual_ping_request);
  EXPECT_NE(-1, actual_ping_request.Find(expected_ping_request_substring))
    << actual_ping_request.GetString()
    << _T("\n\r\n\r")
    << expected_ping_request_substring.GetString();
}

}  // namespace omaha


text:
package org.spongepowered.common.mixin.core.item.inventory;

import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.item.ItemStack;
import org.spongepowered.api.event.item.inventory.InteractInventoryEvent;
import org.spongepowered.api.item.inventory.Carrier;
import org.spongepowered.api.item.inventory.Inventory;
import org.spongepowered.api.item.inventory.InventoryArchetype;
import org.spongepowered.api.item.inventory.InventoryProperty;
import org.spongepowered.api.item.inventory.type.CarriedInventory;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.common.item.inventory.adapter.impl.MinecraftInventoryAdapter;
import org.spongepowered.common.item.inventory.custom.CustomInventory;
import org.spongepowered.common.item.inventory.custom.CustomLens;
import org.spongepowered.common.item.inventory.lens.Fabric;
import org.spongepowered.common.item.inventory.lens.Lens;
import org.spongepowered.common.item.inventory.lens.impl.MinecraftFabric;
import org.spongepowered.common.item.inventory.lens.impl.collections.SlotCollection;
import org.spongepowered.common.item.inventory.observer.InventoryEventArgs;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;

@Mixin(CustomInventory.class)
public abstract class MixinCustomInventory implements MinecraftInventoryAdapter, Inventory, CarriedInventory<Carrier> {

    @Shadow(remap = false) private InventoryArchetype archetype;
    @Shadow(remap = false) public InventoryBasic inv;
    @Shadow(remap = false) public Carrier carrier;

    private Fabric<IInventory> inventory;
    private SlotCollection slots;
    private CustomLens lens;

    @Inject(method = "<init>*", at = @At("RETURN"), remap = false)
    private void onConstructed(InventoryArchetype archetype, Map<String, InventoryProperty<?, ?>> properties, Carrier carrier, Map<Class<? extends
            InteractInventoryEvent>, List<Consumer<? extends InteractInventoryEvent>>> listeners, Object plugin, CallbackInfo ci) {
        this.inventory = MinecraftFabric.of(this);
        this.slots = new SlotCollection.Builder().add(this.inv.getSizeInventory()).build();
        this.lens = new CustomLens(this, this.slots, archetype, properties);
    }

    @Override
    public Lens<IInventory, ItemStack> getRootLens() {
        return this.lens;
    }

    @Override
    public Fabric<IInventory> getInventory() {
        return this.inventory;
    }

    @Override
    public Inventory getChild(Lens<IInventory, ItemStack> lens) {
        return null; // TODO ?
    }

    @Override
    public void notify(Object source, InventoryEventArgs eventArgs) {
    }

    @Override
    public InventoryArchetype getArchetype() {
        return this.archetype;
    }

    @Override
    public Optional<Carrier> getCarrier() {
        return Optional.ofNullable(this.carrier);
    }
}


text:
package com.anguo.web.controller;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import com.anguo.util.AnguoFileUtils;

/**
 * 上传文件
 * @author Andrew.Wen
 *
 */
@Controller
@RequestMapping(value = "/toFileUpload")
public class FileUploadController  {

	private Logger logger = LoggerFactory.getLogger(FileUploadController.class);

	    /**
		 * 文件批量上传
		 */
		@RequestMapping(value={"/{projectPath}/toMultiUpload.htm"})
		@ResponseBody
		public void FileUploadify(@PathVariable("projectPath") String projectPath,HttpServletRequest request,
				HttpServletResponse response)
				throws ServletException, IOException {

			String clientName ="";
			String serverName ="";

			/**
			 * 返回json字符串
			 */
			String returnJson="[";

			// 设置接收的编码格式
			request.setCharacterEncoding("UTF-8");

			//设置文件保存路径
			String path = request.getSession().getServletContext().getRealPath("")+File.separator+"resources/images/";

			//判断项目路径,如果不存在则新建
			if(!StringUtils.isEmpty(projectPath))
			{
				path=path+projectPath+"/";

				File pathFile=new File(path);
				if(!pathFile.exists())
				{
					pathFile.mkdirs();
				}
			}

			try {
				if (request instanceof MultipartHttpServletRequest) {
					MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;

					Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();

					//System.out.println("===========================================");
					for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {

						MultipartFile multiparfile = entity.getValue();
						//String fileName = mf.getOriginalFilename();

						clientName = multiparfile.getOriginalFilename(); // 获得文件:

						if (!clientName.equals("")) {

						serverName = AnguoFileUtils.getRandomFileName() + "."+AnguoFileUtils.getFileExt(clientName);

						AnguoFileUtils.SaveFileFromInputStream(multiparfile.getInputStream(),serverName, path);

						}

						returnJson+="{\"client\":\"" + clientName + "\",\"server\":\""+ projectPath+"/"+serverName + "\"},";

						//System.out.println(fileName);

					}
					//System.out.println("===========================================");
					//List<MultipartFile> files = multipartRequest.getFiles("file");

					//遍历文件
//					for(MultipartFile multiparfile:files)
//					{
//
//
//
//
//					}

					if(returnJson.length()>1)returnJson=returnJson.substring(0, returnJson.length()-1);

					returnJson+="]";

				}
			} catch (Exception e) {
				logger.error("上传文件失败,因为:" + e.getMessage());
				e.printStackTrace();
			}
			//response.setCharacterEncoding("UTF-8");

			response.setContentType("text/html;charset=gb2312");
			response.setCharacterEncoding("gb2312");
			response.getWriter().write(returnJson);

		}

}


text:
class Lsi
  class List
    def initialize(path:, list_command:)
      @path = path
      @list_command = list_command
    end

    attr_reader :path, :list_command

    def items
      if list_command
        stdout, stderr, status = Open3.capture3(list_command)

        if status.success?
          stdout.split("\n")
        end
      else
        directory_listing
      end
    end

    def item_human_name(item)
      if list_command
        item
      else
        File.basename(item)
      end
    end

    def directory_listing
      Dir["#{path || Dir.pwd}/*"]
    end
  end
end