text:
package types

import (
	"io"
	"time"

	"github.com/docker/docker/reference"
)

// ImageTransport is a top-level namespace for ways to to store/load an image.
// It should generally correspond to ImageSource/ImageDestination implementations.
//
// Note that ImageTransport is based on "ways the users refer to image storage", not necessarily on the underlying physical transport.
// For example, all Docker References would be used within a single "docker" transport, regardless of whether the images are pulled over HTTP or HTTPS
// (or, even, IPv4 or IPv6).
//
// OTOH all images using the same transport should (apart from versions of the image format), be interoperable.
// For example, several different ImageTransport implementations may be based on local filesystem paths,
// but using completely different formats for the contents of that path (a single tar file, a directory containing tarballs, a fully expanded container filesystem, ...)
//
// See also transports.KnownTransports.
type ImageTransport interface {
	// Name returns the name of the transport, which must be unique among other transports.
	Name() string
	// ParseReference converts a string, which should not start with the ImageTransport.Name prefix, into an ImageReference.
	ParseReference(reference string) (ImageReference, error)
	// ValidatePolicyConfigurationScope checks that scope is a valid name for a signature.PolicyTransportScopes keys
	// (i.e. a valid PolicyConfigurationIdentity() or PolicyConfigurationNamespaces() return value).
	// It is acceptable to allow an invalid value which will never be matched, it can "only" cause user confusion.
	// scope passed to this function will not be "", that value is always allowed.
	ValidatePolicyConfigurationScope(scope string) error
}

// ImageReference is an abstracted way to refer to an image location, namespaced within an ImageTransport.
//
// The object should preferably be immutable after creation, with any parsing/state-dependent resolving happening
// within an ImageTransport.ParseReference() or equivalent API creating the reference object.
// That's also why the various identification/formatting methods of this type do not support returning errors.
//
// WARNING: While this design freezes the content of the reference within this process, it can not freeze the outside
// world: paths may be replaced by symlinks elsewhere, HTTP APIs may start returning different results, and so on.
type ImageReference interface {
	Transport() ImageTransport
	// StringWithinTransport returns a string representation of the reference, which MUST be such that
	// reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference.
	// NOTE: The returned string is not promised to be equal to the original input to ParseReference;
	// e.g. default attribute values omitted by the user may be filled in in the return value, or vice versa.
	// WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix;
	// instead, see transports.ImageName().
	StringWithinTransport() string

	// DockerReference returns a Docker reference associated with this reference
	// (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent,
	// not e.g. after redirect or alias processing), or nil if unknown/not applicable.
	DockerReference() reference.Named

	// PolicyConfigurationIdentity returns a string representation of the reference, suitable for policy lookup.
	// This MUST reflect user intent, not e.g. after processing of third-party redirects or aliases;
	// The value SHOULD be fully explicit about its semantics, with no hidden defaults, AND canonical
	// (i.e. various references with exactly the same semantics should return the same configuration identity)
	// It is fine for the return value to be equal to StringWithinTransport(), and it is desirable but
	// not required/guaranteed that it will be a valid input to Transport().ParseReference().
	// Returns "" if configuration identities for these references are not supported.
	PolicyConfigurationIdentity() string

	// PolicyConfigurationNamespaces returns a list of other policy configuration namespaces to search
	// for if explicit configuration for PolicyConfigurationIdentity() is not set.  The list will be processed
	// in order, terminating on first match, and an implicit "" is always checked at the end.
	// It is STRONGLY recommended for the first element, if any, to be a prefix of PolicyConfigurationIdentity(),
	// and each following element to be a prefix of the element preceding it.
	PolicyConfigurationNamespaces() []string

	// NewImage returns a types.Image for this reference.
	NewImage(certPath string, tlsVerify bool) (Image, error)
	// NewImageSource returns a types.ImageSource for this reference.
	NewImageSource(certPath string, tlsVerify bool) (ImageSource, error)
	// NewImageDestination returns a types.ImageDestination for this reference.
	NewImageDestination(certPath string, tlsVerify bool) (ImageDestination, error)
}

// ImageSource is a service, possibly remote (= slow), to download components of a single image.
// This is primarily useful for copying images around; for examining their properties, Image (below)
// is usually more useful.
type ImageSource interface {
	// Reference returns the reference used to set up this source, _as specified by the user_
	// (not as the image itself, or its underlying storage, claims).  This can be used e.g. to determine which public keys are trusted for this image.
	Reference() ImageReference
	// GetManifest returns the image's manifest along with its MIME type. The empty string is returned if the MIME type is unknown. The slice parameter indicates the supported mime types the manifest should be when getting it.
	// It may use a remote (= slow) service.
	GetManifest([]string) ([]byte, string, error)
	// Note: Calling GetBlob() may have ordering dependencies WRT other methods of this type. FIXME: How does this work with (docker save) on stdin?
	// the second return value is the size of the blob. If not known 0 is returned
	GetBlob(digest string) (io.ReadCloser, int64, error)
	// GetSignatures returns the image's signatures.  It may use a remote (= slow) service.
	GetSignatures() ([][]byte, error)
	// Delete image from registry, if operation is supported
	Delete() error
}

// ImageDestination is a service, possibly remote (= slow), to store components of a single image.
type ImageDestination interface {
	// Reference returns the reference used to set up this destination.  Note that this should directly correspond to user's intent,
	// e.g. it should use the public hostname instead of the result of resolving CNAMEs or following redirects.
	Reference() ImageReference
	// FIXME? This should also receive a MIME type if known, to differentiate between schema versions.
	PutManifest([]byte) error
	// Note: Calling PutBlob() and other methods may have ordering dependencies WRT other methods of this type. FIXME: Figure out and document.
	PutBlob(digest string, stream io.Reader) error
	PutSignatures(signatures [][]byte) error
	// SupportedManifestMIMETypes tells which manifest mime types the destination supports
	// If an empty slice or nil it's returned, then any mime type can be tried to upload
	SupportedManifestMIMETypes() []string
}

// Image is the primary API for inspecting properties of images.
type Image interface {
	// Reference returns the reference used to set up this source, _as specified by the user_
	// (not as the image itself, or its underlying storage, claims).  This can be used e.g. to determine which public keys are trusted for this image.
	Reference() ImageReference
	// ref to repository?
	// Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need.
	// NOTE: It is essential for signature verification that Manifest returns the manifest from which BlobDigests is computed.
	Manifest() ([]byte, string, error)
	// Signatures is like ImageSource.GetSignatures, but the result is cached; it is OK to call this however often you need.
	Signatures() ([][]byte, error)
	// BlobDigests returns a list of blob digests referenced by this image.
	// The list will not contain duplicates; it is not intended to correspond to the "history" or "parent chain" of a Docker image.
	// NOTE: It is essential for signature verification that BlobDigests is computed from the same manifest which is returned by Manifest().
	BlobDigests() ([]string, error)
	// Inspect returns various information for (skopeo inspect) parsed from the manifest and configuration.
	Inspect() (*ImageInspectInfo, error)
}

