text:
package org.apache.beam.sdk.io;

import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.sdk.runners.DataflowPipelineRunner;
import org.apache.beam.sdk.testing.TestDataflowPipelineOptions;
import org.apache.beam.sdk.util.GcsUtil;
import org.apache.beam.sdk.util.TestCredential;
import org.apache.beam.sdk.util.gcsfs.GcsPath;

import com.google.common.collect.ImmutableList;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.channels.SeekableByteChannel;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.List;

/**
 * {@link DataflowPipelineRunner} specific tests for TextIO Read and Write transforms.
 */
@RunWith(JUnit4.class)
public class DataflowTextIOTest {

  private TestDataflowPipelineOptions buildTestPipelineOptions() {
    TestDataflowPipelineOptions options =
        PipelineOptionsFactory.as(TestDataflowPipelineOptions.class);
    options.setGcpCredential(new TestCredential());
    return options;
  }

  private GcsUtil buildMockGcsUtil() throws IOException {
    GcsUtil mockGcsUtil = Mockito.mock(GcsUtil.class);

    // Any request to open gets a new bogus channel
    Mockito
        .when(mockGcsUtil.open(Mockito.any(GcsPath.class)))
        .then(new Answer<SeekableByteChannel>() {
          @Override
          public SeekableByteChannel answer(InvocationOnMock invocation) throws Throwable {
            return FileChannel.open(
                Files.createTempFile("channel-", ".tmp"),
                StandardOpenOption.CREATE, StandardOpenOption.DELETE_ON_CLOSE);
          }
        });

    // Any request for expansion returns a list containing the original GcsPath
    // This is required to pass validation that occurs in TextIO during apply()
    Mockito
        .when(mockGcsUtil.expand(Mockito.any(GcsPath.class)))
        .then(new Answer<List<GcsPath>>() {
          @Override
          public List<GcsPath> answer(InvocationOnMock invocation) throws Throwable {
            return ImmutableList.of((GcsPath) invocation.getArguments()[0]);
          }
        });

    return mockGcsUtil;
  }

  /**
   * This tests a few corner cases that should not crash.
   */
  @Test
  public void testGoodWildcards() throws Exception {
    TestDataflowPipelineOptions options = buildTestPipelineOptions();
    options.setGcsUtil(buildMockGcsUtil());

    Pipeline pipeline = Pipeline.create(options);

    applyRead(pipeline, "gs://bucket/foo");
    applyRead(pipeline, "gs://bucket/foo/");
    applyRead(pipeline, "gs://bucket/foo/*");
    applyRead(pipeline, "gs://bucket/foo/?");
    applyRead(pipeline, "gs://bucket/foo/[0-9]");
    applyRead(pipeline, "gs://bucket/foo/*baz*");
    applyRead(pipeline, "gs://bucket/foo/*baz?");
    applyRead(pipeline, "gs://bucket/foo/[0-9]baz?");
    applyRead(pipeline, "gs://bucket/foo/baz/*");
    applyRead(pipeline, "gs://bucket/foo/baz/*wonka*");
    applyRead(pipeline, "gs://bucket/foo/*baz/wonka*");
    applyRead(pipeline, "gs://bucket/foo*/baz");
    applyRead(pipeline, "gs://bucket/foo?/baz");
    applyRead(pipeline, "gs://bucket/foo[0-9]/baz");

    // Check that running doesn't fail.
    pipeline.run();
  }

  private void applyRead(Pipeline pipeline, String path) {
    pipeline.apply("Read(" + path + ")", TextIO.Read.from(path));
  }
}


text:
<?php

namespace Widop\Twitter\Options;

/**
 * Option bag.
 *
 * @author GeLo <geloen.eric@gmail.com>
 */
class OptionBag implements \ArrayAccess, \IteratorAggregate
{
    /** @var \Widop\Twitter\Options\OptionFactory */
    private $factory;

    /** @var array */
    private $options;

    /**
     * Creates an option bag.
     *
     * @param \Widop\Twitter\Options\OptionFactory|null $factory The option factory.
     */
    public function __construct(OptionFactory $factory = null)
    {
        $this->factory = $factory ?: new OptionFactory();
        $this->options = array();
    }