// ImageInspectInfo is a set of metadata describing Docker images, primarily their manifest and configuration.
// The Tag field is a legacy field which is here just for the Docker v2s1 manifest. It won't be supported
// for other manifest types.
type ImageInspectInfo struct {
	Tag           string
	Created       time.Time
	DockerVersion string
	Labels        map[string]string
	Architecture  string
	Os            string
	Layers        []string
}


text:
// RTS library headers
#include <stdio.h>
#include <stdlib.h>        /* for exit() */

// Mathworks data type definitions
#include "rtwtypes.h"
#include "rtw_extmode.h"

// External mode headers
#include "ext_types.h"
#include "ext_share.h"
#include "updown.h"
#include "ext_svr_c6000.h"
#include "ext_svr_transport_c6000.h"
#include "ext_work.h"
//
// DSP/BIOS headers
//
#include <xdc/std.h>
#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Semaphore.h>

#include <xdc/cfg/global.h>

// Define external mode simulation states
typedef enum {
    EXTMODE_STARTUP = 0,
    EXTMODE_NET_INITIALIZED,
    EXTMODE_WAITING_START_PACKET,
    EXTMODE_RUNNING,
    EXTMODE_STOPPED,
    NUM_EXTMODE_SIM_STATES
} ExtModeSimStatus;

// Global variables used for external
int_T            volatile startModel       = FALSE;
TargetSimStatus  volatile modelStatus      = TARGET_STATUS_WAITING_TO_START;
ExtModeSimStatus volatile extmodeSimStatus = EXTMODE_STARTUP;
Semaphore_Handle uploadSem;
Semaphore_Handle extStartStopSem;
Task_Handle extern_pkt_tid;
Task_Handle extern_upload_tid;

// External mode task stack sizes
#define EXT_MODE_TSK_STACK_SIZE (6144)
uint8_T stack_pkt_tid[EXT_MODE_TSK_STACK_SIZE];
uint8_T stack_upload_tid[EXT_MODE_TSK_STACK_SIZE];
PRIVATE void rtExtModeInitUD(void);
//extern void TSK_prolog(TSK_Handle hTask);
//extern void TSK_epilog(TSK_Handle hTask);
//extern void waitNetworkStartup(void);

/* TODO: should be called in ext_main.c */
extern int_T rt_TermModel(void);
extern Clock_Handle rt_task_handle;

ExtStepArgs sExtStepArgs;

// External mode startup function
void rtExtModeC6000Startup( RTWExtModeInfo *ei,
                            int_T          numSampTimes,
                            boolean_T      *stopReqPtr)
{
    Task_Params attr;
    Task_Params_init(&attr);
    Semaphore_Params sem_params;
    Semaphore_Params_init(&sem_params);

    sem_params.mode = ti_sysbios_knl_Semaphore_Mode_BINARY;

    sExtStepArgs.ei = ei;
    sExtStepArgs.numSampTimes = numSampTimes;
    sExtStepArgs.stopReqPtr = stopReqPtr;
    attr.arg1 = (UArg) &sExtStepArgs;

    // Set external mode state to
    extmodeSimStatus = EXTMODE_STARTUP;

	// Initialize semaphores used for external mode
	// communication
    uploadSem = Semaphore_create(1, &sem_params, NULL);
    extStartStopSem = Semaphore_create(1, NULL, NULL);

    // Pause until Ethernet network initialization completes
    //waitNetworkStartup();
    extmodeSimStatus = EXTMODE_NET_INITIALIZED;

    // Initialize user data structure
    rtExtModeInitUD();
    rt_ExtModeInit();

    // Create external mode task
    attr.priority = 1;
    attr.stack = (Ptr) &stack_pkt_tid[0];
    attr.stackSize = EXT_MODE_TSK_STACK_SIZE;
    extern_pkt_tid = Task_create( (Task_FuncPtr) rtExtModeOneStep,
        &attr, NULL );
    if (extern_pkt_tid == NULL)
    {
        printf("handle taskpawn error");
    }

    /*
     * Pause until receive model start packet - if external mode.
     * Make sure the external mode tasks are running so that
     * we are listening for commands from the host.
     */
    extmodeSimStatus = EXTMODE_WAITING_START_PACKET;
    modelStatus      = TARGET_STATUS_WAITING_TO_START;
    if (ExtWaitForStartPkt())
    {
        printf("\nWaiting for start packet from host.\n");
        // rt_PktServerWork() function posts a semaphore when
        // it receives start packet from host
        // this function in turn runs as part of rt_PktServer task
        //Semaphore_pend(extStartStopSem, BIOS_WAIT_FOREVER);
        while (rt_PktServerWork(ei, numSampTimes, stopReqPtr) != EXT_MODEL_START)
        {
        };
    }
    modelStatus      = TARGET_STATUS_RUNNING;
    extmodeSimStatus = EXTMODE_RUNNING;
}

void rtExtModeC6000Cleanup(int_T numSampTimes)
{
    // Change external mode state to STOP
    // to signal rtExtModeOneStep() task to
    // complete remaining Pkt / Upload work
    extmodeSimStatus = EXTMODE_STOPPED;

    // Wait for external mode server task to
    // shutdown
    /*Semaphore_pend(extStartStopSem, BIOS_WAIT_FOREVER); */

    // Delete external mode task
    //TSK_epilog( extern_pkt_tid );
    /*Task_delete( &extern_pkt_tid ); */
}

// This task is run at priority level 1, essentially a background
// task.
void rtExtModeOneStep(UArg arg0, ExtStepArgs *arg1)
{
    // Process external mode packets and upload data
    //TSK_prolog( TSK_self() );
    RTWExtModeInfo *ei = arg1->ei;
    int_T numSampTimes = arg1->numSampTimes;
    boolean_T *stopReqPtr = arg1->stopReqPtr;
    while (extmodeSimStatus != EXTMODE_STOPPED) {
        rt_PktServerWork(ei, numSampTimes, stopReqPtr);
        rt_UploadServerWork(numSampTimes);
    }
    rt_ExtModeShutdown(numSampTimes);
    //TSK_epilog( TSK_self() );

    /* TODO: */
    Clock_delete( &rt_task_handle );
    rt_TermModel();

    // Signal completion of Pkt / Upload server work
    Semaphore_post(extStartStopSem);
}

void rtExtModeUpload(int_T tid, real_T taskTime)
{
    rt_UploadBufAddTimePoint(tid, taskTime);
}

void rtExtModeCheckEndTrigger(void)
{
    rt_UploadCheckEndTrigger();
}

void rtExtModeUploadCheckTrigger(int_T numSampTimes)
{
    rt_UploadCheckTrigger(numSampTimes);
}

void rtExtModeCheckInit(int_T numSampTimes)
{
    UNUSED_PARAMETER(numSampTimes);
    if (rt_ExtModeInit() != EXT_NO_ERROR) exit(EXIT_FAILURE);
}

void rtExtModeShutdown(int_T numSampTimes)
{
    //rt_ExtModeShutdown(numSampTimes);
}

extern PUBLIC const char_T *ExtInitUD(void);
PRIVATE void rtExtModeInitUD(void)
{
    const char_T *extErrStr = ExtInitUD();

    if (extErrStr != NULL) {
        printf("\nError processing External Mode command line arguments:\n");
        printf("\t%s", extErrStr);

        exit(EXIT_FAILURE);
    }
}

/* Start of ERT specific functions and data */
#ifndef C6000_EXT_MODE
static void displayUsage(void)
{
    (void) printf("usage: model_name -tf <finaltime> -w -port <TCPport>\n");
    (void) printf("arguments:\n");
    (void) printf("  -tf <finaltime> - overrides final time specified in "
                  "Simulink (inf for no limit).\n");
    (void) printf("  -w              - waits for Simulink to start model "
                  "in External Mode.\n");
    (void) printf("  -port <TCPport> - overrides 17725 default port in "
                  "External Mode, valid range 256 to 65535.\n");
}
#endif

static const real_T RUN_FOREVER = (real_T)-1;
#if INTEGER_CODE == 0
static real_T finaltime = (real_T)-2; /* default to stop time in Sim Params. */
#else
static real_T finaltime = (real_T)-1; /* default to stop time inf */
#endif

void rtERTExtModeSetTFinal(real_T *rtmTFinal)
{
    if (finaltime >= (real_T)0 || finaltime == RUN_FOREVER) {
        *rtmTFinal = finaltime;
    }
}

void rtSetTFinalForExtMode(real_T *rtmTFinal)
{
    rtERTExtModeSetTFinal(rtmTFinal);
}

void rtERTExtModeStartMsg(void)
{
    #ifndef EXTMODE_DISABLEPRINTF
        (void)printf("\n** starting the model **\n");
    #endif
}

/* End of ERT specific functions and data */

/* [EOF] ext_work.c */

redpajama_set_name: RedPajamaGithub


text:
import { GraphQLObjectType, GraphQLSchema, OperationTypeNode } from 'graphql';
export declare function getDefinedRootType(schema: GraphQLSchema, operation: OperationTypeNode): GraphQLObjectType;
export declare function getRootTypeNames(schema: GraphQLSchema): Set<string>;
export declare function getRootTypes(schema: GraphQLSchema): Set<GraphQLObjectType>;
export declare function getRootTypeMap(schema: GraphQLSchema): Map<OperationTypeNode, GraphQLObjectType>;


text:
//--------------------------------------------------------------------------------------
// Finding valid device settings
//--------------------------------------------------------------------------------------
enum DXUT_MATCH_TYPE
{
    DXUTMT_IGNORE_INPUT = 0,  // Use the closest valid value to a default
    DXUTMT_PRESERVE_INPUT,    // Use input without change, but may cause no valid device to be found
    DXUTMT_CLOSEST_TO_INPUT   // Use the closest valid value to the input
};

struct DXUTMatchOptions
{
    DXUT_MATCH_TYPE eAPIVersion;
    DXUT_MATCH_TYPE eAdapterOrdinal;
    DXUT_MATCH_TYPE eOutput;
    DXUT_MATCH_TYPE eDeviceType;
    DXUT_MATCH_TYPE eWindowed;
    DXUT_MATCH_TYPE eAdapterFormat;
    DXUT_MATCH_TYPE eVertexProcessing;
    DXUT_MATCH_TYPE eResolution;
    DXUT_MATCH_TYPE eBackBufferFormat;
    DXUT_MATCH_TYPE eBackBufferCount;
    DXUT_MATCH_TYPE eMultiSample;
    DXUT_MATCH_TYPE eSwapEffect;
    DXUT_MATCH_TYPE eDepthFormat;
    DXUT_MATCH_TYPE eStencilFormat;
    DXUT_MATCH_TYPE ePresentFlags;
    DXUT_MATCH_TYPE eRefreshRate;
    DXUT_MATCH_TYPE ePresentInterval;
};

HRESULT WINAPI DXUTFindValidDeviceSettings( DXUTDeviceSettings* pOut, DXUTDeviceSettings* pIn = NULL,
                                            DXUTMatchOptions* pMatchOptions = NULL );

//--------------------------------------------------------------------------------------
// Functions to get bit depth from formats
//--------------------------------------------------------------------------------------
HRESULT WINAPI DXUTGetD3D10AdapterDisplayMode( UINT AdapterOrdinal, UINT Output, DXGI_MODE_DESC* pModeDesc ); // TODO: refactor?
UINT WINAPI DXUTGetD3D9ColorChannelBits( D3DFORMAT fmt );
UINT WINAPI DXUTGetAlphaChannelBits( D3DFORMAT fmt );
UINT WINAPI DXUTGetStencilBits( D3DFORMAT fmt );
UINT WINAPI DXUTGetDepthBits( D3DFORMAT fmt );
UINT WINAPI DXUTGetDXGIColorChannelBits( DXGI_FORMAT fmt );

//--------------------------------------------------------------------------------------
// Forward declarations
//--------------------------------------------------------------------------------------
class CD3D9EnumAdapterInfo;
class CD3D9EnumDeviceInfo;
struct CD3D9EnumDeviceSettingsCombo;
struct CD3D9EnumDSMSConflict;

//--------------------------------------------------------------------------------------
// Optional memory create/destory functions.  If not call, these will be called automatically
//--------------------------------------------------------------------------------------
HRESULT WINAPI DXUTCreateD3D9Enumeration();
HRESULT WINAPI DXUTCreateD3D10Enumeration();
void WINAPI DXUTDestroyD3D9Enumeration();
void WINAPI DXUTDestroyD3D10Enumeration();

//--------------------------------------------------------------------------------------
// Enumerates available Direct3D9 adapters, devices, modes, etc.
// Use DXUTGetD3D9Enumeration() to access global instance
//--------------------------------------------------------------------------------------
class CD3D9Enumeration
{
public:
    // These should be called before Enumerate().
    //
    // Use these calls and the IsDeviceAcceptable to control the contents of
    // the enumeration object, which affects the device selection and the device settings dialog.
    void                    SetRequirePostPixelShaderBlending( bool bRequire )
    {
        m_bRequirePostPixelShaderBlending = bRequire;
    }
    void                    SetResolutionMinMax( UINT nMinWidth, UINT nMinHeight, UINT nMaxWidth, UINT nMaxHeight );
    void                    SetRefreshMinMax( UINT nMin, UINT nMax );
    void                    SetMultisampleQualityMax( UINT nMax );
    void                    GetPossibleVertexProcessingList( bool* pbSoftwareVP, bool* pbHardwareVP,
                                                             bool* pbPureHarewareVP, bool* pbMixedVP );
    void                    SetPossibleVertexProcessingList( bool bSoftwareVP, bool bHardwareVP, bool bPureHarewareVP,
                                                             bool bMixedVP );
    CGrowableArray <D3DFORMAT>* GetPossibleDepthStencilFormatList();
    CGrowableArray <D3DMULTISAMPLE_TYPE>* GetPossibleMultisampleTypeList();
    CGrowableArray <UINT>* GetPossiblePresentIntervalList();
    void                    ResetPossibleDepthStencilFormats();
    void                    ResetPossibleMultisampleTypeList();
    void                    ResetPossiblePresentIntervalList();