    /**
     * Registers an option.
     *
     * @param string|\Widop\Twitter\Options\OptionInterface $option The option.
     * @param string                                        $type   The option type.
     *
     * @throws \InvalidArgumentException If the option is not valid.
     *
     * @return \Widop\Twitter\Options\OptionBag The option bag.
     */
    public function register($option, $type = OptionInterface::TYPE_GET)
    {
        if (is_string($option)) {
            $option = $this->factory->create($option, $type);
        }

        if (!$option instanceof OptionInterface) {
            throw new \InvalidArgumentException(
                'The option should be either a string or a "Widop\Twitter\Options\OptionInterface".'
            );
        }

        $this->options[$option->getName()] = $option;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function offsetExists($offset)
    {
        return $this->getOption($offset)->hasValue();
    }

    /**
     * {@inheritdoc}
     */
    public function offsetGet($offset)
    {
        return $this->getOption($offset)->getValue();
    }

    /**
     * {@inheritdoc}
     */
    public function offsetSet($offset, $value)
    {
        $this->getOption($offset)->setValue($value);
    }

    /**
     * {@inheritdoc}
     */
    public function offsetUnset($offset)
    {
        $this->offsetSet($offset, null);
    }

    /**
     * {@inheritdoc}
     */
    public function getIterator()
    {
        return new \ArrayIterator($this->options);
    }

    /**
     * Gets an option.
     *
     * @param string $name The option name.
     *
     * @throws \InvalidArgumentException If the option does not exist.
     *
     * @return \Widop\Twitter\Options\OptionInterface The option.
     */
    private function getOption($name)
    {
        if (!isset($this->options[$name])) {
            throw new \InvalidArgumentException(sprintf('The option "%s" does not exist.', $name));
        }

        return $this->options[$name];
    }
}

redpajama_set_name: RedPajamaGithub


text:
/

#include "IFXSceneGraphPCH.h"
#include "CIFXSceneGraph.h"
#include "IFXCoreServices.h"
#include "CIFXNode.h"
#include "CIFXLight.h"
#include "CIFXModel.h"
#include "IFXTextureObject.h"
#include "IFXMaterialResource.h"
#include "IFXMotionResource.h"
#include "IFXShaderLitTexture.h"
#include "IFXMixerConstruct.h"
#include "IFXRenderingCIDs.h"
#include "IFXScheduler.h"
#include "IFXAuthorCLODResource.h"
#include "IFXAuthorCLODMesh.h"

//#define USE_REF_COUNT_CHECK // Testing remote change conflicts...
#ifdef USE_REF_COUNT_CHECK

class CRefCounter
{
public:
	// IFXNameMap methods
	virtual U32	AddRef( void );
	virtual U32 Release( void );

public:
	CRefCounter();
	virtual ~CRefCounter();

private:
	U32				m_uRefCount;
};

static CRefCounter RefCounter;
CRefCounter::CRefCounter( )
{
	m_uRefCount = 0;
}

CRefCounter::~CRefCounter( )
{
//	Make sure we left in a clean state
	IFXASSERT( 0 == m_uRefCount );
} // CRefCounter::~CRefCounter

U32 CRefCounter::AddRef()
{

	return ++m_uRefCount;
}

U32 CRefCounter::Release()
{

	return --m_uRefCount;
}

#endif

CIFXSceneGraph::CIFXSceneGraph()
{

#ifdef USE_REF_COUNT_CHECK

	RefCounter.AddRef();

#endif

	// IFXUnknown attributes...
	m_uRefCount = 0;

	// IFXMarker attributes...
	m_uRunningMarker = 1;
	m_uMark = 0;
	m_uPriority = 256;
	m_uUserData = 0;

	// IFXSceneGraph attributes...
	m_bInitialized = FALSE;
	m_uDebugFlags = 0;

	m_pCS = NULL;
	U32 uPaletteIndex=0;
	for (uPaletteIndex=0; uPaletteIndex < NUMBER_OF_PALETTES; uPaletteIndex++)
		m_pPalettes[uPaletteIndex] = NULL;

	m_bAnimationEnabledState = TRUE;

	m_pClockSubject = NULL;
}

CIFXSceneGraph::~CIFXSceneGraph()
{

#ifdef USE_REF_COUNT_CHECK

	RefCounter.Release();

#endif

	// Release the palettes
	U32 uPaletteIndex = 0;
	for (; uPaletteIndex < NUMBER_OF_PALETTES; uPaletteIndex++)
		if (m_pPalettes[uPaletteIndex])
			m_pPalettes[uPaletteIndex]->Release();

	IFXRELEASE( m_pCS );
	IFXRELEASE( m_pClockSubject );
}

IFXRESULT CIFXSceneGraph::GetSimClockSubject(IFXSubject** ppOutClockSubject)
{
	if (m_pClockSubject)
	{
		m_pClockSubject->AddRef();
	}
	*ppOutClockSubject = m_pClockSubject;

	return IFX_OK;
}

#if 0
IFXRESULT CIFXSceneGraph::SetSimClockSubject(IFXSubject* pInClockSubject)
{
	IFXRELEASE( m_pClockSubject );
	m_pClockSubject = pInClockSubject;

	if (m_pClockSubject)
	{
		m_pClockSubject->AddRef();
	}

	return IFX_OK;
}
#endif

IFXRESULT CIFXSceneGraph::GetCoreServices(IFXCoreServices **ppCS)
{
	IFXRESULT rc = IFX_OK;
	if (!ppCS)
		rc = IFX_E_INVALID_POINTER;
	else if (!m_pCS)
		rc = IFX_E_NOT_INITIALIZED;
	else
	{
		*ppCS = m_pCS; // copy CoreServices ptr
		m_pCS->AddRef();
	}

	IFXRETURN(rc);
}

IFXRESULT CIFXSceneGraph::Initialize(IFXCoreServices *pCS)
{
	IFXRESULT result = IFX_OK;

	// store a copy of the core services ptr
	if(NULL != pCS)
	{
		IFXRELEASE(m_pCS);
		m_pCS = pCS;
		m_pCS->AddRef();
	}

	IFXScheduler *pScheduler = NULL;
	m_pCS->GetScheduler( IID_IFXScheduler, (void**)&pScheduler);

	if (pScheduler != NULL) {
		IFXSimulationManager *pSimMgr = NULL;
		pScheduler->GetSimulationManager( &pSimMgr );
		IFXASSERT( pSimMgr );
		IFXRELEASE( pScheduler );

		IFXClock *pClock = NULL;
		pSimMgr->GetClock( &pClock );
		IFXASSERT( pClock );
		IFXRELEASE( pSimMgr );

		IFXRELEASE( m_pClockSubject );
		pClock->QueryInterface( IID_IFXSubject, (void**)&m_pClockSubject );
		IFXASSERT( m_pClockSubject );
		IFXRELEASE( pClock );
	}

	U32 uPaletteIndex = 0;
	for (; uPaletteIndex < NUMBER_OF_PALETTES; uPaletteIndex++)
	{
		IFXRELEASE(m_pPalettes[uPaletteIndex]);
		result = IFXCreateComponent( CID_IFXPalette,
		                             IID_IFXPalette,
		                             (void**)&(m_pPalettes[uPaletteIndex]) );
		if (IFXFAILURE(result))
		{
			break;
		}

		result = m_pPalettes[uPaletteIndex]->Initialize(10);
		if (IFXFAILURE(result))
		{
			break;
		}
	}

	// Create the default palette entries at palette ID = 0
	IFXUnknown* pUnknown = NULL;
	IFXModifier* pMod2 = NULL;
	IFXString defaultName;

	defaultName.Assign( PALETTE_DEFAULT_MATERIAL );
	m_pPalettes[MATERIAL]->SetDefault( &defaultName );
	IFXCreateComponent( CID_IFXMaterialResource,
						IID_IFXUnknown,
						(void**)&pUnknown);
	IFXMaterialResource* pMaterialResource = NULL;
	pUnknown->QueryInterface( IID_IFXMaterialResource,
		(void**)&pMaterialResource );
	pMaterialResource->SetSceneGraph( (IFXSceneGraph*)this );
	IFXRELEASE( pMaterialResource );
	m_pPalettes[MATERIAL]->SetDefaultResourcePtr(pUnknown);
	IFXRELEASE( pUnknown );

	defaultName.Assign( PALETTE_DEFAULT_MODEL );
	m_pPalettes[GENERATOR]->SetDefault( &defaultName );
	IFXCreateComponent( CID_IFXAuthorCLODResource,
						IID_IFXModifier,
						(void**)&pMod2);
	IFXAuthorCLODResource* pAuthorCLODResource = NULL;
	pMod2->QueryInterface( IID_IFXAuthorCLODResource,
		(void**)&pAuthorCLODResource );
	pAuthorCLODResource->SetSceneGraph( (IFXSceneGraph*)this );
	IFXAuthorCLODMesh* pMesh = NULL;
	IFXCreateComponent( CID_IFXAuthorMesh,
						IID_IFXAuthorCLODMesh,
						(void**)&pMesh);
	pAuthorCLODResource->SetAuthorMesh( pMesh );
	IFXRELEASE( pMesh );
	IFXRELEASE(pAuthorCLODResource);

	// add the plane to the Palette
	m_pPalettes[GENERATOR]->SetDefaultResourcePtr(pMod2);
	IFXRELEASE( pMod2 );

	defaultName.Assign( PALETTE_DEFAULT_SHADER );
	m_pPalettes[SHADER]->SetDefault( &defaultName );
	IFXCreateComponent( CID_IFXShaderLitTexture,
						IID_IFXUnknown,
						(void**)&pUnknown );
	{
		IFXShaderLitTexture* pShaderLitTexture = NULL;
		pUnknown->QueryInterface( IID_IFXShaderLitTexture,
								  (void**)&pShaderLitTexture );
		pShaderLitTexture->SetSceneGraph( (IFXSceneGraph*)this );
		IFXRELEASE( pShaderLitTexture );
	}
	m_pPalettes[SHADER]->SetDefaultResourcePtr(pUnknown);
	IFXRELEASE( pUnknown );

	//* MotionResource pallete
	defaultName.Assign( PALETTE_DEFAULT_IFX_MOTION );
	m_pPalettes[MOTION]->SetDefault( &defaultName );
	IFXCreateComponent( CID_IFXMotionResource,
						IID_IFXUnknown,
						(void**)&pUnknown);
	{
		IFXMotionResource* pMotionResource = NULL;
		pUnknown->QueryInterface( IID_IFXMotionResource,
								  (void**)&pMotionResource );
		pMotionResource->SetSceneGraph((IFXSceneGraph*)this);
		pMotionResource->GetMotionRef()->SetName(L"DefaultMotion");
		IFXRELEASE(pMotionResource);
	}
	m_pPalettes[MOTION]->SetDefaultResourcePtr(pUnknown);
	IFXRELEASE( pUnknown );

	//* MotionConstruct pallete
	defaultName.Assign( PALETTE_DEFAULT_MOTION );
	m_pPalettes[MIXER]->SetDefault( &defaultName );
	IFXCreateComponent( CID_IFXMixerConstruct,
						IID_IFXUnknown,
						(void**)&pUnknown);
	{
		IFXMixerConstruct* pMixer = NULL;
		pUnknown->QueryInterface( IID_IFXMixerConstruct,
								  (void**)&pMixer );
		pMixer->SetSceneGraph((IFXSceneGraph*)this);
		IFXRELEASE(pMixer);
	}
	m_pPalettes[MIXER]->SetDefaultResourcePtr(pUnknown);
	IFXRELEASE(pUnknown);

	// Create default texture
	defaultName.Assign( PALETTE_DEFAULT_TEXTURE );
	m_pPalettes[TEXTURE]->SetDefault( &defaultName );

	IFXTextureObject* pTextureObject = NULL;

	IFXCreateComponent( CID_IFXTextureObject,
						IID_IFXTextureObject,
						(void**)&pTextureObject );

	IFXASSERT(pTextureObject);
	pTextureObject->SetSceneGraph((IFXSceneGraph*)this);
	pTextureObject->SetDefaultTexture();
	pTextureObject->QueryInterface( IID_IFXUnknown, (void**)&pUnknown );
	m_pPalettes[TEXTURE]->SetDefaultResourcePtr(pUnknown);
	IFXRELEASE(pUnknown);
	IFXRELEASE(pTextureObject);

	// Create the world group
	defaultName.Assign( PALETTE_DEFAULT_GROUP );
	m_pPalettes[NODE]->SetDefault( &defaultName );
	IFXCreateComponent(CID_IFXGroup, IID_IFXUnknown, (void**)&pUnknown);
	pUnknown->QueryInterface(IID_IFXModifier, (void**)&pMod2);
	pMod2->SetSceneGraph( (IFXSceneGraph*)this );
	m_pPalettes[NODE]->SetDefaultResourcePtr(pUnknown);
	IFXRELEASE( pMod2 );
	IFXRELEASE( pUnknown );

	// set default light resource
	defaultName.Assign( PALETTE_DEFAULT_LIGHT );
	m_pPalettes[LIGHT]->SetDefault( &defaultName );
	IFXCreateComponent( CID_IFXLightResource,
            IID_IFXUnknown,
            (void**)&pUnknown);
    {
        IFXLightResource* pLightResource = NULL;
		pUnknown->QueryInterface( IID_IFXLightResource,
                (void**)&pLightResource );
		pLightResource->SetSceneGraph((IFXSceneGraph*)this);
		IFXRELEASE(pLightResource);
	}

	m_pPalettes[LIGHT]->SetDefaultResourcePtr(pUnknown);
	IFXRELEASE( pUnknown );

	// set default view resource
	defaultName.Assign( PALETTE_DEFAULT_CAMERA );
	m_pPalettes[VIEW]->SetDefault( &defaultName );
	IFXCreateComponent( CID_IFXViewResource,
            IID_IFXUnknown,
            (void**)&pUnknown);
	{
		IFXDECLARELOCAL(IFXViewResource,pViewResource);

		pUnknown->QueryInterface( IID_IFXViewResource,
                (void**)&pViewResource );
		pViewResource->SetSceneGraph((IFXSceneGraph*)this);
		pViewResource->SetNumRenderPasses( 1 );
		pViewResource->SetRootNode( 0, 0 );
	}

	m_pPalettes[VIEW]->SetDefaultResourcePtr(pUnknown);
	IFXRELEASE( pUnknown );

	if ( IFXSUCCESS( result ) )
		m_bInitialized = TRUE;

	return result;
} // CIFXSceneGraph::Initialize(IFXCoreServices *pCS)

IFXRESULT IFXAPI_CALLTYPE CIFXSceneGraph_Factory(IFXREFIID riid, void **ppv)
{
	IFXRESULT result;

	if ( ppv )
	{
		// Create the CIFXClassName component.
		CIFXSceneGraph *pSceneGraph = new CIFXSceneGraph();

		if ( pSceneGraph )
		{
			// Perform a temporary AddRef for our usage of the component.
			pSceneGraph->AddRef();

			// Attempt to obtain a pointer to the requested interface.
			result = pSceneGraph->QueryInterface( riid, ppv );

			// Perform a Release since our usage of the component is now
			// complete.  Note:  If the QI fails, this will cause the
			// component to be destroyed.
			pSceneGraph->Release();
		}
		else result = IFX_E_OUT_OF_MEMORY;
	}
	else result = IFX_E_INVALID_POINTER;

	return result;
}

// IFXUnknown
U32 CIFXSceneGraph::AddRef()
{

	return ++m_uRefCount;
}

U32 CIFXSceneGraph::Release()
{

	if( m_uRefCount == 1 )
	{
		PreDestruct();
		delete this ;
		return 0 ;
	}
	else
		return --m_uRefCount;
}

IFXRESULT CIFXSceneGraph::QueryInterface(IFXREFIID riid, void **ppv)
{
	IFXRESULT result = IFX_OK;

	if ( ppv )
	{
		if ( riid == IID_IFXUnknown    )
			*ppv = (IFXUnknown*)this;
		else if ( riid == IID_IFXSceneGraph )
			*ppv = (IFXSceneGraph*)this;
		else if ( riid == IID_IFXMarker )
			*ppv = (IFXMarker*)this;
		else if ( riid == IID_IFXSubject )
			*ppv = (IFXSubject*)this;
		else if ( riid == IID_IFXMetaDataX )
			*ppv = ( IFXMetaDataX* ) this;
		else
		{
			*ppv = NULL;
			result = IFX_E_UNSUPPORTED;
		}

		if( IFXSUCCESS(result) )
			AddRef();
	}
	else result = IFX_E_INVALID_POINTER;

	return result;
}

IFXRESULT CIFXSceneGraph::Mark(void)
{
	IFXRESULT result = IFX_E_UNDEFINED;

	// Mark local
	m_uMark = m_uRunningMarker;

	// Mark all the components in the scenegraph database...
	U32 uPaletteIndex = 0;
	for (; uPaletteIndex < NUMBER_OF_PALETTES; uPaletteIndex++)
	{
		if ( m_pPalettes[uPaletteIndex] )
		{
			U32 uID = 0;
			IFXMarker* pMarker = NULL;

			result = m_pPalettes[uPaletteIndex]->First(&uID);

			while ( IFXSUCCESS(result) )
			{
				result = m_pPalettes[uPaletteIndex]->GetResourcePtr(
														uID,
														IID_IFXMarker,
														(void**)&pMarker );

				if (IFXSUCCESS(result))
					result = pMarker->Mark();

				// it's ok if there's no resource.
				else if (    (IFX_E_PALETTE_NULL_RESOURCE_POINTER == result)
					      || (IFX_E_INVALID_RANGE == result) )
					result = IFX_OK ;

				IFXRELEASE( pMarker );

				if (IFXSUCCESS(result))
					result = m_pPalettes[uPaletteIndex]->Next(&uID);
			}
			if (result == IFX_E_PALETTE_INVALID_ENTRY)
				result = IFX_OK;
		}
		else result = IFX_E_NOT_INITIALIZED;
	}

	return result;
}

IFXRESULT CIFXSceneGraph::Marked(BOOL* pbOutMarked)
{
	IFXRESULT result = IFX_OK;

	if (pbOutMarked)
		*pbOutMarked = (m_uMark == m_uRunningMarker);
	else
		result = IFX_E_INVALID_POINTER;

	return result;
}

void CIFXSceneGraph::SetPriority( U32 uInPriority,
								  BOOL bRecursive,		// optional. default == IFX_TRUE.
								  BOOL bPromotionOnly )	// optional. default == IFX_TRUE.
{
	// take the priority if it's a higher priority and we're only promoting:
	if (bPromotionOnly == IFX_TRUE)
	{
		if (uInPriority < m_uPriority)
			m_uPriority = uInPriority ;
	}
	else
		m_uPriority = uInPriority ;

	// Call SetPriority() on all children recursively:
	if (bRecursive == IFX_TRUE)
	{
		// set all the components in the scenegraph database:
		IFXRESULT rc = IFX_OK ;
		U32 uPaletteIndex = 0;

		// go through all the palettes:
		for (uPaletteIndex = 0; uPaletteIndex < NUMBER_OF_PALETTES; uPaletteIndex++)
		{
			if ( m_pPalettes[uPaletteIndex] != NULL )
			{
				U32 uID					= 0 ;
				//IFXUnknown* pUnknown	= NULL ;
				IFXMarker* pMarker		= NULL ;

				// get the first entry:
				rc = m_pPalettes[uPaletteIndex]->First(&uID);

				while ( IFXSUCCESS(rc) )
				{
					// get the IFXUnknown handle:
					rc = m_pPalettes[uPaletteIndex]->GetResourcePtr( uID,
																	 IID_IFXMarker,
																	 (void**)&pMarker );

					// propagate the call:
					if (IFXSUCCESS(rc))
						pMarker->SetPriority( uInPriority,
											  bRecursive,
											  bPromotionOnly);

					// it's ok if there's no resource.
					else if (    (IFX_E_PALETTE_NULL_RESOURCE_POINTER == rc)
							  || (IFX_E_INVALID_RANGE == rc) )
						rc = IFX_OK ;

					IFXRELEASE( pMarker );

					// get the next entry in the palette:
					if (IFXSUCCESS(rc))
						rc = m_pPalettes[uPaletteIndex]->Next(&uID);
				} // end while (stepping through palette entries)

				if (rc == IFX_E_PALETTE_INVALID_ENTRY)
					rc = IFX_OK;
			} // if ( m_pPalettes[uPaletteIndex] != NULL )

			else rc = IFX_E_NOT_INITIALIZED;
		} // end for (uPaletteIndex = 0; uPaletteIndex < NUMBER_OF_PALETTES; uPaletteIndex++)

	} // end if (bRecursive == IFX_TRUE)

	return ;
}

IFXRESULT CIFXSceneGraph::GetDebugFlags( U32* puOutDebugFlags )
{
	IFXRESULT result = IFX_OK;

	if (puOutDebugFlags)
		*puOutDebugFlags = m_uDebugFlags;
	else
		result = IFX_E_INVALID_POINTER;

	return result;
}

IFXRESULT CIFXSceneGraph::GetPalette( EIFXPalette  eInPalette,
                                      IFXPalette** ppOutPalette )
{
	IFXRESULT result = IFX_E_UNDEFINED;

	if (m_bInitialized)
	{
		if (eInPalette < NUMBER_OF_PALETTES)
		{
			if (m_pPalettes[eInPalette])
			{
				*ppOutPalette = m_pPalettes[eInPalette];
				m_pPalettes[eInPalette]->AddRef();
				result = IFX_OK;
			}
			else result = IFX_E_INVALID_POINTER;
		}
		else result = IFX_E_INVALID_HANDLE;
	}
	else result = IFX_E_NOT_INITIALIZED;

	return result;
}

U32 CIFXSceneGraph::CurrentMark(void)
{
	return m_uRunningMarker;
}

IFXRESULT CIFXSceneGraph::UnmarkAll(void)
{
	IFXRESULT result = IFX_E_UNDEFINED;

	// Increment running marker.
	// Note: A component is marked if it's m_uMark is equal to
	//       m_uRunningMarker.
	m_uRunningMarker++;

	if (m_uRunningMarker == 0)
	{ // We have exceeded the size of the datatype.

		// Explicitly set all marks in the database to zero.
		// Note: Since the m_uRunningMarker is currently zero,
		//       we can just call Mark().
		result = Mark();

		// Increment the marker to unmark everything.
		m_uRunningMarker++;
	}
	else result = IFX_OK;

	return result;
}

IFXRESULT CIFXSceneGraph::SetDebugFlags(U32 uInDebugFlags)
{
	m_uDebugFlags = uInDebugFlags;
	return IFX_OK;
}

IFXRESULT CIFXSceneGraph::GetAnimationEnabledState( BOOL* pState )
//	This method is used to get the current animation enabled state.  If the
//	animation enabled state is TRUE, animation is globally enabled.  If
//	FALSE, animation is globally disabled and NO animation should playback.
//	Upon success, the specified BOOL is initialized with the animation
//	enabled state and IFX_OK is returned.  Otherwise, the following values
//	are returned:  IFX_E_INVALID_POINTER or IFX_E_NOT_INITIALIZED.
{
	IFXRESULT	result	= IFX_OK;

	if ( m_pCS )
	{
		if ( pState )
			*pState = m_bAnimationEnabledState;
		else
			result = IFX_E_INVALID_POINTER;
	}
	else
		result = IFX_E_NOT_INITIALIZED;

	return result;
}

IFXRESULT CIFXSceneGraph::SetAnimationEnabledState( BOOL state )
//	This method is used to set the animation enabled state.  If the animation
//	enabled state is TRUE, animation is globally enabled.  If FALSE,
//	animation is globally disabled and NO animation should playback.  Upon
//	success, IFX_OK is returned.  Otherwise, IFX_E_NOT_INITIALIZED is
//	returned.
{
	IFXRESULT	result	= IFX_OK;

	if ( m_pCS )
		m_bAnimationEnabledState = state;
	else
		result = IFX_E_NOT_INITIALIZED;

	return result;
}


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

<!--Parts from the iGEM Registry of Standard Biological Parts-->
<rsbpml>
<part_list>
<part>
<part_id>19622</part_id>
<part_name>BBa_K418003</part_name>
<part_short_name>K418003</part_short_name>
<part_short_desc>IPTG inducible Lac promoter cassette </part_short_desc>
<part_type>Intermediate</part_type>
<release_status>Not Released</release_status>
<sample_status>Pending</sample_status>
<part_results>None</part_results>
<part_nickname>CP2LacPI1</part_nickname>
<part_rating></part_rating>
<part_url>http://parts.igem.org/Part:BBa_K418003</part_url>
<part_entered>2010-10-16</part_entered>
<part_author>Northwestern University iGEM 2010</part_author>
<deep_subparts>
<subpart>
<part_id>7146</part_id>
<part_name>BBa_J23104</part_name>
<part_short_desc>constitutive promoter family member</part_short_desc>
<part_type>Regulatory</part_type>
<part_nickname></part_nickname></subpart>
<subpart>
<part_id>148</part_id>
<part_name>BBa_B0031</part_name>
<part_short_desc>RBS.2 (weak) -- derivative of BBa_0030</part_short_desc>
<part_type>RBS</part_type>
<part_nickname></part_nickname></subpart>
<subpart>
<part_id>153</part_id>
<part_name>BBa_C0012</part_name>
<part_short_desc>lacI repressor  from E. coli (+LVA)</part_short_desc>
<part_type>Coding</part_type>
<part_nickname>lacI</part_nickname></subpart>
<subpart>
<part_id>603</part_id>
<part_name>BBa_B0010</part_name>
<part_short_desc>T1 from E. coli rrnB</part_short_desc>
<part_type>Terminator</part_type>
<part_nickname></part_nickname></subpart>
<subpart>
<part_id>145</part_id>
<part_name>BBa_B0012</part_name>
<part_short_desc>TE from coliphageT7</part_short_desc>
<part_type>Terminator</part_type>
<part_nickname></part_nickname></subpart>
<subpart>
<part_id>186</part_id>
<part_name>BBa_R0011</part_name>
<part_short_desc>Promoter (lacI regulated, lambda pL hybrid)</part_short_desc>
<part_type>Regulatory</part_type>
<part_nickname>lacI+pL</part_nickname></subpart></deep_subparts>
<specified_subparts>
<subpart>
<part_id>7146</part_id>
<part_name>BBa_J23104</part_name>
<part_short_desc>constitutive promoter family member</part_short_desc>
<part_type>Regulatory</part_type>
<part_nickname></part_nickname></subpart>
<subpart>
<part_id>2129</part_id>
<part_name>BBa_Q01121</part_name>
<part_short_desc>QPI (B0031.C0012.B0015.R0011)</part_short_desc>
<part_type>Inverter</part_type>
<part_nickname></part_nickname></subpart></specified_subparts>
<specified_subscars>
<subpart>
<part_id>7146</part_id>
<part_name>BBa_J23104</part_name>
<part_short_desc>constitutive promoter family member</part_short_desc>
<part_type>Regulatory</part_type>
<part_nickname></part_nickname></subpart>
<scar>
<scar_id>1</scar_id>
<scar_standard>10</scar_standard>
<scar_type>Scar</scar_type>
<scar_name>RFC[10]</scar_name>
<scar_nickname>[10]</scar_nickname>
<scar_comments></scar_comments>
<scar_sequence>tactagag</scar_sequence></scar>
<subpart>
<part_id>2129</part_id>
<part_name>BBa_Q01121</part_name>
<part_short_desc>QPI (B0031.C0012.B0015.R0011)</part_short_desc>
<part_type>Inverter</part_type>
<part_nickname></part_nickname></subpart></specified_subscars>
<sequences>
<seq_data>ttgacagctagctcagtcctaggtattgtgctagctactagagtcacacaggaaacctactagatggtgaatgtgaaacc
agtaacgttatacgatgtcgcagagtatgccggtgtctcttatcagaccgtttcccgcgtggtgaaccaggccagccacg
tttctgcgaaaacgcgggaaaaagtggaagcggcgatggcggagctgaattacattcccaaccgcgtggcacaacaactg
gcgggcaaacagtcgttgctgattggcgttgccacctccagtctggccctgcacgcgccgtcgcaaattgtcgcggcgat
taaatctcgcgccgatcaactgggtgccagcgtggtggtgtcgatggtagaacgaagcggcgtcgaagcctgtaaagcgg
cggtgcacaatcttctcgcgcaacgcgtcagtgggctgatcattaactatccgctggatgaccaggatgccattgctgtg
gaagctgcctgcactaatgttccggcgttatttcttgatgtctctgaccagacacccatcaacagtattattttctccca
tgaagacggtacgcgactgggcgtggagcatctggtcgcattgggtcaccagcaaatcgcgctgttagcgggcccattaa
gttctgtctcggcgcgtctgcgtctggctggctggcataaatatctcactcgcaatcaaattcagccgatagcggaacgg
gaaggcgactggagtgccatgtccggttttcaacaaaccatgcaaatgctgaatgagggcatcgttcccactgcgatgct
ggttgccaacgatcagatggcgctgggcgcaatgcgcgccattaccgagtccgggctgcgcgttggtgcggatatctcgg
tagtgggatacgacgataccgaagacagctcatgttatatcccgccgttaaccaccatcaaacaggattttcgcctgctg
gggcaaaccagcgtggaccgcttgctgcaactctctcagggccaggcggtgaagggcaatcagctgttgcccgtctcact
ggtgaaaagaaaaaccaccctggcgcccaatacgcaaaccgcctctccccgcgcgttggccgattcattaatgcagctgg
cacgacaggtttcccgactggaaagcgggcaggctgcaaacgacgaaaactacgctttagtagcttaataactctgatag
tgctagtgtagatctctactagagccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatc
tgttgtttgtcggtgaacgctctctactagagtcacactggctcaccttcgggtgggcctttctgcgtttatatactaga
gaattgtgagcggataacaattgacattgtgagcggataacaagatactgagcaca
</seq_data></sequences>
<features>
<feature>
<id>2263763</id>
<title>BBa_J23104</title>
<type>BioBrick</type>
<direction>reverse</direction>
<startpos>1</startpos>
<endpos>35</endpos></feature>
<feature>
<id>2263782</id>
<title>BBa_Q01121</title>
<type>BioBrick</type>
<direction>reverse</direction>
<startpos>44</startpos>
<endpos>1416</endpos></feature>
<feature>
<id>2263764</id>
<title>BBa_B0031</title>
<type>BioBrick</type>
<direction>reverse</direction>
<startpos>44</startpos>
<endpos>57</endpos></feature>
<feature>
<id>2263765</id>
<title></title>
<type>conserved</type>
<direction>forward</direction>
<startpos>50</startpos>
<endpos>53</endpos></feature>
<feature>
<id>2263767</id>
<title>BBa_C0012</title>
<type>BioBrick</type>
<direction>forward</direction>
<startpos>64</startpos>
<endpos>1191</endpos></feature>
<feature>
<id>2263766</id>
<title>lacI-LVA</title>
<type>cds</type>
<direction>forward</direction>
<startpos>64</startpos>
<endpos>1191</endpos></feature>
<feature>
<id>2263768</id>
<title>LVA</title>
<type>tag</type>
<direction>forward</direction>
<startpos>1153</startpos>
<endpos>1191</endpos></feature>
<feature>
<id>2263769</id>
<title>Help:Barcodes</title>
<type>barcode</type>
<direction>forward</direction>
<startpos>1192</startpos>
<endpos>1216</endpos></feature>
<feature>
<id>2263770</id>
<title>BBa_B0010</title>
<type>BioBrick</type>
<direction>forward</direction>
<startpos>1225</startpos>
<endpos>1304</endpos></feature>
<feature>
<id>2263771</id>
<title>BBa_B0015</title>
<type>BioBrick</type>
<direction>reverse</direction>
<startpos>1225</startpos>
<endpos>1353</endpos></feature>
<feature>
<id>2263772</id>
<title></title>
<type>stem_loop</type>
<direction>forward</direction>
<startpos>1236</startpos>
<endpos>1279</endpos></feature>
<feature>
<id>2263773</id>
<title>BBa_B0012</title>
<type>BioBrick</type>
<direction>forward</direction>
<startpos>1313</startpos>
<endpos>1353</endpos></feature>
<feature>
<id>2263774</id>
<title>T7 TE</title>
<type>stem_loop</type>
<direction>forward</direction>
<startpos>1320</startpos>
<endpos>1339</endpos></feature>
<feature>
<id>2263775</id>
<title></title>
<type>polya</type>
<direction>forward</direction>
<startpos>1340</startpos>
<endpos>1353</endpos></feature>
<feature>
<id>2263776</id>
<title></title>
<type>stop</type>
<direction>forward</direction>
<startpos>1346</startpos>
<endpos>1346</endpos></feature>
<feature>
<id>2263777</id>
<title>BBa_R0011</title>
<type>BioBrick</type>
<direction>forward</direction>
<startpos>1362</startpos>
<endpos>1415</endpos></feature>
<feature>
<id>2263778</id>
<title>lac O1</title>
<type>operator</type>
<direction>forward</direction>
<startpos>1364</startpos>
<endpos>1380</endpos></feature>
<feature>
<id>2263779</id>
<title>-35</title>
<type>promoter</type>
<direction>forward</direction>
<startpos>1381</startpos>
<endpos>1386</endpos></feature>
<feature>
<id>2263780</id>
<title>lac O1</title>
<type>operator</type>
<direction>forward</direction>
<startpos>1387</startpos>
<endpos>1403</endpos></feature>
<feature>
<id>2263781</id>
<title>-10</title>
<type>promoter</type>
<direction>forward</direction>
<startpos>1404</startpos>
<endpos>1409</endpos></feature></features>
<parameters>
<!-- NOTE: Currently, each parameter name can have only one value.-->
<!--This will change as we fully support the context of a parameter. RDR 4/2010 -->
<parameter>
<name>input_s</name>
<value>4564</value>
<units></units>
<url></url>
<id>10417</id>
<m_date>2010-10-16 14:17:09</m_date>
<user_id>6938</user_id>
<user_name>krr533</user_name></parameter>
<parameter>
<name>output_s</name>
<value>186</value>
<units></units>
<url></url>
<id>10418</id>
<m_date>2010-10-16 14:17:09</m_date>
<user_id>6938</user_id>
<user_name>krr533</user_name></parameter>
<parameter>
<name>protein</name>
<value>LacI</value>
<units></units>
<url></url>
<id>10419</id>
<m_date>2010-10-16 14:17:09</m_date>
<user_id>6938</user_id>
<user_name>krr533</user_name></parameter>
<parameter>
<name>rbs</name>
<value>148</value>
<units></units>
<url></url>
<id>10420</id>
<m_date>2010-10-16 14:17:09</m_date>
<user_id>6938</user_id>
<user_name>krr533</user_name></parameter>
<parameter>
<name>tag</name>
<value>LVA</value>
<units></units>
<url></url>
<id>10421</id>
<m_date>2010-10-16 14:17:09</m_date>
<user_id>6938</user_id>
<user_name>krr533</user_name></parameter>
<parameter>
<name>negative_regulators</name>
<value>NA</value>
<units></units>
<url></url>
<id>10415</id>
<m_date>2010-10-16 14:16:49</m_date>
<user_id>6938</user_id>
<user_name>krr533</user_name></parameter>
<parameter>
<name>positive_regulators</name>
<value>NA</value>
<units></units>
<url></url>
<id>10416</id>
<m_date>2010-10-16 14:16:49</m_date>
<user_id>6938</user_id>
<user_name>krr533</user_name></parameter></parameters>
<categories>
<category>//rnap/prokaryote/ecoli/sigma70</category>
<category>//direction/forward</category>
<category>//chassis/prokaryote/ecoli</category>
<category>//promoter/Anderson</category>
<category>//regulation/constitutive</category></categories>
<twins>
<twin>BBa_S04502</twin>
<twin>BBa_S04506</twin></twins>
<samples>
<!--Samples have been turned off for now - rdr 2013--></samples>
<references>
<!--References are not available yet - rdr 2013--></references>
<groups>
<!-- Group access information is not yet available - rdr 2013--></groups></part></part_list></rsbpml>


text:
package com.chickenkiller.upods2.interfaces;

import com.chickenkiller.upods2.views.SlidingMenu;

/**
 * Created by Alon Zilberman on 7/10/15.
 */
public interface ISlidingMenuHolder{