    // Call Enumerate() to enumerate available D3D adapters, devices, modes, etc.
    bool                    HasEnumerated()
    {
        return m_bHasEnumerated;
    }
    HRESULT                 Enumerate( LPDXUTCALLBACKISD3D9DEVICEACCEPTABLE IsD3D9DeviceAcceptableFunc = NULL,
                                       void* pIsD3D9DeviceAcceptableFuncUserContext = NULL );

    // These should be called after Enumerate() is called
    CGrowableArray <CD3D9EnumAdapterInfo*>* GetAdapterInfoList();
    CD3D9EnumAdapterInfo* GetAdapterInfo( UINT AdapterOrdinal );
    CD3D9EnumDeviceInfo* GetDeviceInfo( UINT AdapterOrdinal, D3DDEVTYPE DeviceType );
    CD3D9EnumDeviceSettingsCombo* GetDeviceSettingsCombo( DXUTD3D9DeviceSettings* pD3D9DeviceSettings )
    {
        return GetDeviceSettingsCombo( pD3D9DeviceSettings->AdapterOrdinal, pD3D9DeviceSettings->DeviceType,
                                       pD3D9DeviceSettings->AdapterFormat, pD3D9DeviceSettings->pp.BackBufferFormat,
                                       pD3D9DeviceSettings->pp.Windowed );
    }
    CD3D9EnumDeviceSettingsCombo* GetDeviceSettingsCombo( UINT AdapterOrdinal, D3DDEVTYPE DeviceType,
                                                          D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat,
                                                          BOOL Windowed );

                            ~CD3D9Enumeration();

private:
    friend HRESULT WINAPI   DXUTCreateD3D9Enumeration();

    // Use DXUTGetD3D9Enumeration() to access global instance
                            CD3D9Enumeration();

    bool m_bHasEnumerated;
    IDirect3D9* m_pD3D;
    LPDXUTCALLBACKISD3D9DEVICEACCEPTABLE m_IsD3D9DeviceAcceptableFunc;
    void* m_pIsD3D9DeviceAcceptableFuncUserContext;
    bool m_bRequirePostPixelShaderBlending;
    CGrowableArray <D3DFORMAT> m_DepthStencilPossibleList;
    CGrowableArray <D3DMULTISAMPLE_TYPE> m_MultiSampleTypeList;
    CGrowableArray <UINT> m_PresentIntervalList;

    bool m_bSoftwareVP;
    bool m_bHardwareVP;
    bool m_bPureHarewareVP;
    bool m_bMixedVP;

    UINT m_nMinWidth;
    UINT m_nMaxWidth;
    UINT m_nMinHeight;
    UINT m_nMaxHeight;
    UINT m_nRefreshMin;
    UINT m_nRefreshMax;
    UINT m_nMultisampleQualityMax;

    // Array of CD3D9EnumAdapterInfo* with unique AdapterOrdinals
    CGrowableArray <CD3D9EnumAdapterInfo*> m_AdapterInfoList;

    HRESULT                 EnumerateDevices( CD3D9EnumAdapterInfo* pAdapterInfo,
                                              CGrowableArray <D3DFORMAT>* pAdapterFormatList );
    HRESULT                 EnumerateDeviceCombos( CD3D9EnumAdapterInfo* pAdapterInfo,
                                                   CD3D9EnumDeviceInfo* pDeviceInfo,
                                                   CGrowableArray <D3DFORMAT>* pAdapterFormatList );
    void                    BuildDepthStencilFormatList( CD3D9EnumDeviceSettingsCombo* pDeviceCombo );
    void                    BuildMultiSampleTypeList( CD3D9EnumDeviceSettingsCombo* pDeviceCombo );
    void                    BuildDSMSConflictList( CD3D9EnumDeviceSettingsCombo* pDeviceCombo );
    void                    BuildPresentIntervalList( CD3D9EnumDeviceInfo* pDeviceInfo,
                                                      CD3D9EnumDeviceSettingsCombo* pDeviceCombo );
    void                    ClearAdapterInfoList();
};

CD3D9Enumeration*   WINAPI DXUTGetD3D9Enumeration( bool bForceEnumerate = false );

//--------------------------------------------------------------------------------------
// A class describing an adapter which contains a unique adapter ordinal
// that is installed on the system
//--------------------------------------------------------------------------------------
class CD3D9EnumAdapterInfo
{
public:
            ~CD3D9EnumAdapterInfo();

    UINT AdapterOrdinal;
    D3DADAPTER_IDENTIFIER9 AdapterIdentifier;
    WCHAR   szUniqueDescription[256];

    CGrowableArray <D3DDISPLAYMODE> displayModeList; // Array of supported D3DDISPLAYMODEs
    CGrowableArray <CD3D9EnumDeviceInfo*> deviceInfoList; // Array of CD3D9EnumDeviceInfo* with unique supported DeviceTypes
};

//--------------------------------------------------------------------------------------
// A class describing a Direct3D device that contains a
//       unique supported device type
//--------------------------------------------------------------------------------------
class CD3D9EnumDeviceInfo
{
public:
    ~CD3D9EnumDeviceInfo();

    UINT AdapterOrdinal;
    D3DDEVTYPE DeviceType;
    D3DCAPS9 Caps;

    // List of CD3D9EnumDeviceSettingsCombo* with a unique set
    // of AdapterFormat, BackBufferFormat, and Windowed
    CGrowableArray <CD3D9EnumDeviceSettingsCombo*> deviceSettingsComboList;
};

//--------------------------------------------------------------------------------------
// A struct describing device settings that contains a unique combination of
// adapter format, back buffer format, and windowed that is compatible with a
// particular Direct3D device and the app.
//--------------------------------------------------------------------------------------
struct CD3D9EnumDeviceSettingsCombo
{
    UINT AdapterOrdinal;
    D3DDEVTYPE DeviceType;
    D3DFORMAT AdapterFormat;
    D3DFORMAT BackBufferFormat;
    BOOL Windowed;

    CGrowableArray <D3DFORMAT> depthStencilFormatList; // List of D3DFORMATs
    CGrowableArray <D3DMULTISAMPLE_TYPE> multiSampleTypeList; // List of D3DMULTISAMPLE_TYPEs
    CGrowableArray <DWORD> multiSampleQualityList; // List of number of quality levels for each multisample type
    CGrowableArray <UINT> presentIntervalList; // List of D3DPRESENT flags
    CGrowableArray <CD3D9EnumDSMSConflict> DSMSConflictList; // List of CD3D9EnumDSMSConflict

    CD3D9EnumAdapterInfo* pAdapterInfo;
    CD3D9EnumDeviceInfo* pDeviceInfo;
};

//--------------------------------------------------------------------------------------
// A depth/stencil buffer format that is incompatible with a
// multisample type.
//--------------------------------------------------------------------------------------
struct CD3D9EnumDSMSConflict
{
    D3DFORMAT DSFormat;
    D3DMULTISAMPLE_TYPE MSType;
};

//--------------------------------------------------------------------------------------
// Forward declarations
//--------------------------------------------------------------------------------------
class CD3D10EnumAdapterInfo;
class CD3D10EnumDeviceInfo;
class CD3D10EnumOutputInfo;
struct CD3D10EnumDeviceSettingsCombo;

//--------------------------------------------------------------------------------------
// Enumerates available Direct3D10 adapters, devices, modes, etc.
// Use DXUTGetD3D9Enumeration() to access global instance
//--------------------------------------------------------------------------------------
class CD3D10Enumeration
{
public:
    // These should be called before Enumerate().
    //
    // Use these calls and the IsDeviceAcceptable to control the contents of
    // the enumeration object, which affects the device selection and the device settings dialog.
    void                    SetResolutionMinMax( UINT nMinWidth, UINT nMinHeight, UINT nMaxWidth, UINT nMaxHeight );
    void                    SetRefreshMinMax( UINT nMin, UINT nMax );
    void                    SetMultisampleQualityMax( UINT nMax );
    CGrowableArray <D3DFORMAT>* GetPossibleDepthStencilFormatList();
    void                    ResetPossibleDepthStencilFormats();
    void                    SetEnumerateAllAdapterFormats( bool bEnumerateAllAdapterFormats, bool bEnumerateNow =
                                                           true );

    // Call Enumerate() to enumerate available D3D10 adapters, devices, modes, etc.
    bool                    HasEnumerated()
    {
        return m_bHasEnumerated;
    }
    HRESULT                 Enumerate( LPDXUTCALLBACKISD3D10DEVICEACCEPTABLE IsD3D10DeviceAcceptableFunc,
                                       void* pIsD3D10DeviceAcceptableFuncUserContext );

    // These should be called after Enumerate() is called
    CGrowableArray <CD3D10EnumAdapterInfo*>* GetAdapterInfoList();
    CD3D10EnumAdapterInfo* GetAdapterInfo( UINT AdapterOrdinal );
    CD3D10EnumDeviceInfo* GetDeviceInfo( UINT AdapterOrdinal, D3D10_DRIVER_TYPE DeviceType );
    CD3D10EnumOutputInfo* GetOutputInfo( UINT AdapterOrdinal, UINT Output );
    CD3D10EnumDeviceSettingsCombo* GetDeviceSettingsCombo( DXUTD3D10DeviceSettings* pDeviceSettings )
    {
        return GetDeviceSettingsCombo( pDeviceSettings->AdapterOrdinal, pDeviceSettings->DriverType,
                                       pDeviceSettings->Output, pDeviceSettings->sd.BufferDesc.Format,
                                       pDeviceSettings->sd.Windowed );
    }
    CD3D10EnumDeviceSettingsCombo* GetDeviceSettingsCombo( UINT AdapterOrdinal, D3D10_DRIVER_TYPE DeviceType,
                                                           UINT Output, DXGI_FORMAT BackBufferFormat, BOOL Windowed );

                            ~CD3D10Enumeration();

private:
    friend HRESULT WINAPI   DXUTCreateD3D10Enumeration();

    // Use DXUTGetD3D10Enumeration() to access global instance
                            CD3D10Enumeration();

    bool m_bHasEnumerated;
    LPDXUTCALLBACKISD3D10DEVICEACCEPTABLE m_IsD3D10DeviceAcceptableFunc;
    void* m_pIsD3D10DeviceAcceptableFuncUserContext;

    CGrowableArray <DXGI_FORMAT> m_DepthStencilPossibleList;

    UINT m_nMinWidth;
    UINT m_nMaxWidth;
    UINT m_nMinHeight;
    UINT m_nMaxHeight;
    UINT m_nRefreshMin;
    UINT m_nRefreshMax;
    UINT m_nMultisampleQualityMax;
    bool m_bEnumerateAllAdapterFormats;

    // Array of CD3D9EnumAdapterInfo* with unique AdapterOrdinals
    CGrowableArray <CD3D10EnumAdapterInfo*> m_AdapterInfoList;

    HRESULT                 EnumerateOutputs( CD3D10EnumAdapterInfo* pAdapterInfo );
    HRESULT                 EnumerateDevices( CD3D10EnumAdapterInfo* pAdapterInfo );
    HRESULT                 EnumerateDeviceCombos( IDXGIFactory* pFactory, CD3D10EnumAdapterInfo* pAdapterInfo );
    HRESULT                 EnumerateDisplayModes( CD3D10EnumOutputInfo* pOutputInfo );
    void                    BuildMultiSampleQualityList( DXGI_FORMAT fmt,
                                                         CD3D10EnumDeviceSettingsCombo* pDeviceCombo );
    void                    ClearAdapterInfoList();
};

CD3D10Enumeration*  WINAPI DXUTGetD3D10Enumeration( bool bForceEnumerate = false, bool EnumerateAllAdapterFormats =
                                                    false );

#define DXGI_MAX_DEVICE_IDENTIFIER_STRING 128

//--------------------------------------------------------------------------------------
// A class describing an adapter which contains a unique adapter ordinal
// that is installed on the system
//--------------------------------------------------------------------------------------
class CD3D10EnumAdapterInfo
{
    const CD3D10EnumAdapterInfo& operator =( const CD3D10EnumAdapterInfo& rhs );

public:
            ~CD3D10EnumAdapterInfo();

    UINT AdapterOrdinal;
    DXGI_ADAPTER_DESC AdapterDesc;
    WCHAR   szUniqueDescription[DXGI_MAX_DEVICE_IDENTIFIER_STRING];
    IDXGIAdapter* m_pAdapter;

    CGrowableArray <CD3D10EnumOutputInfo*> outputInfoList; // Array of CD3D10EnumOutputInfo*
    CGrowableArray <CD3D10EnumDeviceInfo*> deviceInfoList; // Array of CD3D10EnumDeviceInfo*
    // List of CD3D10EnumDeviceSettingsCombo* with a unique set
    // of BackBufferFormat, and Windowed
    CGrowableArray <CD3D10EnumDeviceSettingsCombo*> deviceSettingsComboList;
};

class CD3D10EnumOutputInfo
{
    const CD3D10EnumOutputInfo& operator =( const CD3D10EnumOutputInfo& rhs );

public:
    ~CD3D10EnumOutputInfo();

    UINT AdapterOrdinal;
    UINT Output;
    IDXGIOutput* m_pOutput;
    DXGI_OUTPUT_DESC Desc;

    CGrowableArray <DXGI_MODE_DESC> displayModeList; // Array of supported D3DDISPLAYMODEs
};

//--------------------------------------------------------------------------------------
// A class describing a Direct3D10 device that contains a
//       unique supported driver type
//--------------------------------------------------------------------------------------
class CD3D10EnumDeviceInfo
{
    const CD3D10EnumDeviceInfo& operator =( const CD3D10EnumDeviceInfo& rhs );

public:
    ~CD3D10EnumDeviceInfo();

    UINT AdapterOrdinal;
    D3D10_DRIVER_TYPE DeviceType;
};