    SlidingMenu getSlidingMenu();

    void setSlidingMenuHeader(String itemName);
}


text:
"use strict";
/**
 * @class  elFinder command "view"
 * Change current directory view (icons/list)
 *
 * @author Dmitry (dio) Levashov
 **/
elFinder.prototype.commands.view = function() {
	this.value          = this.fm.storage('view');
	this.alwaysEnabled  = true;
	this.updateOnSelect = false;

	this.options = { ui : 'viewbutton'};

	this.getstate = function() {
		return 0;
	}

	this.exec = function() {
		var value = this.fm.storage('view', this.value == 'list' ? 'icons' : 'list');
		this.fm.viewchange();
		this.update(void(0), value);
	}

}


text:
package ble

import (
	"fmt"
	"sync"
	"time"

	"v.io/v23/context"
	"v.io/v23/discovery"

	idiscovery "v.io/x/ref/lib/discovery"
)

// TODO(jhahn): Remove the limit on the number of advertisements per interface.
//
// The current plan is
//    * if there is only one advertisement
//			- publish all information except attachments as is
//		* if there are more than one advertisements
//			- publish the latest directory addresses, # of advertisements
//			- if there are <= 8 advertisements,
//					- publish each advertisements up to 2K (4 characteristics)
//						* if it doesn't fit, publish only id, hash
//			- if there are <= 64 advertisements,
//				  - publish a list of a pair of id and hash (24 bytes / <id, hash>)
//
//		* all missed advertisements / information will be fetched from directory server.

type advertiser struct {
	ctx    *context.T
	driver Driver

	mu        sync.Mutex
	adRecords map[string]*adRecord // GUARDED_BY(mu)
}

type adRecord struct {
	uuid    idiscovery.Uuid
	adinfos map[discovery.AdId][]byte
	expiry  time.Time
}

const (
	uuidGcDelay = 10 * time.Minute
)

func (a *advertiser) addAd(adinfo *idiscovery.AdInfo) error {
	encoded, err := encodeAdInfo(adinfo)
	if err != nil {
		return err
	}

	a.mu.Lock()
	defer a.mu.Unlock()

	a.gcLocked()

	rec := a.adRecords[adinfo.Ad.InterfaceName]
	if rec == nil {
		rec = &adRecord{
			uuid:    newServiceUuid(adinfo.Ad.InterfaceName),
			adinfos: make(map[discovery.AdId][]byte),
		}
		a.adRecords[adinfo.Ad.InterfaceName] = rec
	} else {
		if len(rec.adinfos) >= maxNumPackedServices {
			return fmt.Errorf("too many advertisements per interface: %d > %d", len(rec.adinfos), maxNumPackedServices)
		}

		// Stop the current advertising and restart with a toggled uuid to avoid a new
		// advertisement from being deduped by cache.
		a.driver.RemoveService(rec.uuid.String())

		toggleServiceUuid(rec.uuid)
		rec.expiry = time.Time{}
	}
	rec.adinfos[adinfo.Ad.Id] = encoded

	cs := packToCharacteristics(rec.adinfos)
	err = a.driver.AddService(rec.uuid.String(), cs)
	if err != nil {
		rec.expiry = time.Now().Add(uuidGcDelay)
	}
	return err
}

func (a *advertiser) removeAd(adinfo *idiscovery.AdInfo) {
	a.mu.Lock()
	defer a.mu.Unlock()

	a.gcLocked()

	rec := a.adRecords[adinfo.Ad.InterfaceName]
	if rec == nil {
		return
	}

	a.driver.RemoveService(rec.uuid.String())
	delete(rec.adinfos, adinfo.Ad.Id)

	if len(rec.adinfos) == 0 {
		rec.expiry = time.Now().Add(uuidGcDelay)
	} else {
		// Restart advertising with a toggled uuid to avoid the updated advertisement
		// from being deduped by cache.
		toggleServiceUuid(rec.uuid)

		cs := packToCharacteristics(rec.adinfos)
		if err := a.driver.AddService(rec.uuid.String(), cs); err != nil {
			a.ctx.Error(err)
			rec.expiry = time.Now().Add(uuidGcDelay)
		}
	}
}

func (a *advertiser) gcLocked() {
	// Instead of asynchronous gc, we purge old entries in every call to addAd or removeAd
	// for simplicity. We do not worry about purging all old entries since there will be
	// only a handful of ads in practice.
	now := time.Now()
	for interfaceName, rec := range a.adRecords {
		if rec.expiry.IsZero() || rec.expiry.After(now) {
			continue
		}
		delete(a.adRecords, interfaceName)
	}
}

func newAdvertiser(ctx *context.T, driver Driver) *advertiser {
	return &advertiser{
		ctx:       ctx,
		driver:    driver,
		adRecords: make(map[string]*adRecord),
	}
}


text:
Service Container
===========================

# Overview
This is a Typesafe Activator Template for demonstrating how to build a microservice using the
[Service Container](https://github.com/vonnagy/service-container). The example contained within the template constructs
a simple REST API for the CRUD operation of a Widget. It simulates the persistence layer, bug can easily be replaced with your favorite bit of technology.

## Application
The main application entry point in `Service.scala`. In this file, it builds up an instance of the service and starts
the service. During the builder operation is registers the API endpoints that are contained in the class `WidgetService`.

```scala
// Here we establish the container and build it while
// applying extras.
val service = new ContainerBuilder()
  // Register the API routes
  .withRoutes(classOf[WidgetService]).build

service.start
```

By default, the service runs on [http://localhost:9092](http://localhost:9092) and thus all endpoints can be accessed using this base address. There are several built-in endpoints that the container exposes and those are documented here: [Built-in Endpoints](https://github.com/vonnagy/service-container/blob/master/docs/Endpoints.md)

## Configuration
Configuration of the **Service Container** uses the standard [Typesafe Config](https://github.com/typesafehub/config) rollup patterns. For more detailed information, refer to the [Configuration](https://github.com/vonnagy/service-container/blob/master/docs/Configuration.md)

This template contains an `application.conf` file that overrides the default settings which are contained in the dependent libraries. This file can be edited or configuration can also be set by the following:

 - A JVM system property called `config.file` can be used (e.g. `-Dconfig.file=/myconfig.conf`)
 - Place an `application.conf` file in a **conf** sub-directory off the process root
 - Configure the service with a config during the build process (e.g. `val service = new ContainerBuilder().withConfig(ConfigFactory.parseFile("/somefile.conf"))`)

## API Endpoints
The API endpoints are defined in the class `WidgetService`. This class defines the routes to be used by applying standard standard [Spray](http://spray.io) routing techniques.

## Health Checks
The **Service Container** allows one to define sub-checks within the system in order to help determine the state of the service. Any number of registered healths checks can be used and there is support for registration by using traits (`RegisteredHealthCheck` and `RegisteredHealthCheckActor`) or by registering when building the service.

In this template the class `WidgetPersistence` registers itself as a health check to evaluate the state of the persistence.

```scala
class WidgetPersistence(implicit val system: ActorSystem) extends RegisteredHealthCheck {

  import system.dispatcher

  /**
   * Fetch the health for this registered checker.
   * @return returns a future to the health information
   */
  def getHealth: Future[HealthInfo] = Future {
    HealthInfo("db", HealthState.OK, s"The persistence is running and currently contains ${WidgetPersistence.widgets.size} Widgets")
  }
```

## Metrics
The **Service Container** supports the management of metrics. For more details about metrics can be obtained here: [Metrics](https://github.com/vonnagy/service-container/blob/master/docs/Metrics.md)

In this template the class `WidgetPersistence` registers calls to it's functions and records the number of times they have been called. Each metrics is created like the following:

```scala
val get = Counter("db.widgets.get")
```

Per the comments above regarding built-in endpoints, the new metrics can be viewed by calling the endpoint at [http://localhost:9092/metrics](http://localhost:9092/metrics).

### Reporting
Once metrics are gathered they can be reported to other sources. Reporters are defined in the configuration files and follow a standard pattern. They are defined under `container.metrics.reporters` and have there own named sections. For more detailed information, refer to the [Metrics](https://github.com/vonnagy/service-container/blob/master/docs/Metrics.md) documentation for the Service Container.

In this template we will enable the default reporter which is writes to the log file using `Slf4j`. The default configuration section looks like the following:

```hocon
container {
	metrics {
	    reporters {
	      Slf4j {
	        # The name of the reporter class
	        class = "com.github.vonnagy.service.container.metrics.reporting.Slf4jReporter"
	        # Is the reporter enabled
	        enabled = on
	        # What is the interval to report on
	        reporting-interval = 60s
	        # What is the logger
	        logger = "com.github.vonnagy.service.container.metrics"
	      }
	    }
	}
}
```

The configuration for this tutorial also contains an example of how to wire up the `StatsD` reporter, but is disabled by default. The `StatsD` reporter is contained in the **Service Container Metrics Reporting** library.

```hocon
statsD {
	# The name of the reporter class
	 class = "com.github.vonnagy.service.container.metrics.reporting.StatsDReporter"
	 # Is the reporter enabled
	 enabled = off
	 # What is the interval to report on
	 reporting-interval = 5s
	 # The StatsD host
	 host = "localhost"
	 # The statsd port
	 port = 8125
	 # An optional prefix to append to metrics being sent to StatsD
	 metric-prefix = ""
}
```


text:
namespace crypto {
namespace tink {

using crypto::tink::util::Enums;
using crypto::tink::util::Status;
using crypto::tink::util::StatusOr;
using google::crypto::tink::JwtRsaSsaPkcs1KeyFormat;
using google::crypto::tink::JwtRsaSsaPkcs1PrivateKey;
using ::google::crypto::tink::JwtRsaSsaPkcs1PublicKey;

namespace {
JwtRsaSsaPkcs1PrivateKey RsaPrivateKeySubtleToProto(
    const internal::RsaPrivateKey& private_key) {
  JwtRsaSsaPkcs1PrivateKey key_proto;
  key_proto.set_version(RawJwtRsaSsaPkcs1SignKeyManager().get_version());
  key_proto.set_d(std::string(util::SecretDataAsStringView(private_key.d)));
  key_proto.set_p(std::string(util::SecretDataAsStringView(private_key.p)));
  key_proto.set_q(std::string(util::SecretDataAsStringView(private_key.q)));
  key_proto.set_dp(std::string(util::SecretDataAsStringView(private_key.dp)));
  key_proto.set_dq(std::string(util::SecretDataAsStringView(private_key.dq)));
  key_proto.set_crt(std::string(util::SecretDataAsStringView(private_key.crt)));
  JwtRsaSsaPkcs1PublicKey* public_key_proto = key_proto.mutable_public_key();
  public_key_proto->set_version(
      RawJwtRsaSsaPkcs1SignKeyManager().get_version());
  public_key_proto->set_n(private_key.n);
  public_key_proto->set_e(private_key.e);
  return key_proto;
}

internal::RsaPrivateKey RsaPrivateKeyProtoToSubtle(
    const JwtRsaSsaPkcs1PrivateKey& key_proto) {
  internal::RsaPrivateKey key;
  key.n = key_proto.public_key().n();
  key.e = key_proto.public_key().e();
  key.d = util::SecretDataFromStringView(key_proto.d());
  key.p = util::SecretDataFromStringView(key_proto.p());
  key.q = util::SecretDataFromStringView(key_proto.q());
  key.dp = util::SecretDataFromStringView(key_proto.dp());
  key.dq = util::SecretDataFromStringView(key_proto.dq());
  key.crt = util::SecretDataFromStringView(key_proto.crt());
  return key;
}

}  // namespace

StatusOr<JwtRsaSsaPkcs1PrivateKey> RawJwtRsaSsaPkcs1SignKeyManager::CreateKey(
    const JwtRsaSsaPkcs1KeyFormat& jwt_rsa_ssa_pkcs1_key_format) const {
  StatusOr<internal::SslUniquePtr<BIGNUM>> e =
      internal::StringToBignum(jwt_rsa_ssa_pkcs1_key_format.public_exponent());
  if (!e.ok()) {
    return e.status();
  }

  internal::RsaPrivateKey private_key;
  internal::RsaPublicKey public_key;
  Status status = internal::NewRsaKeyPair(
      jwt_rsa_ssa_pkcs1_key_format.modulus_size_in_bits(), e->get(),
      &private_key, &public_key);
  if (!status.ok()) {
    return status;
  }

  JwtRsaSsaPkcs1PrivateKey key_proto = RsaPrivateKeySubtleToProto(private_key);
  JwtRsaSsaPkcs1PublicKey* public_key_proto = key_proto.mutable_public_key();
  public_key_proto->set_algorithm(jwt_rsa_ssa_pkcs1_key_format.algorithm());

  return key_proto;
}

StatusOr<std::unique_ptr<PublicKeySign>>
RawJwtRsaSsaPkcs1SignKeyManager::PublicKeySignFactory::Create(
    const JwtRsaSsaPkcs1PrivateKey& private_key) const {
  internal::RsaPrivateKey key = RsaPrivateKeyProtoToSubtle(private_key);
  util::StatusOr<google::crypto::tink::HashType> hash =
      RawJwtRsaSsaPkcs1VerifyKeyManager::HashForPkcs1Algorithm(
          private_key.public_key().algorithm());
  if (!hash.ok()) {
    return hash.status();
  }
  internal::RsaSsaPkcs1Params params;
  params.hash_type = Enums::ProtoToSubtle(*hash);
  util::StatusOr<std::unique_ptr<PublicKeySign>> signer =
      subtle::RsaSsaPkcs1SignBoringSsl::New(key, params);
  if (!signer.ok()) return signer.status();
  // To check that the key is correct, we sign a test message with private key
  // and verify with public key.
  util::StatusOr<std::unique_ptr<PublicKeyVerify>> verifier =
      RawJwtRsaSsaPkcs1VerifyKeyManager().GetPrimitive<PublicKeyVerify>(
          private_key.public_key());
  if (!verifier.ok()) return verifier.status();
  util::Status sign_verify_result =
      SignAndVerify(signer->get(), verifier->get());
  if (!sign_verify_result.ok()) {
    return util::Status(absl::StatusCode::kInternal,
                        "security bug: signing with private key followed by "
                        "verifying with public key failed");
  }
  return signer;
}

Status RawJwtRsaSsaPkcs1SignKeyManager::ValidateKey(
    const JwtRsaSsaPkcs1PrivateKey& key) const {
  Status status = ValidateVersion(key.version(), get_version());
  if (!status.ok()) return status;
  return RawJwtRsaSsaPkcs1VerifyKeyManager().ValidateKey(key.public_key());
}

Status RawJwtRsaSsaPkcs1SignKeyManager::ValidateKeyFormat(
    const JwtRsaSsaPkcs1KeyFormat& key_format) const {
  Status modulus_status =
      internal::ValidateRsaModulusSize(key_format.modulus_size_in_bits());
  if (!modulus_status.ok()) {
    return modulus_status;
  }
  Status exponent_status =
      internal::ValidateRsaPublicExponent(key_format.public_exponent());
  if (!exponent_status.ok()) {
    return exponent_status;
  }
  return RawJwtRsaSsaPkcs1VerifyKeyManager().ValidateAlgorithm(
      key_format.algorithm());
}

}  // namespace tink
}  // namespace crypto


text:
configuration ConfigurationWAC
{
    param
    (
        [Parameter(Mandatory = $true)]
        [string] $DomainName,

        [Parameter(Mandatory = $true)]
        [pscredential] $Credential,

        [Parameter(Mandatory = $true)]
        [string] $NetworkPrefix,

	    [int] $RetryCount = 20,
        [int] $RetryInterval = 30
    );

    Import-DscResource -ModuleName PSDesiredStateConfiguration, cpBase, `
        xNetworking;

    Node WAC
    {
        cpFirewall "Firewall"
        {
        }

        cpNetworking "Networking"
        {
            IpAddress = "$NetworkPrefix.11/24"
            DnsServer = "$NetworkPrefix.10"
        }

        cpDomainOnboarding "DomainOnboarding"
        {
            NodeName = $Node.NodeName
            DomainName = $DomainName
            Credential = $Credential.Password
            DependsOn = "[cpNetworking]Networking"
        }

        xFirewall "WindowsAdminCenter-HTTP-TCP80"
        {
            Name = "Windows Admin Center (HTTP TCP/80)"
            Profile = ("Domain", "Private", "Public")
            Direction = "Inbound"
            Ensure = "Present"
            Enabled = "True"
            LocalPort = "80"
            Protocol = "Tcp"
        }

        xFirewall "WindowsAdminCenter-HTTP-TCP443"
        {
            Name = "Windows Admin Center (HTTP TCP/443)"
            Profile = ("Domain", "Private", "Public")
            Direction = "Inbound"
            Ensure = "Present"
            Enabled = "True"
            LocalPort = "443"
            Protocol = "Tcp"
        }

        Package "P-WindowsAdminCenter"
        {
            Ensure = "Present"
            Name = "Windows Admin Center"
            ProductId = "4FAE3A2E-4369-490E-97F3-0B3BFF183AB9"
            Path = "C:\LabBits\WindowsAdminCenter1809.5.msi"
            Arguments = "RESTART_WINRM=0"
        }
    }
}


text:
package org.spockframework.compiler;

import java.util.*;

import org.codehaus.groovy.ast.*;
import org.codehaus.groovy.ast.expr.*;
import org.codehaus.groovy.ast.stmt.*;
import org.objectweb.asm.Opcodes;

import org.spockframework.lang.Wildcard;
import org.spockframework.runtime.SpockRuntime;
import org.spockframework.util.Nullable;

import org.spockframework.util.ObjectUtil;
import spock.lang.Specification;

/**
 * Utility methods for AST processing.
 *
 * @author Peter Niederwieser
 */
public abstract class AstUtil {
  /**
   * Tells whether the given node has an annotation of the given type.
   *
   * @param node an AST node
   * @param annotationType an annotation type
   * @return <tt>true</tt> iff the given node has an annotation of the given type
   */
  public static boolean hasAnnotation(ASTNode node, Class<?> annotationType) {
    return getAnnotation(node, annotationType) != null;
  }

  public static AnnotationNode getAnnotation(ASTNode node, Class<?> annotationType) {
    if (!(node instanceof AnnotatedNode)) return null;

    AnnotatedNode annotated = (AnnotatedNode)node;
    @SuppressWarnings("unchecked")
    List<AnnotationNode> annotations = annotated.getAnnotations();
    for (AnnotationNode a : annotations)
      if (a.getClassNode().getName().equals(annotationType.getName())) return a;
    return null;
  }

  /**
   * Returns a list of statements of the given method. Modifications to the returned list
   * will affect the method's statements.
   *
   * @param method a method (node)
   * @return a list of statements of the given method
   */
  @SuppressWarnings("unchecked")
  public static List<Statement> getStatements(MethodNode method) {
    Statement code = method.getCode();
    if (!(code instanceof BlockStatement)) { // null or single statement
      BlockStatement block = new BlockStatement();
      if (code != null) block.addStatement(code);
      method.setCode(block);
    }
    return ((BlockStatement)method.getCode()).getStatements();
  }

  @SuppressWarnings("unchecked")
  public static List<Statement> getStatements(ClosureExpression closure) {
    BlockStatement blockStat = (BlockStatement)closure.getCode();
    return blockStat == null ?
        Collections.<Statement> emptyList() : // it's not possible to add any statements to such a ClosureExpression, so immutable list is OK
        blockStat.getStatements();
  }

  public static boolean isInvocationWithImplicitThis(Expression invocation) {
    if (invocation instanceof PropertyExpression) {
      return ((PropertyExpression) invocation).isImplicitThis();
    }
    if (invocation instanceof MethodCallExpression) {
      return ((MethodCallExpression) invocation).isImplicitThis();
    }
    return false;
  }

  public static boolean hasImplicitParameter(ClosureExpression expr) {
    return expr.getParameters() != null && expr.getParameters().length == 0;
  }

  public static Expression getImplicitParameterRef(ClosureExpression expr) {
    assert hasImplicitParameter(expr);

    DynamicVariable var = new DynamicVariable("it", false);
    return new VariableExpression(var);
  }

  public static Expression getInvocationTarget(Expression expr) {
    if (expr instanceof PropertyExpression)
      return ((PropertyExpression) expr).getObjectExpression();
    if (expr instanceof MethodCallExpression)
      return ((MethodCallExpression) expr).getObjectExpression();
    if (expr instanceof StaticMethodCallExpression)
      return new ClassExpression(((StaticMethodCallExpression) expr).getOwnerType());
    if (expr instanceof ConstructorCallExpression)
      return new ClassExpression(((ConstructorCallExpression) expr).getType());
    return null;
  }

  public static boolean isWildcardRef(Expression expr) {
    VariableExpression varExpr = ObjectUtil.asInstance(expr, VariableExpression.class);
    if (varExpr == null || !varExpr.getName().equals(Wildcard.INSTANCE.toString())) return false;

    Variable accessedVar = varExpr.getAccessedVariable();
    if (!(accessedVar instanceof FieldNode)) return false;

    return ((FieldNode) accessedVar).getOwner().getName().equals(Specification.class.getName());
  }

  public static boolean isJavaIdentifier(String id) {
    if (id == null || id.length() == 0
        || !Character.isJavaIdentifierStart(id.charAt(0)))
      return false;

    for (int i = 1; i < id.length(); i++)
      if (!Character.isJavaIdentifierPart(id.charAt(i)))
        return false;

    return true;
  }

  public static <T extends Expression> T getExpression(Statement stat, Class<T> type) {
    ExpressionStatement exprStat = ObjectUtil.asInstance(stat, ExpressionStatement.class);
    if (exprStat == null) return null;
    return ObjectUtil.asInstance(exprStat.getExpression(), type);
  }

  public static boolean isSynthetic(MethodNode method) {
    return method.isSynthetic() || (method.getModifiers() & Opcodes.ACC_SYNTHETIC) != 0;
  }

  /**
   * Tells if the source position for the given AST node is plausible.
   * Does not imply that the source position is correct.
   *
   * @param node an AST node
   * @return <tt>true</tt> iff the AST node has a plausible source position
   */
  public static boolean hasPlausibleSourcePosition(ASTNode node) {
    return node.getLineNumber() > 0 && node.getLastLineNumber() >= node.getLineNumber()
        && node.getColumnNumber() > 0 && node.getLastColumnNumber() > node.getColumnNumber();
  }

  public static Expression getArguments(Expression invocation) {
    if (invocation instanceof MethodCallExpression)
      return ((MethodCallExpression) invocation).getArguments();
    if (invocation instanceof StaticMethodCallExpression)
      return ((StaticMethodCallExpression) invocation).getArguments();
    if (invocation instanceof ConstructorCallExpression)
      return ((ConstructorCallExpression) invocation).getArguments();
    return null;
  }

  // Note: The returned list may contain SpreadExpression's,
  // which can't be used outside an ArgumentListExpression.
  // To pass an argument list to the Groovy or Spock runtime,
  // use this method together with AstUtil.toArgumentArray().
  public static List<Expression> getArgumentList(Expression invocation) {
    return asArgumentList(getArguments(invocation));
  }

  private static List<Expression> asArgumentList(Expression arguments) {
    // MethodCallExpression.getArguments() may return an ArgumentListExpression,
    // a TupleExpression that wraps a NamedArgumentListExpression,
    // or (at least in 1.6) a NamedArgumentListExpression

    if (arguments instanceof NamedArgumentListExpression)
      // return same result as for NamedArgumentListExpression wrapped in TupleExpression
      return Collections.singletonList(arguments);

    return ((TupleExpression) arguments).getExpressions();
  }

  /**
   * Turns an argument list obtained from AstUtil.getArguments() into an Object[] array
   * suitable to be passed to InvokerHelper or SpockRuntime. The main challenge is
   * to handle SpreadExpression's correctly.
   */
  public static Expression toArgumentArray(List<Expression> argList, IRewriteResources resources) {
    List<Expression> normalArgs = new ArrayList<Expression>();
    List<Expression> spreadArgs = new ArrayList<Expression>();
    List<Expression> spreadPositions = new ArrayList<Expression>();

    for (int i = 0; i < argList.size(); i++) {
      Expression arg = argList.get(i);
      if (arg instanceof SpreadExpression) {
        spreadArgs.add(((SpreadExpression) arg).getExpression());
        spreadPositions.add(new ConstantExpression(i));
      } else {
        normalArgs.add(arg);
      }
    }

    if (spreadArgs.isEmpty())
      return new ArrayExpression(ClassHelper.OBJECT_TYPE, argList);

    return new MethodCallExpression(
        new ClassExpression(resources.getAstNodeCache().SpockRuntime),
        new ConstantExpression(SpockRuntime.DESPREAD_LIST),
        new ArgumentListExpression(
            new ArrayExpression(ClassHelper.OBJECT_TYPE, normalArgs),
            new ArrayExpression(ClassHelper.OBJECT_TYPE, spreadArgs),
            new ArrayExpression(ClassHelper.int_TYPE, spreadPositions)
        ));
  }

  public static void copySourcePosition(ASTNode from, ASTNode to) {
    to.setLineNumber(from.getLineNumber());
    to.setLastLineNumber(from.getLastLineNumber());
    to.setColumnNumber(from.getColumnNumber());
    to.setLastColumnNumber(from.getLastColumnNumber());
  }

  @Nullable
  public static Expression getAssertionMessage(AssertStatement stat) {
    Expression msg = stat.getMessageExpression();
    if (msg == null) return null; // should not happen
    if (!(msg instanceof ConstantExpression)) return msg;
    return ((ConstantExpression) msg).isNullExpression() ? null : msg;
  }

  public static boolean isThisExpression(Expression expr) {
    return expr instanceof VariableExpression
        && ((VariableExpression) expr).isThisExpression();
  }

  public static boolean isSuperExpression(Expression expr) {
    return expr instanceof VariableExpression
        && ((VariableExpression) expr).isSuperExpression();
  }

  public static boolean isThisOrSuperExpression(Expression expr) {
    return isThisExpression(expr) || isSuperExpression(expr);
  }

  public static void setVisibility(MethodNode method, int visibility) {
    int modifiers = method.getModifiers();
    modifiers &= ~(Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE);
    method.setModifiers(modifiers | visibility);
  }

  public static int getVisibility(FieldNode field) {
    return field.getModifiers() & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE);
  }

  public static void setVisibility(FieldNode field, int visibility) {
    int modifiers = field.getModifiers();
    modifiers &= ~(Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE);
    field.setModifiers(modifiers | visibility);
  }

  public static boolean isJointCompiled(ClassNode clazz) {
    return clazz.getModule().getUnit().getConfig().getJointCompilationOptions() != null;
  }

  public static MethodCallExpression createDirectMethodCall(Expression target, MethodNode method, Expression arguments) {
    MethodCallExpression result = new MethodCallExpression(target, method.getName(), arguments);
    result.setMethodTarget(method);
    result.setImplicitThis(false); // see http://groovy.329449.n5.nabble.com/Problem-with-latest-2-0-beta-3-snapshot-and-Spock-td5496353.html
    return result;
  }

  public static void deleteMethod(ClassNode clazz, MethodNode method) {
    // as of 1.8.6, this is the best possible implementation
    clazz.getMethods().remove(method);
    clazz.getDeclaredMethods(method.getName()).remove(method);
  }

  public static Expression getVariableName(BinaryExpression assignment) {
    Expression left = assignment.getLeftExpression();
    if (left instanceof Variable) return new ConstantExpression(((Variable) left).getName());
    if (left instanceof FieldExpression) return new ConstantExpression(((FieldExpression) left).getFieldName());
    return ConstantExpression.NULL;
  }

  public static Expression getVariableType(BinaryExpression assignment) {
    ClassNode type = assignment.getLeftExpression().getType();
    return type == null || type == ClassHelper.DYNAMIC_TYPE ? ConstantExpression.NULL : new ClassExpression(type);
  }

  public static void fixUpLocalVariables(Variable[] localVariables, VariableScope scope, boolean isClosureScope) {
    fixUpLocalVariables(Arrays.asList(localVariables), scope, isClosureScope);
  }

  /**
   * Fixes up scope references to variables that used to be free or class variables,
   * and have been changed to local variables.
   */
  public static void fixUpLocalVariables(List<? extends Variable> localVariables, VariableScope scope, boolean isClosureScope) {
    for (Variable localVar : localVariables) {
      Variable scopeVar = scope.getReferencedClassVariable(localVar.getName());
      if (scopeVar instanceof DynamicVariable) {
        scope.removeReferencedClassVariable(localVar.getName());
        scope.putReferencedLocalVariable(localVar);
        if (isClosureScope)
          localVar.setClosureSharedVariable(true);
      }
    }
  }
}


text:
<?php

namespace CmsMediaForce\Entity;

use Doctrine\ORM\Mapping as ORM;
use Zend\Stdlib\Hydrator;

/**
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 * @ORM\Table(name="galerias")
 * @ORM\Entity(repositoryClass="CmsMediaForce\Entity\GaleriaRepository")
 */

class Galeria
{

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    protected $id;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    protected $nome;

    public function __construct($options = array())
    {

        (new Hydrator\ClassMethods)->hydrate($options, $this);

    }

    public function toArray()
    {
        return (new Hydrator\ClassMethods)->extract($this);
    }

    /**
     * Gets the value of id.
     *
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Sets the value of id.
     *
     * @param mixed $id the id
     *
     * @return self
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

    /**
     * Gets the value of nome.
     *
     * @return string
     */
    public function getNome()
    {
        return $this->nome;
    }

    /**
     * Sets the value of nome.
     *
     * @param string $nome the nome
     *
     * @return self
     */
    public function setNome($nome)
    {
        $this->nome = $nome;

        return $this;
    }
}


text:
sleep_time=10

# set CONF_FILE from argument if any
#CONF_FILE=$1
# or assume environment variable

# For Summer QPR
while getopts c: option
do
  case "${option}"
  in
  c) CONF=${OPTARG};;
  esac
done

if [ ${CONF+x} ]; then
  echo "Received option CONF: "${CONF}
  # For QPR Summer 2017 should be
  # CONF_FILE="/home/ubuntu/memex/update/data/global_var_summerqpr2017.json"
  CONF_FILE=${CONF}
else
  echo "CONF not set. Using default configuration file."
  CONF_FILE="/home/ubuntu/memex/update/data/global_var_remotehbase_release.json"
fi
echo "CONF_FILE:" ${CONF_FILE}
# log folder should be data/log
LOG_FOLDER="/home/ubuntu/memex/update/logs/"
echo "LOG_FOLDER:" ${LOG_FOLDER}
mkdir -p ${LOG_FOLDER}
API_FOLDER="/home/ubuntu/memex/ColumbiaImageSearch/cu_image_search/www/"
#API_TYPE="api_lopq"
API_TYPE="api"

while true;
do
    if [ ${CONF_FILE+x} ];
    then {
        echo "["$(date)"] Using conf file: "${CONF_FILE} >> ${LOG_FOLDER}logAPI_keep_alive.txt;
        cd ${API_FOLDER}
        python ${API_FOLDER}${API_TYPE}.py -c ${CONF_FILE} &> ${LOG_FOLDER}logAPI$(date +%Y-%m-%d).txt;
    }
    else {
        echo "No conf file set! Leaving"
        exit -1
        #echo "["$(date)"] Using default conf file." >> ${LOG_FOLDER}logAPI_keep_alive.txt;
        #python ${API_FOLDER}${API_TYPE}.py -c ${CONF_FILE} &> ${LOG_FOLDER}logAPI$(date +%Y-%m-%d).txt;
        #python api.py &> logAPI$(date +%Y-%m-%d).txt;
    }
    fi
    echo "["$(date)"] API crashed." >> ${LOG_FOLDER}logAPI_keep_alive.txt;
    sleep ${sleep_time};
done


text:
<?xml version="1.0" encoding="UTF-8"?>
<module codename="org.netbeans.modules.editor.errorstripe.api/1">
    <module_version install_time="1236310962827" last="true" origin="installer" specification_version="2.5.1.1">
        <file crc="3923345787" name="config/Modules/org-netbeans-modules-editor-errorstripe-api.xml"/>
        <file crc="883161701" name="modules/org-netbeans-modules-editor-errorstripe-api.jar"/>
    </module_version>
</module>


text:
FROM debian:wheezy
ADD ./docker-registry-searcher /docker-registry-searcher
ENTRYPOINT ["/docker-registry-searcher"]
#CMD ["/docker-registry-searcher"]


text:
class Dhs1171Pdf
  PDF_DIRECTORY = "app/lib/pdfs".freeze
  SOURCE_PDF = "#{PDF_DIRECTORY}/DHS_1171.pdf".freeze
  COVERSHEET_PDF = "#{PDF_DIRECTORY}/DHS_1171_cover_letter.pdf".freeze
  MAXIMUM_HOUSEHOLD_MEMBERS = 6
  MAXIMUM_EMPLOYED_MEMBERS = 2
  MAXIMUM_SELF_EMPLOYED_MEMBERS = 2

  def initialize(snap_application:)
    @snap_application = snap_application
  end

  def completed_file
    complete_template_pdf_with_client_data
    assemble_complete_application(temp_pdf_files)
  ensure
    temp_pdf_files.map do |t|
      t.close
      t.unlink
    end
  end

  private

  attr_reader :snap_application

  def temp_pdf_files
    @_temp_pdf_files ||= [
      filled_in_application,
      additional_household_member_pages,
      additional_employed_pages,
      additional_self_employed_pages,
      verification_documents,
    ].reject(&:blank?).flatten
  end

  def complete_template_pdf_with_client_data
    PdfForms.new.fill_form(SOURCE_PDF, filled_in_application.path, client_data)
  end

  def assemble_complete_application(filled_in_pdfs)
    PdfBuilder.new(
      output_file: complete_application_with_cover_and_documents,
      files: [File.open(COVERSHEET_PDF)] + filled_in_pdfs,
    ).pdf
  end

  def complete_application_with_cover_and_documents
    @_complete_application_with_cover_and_documents ||=
      Tempfile.new(["snap_app_with_cover_and_documents", ".pdf"], "tmp/")
  end

  def filled_in_application
    @_filled_in_application ||= Tempfile.new(["snap_app", ".pdf"], "tmp/")
  end

  def additional_household_member_pages
    if application_members.length > MAXIMUM_HOUSEHOLD_MEMBERS
      SnapApplicationExtraMemberPdf.new(
        members: additional_members,
        attributes_class: ExtraMemberAttributes,
        title: "Section C Continued",
      ).completed_file
    end
  end

  def additional_employed_pages
    if employed_members.length > MAXIMUM_EMPLOYED_MEMBERS
      SnapApplicationExtraMemberPdf.new(
        members: additional_employed_members,
        attributes_class: ExtraEmployedMemberAttributes,
        title: "Section M Continued",
      ).completed_file
    end
  end

  def additional_self_employed_pages
    if self_employed_members.length > MAXIMUM_SELF_EMPLOYED_MEMBERS
      SnapApplicationExtraMemberPdf.new(
        members: additional_self_employed_members,
        attributes_class: ExtraSelfEmployedMemberAttributes,
        title: "Section L Continued",
      ).completed_file
    end
  end

  def verification_documents
    snap_application.documents.map do |document|
      VerificationDocument.new(
        url: document,
        benefit_application: snap_application,
      ).output_file
    end.reject { |document| document.path.nil? }
  end

  def client_data
    snap_application_attributes.
      merge(member_attributes).
      merge(employed_member_attributes).
      merge(self_employed_member_attributes).
      merge(additional_income_attributes)
  end

  def snap_application_attributes
    SnapApplicationAttributes.new(snap_application: snap_application).to_h
  end

  def member_attributes
    map_attributes(
      records: first_six_members,
      klass: SnapApplicationMemberAttributes,
    )
  end

  def employed_member_attributes
    map_attributes(
      records: first_two_employed_members,
      klass: EmployedMemberAttributes,
    )
  end

  def self_employed_member_attributes
    map_attributes(
      records: first_two_self_employed_members,
      klass: SelfEmployedMemberAttributes,
    )
  end

  def additional_income_attributes
    if additional_income_source.length <= 3
      first_three_additional_income_sources.map do |attrs|
        if attrs[:source].present?
          AdditionalIncomeSourceAttributes.new(attrs).to_h
        end
      end.compact.reduce({}, :merge)
    else
      { more_than_three_additional_income_sources: "See appended page" }
    end
  end

  def map_attributes(records:, klass:)
    records.map do |record|
      if record[:member].present?
        klass.new(record).to_h
      end
    end.compact.reduce({}, :merge)
  end

  def additional_members
    application_members[6..-1]
  end

  def additional_employed_members
    employed_members[2..-1]
  end

  def additional_self_employed_members
    self_employed_members[2..-1]
  end

  def first_six_members
    [
      { member: application_members[0], position: "primary" },
      { member: application_members[1], position: "second" },
      { member: application_members[2], position: "third" },
      { member: application_members[3], position: "fourth" },
      { member: application_members[4], position: "fifth" },
      { member: application_members[5], position: "sixth" },
    ]
  end

  def first_two_employed_members
    [
      { member: employed_members[0], position: "first" },
      { member: employed_members[1], position: "second" },
    ]
  end

  def first_two_self_employed_members
    [
      { member: self_employed_members[0], position: "first" },
      { member: self_employed_members[1], position: "second" },
    ]
  end

  def first_three_additional_income_sources
    [
      {
        source: additional_income_source[0],
        position: "first",
        snap_application: snap_application,
      },
      {
        source: additional_income_source[1],
        position: "second",
        snap_application: snap_application,
      },
      {
        source: additional_income_source[2],
        position: "third",
        snap_application: snap_application,
      },
    ]
  end

  def employed_members
    @_employed_members ||=
      application_members.where(employment_status: "employed")
  end

  def self_employed_members
    @_self_employed_members ||=
      application_members.where(employment_status: "self_employed")
  end

  def additional_income_source
    @_additional_income_source ||= snap_application.additional_income
  end

  def application_members
    @_application_members ||= snap_application.members.order(:id)
  end
end


text:
package io.flutter.plugins.flutter_plugin_android_lifecycle_example;

import android.util.Log;
import androidx.lifecycle.Lifecycle;
import dev.flutter.plugins.integration_test.IntegrationTestPlugin;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter;

public class MainActivity extends FlutterActivity {
  private static final String TAG = "MainActivity";

  @Override
  public void configureFlutterEngine(FlutterEngine flutterEngine) {
    flutterEngine.getPlugins().add(new TestPlugin());
    flutterEngine.getPlugins().add(new IntegrationTestPlugin());
  }

  private static class TestPlugin implements FlutterPlugin, ActivityAware {

    @Override
    public void onAttachedToEngine(FlutterPluginBinding flutterPluginBinding) {}

    @Override
    public void onDetachedFromEngine(FlutterPluginBinding binding) {}

    @Override
    public void onAttachedToActivity(ActivityPluginBinding binding) {
      Lifecycle lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(binding);

      if (lifecycle == null) {
        Log.d(TAG, "Couldn't obtained Lifecycle!");
        return;
        // TODO(amirh): make this throw once the lifecycle API is available on stable.
        // https://github.com/flutter/flutter/issues/42875
        // throw new RuntimeException(
        //     "The FlutterLifecycleAdapter did not correctly provide a Lifecycle instance. Source reference: "
        //         + flutterPluginBinding.getLifecycle());
      }
      Log.d(TAG, "Successfully obtained Lifecycle: " + lifecycle);
    }

    @Override
    public void onDetachedFromActivity() {}

    @Override
    public void onDetachedFromActivityForConfigChanges() {}

    @Override
    public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) {}
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace WarZ
{
    static class MouseHelper
    {
        private static int _prevValue;
        private static float _elapsedTime;
        private static MouseState _prevState;
        private static MouseState _currentState;

        static MouseHelper()
        {
            _prevValue = Mouse.GetState().ScrollWheelValue;

        }

        public static bool IsLeftButtonPressed()
        {
            return (_currentState.LeftButton == ButtonState.Pressed && _prevState.LeftButton == ButtonState.Released);
        }

        public static bool IsRightButtonPressed()
        {
            return (_currentState.RightButton == ButtonState.Pressed && _prevState.RightButton == ButtonState.Released);
        }

        public static bool IsMiddleButtonPressed()
        {
            return (_currentState.MiddleButton == ButtonState.Pressed && _prevState.MiddleButton == ButtonState.Released);
        }

        public static bool hasMoved()
        {
            return Mouse.GetState().ScrollWheelValue != _prevValue;
        }

        public static int ScrollWheelValue(GameTime gameTime)
        {
            int scroll = Mouse.GetState().ScrollWheelValue;
            _elapsedTime += (float)gameTime.ElapsedGameTime.TotalSeconds;

            int result = _prevValue - scroll;

            if (_elapsedTime > 0.01f)
            {
                _prevValue = Mouse.GetState().ScrollWheelValue;
                _elapsedTime = 0;
            }

            return result;
        }

        public static void Update()
        {
            // store last state
            _prevState = _currentState;

            // get newest state
            _currentState = Mouse.GetState();
        }
    }
}


text:
package fr.pizzeria.ihm.option;

import java.util.List;

import fr.pizzeria.ihm.tools.IhmTools;
import fr.pizzeria.modele.Pizza;

public class ListerPizzasMenuOption extends OptionMenu {

	public ListerPizzasMenuOption() {
		super("Lister les pizzas");
	}

	@Override
	public boolean execute(IhmTools ihmTools) {
		List<Pizza> pizzas = ihmTools.getPizzaDao().findAllPizzas();
		for(Pizza pizza : pizzas){
			System.out.println(pizza.toString());
		}
		System.out.println("-> " + Pizza.nbPizzas + " pizzas créées depuis l'initialisation du programme");
		return false;
	}

}


text:
package br.com.triadworks.financas.controller;

import java.util.List;

import br.com.caelum.vraptor.Resource;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.Validator;
import br.com.caelum.vraptor.validator.ValidationMessage;
import br.com.caelum.vraptor.view.Results;
import br.com.triadworks.financas.dao.UsuarioDao;
import br.com.triadworks.financas.model.Usuario;

@Resource
public class UsuarioController {

	private final UsuarioDao dao;
	private final Result result;
	private final Validator validator;

	public UsuarioController(UsuarioDao dao, Result result, Validator validator) {
		this.dao = dao;
		this.result = result;
		this.validator = validator;
	}

	public List<Usuario> lista() {
		return dao.listaTudo();
	}

	public void novo() {
	}

	public void adiciona(Usuario usuario, String confirmacaoDeSenha) {

		valida(usuario, confirmacaoDeSenha);
		validator.onErrorUsePageOf(this).novo();

		dao.salva(usuario);
		result.include("notice", "Usuário adicionado com sucesso!");
		result.redirectTo(this).lista();
	}

	public Usuario edita(Long id) {
		Usuario usuario = dao.carrega(id);
		return usuario;
	}

	public void altera(Usuario usuario, String confirmacaoDeSenha) {

		valida(usuario, confirmacaoDeSenha);
		validator.onErrorUsePageOf(this).edita(usuario.getId());

		dao.atualiza(usuario);
		result.include("notice", "Usuário atualizado com sucesso!");
		result.redirectTo(this).lista();
	}

	/**
	 * Removendo usuário SEM Ajax
	 */
//	public void remove(Long id) {
//		Usuario usuario = dao.carrega(id);
//		dao.remove(usuario);
//		result.include("notice", "Usuário removido com sucesso!");
//		result.redirectTo(this).lista();
//	}
	/**
	 * Removendo usuário COM Ajax
	 */
	public void remove(Long id) {
		Usuario usuario = dao.carrega(id);
		dao.remove(usuario);
		result.use(Results.json())
			.withoutRoot().from(usuario)
//			.from(usuario, "usuario")
			.exclude("senha")
			.serialize();
	}

	private void valida(Usuario usuario, String confirmacaoDeSenha) {
		if (usuario.getNome() == null
				|| usuario.getLogin().length() < 3) {
			validator.add(new ValidationMessage("Campo obrigatório e precisa ter mais de 3 letras", "Nome"));
		}
		if (usuario.getLogin() == null
				|| usuario.getLogin().length() < 4) {
			validator.add(new ValidationMessage("Campo obrigatório e precisa ter mais de 4 letras", "Login"));
		}
		if (usuario.getEmail() == null
				|| usuario.getEmail().isEmpty()) {
			validator.add(new ValidationMessage("Campo obrigatório", "E-mail"));
		} else {
			if (!usuario.getEmail().contains("@")) {
				validator.add(new ValidationMessage("Endereço eletrônico inválido", "E-mail"));
			}
		}
		if (usuario.getSenha() == null
				|| usuario.getSenha().isEmpty()) {
			validator.add(new ValidationMessage("Campo obrigatório", "Senha"));
		} else {
			if (!usuario.getSenha().equals(confirmacaoDeSenha)) {
				validator.add(new ValidationMessage("Confirmação de senha não confere com senha", "Confirmação de senha"));
			}
		}
	}

}


text:
@interface BTHSControlPlugin : NSObject

@property (nonatomic, strong) BTHSInterface *interface;

+ (id)getDelegate;

@end


text:
package higherkindness.mu.rpc
package common

case class A(x: Int, y: Int)

case class B(a1: A, a2: A)

case class C(foo: String, a: A)

case class D(bar: Int)

case class E(a: A, foo: String)

object ExternalScope {
  case class External(e: E)
}


text:
@implementation PCToolbarView

- (void)showMainOptions {
    [UIView animateWithDuration:0.46f animations:^{
        self.mainView.alpha = 1.0f;
        self.suggestionSystemView.alpha = 0.0f;
    }];
}

- (void)hideMainOptions {
    [UIView animateWithDuration:0.46f animations:^{
        self.mainView.alpha = 0.0f;
        self.suggestionSystemView.alpha = 1.0f;
    }];
}

@end


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.examples;

import static ghidra.program.model.data.TranslationSettingsDefinition.TRANSLATION;

import java.util.List;

import ghidra.app.ExamplesPluginPackage;
import ghidra.app.plugin.PluginCategoryNames;
import ghidra.app.services.StringTranslationService;
import ghidra.framework.plugintool.*;
import ghidra.framework.plugintool.util.PluginStatus;
import ghidra.program.model.data.DataUtilities;
import ghidra.program.model.data.StringDataInstance;
import ghidra.program.model.listing.Data;
import ghidra.program.model.listing.Program;
import ghidra.program.util.ProgramLocation;
import ghidra.util.task.TaskLauncher;

/**
 * Example / toy string translation service.
 *

 * When creating your own string translation service plugin, your class's name must end with the
 * substring "Plugin".
 *

 * If done correctly, your plugin will automatically be listed in the Ghidra plugin config
 * screen.
 */
//@formatter:off
@PluginInfo(
	status = PluginStatus.RELEASED,
	packageName = ExamplesPluginPackage.NAME,
	category = PluginCategoryNames.EXAMPLES,
	shortDescription = "Sample String Translation",
	description = "Sample String Translation Service Plugin.  Morphs strings by inserting " +
				"'yeehaw' or 'woot' at various places.",
	servicesProvided = { StringTranslationService.class }
)
//@formatter:on
public class SampleStringTranslationPlugin extends Plugin implements StringTranslationService {

	public SampleStringTranslationPlugin(PluginTool tool) {
		super(tool);
	}

	@Override
	public String getTranslationServiceName() {
		return "Sample Translation Service";
	}

	@Override
	public void translate(Program program, List<ProgramLocation> dataLocations) {
		TaskLauncher.launchModal("Yeehaw-ify strings", monitor -> {

			int id = program.startTransaction("Yeehaw-ify strings");
			try {
				for (ProgramLocation progLoc : dataLocations) {
					Data data = DataUtilities.getDataAtLocation(progLoc);
					StringDataInstance str = StringDataInstance.getStringDataInstance(data);
					String s = str.getStringValue();

					if (s != null) {
						//
						// This is where a real translation should occur
						//
						String translatedValue = s.replaceAll("([ _,;:.])", "$1YEEHAW!$1");
						if (translatedValue.length() == s.length()) {
							translatedValue = s + " !WOOT!";
						}
						TRANSLATION.setTranslatedValue(data, translatedValue);
						TRANSLATION.setShowTranslated(data, true);
					}
				}
			}
			finally {
				program.endTransaction(id, true);
			}
		});
	}

}


text:
goog.provide('core.models.Region');

/**
 * Represents a region of the screen, typically
 * within a shell structure.
 */
core.models.Region = core.models.Control.extend({

  /**
   * Constructor.
   */
  initialize: function() {
    _.bindAll(this, 'loadUrl', 'loadHtml');

    // Call constructor in base class.
    core.models.Control.prototype.initialize.call(this);
  },

  /**
   * Loads the HTML from the given URL, and fires
   * the 'load:html' event when complete.
   *
   * @param {string} url of the HTML (with optional fragment selector).
   * @param {object} complete - include 'success' and 'error'
   *                callbacks as desired.
   */
  loadUrl: function(url, complete) {
    var self = this;

    $.ajax({
      url: url,
      success: function(data) {
        self.loadHtml(data);
        if (complete && complete.success) complete.success(data);
      },
      complete: function(xhr, text) {
        if (text !== 'success') {
          if (complete && complete.error) complete.error(xhr, text);
        }
      }
    });
  },

  /**
   * Tells listeners to load the specified HTML
   * via the 'load:html' event.
   * @param {string} html to load.
   */
  loadHtml: function(html) {
    this.trigger('load:html', html);
  }
});


text:
package org.keycloak.representations.idm;

import org.keycloak.representations.idm.authorization.ResourceServerRepresentation;

import java.util.List;
import java.util.Map;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class ClientRepresentation {
    protected String id;
    protected String clientId;
    protected String name;
    protected String description;
    protected String rootUrl;
    protected String adminUrl;
    protected String baseUrl;
    protected Boolean surrogateAuthRequired;
    protected Boolean enabled;
    protected Boolean alwaysDisplayInConsole;
    protected String clientAuthenticatorType;
    protected String secret;
    protected String registrationAccessToken;
    @Deprecated
    protected String[] defaultRoles;
    protected List<String> redirectUris;
    protected List<String> webOrigins;
    protected Integer notBefore;
    protected Boolean bearerOnly;
    protected Boolean consentRequired;
    protected Boolean standardFlowEnabled;
    protected Boolean implicitFlowEnabled;
    protected Boolean directAccessGrantsEnabled;
    protected Boolean serviceAccountsEnabled;
    protected Boolean oauth2DeviceAuthorizationGrantEnabled;
    protected Boolean authorizationServicesEnabled;
    @Deprecated
    protected Boolean directGrantsOnly;
    protected Boolean publicClient;
    protected Boolean frontchannelLogout;
    protected String protocol;
    protected Map<String, String> attributes;
    protected Map<String, String> authenticationFlowBindingOverrides;
    protected Boolean fullScopeAllowed;
    protected Integer nodeReRegistrationTimeout;
    protected Map<String, Integer> registeredNodes;
    protected List<ProtocolMapperRepresentation> protocolMappers;

    @Deprecated
    protected String clientTemplate;
    @Deprecated
    private Boolean useTemplateConfig;
    @Deprecated
    private Boolean useTemplateScope;
    @Deprecated
    private Boolean useTemplateMappers;

    protected List<String> defaultClientScopes;
    protected List<String> optionalClientScopes;

    private ResourceServerRepresentation authorizationSettings;
    private Map<String, Boolean> access;
    protected String origin;

    public String getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    public String getDescription() {
        return description;
    }

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

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public Boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Boolean isAlwaysDisplayInConsole() {
        return alwaysDisplayInConsole;
    }

    public void setAlwaysDisplayInConsole(Boolean alwaysDisplayInConsole) {
        this.alwaysDisplayInConsole = alwaysDisplayInConsole;
    }

    public Boolean isSurrogateAuthRequired() {
        return surrogateAuthRequired;
    }

    public void setSurrogateAuthRequired(Boolean surrogateAuthRequired) {
        this.surrogateAuthRequired = surrogateAuthRequired;
    }

    public String getRootUrl() {
        return rootUrl;
    }

    public void setRootUrl(String rootUrl) {
        this.rootUrl = rootUrl;
    }

    public String getAdminUrl() {
        return adminUrl;
    }

    public void setAdminUrl(String adminUrl) {
        this.adminUrl = adminUrl;
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public String getClientAuthenticatorType() {
        return clientAuthenticatorType;
    }

    public void setClientAuthenticatorType(String clientAuthenticatorType) {
        this.clientAuthenticatorType = clientAuthenticatorType;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getRegistrationAccessToken() {
        return registrationAccessToken;
    }

    public void setRegistrationAccessToken(String registrationAccessToken) {
        this.registrationAccessToken = registrationAccessToken;
    }

    public List<String> getRedirectUris() {
        return redirectUris;
    }

    public void setRedirectUris(List<String> redirectUris) {
        this.redirectUris = redirectUris;
    }

    public List<String> getWebOrigins() {
        return webOrigins;
    }

    public void setWebOrigins(List<String> webOrigins) {
        this.webOrigins = webOrigins;
    }

    @Deprecated
    public String[] getDefaultRoles() {
        return defaultRoles;
    }

    @Deprecated
    public void setDefaultRoles(String[] defaultRoles) {
        this.defaultRoles = defaultRoles;
    }

    public Integer getNotBefore() {
        return notBefore;
    }

    public void setNotBefore(Integer notBefore) {
        this.notBefore = notBefore;
    }

    public Boolean isBearerOnly() {
        return bearerOnly;
    }

    public void setBearerOnly(Boolean bearerOnly) {
        this.bearerOnly = bearerOnly;
    }

    public Boolean isConsentRequired() {
        return consentRequired;
    }

    public void setConsentRequired(Boolean consentRequired) {
        this.consentRequired = consentRequired;
    }

    public Boolean isStandardFlowEnabled() {
        return standardFlowEnabled;
    }

    public void setStandardFlowEnabled(Boolean standardFlowEnabled) {
        this.standardFlowEnabled = standardFlowEnabled;
    }

    public Boolean isImplicitFlowEnabled() {
        return implicitFlowEnabled;
    }

    public void setImplicitFlowEnabled(Boolean implicitFlowEnabled) {
        this.implicitFlowEnabled = implicitFlowEnabled;
    }

    public Boolean isDirectAccessGrantsEnabled() {
        return directAccessGrantsEnabled;
    }

    public void setDirectAccessGrantsEnabled(Boolean directAccessGrantsEnabled) {
        this.directAccessGrantsEnabled = directAccessGrantsEnabled;
    }

    public Boolean isServiceAccountsEnabled() {
        return serviceAccountsEnabled;
    }

    public void setServiceAccountsEnabled(Boolean serviceAccountsEnabled) {
        this.serviceAccountsEnabled = serviceAccountsEnabled;
    }

    public Boolean getAuthorizationServicesEnabled() {
        if (authorizationSettings != null) {
            return true;
        }
        return authorizationServicesEnabled;
    }

    public void setAuthorizationServicesEnabled(Boolean authorizationServicesEnabled) {
        this.authorizationServicesEnabled = authorizationServicesEnabled;
    }

    @Deprecated
    public Boolean isDirectGrantsOnly() {
        return directGrantsOnly;
    }

    public void setDirectGrantsOnly(Boolean directGrantsOnly) {
        this.directGrantsOnly = directGrantsOnly;
    }

    public Boolean isPublicClient() {
        return publicClient;
    }

    public void setPublicClient(Boolean publicClient) {
        this.publicClient = publicClient;
    }

    public Boolean isFullScopeAllowed() {
        return fullScopeAllowed;
    }

    public void setFullScopeAllowed(Boolean fullScopeAllowed) {
        this.fullScopeAllowed = fullScopeAllowed;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public Map<String, String> getAttributes() {
        return attributes;
    }

    public void setAttributes(Map<String, String> attributes) {
        this.attributes = attributes;
    }

    public Map<String, String> getAuthenticationFlowBindingOverrides() {
        return authenticationFlowBindingOverrides;
    }

    public void setAuthenticationFlowBindingOverrides(Map<String, String> authenticationFlowBindingOverrides) {
        this.authenticationFlowBindingOverrides = authenticationFlowBindingOverrides;
    }

    public Integer getNodeReRegistrationTimeout() {
        return nodeReRegistrationTimeout;
    }

    public void setNodeReRegistrationTimeout(Integer nodeReRegistrationTimeout) {
        this.nodeReRegistrationTimeout = nodeReRegistrationTimeout;
    }

    public Map<String, Integer> getRegisteredNodes() {
        return registeredNodes;
    }

    public void setRegisteredNodes(Map<String, Integer> registeredNodes) {
        this.registeredNodes = registeredNodes;
    }

    public Boolean isFrontchannelLogout() {
        return frontchannelLogout;
    }

    public void setFrontchannelLogout(Boolean frontchannelLogout) {
        this.frontchannelLogout = frontchannelLogout;
    }

    public List<ProtocolMapperRepresentation> getProtocolMappers() {
        return protocolMappers;
    }

    public void setProtocolMappers(List<ProtocolMapperRepresentation> protocolMappers) {
        this.protocolMappers = protocolMappers;
    }

    @Deprecated
    public String getClientTemplate() {
        return clientTemplate;
    }

    @Deprecated
    public Boolean isUseTemplateConfig() {
        return useTemplateConfig;
    }

    @Deprecated
    public Boolean isUseTemplateScope() {
        return useTemplateScope;
    }

    @Deprecated
    public Boolean isUseTemplateMappers() {
        return useTemplateMappers;
    }

    public List<String> getDefaultClientScopes() {
        return defaultClientScopes;
    }

    public void setDefaultClientScopes(List<String> defaultClientScopes) {
        this.defaultClientScopes = defaultClientScopes;
    }

    public List<String> getOptionalClientScopes() {
        return optionalClientScopes;
    }

    public void setOptionalClientScopes(List<String> optionalClientScopes) {
        this.optionalClientScopes = optionalClientScopes;
    }

    public ResourceServerRepresentation getAuthorizationSettings() {
        return authorizationSettings;
    }

    public void setAuthorizationSettings(ResourceServerRepresentation authorizationSettings) {
        this.authorizationSettings = authorizationSettings;
    }

    public Map<String, Boolean> getAccess() {
        return access;
    }

    public void setAccess(Map<String, Boolean> access) {
        this.access = access;
    }

    /**
     * Returns id of ClientStorageProvider that loaded this user
     *
     * @return NULL if user stored locally
     */
    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

}


text:
output:
  - json
---

This page is only available in JSON.


text:
include(Compiler/Clang)
__compiler_clang(HIP)
__compiler_clang_cxx_standards(HIP)

set(_CMAKE_COMPILE_AS_HIP_FLAG "-x hip")
set(_CMAKE_HIP_RDC_FLAG "-fgpu-rdc")

if(NOT "x${CMAKE_HIP_SIMULATE_ID}" STREQUAL "xMSVC")
  set(CMAKE_HIP_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")

  string(APPEND CMAKE_HIP_FLAGS_DEBUG_INIT " -O")
endif()

set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "SHARED")
set(CMAKE_HIP_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC  "")
set(CMAKE_HIP_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED  "")

# Populated by CMakeHIPInformation.cmake
set(CMAKE_HIP_RUNTIME_LIBRARIES_STATIC "")
set(CMAKE_HIP_RUNTIME_LIBRARIES_SHARED "")


text:
/* jslint node: true */
'use strict';

// Init the module
module.exports = function() {

  // Finds the anagrams by the given keywords
  var find = function find(keywords) {

    if(!keywords || !(keywords instanceof Array))
      return false;

    var result       = [],
        keywordsLen  = keywords.length,
        keywordsSort = function(a, b) { return a > b; };

    // Find
    var keywordsGrp = {},
        keywordKey,
        i;

    for(i = 0; i < keywordsLen; i++) {
      if(typeof keywords[i] !== 'string')
        continue;

      keywordKey = keywords[i].split('').sort(keywordsSort).join('');

      if(!keywordsGrp.hasOwnProperty(keywordKey))
        keywordsGrp[keywordKey] = [];

      keywordsGrp[keywordKey].push(keywords[i]);
    }

    var keyword;
    for(keyword in keywordsGrp) {
      if(keywordsGrp.hasOwnProperty(keyword))
        result.push(keywordsGrp[keyword]);
    }

    return result;
  };

  // Return
  return {
    find: find
  };
}();


text:
$msgs = Import-LocalizedData -FileName messages.psd1

function Get-TargetResource {
    [CmdletBinding()]
    [OutputType([System.Collections.Hashtable])]
    param (
        [parameter(Mandatory = $true)]
        [System.String]
        $Name,

        [parameter(Mandatory = $true)]
        [ValidateSet("Present","Absent")]
        [System.String]
        $Ensure,

        [parameter(Mandatory = $true)]
        [System.String]
        $Path
    )

    $folder = Get-FolderStatus @PSBoundParameters
    return $folder
}

function Set-TargetResource {
    [CmdletBinding()]
    param(
        [parameter(Mandatory = $true)]
        [System.String]
        $Name,

        [parameter(Mandatory = $true)]
        [ValidateSet("Present","Absent")]
        [System.String]
        $Ensure,

        [parameter(Mandatory = $true)]
        [System.String]
        $Path
    )

    $folder = Get-FolderStatus @PSBoundParameters

    switch ($Ensure) {
        'Present' {
            if (-Not $folder.Exists) {
                Write-Verbose -Message ($msgs.str_creating_folder -f $folder.FullPath)
                New-Item -ItemType Directory -Path $folder.FullPath -Force
            }
        }
        'Absent' {
            if ($folder.Exists) {
                Write-Verbose -Message ($msgs.str_removing_folder -f $folder.FullPath)
                Remove-Item -Path $folder.FullPath -Force -Confirm:$false
            }
        }
    }
}

function Test-TargetResource {
    [CmdletBinding()]
    param(
        [parameter(Mandatory = $true)]
        [System.String]
        $Name,

        [parameter(Mandatory = $true)]
        [ValidateSet("Present","Absent")]
        [System.String]
        $Ensure,

        [parameter(Mandatory = $true)]
        [System.String]
        $Path
    )

    $folder = Get-FolderStatus @PSBoundParameters

    switch ($Ensure) {
        'Present' {
            return $folder.Exists
        }
        'Absent' {
            return -Not $folder.Exists
        }
    }
}

function Get-FolderStatus {
    [cmdletbinding()]
    [OutputType([System.Collections.Hashtable])]
    param(
        [parameter(Mandatory)]
        [string]$Name,

        [parameter(Mandatory)]
        [ValidateSet('Present', 'Absent')]
        [string]$Ensure,

        [parameter(Mandatory)]
        [string]$Path
    )

    $returnValue = @{
        Name = $Name
        Ensure = $Ensure
        FullPath = (Join-Path -Path $Path -ChildPath $Name)
        Exists = Test-Path -Path (Join-Path -Path $Path -ChildPath $Name)
    }

    if ($returnValue.Exists) {
        Write-Verbose -Message ($msgs.gfs_folder_exists -f $returnValue.FullPath )
    } else {
        Write-Verbose -Message ($msgs.gfs_folder_not_exists -f $returnValue.FullPath )
    }

    return $returnValue
}

Export-ModuleMember -Function *-TargetResource