//--------------------------------------------------------------------------------------
// A struct describing device settings that contains a unique combination of
// adapter format, back buffer format, and windowed that is compatible with a
// particular Direct3D device and the app.
//--------------------------------------------------------------------------------------
struct CD3D10EnumDeviceSettingsCombo
{
    UINT AdapterOrdinal;
    D3D10_DRIVER_TYPE DeviceType;
    DXGI_FORMAT BackBufferFormat;
    BOOL Windowed;
    UINT Output;

    CGrowableArray <UINT> multiSampleCountList; // List of valid sampling counts (multisampling)
    CGrowableArray <UINT> multiSampleQualityList; // List of number of quality levels for each multisample count

    CD3D10EnumAdapterInfo* pAdapterInfo;
    CD3D10EnumDeviceInfo* pDeviceInfo;
    CD3D10EnumOutputInfo* pOutputInfo;
};

#endif


text:
namespace io = boost::iostreams;

void activityCallback(const std_msgs::String::ConstPtr& msg)
{
    ROS_INFO("%s", msg->data.c_str());
}

int main(int argc, char **argv)
{

    typedef std::vector<std::string> frames;

    ros::init(argc, argv, "tf_logger");
    ros::NodeHandle n;
    ros::Subscriber sub = n.subscribe("chatter", 1000, activityCallback);

    ros::Publisher activity_pub = n.advertise<std_msgs::String>("chatter", 1000);

    ros::Rate loop_rate(30);

    tf::TransformListener listener;
    std::string openni_depth_frame;

    //Load config file
    std::string dir = ros::package::getPath("tug_test");
    std::string file_path = dir+std::string("/conf/frames.cfg");
    std::ifstream fin(file_path.c_str());
    if (fin.fail()) {
        ROS_ERROR("Could not open %s.", file_path.c_str());
        exit(-1);
    }

    //Read configuration
    YAML::Node doc = YAML::Load(fin);
    frames target_frames;
    frames reference_frame;
    try{
        target_frames = doc["target_frames"].as<frames>();
        reference_frame = doc["reference_frame"].as<frames>();
    }
    catch(YAML::Exception& e){
        ROS_ERROR("Config file error!!! check conf/frames.cfg, %s", e.what());
        exit(-1);
    }

    //using boost for writing tf data to csv file
    io::stream_buffer<io::file_sink> buf(dir+"/data/data.csv");
    std::ostream                     out(&buf);

    //create headers for csv file
    out<<"\"sequence_number\",";
    out<<"\"reference_frame\"";
    for(unsigned i=0; i<target_frames.size(); i++){
        out << ",\""<<target_frames[i]<<"_X\",";
        out << "\""<<target_frames[i]<<"_Y\",";
        out << "\""<<target_frames[i]<<"_Z\",";

        out << "\""<<target_frames[i]<<"_AngX\",";
        out << "\""<<target_frames[i]<<"_AngY\",";
        out << "\""<<target_frames[i]<<"_AngZ\",";
        out << "\""<<target_frames[i]<<"_AngW\"";
    }
    out<<std::endl;

    int count = 0;
    while (ros::ok())
    {
        //store requested transforms in csv file
        for(unsigned j=0; j<reference_frame.size(); j++){
            out << count;
            out<<",\""<<reference_frame[j]<<"\"";
            for(unsigned i=0; i<target_frames.size(); i++){
                try{
                    tf::StampedTransform transform;
                    listener.waitForTransform(reference_frame[j], target_frames[i], ros::Time(0), ros::Duration(3.0));
                    listener.lookupTransform(reference_frame[j], target_frames[i], ros::Time(0), transform);
                    out <<" , "<<transform.getOrigin().getX()<<" , "
                       <<transform.getOrigin().getY()<<" , "
                      <<transform.getOrigin().getZ()<<" , "
                     <<transform.getRotation().getX()<<" , "
                    <<transform.getRotation().getY()<<" , "
                    <<transform.getRotation().getZ()<<" , "
                    <<transform.getRotation().getW();
                }
                catch (tf::TransformException ex){
                    ROS_ERROR("%s",ex.what());
                    ros::Duration(1.0).sleep();
                }
            }
            out<<std::endl;
        }
        ros::spinOnce();
        loop_rate.sleep();
        ++count;
    }
    return 0;
}


text:
<?php

declare(strict_types=1);

/*
 * This file is part of the GeckoPackages.
 *
 * (c) GeckoPackages https://github.com/GeckoPackages
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace GeckoPackages\PHPUnit\Constraints\XML;

/**
 * @api
 *
 * @author SpacePossum
 */
final class XMLValidConstraint extends AbstractXMLConstraint
{
    /**
     * {@inheritdoc}
     */
    protected function stringMatches($other)
    {
        $internalErrors = libxml_use_internal_errors(true);
        $disableEntities = libxml_disable_entity_loader(true);
        libxml_clear_errors();

        $dom = new \DOMDocument();
        $dom->preserveWhiteSpace = false;
        $dom->validateOnParse = true;
        if (!@$dom->loadXML($other, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
            libxml_disable_entity_loader($disableEntities);
            $this->setXMLConstraintErrors();
            libxml_clear_errors();
            libxml_use_internal_errors($internalErrors);

            return false;
        }

        libxml_disable_entity_loader($disableEntities);
        libxml_clear_errors();

        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function toString()
    {
        return 'is valid XML';
    }
}


text:
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using SimplCommerce.Infrastructure.Data;
using SimplCommerce.Module.Core.Services;
using SimplCommerce.Module.News.Models;
using SimplCommerce.Module.News.ViewModels;

namespace SimplCommerce.Module.News.Controllers
{
    public class NewsItemController : Controller
    {
        private readonly IRepository<NewsItem> _newsItemRepository;
        private readonly IRepository<NewsCategory> _newsCategoryRepository;
        private readonly IMediaService _mediaService;
        private int _pageSize;

        public NewsItemController(IRepository<NewsItem> newsItemRepository,
             IRepository<NewsCategory> newsCategoryRepository,
            IMediaService mediaService,
            IConfiguration config)
        {
            _newsItemRepository = newsItemRepository;
            _newsCategoryRepository = newsCategoryRepository;
            _mediaService = mediaService;
            _pageSize = config.GetValue<int>("News.PageSize");
        }

        [HttpGet("news")]
        public IActionResult NewsHome(int page)
        {
            var newsCategoryList = _newsCategoryRepository.Query()
                .Include(x => x.NewsItems)
                .Where(x => !x.IsDeleted)
                .Select(x => new NewsCategoryVm()
                {
                    Id = x.Id,
                    Name = x.Name,
                    SeoTitle = x.SeoTitle
                })
                .ToList();

            var model = new NewsVm()
            {
                NewsCategory = newsCategoryList
            };

            var query = _newsItemRepository.Query()
                .Where(x => !x.IsDeleted && x.IsPublished)
                .OrderByDescending(x => x.CreatedOn);

            model.TotalItem = query.Count();
            var currentPageNum = page <= 0 ? 1 : page;
            var offset = (_pageSize * currentPageNum) - _pageSize;
            while (currentPageNum > 1 && offset >= model.TotalItem)
            {
                currentPageNum--;
                offset = (_pageSize * currentPageNum) - _pageSize;
            }

            model.NewsItem = query.Include(x => x.ThumbnailImage).Select(x => new NewsItemThumbnail()
            {
                Id = x.Id,
                ShortContent = x.ShortContent,
                ImageUrl = _mediaService.GetMediaUrl(x.ThumbnailImage),
                PublishedOn = x.CreatedOn,
                SeoTitle = x.SeoTitle
            })
            .Skip(offset)
            .Take(_pageSize)
            .ToList();

            model.PageSize = _pageSize;
            model.Page = currentPageNum;
            return View(model);
        }

        public IActionResult NewsItemDetail(long id)
        {
            var newsItem = _newsItemRepository.Query()
                .Include(x => x.ThumbnailImage)
                .FirstOrDefault(x => x.Id == id && x.IsPublished && !x.IsDeleted);

            if (newsItem == null)
            {
                return Redirect("~/Error/FindNotFound");
            }

            var model = new NewsItemVm()
            {
                Name = newsItem.Name,
                FullContent = newsItem.FullContent,
                ThumbnailImageUrl = _mediaService.GetThumbnailUrl(newsItem.ThumbnailImage)
            };

            return View(model);
        }
    }
}


text:
// @flow

import React, { Component } from 'react';
import TextareaAutosize from 'react-textarea-autosize';
import type { Dispatch } from 'redux';

import { isMobileBrowser } from '../../../base/environment/utils';
import { translate } from '../../../base/i18n';
import { Icon, IconPlane, IconSmile } from '../../../base/icons';
import { connect } from '../../../base/redux';
import { areSmileysDisabled } from '../../functions';

import SmileysPanel from './SmileysPanel';

/**
 * The type of the React {@code Component} props of {@link ChatInput}.
 */
type Props = {

    /**
     * Invoked to send chat messages.
     */
    dispatch: Dispatch<any>,

    /**
     * Optional callback to invoke when the chat textarea has auto-resized to
     * fit overflowing text.
     */
    onResize: ?Function,

    /**
     * Callback to invoke on message send.
     */
    onSend: Function,

    /**
     * Invoked to obtain translated strings.
     */
    t: Function,

    /**
     * Whether chat emoticons are disabled.
     */
    _areSmileysDisabled: boolean

};

/**
 * The type of the React {@code Component} state of {@link ChatInput}.
 */
type State = {

    /**
     * User provided nickname when the input text is provided in the view.
     */
    message: string,

    /**
     * Whether or not the smiley selector is visible.
     */
    showSmileysPanel: boolean
};

/**
 * Implements a React Component for drafting and submitting a chat message.
 *
 * @augments Component
 */
class ChatInput extends Component<Props, State> {
    _textArea: ?HTMLTextAreaElement;

    state = {
        message: '',
        showSmileysPanel: false
    };

    /**
     * Initializes a new {@code ChatInput} instance.
     *
     * @param {Object} props - The read-only properties with which the new
     * instance is to be initialized.
     */
    constructor(props: Props) {
        super(props);

        this._textArea = null;

        // Bind event handlers so they are only bound once for every instance.
        this._onDetectSubmit = this._onDetectSubmit.bind(this);
        this._onMessageChange = this._onMessageChange.bind(this);
        this._onSmileySelect = this._onSmileySelect.bind(this);
        this._onSubmitMessage = this._onSubmitMessage.bind(this);
        this._onToggleSmileysPanel = this._onToggleSmileysPanel.bind(this);
        this._onEscHandler = this._onEscHandler.bind(this);
        this._onToggleSmileysPanelKeyPress = this._onToggleSmileysPanelKeyPress.bind(this);
        this._onSubmitMessageKeyPress = this._onSubmitMessageKeyPress.bind(this);
        this._setTextAreaRef = this._setTextAreaRef.bind(this);
    }

    /**
     * Implements React's {@link Component#componentDidMount()}.
     *
     * @inheritdoc
     */
    componentDidMount() {
        if (isMobileBrowser()) {
            // Ensure textarea is not focused when opening chat on mobile browser.
            this._textArea && this._textArea.blur();
        }
    }

    /**
     * Implements React's {@link Component#render()}.
     *
     * @inheritdoc
     * @returns {ReactElement}
     */
    render() {
        const smileysPanelClassName = `${this.state.showSmileysPanel
            ? 'show-smileys' : 'hide-smileys'} smileys-panel`;

        return (
            <div className = { `chat-input-container${this.state.message.trim().length ? ' populated' : ''}` }>

                    { this.props._areSmileysDisabled ? null : (

                                    <div
                                        aria-expanded = { this.state.showSmileysPanel }
                                        aria-haspopup = 'smileysContainer'
                                        aria-label = { this.props.t('chat.smileysPanel') }
                                        className = 'smiley-button'
                                        onClick = { this._onToggleSmileysPanel }
                                        onKeyDown = { this._onEscHandler }
                                        onKeyPress = { this._onToggleSmileysPanelKeyPress }
                                        role = 'button'
                                        tabIndex = { 0 }>
                                        <Icon src = { IconSmile } />

                                <SmileysPanel
                                    onSmileySelect = { this._onSmileySelect } />

                    ) }

                        <TextareaAutosize
                            autoComplete = 'off'
                            autoFocus = { true }
                            id = 'usermsg'
                            maxRows = { 5 }
                            onChange = { this._onMessageChange }
                            onHeightChange = { this.props.onResize }
                            onKeyDown = { this._onDetectSubmit }
                            placeholder = { this.props.t('chat.messagebox') }
                            ref = { this._setTextAreaRef }
                            tabIndex = { 0 }
                            value = { this.state.message } />

                            <Icon src = { IconPlane } />

        );
    }

    /**
     * Place cursor focus on this component's text area.
     *
     * @private
     * @returns {void}
     */
    _focus() {
        this._textArea && this._textArea.focus();
    }

    _onSubmitMessage: () => void;

    /**
     * Submits the message to the chat window.
     *
     * @returns {void}
     */
    _onSubmitMessage() {
        const trimmed = this.state.message.trim();

        if (trimmed) {
            this.props.onSend(trimmed);

            this.setState({ message: '' });

            // Keep the textarea in focus when sending messages via submit button.
            this._focus();
        }

    }
    _onDetectSubmit: (Object) => void;

    /**
     * Detects if enter has been pressed. If so, submit the message in the chat
     * window.
     *
     * @param {string} event - Keyboard event.
     * @private
     * @returns {void}
     */
    _onDetectSubmit(event) {
        // Composition events used to add accents to characters
        // despite their absence from standard US keyboards,
        // to build up logograms of many Asian languages
        // from their base components or categories and so on.
        if (event.isComposing || event.keyCode === 229) {
            // keyCode 229 means that user pressed some button,
            // but input method is still processing that.
            // This is a standard behavior for some input methods
            // like entering japanese or сhinese hieroglyphs.
            return;
        }

        if (event.key === 'Enter'
            && event.shiftKey === false
            && event.ctrlKey === false) {
            event.preventDefault();
            event.stopPropagation();

            this._onSubmitMessage();
        }
    }

    _onSubmitMessageKeyPress: (Object) => void;

    /**
     * KeyPress handler for accessibility.
     *
     * @param {Object} e - The key event to handle.
     *
     * @returns {void}
     */
    _onSubmitMessageKeyPress(e) {
        if (e.key === ' ' || e.key === 'Enter') {
            e.preventDefault();
            this._onSubmitMessage();
        }
    }

    _onMessageChange: (Object) => void;

    /**
     * Updates the known message the user is drafting.
     *
     * @param {string} event - Keyboard event.
     * @private
     * @returns {void}
     */
    _onMessageChange(event) {
        this.setState({ message: event.target.value });
    }

    _onSmileySelect: (string) => void;

    /**
     * Appends a selected smileys to the chat message draft.
     *
     * @param {string} smileyText - The value of the smiley to append to the
     * chat message.
     * @private
     * @returns {void}
     */
    _onSmileySelect(smileyText) {
        if (smileyText) {
            this.setState({
                message: `${this.state.message} ${smileyText}`,
                showSmileysPanel: false
            });
        } else {
            this.setState({
                showSmileysPanel: false
            });
        }

        this._focus();
    }

    _onToggleSmileysPanel: () => void;

    /**
     * Callback invoked to hide or show the smileys selector.
     *
     * @private
     * @returns {void}
     */
    _onToggleSmileysPanel() {
        if (this.state.showSmileysPanel) {
            this._focus();
        }
        this.setState({ showSmileysPanel: !this.state.showSmileysPanel });
    }

    _onEscHandler: (Object) => void;

    /**
     * KeyPress handler for accessibility.
     *
     * @param {Object} e - The key event to handle.
     *
     * @returns {void}
     */
    _onEscHandler(e) {
        // Escape handling does not work in onKeyPress
        if (this.state.showSmileysPanel && e.key === 'Escape') {
            e.preventDefault();
            e.stopPropagation();
            this._onToggleSmileysPanel();
        }
    }

    _onToggleSmileysPanelKeyPress: (Object) => void;

    /**
     * KeyPress handler for accessibility.
     *
     * @param {Object} e - The key event to handle.
     *
     * @returns {void}
     */
    _onToggleSmileysPanelKeyPress(e) {
        if (e.key === ' ' || e.key === 'Enter') {
            e.preventDefault();
            this._onToggleSmileysPanel();
        }
    }

    _setTextAreaRef: (?HTMLTextAreaElement) => void;

    /**
     * Sets the reference to the HTML TextArea.
     *
     * @param {HTMLAudioElement} textAreaElement - The HTML text area element.
     * @private
     * @returns {void}
     */
    _setTextAreaRef(textAreaElement: ?HTMLTextAreaElement) {
        this._textArea = textAreaElement;
    }
}

/**
 * Function that maps parts of Redux state tree into component props.
 *
 * @param {Object} state - Redux state.
 * @private
 * @returns {{
 *     _areSmileysDisabled: boolean
 * }}
 */
const mapStateToProps = state => {
    return {
        _areSmileysDisabled: areSmileysDisabled(state)
    };
};

export default translate(connect(mapStateToProps)(ChatInput));


text:
namespace MScResearchTool.Server.Web.ViewModels
{
    public class CrackingViewModel
    {
        public string ArchivePassword { get; set; }
        public int RangesCount { get; set; }
    }
}


text:
echo "Checking TensorFlow installation..."
if python3 -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"; then
  echo "TensorFlow is working, starting evaluation..."
else
  echo ""
  echo "Before running this script, please install TensorFlow according to the"
  echo "instructions at https://www.tensorflow.org/install/pip."
  exit 0
fi

start=$(date +"%T")
echo "Start time : $start"

SCRIPT_PATH=`dirname $0`

source ${SCRIPT_PATH}/../../datasets/fuss/setup.sh
source ${SCRIPT_PATH}/setup.sh

bash ${SCRIPT_PATH}/install_dependencies.sh

bash ${SCRIPT_PATH}/get_pretrained_baseline_model.sh

DATE=`date +%Y-%m-%d_%H-%M-%S`
OUTPUT_DIR=${MODEL_DIR}/baseline_evaluate/${DATE}
mkdir -p ${OUTPUT_DIR}

python3 ${SCRIPT_PATH}/evaluate.py -cp=${BASELINE_MODEL_DIR}/baseline_model -mp=${BASELINE_MODEL_DIR}/baseline_inference.meta -dp=${DEV_DATA_DIR}/ssdata_reverb/eval_example_list.txt -op=${OUTPUT_DIR}

end=$(date +"%T")
echo "Start time: $start, installation end time: $end"


text:
package no.noen.taxameter;

/**
 * EOS taxameter energy-unit data.
 */
public class UnitTx {
    private long unitId;
    private float valueIn;  // Brutto
    private float valueOut; // Measured
    private Float calcOut;  // Calculated
    private boolean fIsReal;

    /** Constructor. */
    public UnitTx(long id) {
        this(id, 0.0f, 0.0f, 0.0f, true);
    }

    /** Constructor. */
    public UnitTx(long id, float valIn, float valOut, float cOut, boolean isReal) {
        this.unitId = id;
        this.valueIn = valIn;
        this.valueOut = valOut;
        this.calcOut = null;
        if (cOut > 0.0f)
            this.calcOut = new Float(cOut);
        this.fIsReal = isReal;
    }

    /** @return Heating-unit ID */
    public final long getUnitId() {
        return unitId;
    }

    /** @return Brutto value as float. */
    public final float getValueIn() {
        return valueIn;
    }

    /** @return Real value as float. */
    public final float getValueOut() {
        float val = valueIn;
        if (valueOut > 0.0f)
            val = valueOut;
        else if (calcOut != null)
            val = calcOut.floatValue();
        return val;
    }

    /** Increment values. */
    public void increment(float valIn, float valOut) {
        this.valueIn += valIn;
        this.valueOut += valOut;
    }

    /** @return true if value out is calculated from EG profile */
    public final boolean isCalculated() {
        return (calcOut != null);
    }

    /** @return true if value in real (not interpolated) */
    public final boolean isReal() {
        return fIsReal;
    }

}


text:
package anabalica.github.io.meowletters.customviews;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.TableLayout;

import anabalica.github.io.meowletters.R;

/**
 * Custom square TableLayout, i.e. the height is set equal to the width
 * of the layout.
 *
 * @author Ana Balica
 */
public class SquareTableLayout extends TableLayout {
    private int rowsCount;

    public SquareTableLayout(Context context, AttributeSet attrs) {
        super(context, attrs);

        TypedArray attributes = context.getTheme().obtainStyledAttributes(
                attrs, R.styleable.SquareTableLayout, 0, 0);

        try {
            rowsCount = attributes.getInteger(R.styleable.SquareTableLayout_rowsCount, 0);
        } finally {
            attributes.recycle();
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        final int width = getMeasuredWidth();
        setMeasuredDimension(width, width);
    }

    public int getRowsCount() {
        return rowsCount;
    }
}