text:
const unsigned WIDTH = 800;
const unsigned HEIGHT = 600;

Window::Window()
{
	mMode = nullptr;
}

Window::~Window()
{
	if (mMode != nullptr)
	{
		mMode->onModeDeselected();
	}
}

bool Window::init()
{
	setGeometry(0, 0, WIDTH, HEIGHT);

	QWidget *centralWidget = new QWidget(this);

	mGlWidget = new GlWidget(centralWidget);
	mGlWidget->resize(WIDTH, HEIGHT);
	QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	mGlWidget->setSizePolicy(policy);

    QMenuBar *menuBar = new QMenuBar(centralWidget);
    QMenu *modeMenu = new QMenu("mode");
	QMenu *fractalsMenu = new QMenu("fractals");

	addMenu(fractalsMenu, "Mandelbrot", &Window::changeModeMandelbrot);
	addMenu(fractalsMenu, "Julia Set", &Window::changeModeJuliaSet);

	modeMenu->addMenu(fractalsMenu);
    menuBar->addMenu(modeMenu);

    setCentralWidget(centralWidget);
	setMouseTracking(true);

	return true;
}

void Window::afterShow()
{
	changeModeMandelbrot();
}

void Window::mouseMoveEvent(QMouseEvent *event)
{
	mMode->onMouseMoveEvent(event);
}

void Window::mousePressEvent(QMouseEvent *event)
{
	mMode->onMousePressEvent(event);
}

void Window::mouseReleaseEvent(QMouseEvent *event)
{
	mMode->onMouseReleaseEvent(event);
}

void Window::wheelEvent(QWheelEvent *event)
{
	mMode->onMouseWheelEvent(event);
}

void Window::resizeEvent(QResizeEvent *event)
{
	mGlWidget->resize(event->size());
	if (mMode != nullptr)
	{
		mMode->onResizeEvent(event);
	}
}

void Window::closeEvent(QCloseEvent *event)
{
	changeMode(nullptr);
}

void Window::changeModeMandelbrot()
{
	changeMode(new FractalMode(mGlWidget, FractalMode::MANDELBROT, mGlWidget->width(), mGlWidget->height()));
}

void Window::changeModeJuliaSet()
{
	changeMode(new FractalMode(mGlWidget, FractalMode::JULIA_SET, mGlWidget->width(), mGlWidget->height()));
}

void Window::changeMode(Mode *mode)
{
	if (mMode != nullptr)
	{
		mMode->onModeDeselected();
	}

	if (mode != nullptr)
	{
		mode->onModeSelected();
	}

	mMode = mode;
	mGlWidget->setMode(mode);
}

void Window::addMenu(QMenu *parent, const char *actionName, SlotFunction slot)
{
	QAction *action = new QAction(actionName, parent);
	connect(action, &QAction::triggered, this, slot);
    parent->addAction(action);
}


text:
import EachBlock from '../../../nodes/EachBlock';
import InlineComponentWrapper from '../InlineComponent';
import ElementWrapper from '../Element';
import Binding from '../../../nodes/Binding';

export default function mark_each_block_bindings(
	parent: ElementWrapper | InlineComponentWrapper,
	binding: Binding
) {
	// we need to ensure that the each block creates a context including
	// the list and the index, if they're not otherwise referenced
	binding.expression.references.forEach(name => {
		const each_block = parent.node.scope.get_owner(name);
		if (each_block) {
			(each_block as EachBlock).has_binding = true;
		}
	});

	if (binding.name === 'group') {
		const add_index_binding = (name: string) => {
			const each_block = parent.node.scope.get_owner(name);
			if (each_block.type === 'EachBlock') {
				each_block.has_index_binding = true;
				for (const dep of each_block.expression.contextual_dependencies) {
					add_index_binding(dep);
				}
			}
		};
		// for `<input bind:group={} >`, we make sure that all the each blocks creates context with `index`
		for (const name of binding.expression.contextual_dependencies) {
			add_index_binding(name);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
	<form method="post" action="{{ site.data.settings.contact_settings.form_action }}" id="contact-form">

			メールアドレス *
			<input type="text" name="email" placeholder="メールアドレスを入力してください" class="contact-form__input">

			お名前 *
			<input type="text" name="name" placeholder="お名前を入力してください" class="contact-form__input">

			本文 *
			<textarea name="message" placeholder="お問い合わせ内容を入力してください" class="contact-form__textarea"></textarea>

		<input type="hidden" name="_next" value="{{ site.data.settings.contact_settings.confirmation_url }}" />
		<input type="hidden" name="_subject" value="{{ site.data.settings.contact_settings.email_subject }}" />
		<input type="text" name="_gotcha" style="display: none;" class="contact-form__gotcha" val="">

			<input type="submit" value="{{ site.data.settings.contact_settings.send_button_text }}" class="btn btn--large">

	</form>


text:
#ifndef _INC_VSMGT
#define _INC_VSMGT

#include <vss.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum _VSS_PROTECTION_FAULT {
  VSS_PROTECTION_FAULT_NONE                           = 0,
  VSS_PROTECTION_FAULT_DIFF_AREA_MISSING              = ( VSS_PROTECTION_FAULT_NONE + 1 ),
  VSS_PROTECTION_FAULT_IO_FAILURE_DURING_ONLINE       = ( VSS_PROTECTION_FAULT_DIFF_AREA_MISSING + 1 ),
  VSS_PROTECTION_FAULT_META_DATA_CORRUPTION           = ( VSS_PROTECTION_FAULT_IO_FAILURE_DURING_ONLINE + 1 ),
  VSS_PROTECTION_FAULT_MEMORY_ALLOCATION_FAILURE      = ( VSS_PROTECTION_FAULT_META_DATA_CORRUPTION + 1 ),
  VSS_PROTECTION_FAULT_MAPPED_MEMORY_FAILURE          = ( VSS_PROTECTION_FAULT_MEMORY_ALLOCATION_FAILURE + 1 ),
  VSS_PROTECTION_FAULT_COW_READ_FAILURE               = ( VSS_PROTECTION_FAULT_MAPPED_MEMORY_FAILURE + 1 ),
  VSS_PROTECTION_FAULT_COW_WRITE_FAILURE              = ( VSS_PROTECTION_FAULT_COW_READ_FAILURE + 1 ),
  VSS_PROTECTION_FAULT_DIFF_AREA_FULL                 = ( VSS_PROTECTION_FAULT_COW_WRITE_FAILURE + 1 ),
  VSS_PROTECTION_FAULT_GROW_TOO_SLOW                  = ( VSS_PROTECTION_FAULT_DIFF_AREA_FULL + 1 ),
  VSS_PROTECTION_FAULT_GROW_FAILED                    = ( VSS_PROTECTION_FAULT_GROW_TOO_SLOW + 1 ),
  VSS_PROTECTION_FAULT_DESTROY_ALL_SNAPSHOTS          = ( VSS_PROTECTION_FAULT_GROW_FAILED + 1 ),
  VSS_PROTECTION_FAULT_FILE_SYSTEM_FAILURE            = ( VSS_PROTECTION_FAULT_DESTROY_ALL_SNAPSHOTS + 1 ),
  VSS_PROTECTION_FAULT_IO_FAILURE                     = ( VSS_PROTECTION_FAULT_FILE_SYSTEM_FAILURE + 1 ),
  VSS_PROTECTION_FAULT_DIFF_AREA_REMOVED              = ( VSS_PROTECTION_FAULT_IO_FAILURE + 1 ),
  VSS_PROTECTION_FAULT_EXTERNAL_WRITER_TO_DIFF_AREA   = ( VSS_PROTECTION_FAULT_DIFF_AREA_REMOVED + 1 )
} VSS_PROTECTION_FAULT;

typedef enum _VSS_PROTECTION_LEVEL {
  VSS_PROTECTION_LEVEL_ORIGINAL_VOLUME   = 0,
  VSS_PROTECTION_LEVEL_SNAPSHOT          = ( VSS_PROTECTION_LEVEL_ORIGINAL_VOLUME + 1 )
} VSS_PROTECTION_LEVEL;

typedef enum _VSS_MGMT_OBJECT_TYPE {
  VSS_MGMT_OBJECT_UNKNOWN       = 0,
  VSS_MGMT_OBJECT_VOLUME        = 1,
  VSS_MGMT_OBJECT_DIFF_VOLUME   = 2,
  VSS_MGMT_OBJECT_DIFF_AREA     = 3
} VSS_MGMT_OBJECT_TYPE, *PVSS_MGMT_OBJECT_TYPE;

typedef struct _VSS_VOLUME_PROP {
  VSS_PWSZ m_pwszVolumeName;
  VSS_PWSZ m_pwszVolumeDisplayName;
} VSS_VOLUME_PROP, *PVSS_VOLUME_PROP;

typedef struct _VSS_VOLUME_PROTECTION_INFO {
  VSS_PROTECTION_LEVEL m_protectionLevel;
  WINBOOL              m_volumeIsOfflineForProtection;
  VSS_PROTECTION_FAULT m_protectionFault;
  LONG                 m_failureStatus;
  WINBOOL              m_volumeHasUnusedDiffArea;
  DWORD                m_reserved;
} VSS_VOLUME_PROTECTION_INFO;

#if (_WIN32_WINNT >= 0x0600)

typedef struct _VSS_DIFF_AREA_PROP {
  VSS_PWSZ m_pwszVolumeName;
  VSS_PWSZ m_pwszDiffAreaVolumeName;
  LONGLONG m_llMaximumDiffSpace;
  LONGLONG m_llAllocatedDiffSpace;
  LONGLONG m_llUsedDiffSpace;
} VSS_DIFF_AREA_PROP, *PVSS_DIFF_AREA_PROP;

typedef struct _VSS_DIFF_VOLUME_PROP {
  VSS_PWSZ m_pwszVolumeName;
  VSS_PWSZ m_pwszVolumeDisplayName;
  LONGLONG m_llVolumeFreeSpace;
  LONGLONG m_llVolumeTotalSpace;
} VSS_DIFF_VOLUME_PROP, *PVSS_DIFF_VOLUME_PROP;

typedef union _VSS_MGMT_OBJECT_UNION {
  VSS_VOLUME_PROP      Vol;
  VSS_DIFF_VOLUME_PROP DiffVol;
  VSS_DIFF_AREA_PROP   DiffArea;
} VSS_MGMT_OBJECT_UNION, *PVSS_MGMT_OBJECT_UNION;

typedef struct _VSS_MGMT_OBJECT_PROP {
  VSS_MGMT_OBJECT_TYPE  Type;
  VSS_MGMT_OBJECT_UNION Obj;
} VSS_MGMT_OBJECT_PROP, *PVSS_MGMT_OBJECT_PROP;

#endif /* (_WIN32_WINNT >= 0x0600) */

#ifdef __cplusplus
}
#endif

#undef  INTERFACE
#define INTERFACE IVssDifferentialSoftwareSnapshotMgmt
/*IID_IVssDifferentialSoftwareSnapshotMgmt is defined as 214A0F28-B737-4026-B847-4F9E37D79529*/
#ifdef __GNUC__
#warning COM interfaces layout in this header has not been verified.
#warning COM interfaces with incorrect layout may not work at all.
__MINGW_BROKEN_INTERFACE(INTERFACE)
#endif
DECLARE_INTERFACE_(IVssDifferentialSoftwareSnapshotMgmt,IUnknown)
{
    BEGIN_INTERFACE

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IVssDifferentialSoftwareSnapshotMgmt methods */
    STDMETHOD_(HRESULT,AddDiffArea)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PWSZ pwszDiffAreaVolumeName,LONGLONG llMaximumDiffSpace) PURE;
    STDMETHOD_(HRESULT,ChangeDiffAreaMaximumSize)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PWSZ pwszDiffAreaVolumeName,LONGLONG llMaximumDiffSpace) PURE;
    STDMETHOD_(HRESULT,QueryVolumesSupportedForDiffAreas)(THIS_ VSS_PWSZ pwszOriginalVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasForVolume)(THIS_ VSS_PWSZ pwszVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasOnVolume)(THIS_ VSS_PWSZ pwszVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasForSnapshot)(THIS_ VSS_ID SnapshotId,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,Opmun08NotUsedOnWire)(THIS) PURE; /* Reserved */

    END_INTERFACE
};
#ifdef COBJMACROS
#define IVssDifferentialSoftwareSnapshotMgmt_QueryInterface(This,riid,ppvObject) (This)->pVtbl->QueryInterface(This,riid,ppvObject)
#define IVssDifferentialSoftwareSnapshotMgmt_AddRef(This) (This)->pVtbl->AddRef(This)
#define IVssDifferentialSoftwareSnapshotMgmt_Release(This) (This)->pVtbl->Release(This)
#define IVssDifferentialSoftwareSnapshotMgmt_AddDiffArea(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace) (This)->lpVtbl->AddDiffArea(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace)
#define IVssDifferentialSoftwareSnapshotMgmt_ChangeDiffAreaMaximumSize(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace) (This)->lpVtbl->ChangeDiffAreaMaximumSize(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace)
#define IVssDifferentialSoftwareSnapshotMgmt_QueryVolumesSupportedForDiffAreas(This,pwszOriginalVolumeName,ppEnum) (This)->lpVtbl->QueryVolumesSupportedForDiffAreas(This,pwszOriginalVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt_QueryDiffAreasForVolume(This,pwszVolumeName,ppEnum) (This)->lpVtbl->QueryDiffAreasForVolume(This,pwszVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt_QueryDiffAreasOnVolume(This,pwszVolumeName,ppEnum) (This)->lpVtbl->QueryDiffAreasOnVolume(This,pwszVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt_QueryDiffAreasForSnapshot(This,SnapshotId,ppEnum) (This)->lpVtbl->QueryDiffAreasForSnapshot(This,SnapshotId,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt_Opmun08NotUsedOnWire(This)
#endif /*COBJMACROS*/

#if (_WIN32_WINNT >= 0x0600)
#undef  INTERFACE
#define INTERFACE IVssDifferentialSoftwareSnapshotMgmt2
#ifdef __GNUC__
#warning COM interfaces layout in this header has not been verified.
#warning COM interfaces with incorrect layout may not work at all.
__MINGW_BROKEN_INTERFACE(INTERFACE)
#endif
DECLARE_INTERFACE_(IVssDifferentialSoftwareSnapshotMgmt2,IVssDifferentialSoftwareSnapshotMgmt)
{
    BEGIN_INTERFACE

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IVssDifferentialSoftwareSnapshotMgmt methods */
    STDMETHOD_(HRESULT,AddDiffArea)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PWSZ pwszDiffAreaVolumeName,LONGLONG llMaximumDiffSpace) PURE;
    STDMETHOD_(HRESULT,ChangeDiffAreaMaximumSize)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PWSZ pwszDiffAreaVolumeName,LONGLONG llMaximumDiffSpace) PURE;
    STDMETHOD_(HRESULT,QueryVolumesSupportedForDiffAreas)(THIS_ VSS_PWSZ pwszOriginalVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasForVolume)(THIS_ VSS_PWSZ pwszVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasOnVolume)(THIS_ VSS_PWSZ pwszVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasForSnapshot)(THIS_ VSS_ID SnapshotId,IVssEnumMgmtObject **ppEnum) PURE;

    /* IVssDifferentialSoftwareSnapshotMgmt2 methods */
    STDMETHOD_(HRESULT,ChangeDiffAreaMaximumSizeEx)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PWSZ pwszDiffAreaVolumeName,LONGLONG llMaximumDiffSpace,WINBOOL bVolatile) PURE;
    STDMETHOD_(HRESULT,MigrateDiffAreas)(THIS) PURE;      /*Unsupported*/
    STDMETHOD_(HRESULT,QueryMigrationStatus)(THIS) PURE;  /*Unsupported*/
    STDMETHOD_(HRESULT,SetSnapshotPriority)(THIS) PURE;   /*Unsupported*/

    END_INTERFACE
};
#ifdef COBJMACROS
#define IVssDifferentialSoftwareSnapshotMgmt2_QueryInterface(This,riid,ppvObject) (This)->pVtbl->QueryInterface(This,riid,ppvObject)
#define IVssDifferentialSoftwareSnapshotMgmt2_AddRef(This) (This)->pVtbl->AddRef(This)
#define IVssDifferentialSoftwareSnapshotMgmt2_Release(This) (This)->pVtbl->Release(This)
#define IVssDifferentialSoftwareSnapshotMgmt2_AddDiffArea(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace) (This)->lpVtbl->AddDiffArea(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace)
#define IVssDifferentialSoftwareSnapshotMgmt2_ChangeDiffAreaMaximumSize(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace) (This)->lpVtbl->ChangeDiffAreaMaximumSize(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace)
#define IVssDifferentialSoftwareSnapshotMgmt2_QueryVolumesSupportedForDiffAreas(This,pwszOriginalVolumeName,ppEnum) (This)->lpVtbl->QueryVolumesSupportedForDiffAreas(This,pwszOriginalVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt2_QueryDiffAreasForVolume(This,pwszVolumeName,ppEnum) (This)->lpVtbl->QueryDiffAreasForVolume(This,pwszVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt2_QueryDiffAreasOnVolume(This,pwszVolumeName,ppEnum) (This)->lpVtbl->QueryDiffAreasOnVolume(This,pwszVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt2_QueryDiffAreasForSnapshot(This,SnapshotId,ppEnum) (This)->lpVtbl->QueryDiffAreasForSnapshot(This,SnapshotId,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt2_ChangeDiffAreaMaximumSizeEx(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace,bVolatile) (This)->lpVtbl->ChangeDiffAreaMaximumSizeEx(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace,bVolatile)
#define IVssDifferentialSoftwareSnapshotMgmt2_MigrateDiffAreas() (This)->lpVtbl->MigrateDiffAreas(This)
#define IVssDifferentialSoftwareSnapshotMgmt2_QueryMigrationStatus() (This)->lpVtbl->QueryMigrationStatus(This)
#define IVssDifferentialSoftwareSnapshotMgmt2_SetSnapshotPriority() (This)->lpVtbl->SetSnapshotPriority(This)
#endif /*COBJMACROS*/

#undef  INTERFACE
#define INTERFACE IVssDifferentialSoftwareSnapshotMgmt3
#ifdef __GNUC__
#warning COM interfaces layout in this header has not been verified.
#warning COM interfaces with incorrect layout may not work at all.
__MINGW_BROKEN_INTERFACE(INTERFACE)
#endif
DECLARE_INTERFACE_(IVssDifferentialSoftwareSnapshotMgmt3,IVssDifferentialSoftwareSnapshotMgmt2)
{
    BEGIN_INTERFACE

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IVssDifferentialSoftwareSnapshotMgmt methods */
    STDMETHOD_(HRESULT,AddDiffArea)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PWSZ pwszDiffAreaVolumeName,LONGLONG llMaximumDiffSpace) PURE;
    STDMETHOD_(HRESULT,ChangeDiffAreaMaximumSize)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PWSZ pwszDiffAreaVolumeName,LONGLONG llMaximumDiffSpace) PURE;
    STDMETHOD_(HRESULT,QueryVolumesSupportedForDiffAreas)(THIS_ VSS_PWSZ pwszOriginalVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasForVolume)(THIS_ VSS_PWSZ pwszVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasOnVolume)(THIS_ VSS_PWSZ pwszVolumeName,IVssEnumMgmtObject **ppEnum) PURE;
    STDMETHOD_(HRESULT,QueryDiffAreasForSnapshot)(THIS_ VSS_ID SnapshotId,IVssEnumMgmtObject **ppEnum) PURE;

    /* IVssDifferentialSoftwareSnapshotMgmt2 methods */
    STDMETHOD_(HRESULT,ChangeDiffAreaMaximumSizeEx)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PWSZ pwszDiffAreaVolumeName,LONGLONG llMaximumDiffSpace,WINBOOL bVolatile) PURE;
    STDMETHOD_(HRESULT,MigrateDiffAreas)(THIS) PURE;      /*Unsupported*/
    STDMETHOD_(HRESULT,QueryMigrationStatus)(THIS) PURE;  /*Unsupported*/
    STDMETHOD_(HRESULT,SetSnapshotPriority)(THIS) PURE;   /*Unsupported*/

    /* IVssDifferentialSoftwareSnapshotMgmt3 methods */
    STDMETHOD_(HRESULT,SetVolumeProtectLevel)(THIS_ VSS_PWSZ pwszVolumeName,VSS_PROTECTION_LEVEL protectionLevel) PURE;
    STDMETHOD_(HRESULT,GetVolumeProtectLevel)(THIS_ VSS_PWSZ pwszVolumeName,VSS_VOLUME_PROTECTION_INFO *protectionLevel) PURE;
    STDMETHOD_(HRESULT,ClearVolumeProtectFault)(THIS_ VSS_PWSZ pwszVolumeName) PURE;
    STDMETHOD_(HRESULT,DeleteUnusedDiffAreas)(THIS_ VSS_PWSZ pwszDiffAreaVolumeName) PURE;
    STDMETHOD_(HRESULT,QuerySnapshotDeltaBitmap)(THIS) PURE;  /*Unsupported*/

    END_INTERFACE
};
#ifdef COBJMACROS
#define IVssDifferentialSoftwareSnapshotMgmt3_QueryInterface(This,riid,ppvObject) (This)->pVtbl->QueryInterface(This,riid,ppvObject)
#define IVssDifferentialSoftwareSnapshotMgmt3_AddRef(This) (This)->pVtbl->AddRef(This)
#define IVssDifferentialSoftwareSnapshotMgmt3_Release(This) (This)->pVtbl->Release(This)
#define IVssDifferentialSoftwareSnapshotMgmt3_AddDiffArea(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace) (This)->lpVtbl->AddDiffArea(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace)
#define IVssDifferentialSoftwareSnapshotMgmt3_ChangeDiffAreaMaximumSize(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace) (This)->lpVtbl->ChangeDiffAreaMaximumSize(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace)
#define IVssDifferentialSoftwareSnapshotMgmt3_QueryVolumesSupportedForDiffAreas(This,pwszOriginalVolumeName,ppEnum) (This)->lpVtbl->QueryVolumesSupportedForDiffAreas(This,pwszOriginalVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt3_QueryDiffAreasForVolume(This,pwszVolumeName,ppEnum) (This)->lpVtbl->QueryDiffAreasForVolume(This,pwszVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt3_QueryDiffAreasOnVolume(This,pwszVolumeName,ppEnum) (This)->lpVtbl->QueryDiffAreasOnVolume(This,pwszVolumeName,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt3_QueryDiffAreasForSnapshot(This,SnapshotId,ppEnum) (This)->lpVtbl->QueryDiffAreasForSnapshot(This,SnapshotId,ppEnum)
#define IVssDifferentialSoftwareSnapshotMgmt3_ChangeDiffAreaMaximumSizeEx(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace,bVolatile) (This)->lpVtbl->ChangeDiffAreaMaximumSizeEx(This,pwszVolumeName,pwszDiffAreaVolumeName,llMaximumDiffSpace,bVolatile)
#define IVssDifferentialSoftwareSnapshotMgmt3_MigrateDiffAreas() (This)->lpVtbl->MigrateDiffAreas(This)
#define IVssDifferentialSoftwareSnapshotMgmt3_QueryMigrationStatus() (This)->lpVtbl->QueryMigrationStatus(This)
#define IVssDifferentialSoftwareSnapshotMgmt3_SetSnapshotPriority() (This)->lpVtbl->SetSnapshotPriority(This)
#define IVssDifferentialSoftwareSnapshotMgmt3_SetVolumeProtectLevel(This,pwszVolumeName,protectionLevel) (This)->lpVtbl->SetVolumeProtectLevel(This,pwszVolumeName,protectionLevel)
#define IVssDifferentialSoftwareSnapshotMgmt3_GetVolumeProtectLevel(This,pwszVolumeName,protectionLevel) (This)->lpVtbl->GetVolumeProtectLevel(This,pwszVolumeName,protectionLevel)
#define IVssDifferentialSoftwareSnapshotMgmt3_ClearVolumeProtectFault(This,pwszVolumeName) (This)->lpVtbl->ClearVolumeProtectFault(This,pwszVolumeName)
#define IVssDifferentialSoftwareSnapshotMgmt3_DeleteUnusedDiffAreas(This,pwszDiffAreaVolumeName) (This)->lpVtbl->DeleteUnusedDiffAreas(This,pwszDiffAreaVolumeName)
#define IVssDifferentialSoftwareSnapshotMgmt3_QuerySnapshotDeltaBitmap() (This)->lpVtbl->QuerySnapshotDeltaBitmap(This)
#endif /*COBJMACROS*/

#undef  INTERFACE
#define INTERFACE IVssEnumMgmtObject
/*IID_IVssEnumMgmtObject is defined as 01954E6B-9254-4e6e-808C-C9E05D007696*/
#ifdef __GNUC__
#warning COM interfaces layout in this header has not been verified.
#warning COM interfaces with incorrect layout may not work at all.
__MINGW_BROKEN_INTERFACE(INTERFACE)
#endif
DECLARE_INTERFACE_(IVssEnumMgmtObject,IUnknown)
{
    BEGIN_INTERFACE

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IVssEnumMgmtObject methods */
    STDMETHOD_(HRESULT,Next)(THIS_ ULONG celt,VSS_MGMT_OBJECT_PROP *rgelt,ULONG *pceltFetched) PURE;
    STDMETHOD_(HRESULT,Skip)(THIS_ ULONG celt) PURE;
    STDMETHOD_(HRESULT,Reset)(THIS) PURE;
    STDMETHOD_(HRESULT,Clone)(THIS_ IVssEnumMgmtObject **ppenum) PURE;

    END_INTERFACE
};
#ifdef COBJMACROS
#define IVssEnumMgmtObject_QueryInterface(This,riid,ppvObject) (This)->pVtbl->QueryInterface(This,riid,ppvObject)
#define IVssEnumMgmtObject_AddRef(This) (This)->pVtbl->AddRef(This)
#define IVssEnumMgmtObject_Release(This) (This)->pVtbl->Release(This)
#define IVssEnumMgmtObject_Next(This,celt,rgelt,pceltFetched) (This)->lpVtbl->Next(This,celt,rgelt,pceltFetched)
#define IVssEnumMgmtObject_Skip(This,celt) (This)->lpVtbl->Skip(This,celt)
#define IVssEnumMgmtObject_Reset() (This)->lpVtbl->Reset(This)
#define IVssEnumMgmtObject_Clone(This,ppenum) (This)->lpVtbl->Clone(This,ppenum)
#endif /*COBJMACROS*/

#endif /* (_WIN32_WINNT >= 0x0600) */

#undef  INTERFACE
#define INTERFACE IVssSnapshotMgmt
/*IID_IVssSnapshotMgmt is defined as FA7DF749-66E7-4986-A27F-E2F04AE53772*/
#ifdef __GNUC__
#warning COM interfaces layout in this header has not been verified.
#warning COM interfaces with incorrect layout may not work at all.
__MINGW_BROKEN_INTERFACE(INTERFACE)
#endif
DECLARE_INTERFACE_(IVssSnapshotMgmt,IUnknown)
{
    BEGIN_INTERFACE

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IVssSnapshotMgmt methods */
    STDMETHOD_(HRESULT,GetProviderMgmtInterface)(THIS_ VSS_ID ProviderId,REFIID InterfaceId,IUnknown **ppItf) PURE;
    STDMETHOD_(HRESULT,QueryVolumesSupportedForSnapshots)(THIS) PURE; /*Unsupported*/
    STDMETHOD_(HRESULT,QuerySnapshotsByVolume)(THIS) PURE;            /*Unsupported*/

    END_INTERFACE
};
#ifdef COBJMACROS
#define IVssSnapshotMgmt_QueryInterface(This,riid,ppvObject) (This)->pVtbl->QueryInterface(This,riid,ppvObject)
#define IVssSnapshotMgmt_AddRef(This) (This)->pVtbl->AddRef(This)
#define IVssSnapshotMgmt_Release(This) (This)->pVtbl->Release(This)
#define IVssSnapshotMgmt_GetProviderMgmtInterface(This,ProviderId,InterfaceId,ppItf) (This)->lpVtbl->GetProviderMgmtInterface(This,ProviderId,InterfaceId,ppItf)
#define IVssSnapshotMgmt_QueryVolumesSupportedForSnapshots() (This)->lpVtbl->QueryVolumesSupportedForSnapshots(This)
#define IVssSnapshotMgmt_QuerySnapshotsByVolume() (This)->lpVtbl->QuerySnapshotsByVolume(This)
#endif /*COBJMACROS*/

#undef  INTERFACE
#define INTERFACE IVssSnapshotMgmt2
DECLARE_INTERFACE_(IVssSnapshotMgmt2,IUnknown)
{
    BEGIN_INTERFACE

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IVssSnapshotMgmt2 methods */
    STDMETHOD_(HRESULT,GetMinDiffAreaSize)(THIS_ LONGLONG *pllMinDiffAreaSize) PURE;

    END_INTERFACE
};
#ifdef COBJMACROS
#define IVssSnapshotMgmt2_QueryInterface(This,riid,ppvObject) (This)->pVtbl->QueryInterface(This,riid,ppvObject)
#define IVssSnapshotMgmt2_AddRef(This) (This)->pVtbl->AddRef(This)
#define IVssSnapshotMgmt2_Release(This) (This)->pVtbl->Release(This)
#define IVssSnapshotMgmt2_GetMinDiffAreaSize(This,pllMinDiffAreaSize) (This)->lpVtbl->GetMinDiffAreaSize(This,pllMinDiffAreaSize)
#endif /*COBJMACROS*/

#endif /*_INC_VSMGT*/


text:
cask "powder-player" do
  version "1.60"
  sha256 "66f532b975c12f3d5343e7589dcc6746e1a555416494bd8f6b80642464b7b66a"

  url "https://github.com/jaruba/PowderPlayer/releases/download/v#{version}/PowderPlayer_v#{version}.dmg",
      verified: "github.com/jaruba/PowderPlayer/"
  appcast "https://github.com/jaruba/PowderPlayer/releases.atom"
  name "Powder Player"
  homepage "https://powder.media/"

  app "Powder Player.app"
end


text:
#include <irtkImage.h>
#include <irtkTransformation.h>
#include <irtkRegistration.h>

#include <sys/types.h>
#include <sys/stat.h>

// Local includes
#include <Fl_RViewUI.h>

#ifdef HAS_TRANSFORMATION_PANEL

extern Fl_RViewUI  *rviewUI;
extern Fl_RView    *viewer;
extern irtkRView    *rview;

void Fl_RViewUI::AddTransformation(char *filename)
{
  int i;

  // Update browser and slider
  rviewUI->transformationBrowser->add(filename);
  rviewUI->transformationBrowser->value(1);

  char *buffer = strdup(rviewUI->transformationBrowser->text(rviewUI->transformationBrowser->value()));
  rview->ReadTransformation(buffer);
  rviewUI->info_trans_filename->value(buffer);
  free(buffer);

  // Update transformation valuator
  irtkTransformation *transform = rview->GetTransformation();

  if (dynamic_cast<irtkFreeFormTransformation *>(transform) != NULL) return;

  for (i = 0; i<transform->NumberOfDOFs(); i++) {
    rviewUI->transformationValuator[i]->value(transform->Get(i));
  }

}

void Fl_RViewUI::cb_loadTransformation(Fl_Button *, void *)
{
  int i;
  char *filename = fl_file_chooser("Load transformation", "*.{dof,dof.gz}", "");

  if (filename != NULL) {
    rview->ReadTransformation(filename);

    // Update browser and info
    rviewUI->transformationBrowser->add(filename);
    rviewUI->transformationBrowser->deselect();
    rviewUI->transformationBrowser->select(rviewUI->transformationBrowser->size());
    rviewUI->info_trans_filename->value(filename);
    // Update
    rview->Update();
    viewer->redraw();
  }

  // Update transformation valuator
  irtkTransformation *transform = rview->GetTransformation();

  if (dynamic_cast<irtkFreeFormTransformation *>(transform) != NULL) return;

  for (i = 0; i<transform->NumberOfDOFs(); i++) {
    rviewUI->transformationValuator[i]->value(transform->Get(i));
  }
}

void Fl_RViewUI::cb_saveTransformation(Fl_Button *, void *)
{
  char *filename = fl_file_chooser("Save transformation", "*.{dof,dof.gz}", "");
  if (filename != NULL) {
    struct stat buffer;
    if (stat(filename, &buffer) == 0) {
      if (fl_choice("File already exists. Do you want to overwrite the file?", NULL, "No", "Yes") == 2) {
        rview->WriteTransformation(filename);
      }
    } else {
      rview->WriteTransformation(filename);
    }
  }
}

void Fl_RViewUI::cb_browseTransformation(Fl_Browser* o, void*)
{
  if (Fl::event_key() == FL_BackSpace) {
    int n;

    if (rviewUI->transformationBrowser->value() != 0) {
      n = rviewUI->transformationBrowser->value();

      if (rviewUI->transformationBrowser->size() == 1) {
        fl_alert("Can't delete last transformation");
      } else {
        rviewUI->transformationBrowser->remove(n);
        if (n > 1) n--;
        rviewUI->transformationBrowser->select(n);
        char *buffer = strdup(rviewUI->transformationBrowser->text(n));
        rview->ReadTransformation(buffer);
        rviewUI->info_trans_filename->value(buffer);
        free(buffer);
      }
    }
  } else {
    if (o->value() != 0) {
      char *buffer = strdup(o->text(o->value()));
      rview->ReadTransformation(buffer);
      rviewUI->info_trans_filename->value(buffer);
      free(buffer);
    }
  }

  // Update
  rview->Update();
  rviewUI->update();
  viewer->redraw();
}

void Fl_RViewUI::cb_deleteTransformation(Fl_Button* o, void*)
{
  int n;

  if (rviewUI->transformationBrowser->value() != 0) {
    n = rviewUI->transformationBrowser->value();

    if (rviewUI->transformationBrowser->size() == 1) {
      fl_alert("Can't delete last transformation");
    } else {
      rviewUI->transformationBrowser->remove(n);
      if (n > 1) n--;
      rviewUI->transformationBrowser->select(n);
      char *buffer = strdup(rviewUI->transformationBrowser->text(n));
      rview->ReadTransformation(buffer);
      rviewUI->info_trans_filename->value(buffer);
      free(buffer);
    }
  }
  o->clear();

  // Update
  rview->Update();
  rviewUI->update();
  viewer->redraw();
}

void Fl_RViewUI::cb_editTransformation(Fl_Button* o, void*)
{
  rviewUI->editTransformation->show();
  o->clear();

  // Update
  rview->Update();
  rviewUI->update();
  viewer->redraw();
}

void Fl_RViewUI::cb_editTransformationApply(Fl_Button*, void*)
{
  rviewUI->editTransformation->hide();
}

void Fl_RViewUI::cb_editTransformationUpdate(Fl_Valuator* o, void* v)
{
  // Get transformation
  irtkTransformation *transform = rview->GetTransformation();

  // Set values to selected values
  if ((long)v < transform->NumberOfDOFs()) transform->Put((long)v, o->value());

  // Update
  rview->SourceUpdateOn();
  rview->Update();
  viewer->redraw();
}

void Fl_RViewUI::cb_editTransformationReset(Fl_Button*, void*)
{
  if (fl_choice("Do you really want to reset transformation?", NULL, "No", "Yes") == 2) {
    int i;

    // Get transformation
    irtkTransformation *transform = rview->GetTransformation();

    // Reset values to identity
    for (i=0; i<transform->NumberOfDOFs(); i++) transform->Put(i, 0);
    for (i=6; i<transform->NumberOfDOFs(); i++) transform->Put(i, 100);
    for (i=9; i<transform->NumberOfDOFs(); i++) transform->Put(i, 0);
    for (i=0; i<transform->NumberOfDOFs(); i++) {
      rviewUI->transformationValuator[i]->value(transform->Get(i));
    }
    // Update
    rview->SourceUpdateOn();
    rview->Update();
    viewer->redraw();
  }
}

void Fl_RViewUI::cb_applyTransformation(Fl_Button* o, void*)
{
  rview->SetSourceTransformApply(o->value());

  // Update
  rview->SourceUpdateOn();
  rview->Update();
  viewer->redraw();
}

void Fl_RViewUI::cb_invertTransformation(Fl_Button* o, void*)
{
  rview->SetSourceTransformInvert(o->value());

  // Update
  rview->SourceUpdateOn();
  rview->Update();
  viewer->redraw();
}

void Fl_RViewUI::cb_moveupTransformation(Fl_Button* o, void*)
{
  int n;

  if (rviewUI->transformationBrowser->value() != 0) {
    n = rviewUI->transformationBrowser->value();
    if (n > 1) {
      char *buffer = strdup(rviewUI->transformationBrowser->text(n));
      rviewUI->transformationBrowser->remove(n);
      rviewUI->transformationBrowser->insert(n-1, buffer);
      rviewUI->transformationBrowser->deselect();
      rviewUI->transformationBrowser->select(n-1);
      rviewUI->info_trans_filename->value(buffer);
      free(buffer);
    }
  }
  o->clear();

  // Update
  rviewUI->update();
  viewer->redraw();
}

void Fl_RViewUI::cb_movedownTransformation(Fl_Button* o, void*)
{
  int n;

  if (rviewUI->transformationBrowser->value() != 0) {
    n = rviewUI->transformationBrowser->value();
    if (n < rviewUI->transformationBrowser->size()) {
      char *buffer = strdup(rviewUI->transformationBrowser->text(n));
      rviewUI->transformationBrowser->remove(n);
      rviewUI->transformationBrowser->insert(n+1, buffer);
      rviewUI->transformationBrowser->deselect();
      rviewUI->transformationBrowser->select(n+1);
      rviewUI->info_trans_filename->value(buffer);
      free(buffer);
    }
  }
  o->clear();

  // Update
  rviewUI->update();
  viewer->redraw();
}

void Fl_RViewUI::cb_movieTransformation(Fl_Button* o, void*)
{
  int i;
  char buffer2[256];

  if (fl_choice("Do you want to save the movie to disk?", NULL, "No", "Yes") == 2) {

    for (i = 1; i <= rviewUI->transformationBrowser->size(); i++) {

      // Read transformation
      char *buffer = strdup(rviewUI->transformationBrowser->text(i));
      rview->ReadTransformation(buffer);
      rviewUI->info_trans_filename->value(buffer);
      free(buffer);

      // Update
      rview->Update();
      sprintf(buffer2, "movie_%.5d.png", i);
      rview->DrawOffscreen(buffer2);
    }
  } else {

    for (i = 1; i <= rviewUI->transformationBrowser->size(); i++) {

      // Read transformation
      char *buffer = strdup(rviewUI->transformationBrowser->text(i));
      rview->ReadTransformation(buffer);
      rviewUI->info_trans_filename->value(buffer);
      free(buffer);

      // Update
      rview->Update();
      viewer->redraw();

      // Force drawing
      Fl::wait(0);
    }
  }

  if (rviewUI->transformationBrowser->size() > 0) {
    // Read transformation
    char *buffer = strdup(rviewUI->transformationBrowser->text(rviewUI->transformationBrowser->value()));
    rview->ReadTransformation(buffer);
    rviewUI->info_trans_filename->value(buffer);
    free(buffer);
  }

  // Update
  rview->Update();
  viewer->redraw();

  o->clear();
}

void Fl_RViewUI::cb_viewDeformationGridResolution(Fl_Slider* o, void*)
{
  rview->SetDisplayDeformationGridResolution(round(o->value()));
  rview->Update();
  viewer->redraw();
}

void Fl_RViewUI::cb_viewDeformationGrid(Fl_Button* o, void*)
{
  if (o->value() == 0) rview->DisplayDeformationGridOff();
  if (o->value() == 1) rview->DisplayDeformationGridOn();
  rview->Update();
  viewer->redraw();
}

void Fl_RViewUI::cb_viewDeformationArrows(Fl_Button* o, void*)
{
  if (o->value() == 0) rview->DisplayDeformationArrowsOff();
  if (o->value() == 1) rview->DisplayDeformationArrowsOn();
  rview->Update();
  viewer->redraw();
}

void Fl_RViewUI::cb_viewDeformationPoints(Fl_Button* o, void*)
{
  if (o->value() == 0) rview->DisplayDeformationPointsOff();
  if (o->value() == 1) rview->DisplayDeformationPointsOn();
  rview->Update();
  viewer->redraw();
}

void Fl_RViewUI::UpdateTransformationControlWindow()
{
  int j;
  list<char *> textList;
  list<char *>::iterator i;

  // Get list with transformation information
  rview->GetTransformationText(textList);

  // Clear browser
  info_trans_details->clear();

  // Add transformation information
  for (i = textList.begin(); i != textList.end(); i++) {
    info_trans_details->add(*i);
  }

  // Update transformation display
  rviewUI->transformApply->value(rview->GetSourceTransformApply());
  rviewUI->transformInvert->value(rview->GetSourceTransformInvert());
  rviewUI->viewDeformationGrid->value(rview->GetDisplayDeformationGrid());
  rviewUI->viewDeformationPoints->value(rview->GetDisplayDeformationPoints());
  rviewUI->viewDeformationArrows->value(rview->GetDisplayDeformationArrows());
  rviewUI->viewDeformationGridResolution->value(rview->GetDisplayDeformationGridResolution());

  // Get transformation
  irtkTransformation *transform = rview->GetTransformation();

  // Reset values to identity if transformation is has affine component
  if (dynamic_cast<irtkFreeFormTransformation *>(transform) != NULL) return;

  for (j = 0; j < transform->NumberOfDOFs(); j++) {
    rviewUI->transformationValuator[j]->value(transform->Get(j));
  }
}

void Fl_RViewUI::ShowTransformationControlWindow()
{}

void Fl_RViewUI::InitializeTransformationControlWindow()
{
  {
    // Create transformation controls
    Fl_Group* o = new Fl_Group(0, 30, 400, 460, "Transformation controls");
    o->user_data((void*)(this));
    o->box(FL_ENGRAVED_BOX);
    o->labeltype(FL_NO_LABEL);
    {
      transformationBrowser = new Fl_Simple_Browser(10, 40, 370, 180, "Transformations");
      transformationBrowser->callback((Fl_Callback*)cb_browseTransformation);
      {
        Fl_Button  *o = new Fl_Button(15,  240,  100,  30, "Move up");
        o->callback((Fl_Callback*)cb_moveupTransformation);
      }
      {
        Fl_Button  *o = new Fl_Button(145, 240,  100,  30, "Edit");
        o->callback((Fl_Callback*)cb_editTransformation);
      }
      {
        Fl_Button  *o = new Fl_Button(275, 240,  100,  30, "Reset");
        o->callback((Fl_Callback*)cb_editTransformationReset);
      }
      {
        Fl_Button  *o = new Fl_Button(15,  280,  100,  30, "Move down");
        o->callback((Fl_Callback*)cb_movedownTransformation);
      }
      {
        Fl_Button  *o = new Fl_Button(145, 280,  100,  30, "Delete");
        o->callback((Fl_Callback*)cb_deleteTransformation);
      }
      {
        Fl_Button  *o = new Fl_Button(275, 280,  100,  30, "Movie");
        o->callback((Fl_Callback*)cb_movieTransformation);
      }

      transformApply = new Fl_Check_Button(20, 320, 170, 20, "  Apply transformation");
      transformApply->callback((Fl_Callback*)cb_applyTransformation);

      transformInvert = new Fl_Check_Button(200, 320, 170, 20, "  Invert transformation");
      transformInvert->callback((Fl_Callback*)cb_invertTransformation);

      info_trans_filename = new Fl_Output(150, 350, 230, 20, "Transform filename = ");
      info_trans_filename->box(FL_FLAT_BOX);
      info_trans_details = new Fl_Hold_Browser(150, 380, 230, 100, "Transform details    = ");
      info_trans_details->align(FL_ALIGN_LEFT);
    }
    o->end(); // End of transformation controls
  }
  {
    // Create deformation display controls
    Fl_Group* o = new Fl_Group(0, 490, 400, 220, "Deformation Display");
    o->user_data((void*)(this));
    o->box(FL_ENGRAVED_BOX);
    o->labeltype(FL_NO_LABEL);
    {
      Fl_Check_Button *o  = viewDeformationArrows = new Fl_Check_Button(20, 510, 60, 20, "Deformation vectors");
      o->callback((Fl_Callback*)cb_viewDeformationArrows);
    }
    {
      Fl_Check_Button *o  = viewDeformationGrid = new Fl_Check_Button(210, 510, 60, 20, "Deformation grid");
      o->callback((Fl_Callback*)cb_viewDeformationGrid);
    }
    {
      Fl_Check_Button *o  = viewDeformationPoints = new Fl_Check_Button(20, 550, 120, 20, "Control points");
      o->callback((Fl_Callback*)cb_viewDeformationPoints);
    }
    {
      Fl_Value_Slider* o = viewDeformationGridResolution = new Fl_Value_Slider(10, 610, 380, 20, "Deformation field resolution");
      o->step(1);
      o->minimum(0);
      o->maximum(40);
      o->type(5);
      o->box(FL_EMBOSSED_BOX);
      o->align(FL_ALIGN_TOP_LEFT);
      o->callback((Fl_Callback*)cb_viewDeformationGridResolution);
    }
    o->end(); // End of deformation display controls
  }
}

void Fl_RViewUI::InitializeTransformationEditor()
{
  // Global transformation Editor
  {
    editTransformation = new Fl_Window(750, 230, "editGlobalTransformation");
    editTransformation->set_modal();
    {
      Fl_Window *o = new Fl_Window(0, 0, 750, 180);
      o->box(FL_ENGRAVED_BOX);
      {
        // Boxes
        Fl_Box **o = new Fl_Box *[5];
        o[0] = new Fl_Box( 10,  40, 100, 20, "Translation (mm)");
        o[1] = new Fl_Box( 10,  70, 100, 20, "Rotation (deg)");
        o[2] = new Fl_Box( 10, 100, 100, 20, "Scaling (%)");
        o[3] = new Fl_Box( 10, 130, 100, 20, "Skews (deg)");
        o[4] = new Fl_Box(320,  10, 100, 20, "Transformation parameters");
      }
      {
        {
          // Sliders
          int i;
          Fl_Valuator** o = transformationValuator = new Fl_Valuator *[12];

          // translation
          o[0]  = new Fl_Value_Slider(140, 40, 180, 20, "tx");
          o[1]  = new Fl_Value_Slider(350, 40, 180, 20, "ty");
          o[2]  = new Fl_Value_Slider(560, 40, 180, 20, "tz");
          for (i=0; i<3; i++) {
            o[i]->range(_GLOBAL_TRANSLATION_MIN, _GLOBAL_TRANSLATION_MAX);
            o[i]->step(0.5);
          }

          // rotation
          o[3]  = new Fl_Value_Slider(140, 70, 180, 20, "rx");
          o[4]  = new Fl_Value_Slider(350, 70, 180, 20, "ry");
          o[5]  = new Fl_Value_Slider(560, 70, 180, 20, "rz");
          for (i=3; i<6; i++) {
            o[i]->range(_GLOBAL_ROTATION_MIN, _GLOBAL_ROTATION_MAX);
            o[i]->step(1);
          }

          // scaling
          o[6]  = new Fl_Value_Slider(140, 100, 180, 20, "sx");
          o[7]  = new Fl_Value_Slider(350, 100, 180, 20, "sy");
          o[8]  = new Fl_Value_Slider(560, 100, 180, 20, "sz");
          for (i=6; i<9; i++) {
            o[i]->range(_GLOBAL_SCALING_MIN, _GLOBAL_SCALING_MAX);
            o[i]->step(5);
          }

          // skews
          o[9]  = new Fl_Value_Slider(140, 130, 180, 20, "xy");
          o[10] = new Fl_Value_Slider(350, 130, 180, 20, "yz");
          o[11] = new Fl_Value_Slider(560, 130, 180, 20, "xz");
          for (i=9; i<12; i++) {
            o[i]->range(_GLOBAL_ROTATION_MIN, _GLOBAL_ROTATION_MAX);
            o[i]->step(1);
          }

          // Settings and callback
          irtkTransformation *transform = rview->GetTransformation();
          for (i=0; i<transform->NumberOfDOFs(); i++) {
            o[i]->callback((Fl_Callback*)cb_editTransformationUpdate,
                           reinterpret_cast<void *>(i));
            o[i]->type(FL_HOR_NICE_SLIDER);
            o[i]->box(FL_EMBOSSED_BOX);
            o[i]->value(transform->Get(i));
            o[i]->align(FL_ALIGN_LEFT);
          }
        }
      }
      o->end();
    }
    {
      Fl_Window *o = new Fl_Window(0, 180, 750, 50);
      o->box(FL_ENGRAVED_BOX);
      {
        // Buttons
        Fl_Button **o = new  Fl_Button *[2];
        o[0] = new Fl_Return_Button( 10, 10, 80, 30, "OK");
        o[1] = new Fl_Return_Button(110, 10, 80, 30, "Reset");
        o[0]->callback((Fl_Callback *)cb_editTransformationApply);
        o[1]->callback((Fl_Callback *)cb_editTransformationReset);
      }
      o->end();
    }
    editTransformation->end(); // End of editGlobalTransformation
  }
}

#endif


text:
#ifndef BERRYIWORKBENCHWINDOW_H_
#define BERRYIWORKBENCHWINDOW_H_

#include <berryMacros.h>
#include <berryIAdaptable.h>

#include <org_blueberry_ui_qt_Export.h>

#include "berryIPageService.h"
#include "berryShell.h"

#include "services/berryIServiceLocator.h"

namespace berry {

struct IPartService;
struct ISelectionService;
struct IWorkbenchPage;
struct IWorkbench;

/**
 * \ingroup org_blueberry_ui_qt
 *
 * A workbench window is a top level window in a workbench. Visually, a
 * workbench window has a menubar, a toolbar, a status bar, and a main area for
 * displaying a single page consisting of a collection of views and editors.
 *

 * Each workbench window has a collection of 0 or more pages; the active page is
 * the one that is being presented to the end user; at most one page is active
 * in a window at a time.
 *

 *

 * The workbench window supports a few {@link IServiceLocator services} by
 * default. If these services are used to allocate resources, it is important to
 * remember to clean up those resources after you are done with them. Otherwise,
 * the resources will exist until the workbench window is closed. The supported
 * services are:
 *

 *

 *
{@link ICommandService}

 *
{@link IContextService}

 *
{@link IHandlerService}

 *
{@link IBindingService}. Resources allocated through this service will
 * not be cleaned up until the workbench shuts down.

 *

 *

 * This interface is not intended to be implemented by clients.
 *

 *
 * @see IWorkbenchPage
 * @noimplement This interface is not intended to be implemented by clients.
 *
 */
struct BERRY_UI_QT IWorkbenchWindow : public IPageService, public IServiceLocator, public virtual Object
{

  berryObjectMacro(berry::IWorkbenchWindow, IPageService, IServiceLocator, Object)

  /**
   * Closes this workbench window.
   *

   * If the window has an open editor with unsaved content, the user will be
   * given the opportunity to save it.
   *

   *
   * @return true if the window was successfully closed, and
   *         false if it is still open
   */
  virtual bool Close() = 0;

  /**
   * Returns a list of the pages in this workbench window.
   *

   * Note that each window has its own pages; pages are never shared between
   * different windows.
   *

   *
   * @return a list of pages
   */
  virtual QList<SmartPointer<IWorkbenchPage> > GetPages() const = 0;

  /**
   * Returns the currently active page for this workbench window.
   *
   * @return the active page, or null if none
   */
  SmartPointer<IWorkbenchPage> GetActivePage() const override = 0;

  /**
   * Sets or clears the currently active page for this workbench window.
   *
   * @param page
   *            the new active page
   */
  virtual void SetActivePage(SmartPointer<IWorkbenchPage> page) = 0;

  /**
   * Returns the part service which tracks part activation within this
   * workbench window.
   *
   * @return the part service
   */
  virtual IPartService* GetPartService() = 0;

  /**
   * Returns the selection service which tracks selection within this
   * workbench window.
   *
   * @return the selection service
   */
  virtual ISelectionService* GetSelectionService() const = 0;

  /**
   * Returns this workbench window's shell.
   *
   * @return the shell containing this window's controls or null
   *   if the shell has not been created yet or if the window has been closed
   */
  virtual Shell::Pointer GetShell() const = 0;

  /**
   * Returns the workbench for this window.
   *
   * @return the workbench
   */
  virtual IWorkbench* GetWorkbench() const = 0;

  /**
   * Returns whether the specified menu is an application menu as opposed to
   * a part menu. Application menus contain items which affect the workbench
   * or window. Part menus contain items which affect the active part (view
   * or editor).
   *

   * This is typically used during "in place" editing. Application menus
   * should be preserved during menu merging. All other menus may be removed
   * from the window.
   *

   *
   * @param menuId
   *            the menu id
   * @return true if the specified menu is an application
   *         menu, and false if it is not
   */
  //virtual bool IsApplicationMenu(const QString& menuId) = 0;

  /**
   * Creates and opens a new workbench page. The perspective of the new page
   * is defined by the specified perspective ID. The new page become active.
   *

   * Note: Since release 2.0, a window is limited to contain at most
   * one page. If a page exist in the window when this method is used, then
   * another window is created for the new page. Callers are strongly
   * recommended to use the IWorkbench.showPerspective APIs to
   * programmatically show a perspective.
   *

   *
   * @param perspectiveId
   *            the perspective id for the window's initial page
   * @param input
   *            the page input, or null if there is no current
   *            input. This is used to seed the input for the new page's
   *            views.
   * @return the new workbench page
   * @exception WorkbenchException
   *                if a page could not be opened
   *
   * @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable)
   */
  virtual SmartPointer<IWorkbenchPage> OpenPage(const QString& perspectiveId, IAdaptable* input) = 0;

  /**
   * Creates and opens a new workbench page. The default perspective is used
   * as a template for creating the page. The page becomes active.
   *

   * Note: Since release 2.0, a window is limited to contain at most
   * one page. If a page exist in the window when this method is used, then
   * another window is created for the new page. Callers are strongly
   * recommended to use the IWorkbench.showPerspective APIs to
   * programmatically show a perspective.
   *

   *
   * @param input
   *            the page input, or null if there is no current
   *            input. This is used to seed the input for the new page's
   *            views.
   * @return the new workbench window
   * @exception WorkbenchException
   *                if a page could not be opened
   *
   * @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable)
   */
  virtual SmartPointer<IWorkbenchPage> OpenPage(IAdaptable* input) = 0;

  //virtual void SetPerspectiveExcludeList(const QStringList& v) = 0;
  //virtual QStringList GetPerspectiveExcludeList() const = 0;

  //virtual void SetViewExcludeList(const QStringList& v) = 0;
  //virtual QStringList GetViewExcludeList() const = 0;

  ~IWorkbenchWindow() override;

};

}

#endif /*BERRYIWORKBENCHWINDOW_H_*/


text:
module Open
	class PullRequest
		VERSION = "0.0.4"
	end
end


text:
using namespace lldb;
using namespace lldb_private;

class TraceImpl {
public:
  lldb::user_id_t uid;
};

lldb::ProcessSP SBTrace::GetSP() const { return m_opaque_wp.lock(); }

size_t SBTrace::GetTraceData(SBError &error, void *buf, size_t size,
                             size_t offset, lldb::tid_t thread_id) {
  LLDB_RECORD_DUMMY(size_t, SBTrace, GetTraceData,
                    (lldb::SBError &, void *, size_t, size_t, lldb::tid_t),
                    error, buf, size, offset, thread_id);

  ProcessSP process_sp(GetSP());
  llvm::MutableArrayRef<uint8_t> buffer(static_cast<uint8_t *>(buf), size);
  error.Clear();

  if (!process_sp) {
    error.SetErrorString("invalid process");
  } else {
    error.SetError(
        process_sp->GetData(GetTraceUID(), thread_id, buffer, offset));
  }
  return buffer.size();
}

size_t SBTrace::GetMetaData(SBError &error, void *buf, size_t size,
                            size_t offset, lldb::tid_t thread_id) {
  LLDB_RECORD_DUMMY(size_t, SBTrace, GetMetaData,
                    (lldb::SBError &, void *, size_t, size_t, lldb::tid_t),
                    error, buf, size, offset, thread_id);

  ProcessSP process_sp(GetSP());
  llvm::MutableArrayRef<uint8_t> buffer(static_cast<uint8_t *>(buf), size);
  error.Clear();

  if (!process_sp) {
    error.SetErrorString("invalid process");
  } else {
    error.SetError(
        process_sp->GetMetaData(GetTraceUID(), thread_id, buffer, offset));
  }
  return buffer.size();
}

void SBTrace::StopTrace(SBError &error, lldb::tid_t thread_id) {
  LLDB_RECORD_METHOD(void, SBTrace, StopTrace, (lldb::SBError &, lldb::tid_t),
                     error, thread_id);

  ProcessSP process_sp(GetSP());
  error.Clear();

  if (!process_sp) {
    error.SetErrorString("invalid process");
    return;
  }
  error.SetError(process_sp->StopTrace(GetTraceUID(), thread_id));
}

void SBTrace::GetTraceConfig(SBTraceOptions &options, SBError &error) {
  LLDB_RECORD_METHOD(void, SBTrace, GetTraceConfig,
                     (lldb::SBTraceOptions &, lldb::SBError &), options, error);

  ProcessSP process_sp(GetSP());
  error.Clear();

  if (!process_sp) {
    error.SetErrorString("invalid process");
  } else {
    error.SetError(process_sp->GetTraceConfig(GetTraceUID(),
                                              *(options.m_traceoptions_sp)));
  }
}

lldb::user_id_t SBTrace::GetTraceUID() {
  LLDB_RECORD_METHOD_NO_ARGS(lldb::user_id_t, SBTrace, GetTraceUID);

  if (m_trace_impl_sp)
    return m_trace_impl_sp->uid;
  return LLDB_INVALID_UID;
}

void SBTrace::SetTraceUID(lldb::user_id_t uid) {
  if (m_trace_impl_sp)
    m_trace_impl_sp->uid = uid;
}

SBTrace::SBTrace() {
  LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBTrace);

  m_trace_impl_sp = std::make_shared<TraceImpl>();
  if (m_trace_impl_sp)
    m_trace_impl_sp->uid = LLDB_INVALID_UID;
}

void SBTrace::SetSP(const ProcessSP &process_sp) { m_opaque_wp = process_sp; }

bool SBTrace::IsValid() {
  LLDB_RECORD_METHOD_NO_ARGS(bool, SBTrace, IsValid);
  return this->operator bool();
}
SBTrace::operator bool() const {
  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTrace, operator bool);

  if (!m_trace_impl_sp)
    return false;
  if (!GetSP())
    return false;
  return true;
}

namespace lldb_private {
namespace repro {

template <>
void RegisterMethods<SBTrace>(Registry &R) {
  LLDB_REGISTER_METHOD(void, SBTrace, StopTrace,
                       (lldb::SBError &, lldb::tid_t));
  LLDB_REGISTER_METHOD(void, SBTrace, GetTraceConfig,
                       (lldb::SBTraceOptions &, lldb::SBError &));
  LLDB_REGISTER_METHOD(lldb::user_id_t, SBTrace, GetTraceUID, ());
  LLDB_REGISTER_CONSTRUCTOR(SBTrace, ());
  LLDB_REGISTER_METHOD(bool, SBTrace, IsValid, ());
  LLDB_REGISTER_METHOD_CONST(bool, SBTrace, operator bool, ());
}

}
}


text:
package jdepend.model.component.modelconf;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import jdepend.metadata.Candidate;
import jdepend.metadata.JavaPackage;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

/**
 * 组件模型配置信息类
 *
 * @author <b>Abner</b>
 *
 */
public abstract class ComponentModelConf implements Serializable, Cloneable {

	private String name;

	private List<ComponentConf> componentConfs = new ArrayList<ComponentConf>();

	private List<String> ignoreItems = new ArrayList<String>();

	public final static String ComponentModelType_Package = "package";
	public final static String ComponentModelType_Class = "class";

	public final static String ADD = "ADD";
	public final static String DELETE = "DELETE";

	public ComponentModelConf() {

	}

	public ComponentModelConf(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

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

	public abstract void addComponentConf(String name, int layer, List<String> packageNames) throws ComponentConfException;

	protected void addComponentConf(ComponentConf componentConf) {
		if (!componentConfs.contains(componentConf)) {
			componentConfs.add(componentConf);
		}
	}

	/**
	 * 删除一个组件配置
	 *
	 * @param name
	 */
	public void deleteComponentConf(String name) {
		ComponentConf componentConf = this.getTheComponentConf(name);
		if (componentConf != null) {
			componentConfs.remove(componentConf);
		}
	}

	public boolean contains(String name) {
		return this.getTheComponentConf(name) == null ? false : true;
	}

	public int size() {
		return componentConfs.size();
	}

	/**
	 * 得到组件列表名称
	 *
	 * @return
	 */
	public List<String> getComponentConfNames() {

		List<String> names = new ArrayList<String>();

		for (ComponentConf componentConf : componentConfs) {
			names.add(componentConf.getName());
		}

		return names;
	}

	/**
	 * 得到指定组件配置信息
	 *
	 * @param name
	 * @return
	 */
	public ComponentConf getTheComponentConf(String name) {

		for (ComponentConf componentConf : componentConfs) {
			if (componentConf.getName().equals(name)) {
				return componentConf;
			}
		}
		return null;
	}

	public List<ComponentConf> getComponentConfs() {
		return this.componentConfs;
	}

	/**
	 * 得到在创建该组件模型时未被包含的javaPackages
	 *
	 * @return
	 */
	public List<String> getIgnoreItems() {
		return ignoreItems;
	}

	public void setIgnoreItems(List<String> ignoreItems) {
		this.ignoreItems = ignoreItems;
	}

	public void addIgnoreItem(String ignoreItem) {
		if (!this.ignoreItems.contains(ignoreItem)) {
			this.ignoreItems.add(ignoreItem);
		}
	}

	/**
	 * 得到该组件模型包含的javaPackages
	 *
	 * @return
	 */
	public Collection<String> getContainItems() {
		Collection<String> containItems = new ArrayList<String>();
		for (ComponentConf componentConf : this.getComponentConfs()) {
			for (String itemName : componentConf.getItemIds()) {
				containItems.add(itemName);
			}
		}
		return containItems;
	}

	public void validateData() throws ComponentConfException {
		if (this.size() == 0) {
			throw new ComponentConfException("您没有设置组件!");
		}
		if (this.getName() == null || this.getName().length() == 0) {
			throw new ComponentConfException("未指定组件组名称!");
		}
	}

	public abstract ComponentModelConf clone() throws CloneNotSupportedException;

	public abstract Element save(Document document);

	public abstract ComponentModelConf load(Node componentModel) throws ComponentConfException;

	public abstract Collection<? extends Candidate> getCandidates(Collection<JavaPackage> packages);

	public Map<String, String> calDiffElements(Collection<JavaPackage> packages) {

		Map<String, String> diffElements = new LinkedHashMap<String, String>();

		Collection<String> containItems = this.getContainItems();
		Collection<String> ignoreItems = this.getIgnoreItems();
		Collection<String> runItems = new ArrayList<String>();

		Map<String, Candidate> candidateForId = new HashMap<String, Candidate>();
		for (Candidate candidate : this.getCandidates(packages)) {
			runItems.add(candidate.getId());
			candidateForId.put(candidate.getId(), candidate);
		}
		for (String runItem : runItems) {
			if (!containItems.contains(runItem) && !ignoreItems.contains(runItem)) {
				if (candidateForId.get(runItem).isInner()) {
					diffElements.put(runItem, ADD);
				}
			}
		}
		for (String containItem : containItems) {
			if (!runItems.contains(containItem)) {
				diffElements.put(containItem, DELETE);
			}
		}

		return diffElements;
	}

	@Override
	public String toString() {
		StringBuilder content = new StringBuilder();
		content.append("组件模型名称:");
		content.append(this.name);
		content.append("\n");

		for (ComponentConf conf : this.componentConfs) {
			content.append(conf);
		}

		return content.toString();
	}
}


text:
package de.bayerl.statistics.persitance;

import com.hp.hpl.jena.rdf.model.Model;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.apache.jena.riot.Lang;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

/**
 * Created by sebastianbayerl on 31/05/15.
 */
public class BigdataEndpoint {

    private static final String STORE  = "http://zaire.dimis.fim.uni-passau.de:8181/bigdata-statistics/sparql";

    private final static String CONTEXT_URI = "?context-uri=";

    private String convertModelToString(Model model) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        model.write(baos, Lang.N3.getName());

        return baos.toString();
    }

    public String persist(Model model, ContentTypeRdf contentType, String context) {
        String content = convertModelToString(model);
        //System.out.println(content);
        HttpClient httpClient = HttpClients.createDefault();

        HttpPost httpPost = new HttpPost(STORE + CONTEXT_URI + context);

        httpPost.setHeader("Content-Type", contentType.getContentTypeRdf());

        try {
            httpPost.setEntity(new StringEntity(content));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        HttpResponse response = null;
        String result = "";
        try {
            response = httpClient.execute(httpPost);
            HttpEntity entity = response.getEntity();
            result = IOUtils.toString(entity.getContent(), "UTF-8");
            EntityUtils.consume(entity);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            httpPost.releaseConnection();
        }

        return result;
    }
}


text:
'use strict';

/**
@module ember-cli
*/
const RSVP = require('rsvp');
const path = require('path');
const findup = require('find-up');
let resolve = RSVP.denodeify(require('resolve'));
const fs = require('fs-extra');
const existsSync = require('exists-sync');
const _ = require('ember-cli-lodash-subset');
let logger = require('heimdalljs-logger')('ember-cli:project');
const nodeModulesPath = require('node-modules-path');
const versionUtils = require('../utilities/version-utils');
let emberCLIVersion = versionUtils.emberCLIVersion;
const findAddonByName = require('../utilities/find-addon-by-name');
const Instrumentation = require('./instrumentation');
const heimdall = require('heimdalljs');

let processCwd = process.cwd();
// ensure NULL_PROJECT is a singleton
let NULL_PROJECT;

class Project {
  /**
    The Project model is tied to your package.json. It is instantiated
    by giving {{#crossLink "Project/closestSync:method"}}{{/crossLink}}
    the path to your project.

    @class Project
    @constructor
    @param {String} root Root directory for the project
    @param {Object} pkg  Contents of package.json
    @param {UI} ui
    @param {CLI} cli
  */
  constructor(root, pkg, ui, cli) {
    const AddonDiscovery = require('../models/addon-discovery');
    const AddonsFactory = require('../models/addons-factory');

    logger.info('init root: %s', root);

    this.root = root;
    this.pkg = pkg;
    this.ui = ui;
    this.cli = cli;
    this.addonPackages = {};
    this.addons = [];
    this.liveReloadFilterPatterns = [];
    this.setupBowerDirectory();
    this.setupNodeModulesPath();
    this.addonDiscovery = new AddonDiscovery(this.ui);
    this.addonsFactory = new AddonsFactory(this, this);

    /**
      Set when the `Watcher.detectWatchman` helper method finishes running,
      so that other areas of the system can be aware that watchman is being used.

      For example, this information is used in the broccoli build pipeline to know
      if we can watch additional directories (like bower_components) "cheaply".

      Contains `enabled` and `version`.

      @private
      @property _watchmanInfo
      @return {Object}
      @default false
    */
    this._watchmanInfo = {
      enabled: false,
      version: null,
      canNestRoots: false,
    };

    let instrumentation = this._instrumentation = ensureInstrumentation(cli, ui);
    instrumentation.project = this;

    this.emberCLIVersion = emberCLIVersion;
  }

  /**
    Sets the name of the bower directory for this project

    @private
    @method setupBowerDirectory
   */
  setupBowerDirectory() {
    let bowerrcPath = path.join(this.root, '.bowerrc');

    logger.info('bowerrc path: %s', bowerrcPath);

    if (existsSync(bowerrcPath)) {
      try {
        this.bowerDirectory = fs.readJsonSync(bowerrcPath).directory;
      } catch (exception) {
        logger.info('failed to parse bowerc: %s', exception);
        this.bowerDirectory = null;
      }
    }

    this.bowerDirectory = this.bowerDirectory || 'bower_components';
    logger.info('bowerDirectory: %s', this.bowerDirectory);
  }

  hasDependencies() {
    return !!this.nodeModulesPath;
  }

  /**
    Sets the path to the node_modules directory for this
    project.

    @private
    @method setupNodeModulesPath
   */
  setupNodeModulesPath() {
    this.nodeModulesPath = nodeModulesPath(this.root);

    logger.info('nodeModulesPath: %s', this.nodeModulesPath);
  }

  static nullProject(ui, cli) {
    if (NULL_PROJECT) { return NULL_PROJECT; }

    NULL_PROJECT = new Project(processCwd, {}, ui, cli);

    NULL_PROJECT.isEmberCLIProject = function() {
      return false;
    };

    NULL_PROJECT.isEmberCLIAddon = function() {
      return false;
    };

    NULL_PROJECT.name = function() {
      return path.basename(process.cwd());
    };

    NULL_PROJECT.initializeAddons();

    return NULL_PROJECT;
  }

  /**
    Returns the name from package.json.

    @private
    @method name
    @return {String} Package name
   */
  name() {
    const getPackageBaseName = require('../utilities/get-package-base-name');

    return getPackageBaseName(this.pkg.name);
  }

  /**
    Returns whether or not this is an Ember CLI project.
    This checks whether ember-cli is listed in devDependencies.

    @private
    @method isEmberCLIProject
    @return {Boolean} Whether this is an Ember CLI project
   */
  isEmberCLIProject() {
    return (this.cli ? this.cli.npmPackage : 'ember-cli') in this.dependencies();
  }

  /**
    Returns whether or not this is an Ember CLI addon.

    @method isEmberCLIAddon
    @return {Boolean} Whether or not this is an Ember CLI Addon.
   */
  isEmberCLIAddon() {
    return !!this.pkg.keywords && this.pkg.keywords.indexOf('ember-addon') > -1;
  }

  /**
    Returns the path to the configuration.

    @private
    @method configPath
    @return {String} Configuration path
   */
  configPath() {
    let configPath = 'config';

    if (this.pkg['ember-addon'] && this.pkg['ember-addon']['configPath']) {
      configPath = this.pkg['ember-addon']['configPath'];
    }

    return path.join(this.root, configPath, 'environment');
  }

  /**
    Loads the configuration for this project and its addons.

    @public
    @method config
    @param  {String} env Environment name
    @return {Object}     Merged confiration object
   */
  config(env) {
    let configPath = this.configPath();

    if (existsSync(`${configPath}.js`)) {
      let appConfig = this.require(configPath)(env);
      let addonsConfig = this.getAddonsConfig(env, appConfig);

      return _.merge(addonsConfig, appConfig);
    } else {
      return this.getAddonsConfig(env, {});
    }
  }

  /**
    Returns the addons configuration.

    @private
    @method getAddonsConfig
    @param  {String} env       Environment name
    @param  {Object} appConfig Application configuration
    @return {Object}           Merged configuration of all addons
   */
  getAddonsConfig(env, appConfig) {
    this.initializeAddons();

    let initialConfig = _.merge({}, appConfig);

    return this.addons.reduce((config, addon) => {
      if (addon.config) {
        _.merge(config, addon.config(env, config));
      }

      return config;
    }, initialConfig);
  }

  /**
    Returns whether or not the given file name is present in this project.

    @private
    @method has
    @param  {String}  file File name
    @return {Boolean}      Whether or not the file is present
   */
  has(file) {
    return existsSync(path.join(this.root, file)) || existsSync(path.join(this.root, `${file}.js`));
  }

  /**
    Resolves the absolute path to a file.

    @private
    @method resolve
    @param  {String} file File to resolve
    @return {String}      Absolute path to file
   */
  resolve(file) {
    return resolve(file, {
      basedir: this.root,
    });
  }

  /**
    Resolves the absolute path to a file synchronously

    @private
    @method resolveSync
    @param  {String} file File to resolve
    @return {String}      Absolute path to file
   */
  resolveSync(file) {
    return resolve.sync(file, {
      basedir: this.root,
    });
  }

  /**
    Calls `require` on a given module.

    @private
    @method require
    @param  {String} file File path or module name
    @return {Object}      Imported module
   */
  require(file) {
    if (/^\.\//.test(file)) { // Starts with ./
      return require(path.join(this.root, file));
    } else if (file.slice(0, this.root.length) === this.root) { // Starts with this.root
      return require(file);
    } else {
      return require(path.join(this.nodeModulesPath, file));
    }
  }

  /**
    Returns the dependencies from a package.json

    @private
    @method dependencies
    @param  {Object}  pkg            Package object. If false, the current package is used.
    @param  {Boolean} excludeDevDeps Whether or not development dependencies should be excluded, defaults to false.
    @return {Object}                 Dependencies
   */
  dependencies(pkg, excludeDevDeps) {
    pkg = pkg || this.pkg || {};

    let devDependencies = pkg['devDependencies'];
    if (excludeDevDeps) {
      devDependencies = {};
    }

    return _.assign({}, devDependencies, pkg['dependencies']);
  }

  /**
    Returns the bower dependencies for this project.

    @private
    @method bowerDependencies
    @param  {String} bower Path to bower.json
    @return {Object}       Bower dependencies
   */
  bowerDependencies(bower) {
    if (!bower) {
      let bowerPath = path.join(this.root, 'bower.json');
      bower = (existsSync(bowerPath)) ? require(bowerPath) : {};
    }
    return _.assign({}, bower['devDependencies'], bower['dependencies']);
  }

  /**
    Provides the list of paths to consult for addons that may be provided
    internally to this project. Used for middleware addons with built-in support.

    @private
    @method supportedInternalAddonPaths
  */
  supportedInternalAddonPaths() {
    if (!this.root) { return []; }

    let internalMiddlewarePath = path.join(__dirname, '../tasks/server/middleware');
    let legacyBlueprintsPath = require.resolve('ember-cli-legacy-blueprints');
    let emberTryPath = require.resolve('ember-try');
    return [
      path.join(internalMiddlewarePath, 'testem-url-rewriter'),
      path.join(internalMiddlewarePath, 'tests-server'),
      path.join(internalMiddlewarePath, 'history-support'),
      path.join(internalMiddlewarePath, 'broccoli-watcher'),
      path.join(internalMiddlewarePath, 'broccoli-serve-files'),
      path.join(internalMiddlewarePath, 'proxy-server'),
      path.dirname(legacyBlueprintsPath),
      path.dirname(emberTryPath),
    ];
  }

  /**
    Discovers all addons for this project and stores their names and
    package.json contents in this.addonPackages as key-value pairs

    @private
    @method discoverAddons
   */
  discoverAddons() {
    let addonsList = this.addonDiscovery.discoverProjectAddons(this);

    this.addonPackages = this.addonDiscovery.addonPackages(addonsList);
  }

  /**
    Loads and initializes all addons for this project.

    @private
    @method initializeAddons
   */
  initializeAddons() {
    if (this._addonsInitialized) {
      return;
    }
    this._addonsInitialized = true;

    logger.info('initializeAddons for: %s', this.name());

    this.discoverAddons();

    this.addons = this.addonsFactory.initializeAddons(this.addonPackages);

    this.addons.forEach(addon => {
      logger.info('addon: %s', addon.name);
    });
  }

  /**
    Returns what commands are made available by addons by inspecting
    `includedCommands` for every addon.

    @private
    @method addonCommands
    @return {Object} Addon names and command maps as key-value pairs
   */
  addonCommands() {
    const Command = require('../models/command');
    let commands = {};
    this.addons.forEach(addon => {
      if (!addon.includedCommands) { return; }

      let token = heimdall.start({
        name: `lookup-commands: ${addon.name}`,
        addonName: addon.name,
        addonCommandInitialization: true,
      });

      let includedCommands = addon.includedCommands();
      let addonCommands = {};

      for (let key in includedCommands) {
        if (typeof includedCommands[key] === 'function') {
          addonCommands[key] = includedCommands[key];
        } else {
          addonCommands[key] = Command.extend(includedCommands[key]);
        }
      }
      if (Object.keys(addonCommands).length) {
        commands[addon.name] = addonCommands;
      }

      token.stop();
    });
    return commands;
  }

  /**
    Execute a given callback for every addon command.
    Example:

    ```
    project.eachAddonCommand(function(addonName, commands) {
      console.log('Addon ' + addonName + ' exported the following commands:' + commands.keys().join(', '));
    });
    ```

    @private
    @method eachAddonCommand
    @param  {Function} callback [description]
   */
  eachAddonCommand(callback) {
    if (this.initializeAddons && this.addonCommands) {
      this.initializeAddons();
      let addonCommands = this.addonCommands();

      _.forOwn(addonCommands, (commands, addonName) => callback(addonName, commands));
    }
  }

  /**
    Path to the blueprints for this project.

    @private
    @method localBlueprintLookupPath
    @return {String} Path to blueprints
   */
  localBlueprintLookupPath() {
    return path.join(this.root, 'blueprints');
  }

  /**
    Returns a list of paths (including addon paths) where blueprints will be looked up.

    @private
    @method blueprintLookupPaths
    @return {Array} List of paths
   */
  blueprintLookupPaths() {
    if (this.isEmberCLIProject()) {
      let lookupPaths = [this.localBlueprintLookupPath()];
      let addonLookupPaths = this.addonBlueprintLookupPaths();

      return lookupPaths.concat(addonLookupPaths);
    } else {
      return this.addonBlueprintLookupPaths();
    }
  }

  /**
    Returns a list of addon paths where blueprints will be looked up.

    @private
    @method addonBlueprintLookupPaths
    @return {Array} List of paths
   */
  addonBlueprintLookupPaths() {
    let addonPaths = this.addons.map(addon => {
      if (addon.blueprintsPath) {
        return addon.blueprintsPath();
      }
    }, this);

    return addonPaths.filter(Boolean).reverse();
  }

  /**
    Reloads package.json

    @private
    @method reloadPkg
    @return {Object} Package content
   */
  reloadPkg() {
    let pkgPath = path.join(this.root, 'package.json');

    // We use readFileSync instead of require to avoid the require cache.
    this.pkg = fs.readJsonSync(pkgPath);

    return this.pkg;
  }

  /**
    Re-initializes addons.

    @private
    @method reloadAddons
   */
  reloadAddons() {
    this.reloadPkg();
    this._addonsInitialized = false;
    return this.initializeAddons();
  }

  /**
    Find an addon by its name

    @private
    @method findAddonByName
    @param  {String} name Addon name as specified in package.json
    @return {Addon}       Addon instance
   */
  findAddonByName(name) {
    this.initializeAddons();

    return findAddonByName(this.addons, name);
  }

  /**
    Generate test file contents.

    This method is supposed to be overwritten by test framework addons
    like `ember-cli-qunit` and `ember-cli-mocha`.

    @public
    @method generateTestFile
    @param {String} moduleName Name of the test module (e.g. `JSHint`)
    @param {Object[]} tests Array of tests with `name`, `passed` and `errorMessage` properties
    @return {String} The test file content
   */
  generateTestFile() {
    let message = 'Please install an Ember.js test framework addon or update your dependencies.';

    if (this.ui) {
      this.ui.writeDeprecateLine(message);
    } else {
      console.warn(message);
    }

    return '';
  }

  /**
    Returns a new project based on the first package.json that is found
    in `pathName`.

    @deprecated
    @private
    @static
    @method closest
    @param  {String} pathName Path to your project
    @return {Promise}         Promise which resolves to a {Project}
   */
  static closest(pathName, _ui, _cli) {
    let ui = ensureUI(_ui);

    ui.writeDeprecateLine('`Project.closest` is a private method that will be removed, please use `Project.closestSync` instead.');

    return closestPackageJSON(pathName).then(result => {
      logger.info('closest %s -> %s', pathName, result);
      if (result.pkg && result.pkg.name === 'ember-cli') {
        return Project.nullProject(_ui, _cli);
      }

      return new Project(result.directory, result.pkg, ui, _cli);
    });
  }

  /**
    Returns a new project based on the first package.json that is found
    in `pathName`.

    @private
    @static
    @method closestSync
    @param  {String} pathName Path to your project
    @param  {UI} _ui The UI instance to provide to the created Project.
    @return {Project}         Project instance
   */
  static closestSync(pathName, _ui, _cli) {
    logger.info('looking for package.json starting at %s', pathName);

    let ui = ensureUI(_ui);

    let directory = findupPath(pathName);
    logger.info('found package.json at %s', directory);

    let relative = path.relative(directory, pathName);
    if (relative.indexOf('tmp') === 0) {
      logger.info('ignoring parent project since we are in the tmp folder of the project');
      return Project.nullProject(_ui, _cli);
    }

    let pkg = fs.readJsonSync(path.join(directory, 'package.json'));
    logger.info('project name: %s', pkg && pkg.name);

    if (!isEmberCliProject(pkg)) {
      logger.info('ignoring parent project since it is not an ember-cli project');
      return Project.nullProject(_ui, _cli);
    }

    return new Project(directory, pkg, ui, _cli);
  }

  /**
    Returns a new project based on the first package.json that is found
    in `pathName`, or the nullProject.

    The nullProject signifies no-project, but abides by the null object pattern

    @private
    @static
    @method projectOrnullProject
    @param  {UI} _ui The UI instance to provide to the created Project.
    @return {Project}         Project instance
   */
  static projectOrnullProject(_ui, _cli) {
    try {
      return Project.closestSync(process.cwd(), _ui, _cli);
    } catch (reason) {
      if (reason instanceof Project.NotFoundError) {
        return Project.nullProject(_ui, _cli);
      } else {
        throw reason;
      }
    }
  }

  /**
    Returns the project root based on the first package.json that is found

    @static
    @method getProjectRoot
    @return {String} The project root directory
   */
  static getProjectRoot() {
    let packagePath = findup.sync('package.json');
    if (!packagePath) {
      logger.info('getProjectRoot: not found. Will use cwd: %s', process.cwd());
      return process.cwd();
    }

    let directory = path.dirname(packagePath);
    const pkg = require(packagePath);

    if (pkg && pkg.name === 'ember-cli') {
      logger.info('getProjectRoot: named \'ember-cli\'. Will use cwd: %s', process.cwd());
      return process.cwd();
    }

    logger.info('getProjectRoot %s -> %s', process.cwd(), directory);
    return directory;
  }
}

class NotFoundError extends Error {
  constructor(message) {
    super(message);
    this.name = 'NotFoundError';
    this.stack = (new Error()).stack;
  }
}

Project.NotFoundError = NotFoundError;

function ensureInstrumentation(cli, ui) {
  if (cli && cli.instrumentation) {
    return cli.instrumentation;
  }

  // created without a `cli` object (possibly from deprecated `Brocfile.js`)
  return new Instrumentation({
    ui,
    initInstrumentation: null,
  });
}

function ensureUI(_ui) {
  let ui = _ui;

  if (!ui) {
    // TODO: one UI (lib/cli/index.js also has one for now...)
    const UI = require('console-ui');
    ui = new UI({
      inputStream: process.stdin,
      outputStream: process.stdout,
      ci: process.env.CI || (/^(dumb|emacs)$/).test(process.env.TERM),
      writeLevel: (process.argv.indexOf('--silent') !== -1) ? 'ERROR' : undefined,
    });
  }

  return ui;
}

function closestPackageJSON(pathName) {
  return findup('package.json', { cwd: pathName }).then(packagePath => {
    if (!packagePath) {
      throw new NotFoundError(`No project found at or up from: \`${pathName}\``);
    }

    return {
      directory: path.dirname(packagePath),
      pkg: require(packagePath),
    };
  });
}

function findupPath(pathName) {
  let pkgPath = findup.sync('package.json', { cwd: pathName });
  if (!pkgPath) {
    throw new NotFoundError(`No project found at or up from: \`${pathName}\``);
  }

  return path.dirname(pkgPath);
}

function isEmberCliProject(pkg) {
  return pkg && (
    (pkg.dependencies && Object.keys(pkg.dependencies).indexOf('ember-cli') !== -1) ||
    (pkg.devDependencies && Object.keys(pkg.devDependencies).indexOf('ember-cli') !== -1)
  );
}

// Export
module.exports = Project;


text:
create administrator

        <form action="/business-farmer/save_user" method="post">
            <?php echo  $_COOKIE['name_user'] .' ' .$_COOKIE['last_name_user']?>

            Create an administrator password
            <input type="password" name="password" class="form-control">

            Confirm password
            <input type="password" name="password2" class="form-control">

            <button type="submit" class="btn btn-success btn-block">create</button>
        </form>


text:
package uk.co.ribot.androidboilerplate.ui.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;
import uk.co.ribot.androidboilerplate.R;
import uk.co.ribot.androidboilerplate.data.model.net.response.StatementAccountListResponse;
import uk.co.ribot.androidboilerplate.tools.TimeUtils;
import uk.co.ribot.androidboilerplate.tools.UserUtils;
import uk.co.ribot.androidboilerplate.ui.adapter.base.BaseAdapter;

/**
 * Created by mike on 2017/11/28.
 */

public class StatementAccountAdapter extends BaseAdapter<StatementAccountAdapter.ViewHolder> {

    ArrayList<StatementAccountListResponse.BankStatementBean> mBankStatementBeans = new ArrayList<>();

    @Inject
    public StatementAccountAdapter() {
    }

    public void setData(List<StatementAccountListResponse.BankStatementBean> bankStatementBeans) {
        mBankStatementBeans.clear();
        mBankStatementBeans.addAll(bankStatementBeans);
        notifyDataSetChanged();
    }

    @Override
    public StatementAccountAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = getLayout(parent.getContext(), R.layout.item_statement_account);
        ViewHolder viewHolder = new ViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(StatementAccountAdapter.ViewHolder holder, int position) {
        StatementAccountListResponse.BankStatementBean bankStatementBean = mBankStatementBeans.get(position);
        holder.mTvDate.setText(TimeUtils.getTimeStamps4(bankStatementBean.getBeginDate()) + "至" + TimeUtils.getTimeStamps4(bankStatementBean.getEndDate()));
        holder.mTvName.setText(bankStatementBean.getName());
        if(!TimeUtils.isTimeInner(bankStatementBean.getBeginDate(),bankStatementBean.getEndDate())) {
            bankStatementBean.setTimeLater(true);
            holder.mTvStatus.setVisibility(View.VISIBLE);
        }
        else {
            bankStatementBean.setTimeLater(false);
            holder.mTvStatus.setVisibility(View.GONE);
        }
        holder.mTvMoney.setText("¥"+ UserUtils.formatPrice(bankStatementBean.getTotalPrice()));
    }

    @Override
    public int getItemCount() {
        return 0;
    }

    static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.tv_date)
        TextView mTvDate;
        @BindView(R.id.tv_status)
        TextView mTvStatus;
        @BindView(R.id.tv_name)
        TextView mTvName;
        @BindView(R.id.tv_money)
        TextView mTvMoney;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}


text:
package interpolation

import (
	"reflect"

	"github.com/hashicorp/hil"
	"github.com/hashicorp/hil/ast"
)

// Eval evaluates the tempate string using hil https://github.com/hashicorp/hil
// with the given variables that can be accessed form the string.
func Eval(templateString string, variables map[string]interface{}) (interface{}, error) {
	tree, err := hil.Parse(templateString)
	if err != nil {
		return nil, err
	}

	varMap := make(map[string]ast.Variable)
	for vn, vv := range variables {
		converted, err := hil.InterfaceToVariable(vv)
		if err != nil {
			return nil, err
		}
		varMap[vn] = converted
	}

	config := &hil.EvalConfig{
		GlobalScope: &ast.BasicScope{
			VarMap:  varMap,
			FuncMap: hilStandardLibrary,
		},
	}

	result, err := hil.Eval(tree, config)
	if err != nil {
		return nil, err
	}

	return result.Value, err
}

// IsHILExpression returns true if the template is a HIL expression and false
// otherwise.
func IsHILExpression(template string) bool {
	tree, err := hil.Parse(template)
	if err != nil {
		return false
	}

	// Eval will error if it can't resolve a reference so we know the template is
	// a HIL expression
	result, err := hil.Eval(tree, &hil.EvalConfig{GlobalScope: &ast.BasicScope{}})
	if err != nil {
		return true
	}

	// if the template doesn't match the result value then we know something was
	// evaluated
	return !reflect.DeepEqual(template, result.Value)
}


text:
package com.vmware.vim25;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for HostCapabilityVmDirectPathGen2UnsupportedReason.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="HostCapabilityVmDirectPathGen2UnsupportedReason">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="hostNptIncompatibleProduct"/>
 *     <enumeration value="hostNptIncompatibleHardware"/>
 *     <enumeration value="hostNptDisabled"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "HostCapabilityVmDirectPathGen2UnsupportedReason")
@XmlEnum
public enum HostCapabilityVmDirectPathGen2UnsupportedReason {

    @XmlEnumValue("hostNptIncompatibleProduct")
    HOST_NPT_INCOMPATIBLE_PRODUCT("hostNptIncompatibleProduct"),
    @XmlEnumValue("hostNptIncompatibleHardware")
    HOST_NPT_INCOMPATIBLE_HARDWARE("hostNptIncompatibleHardware"),
    @XmlEnumValue("hostNptDisabled")
    HOST_NPT_DISABLED("hostNptDisabled");
    private final String value;

    HostCapabilityVmDirectPathGen2UnsupportedReason(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static HostCapabilityVmDirectPathGen2UnsupportedReason fromValue(String v) {
        for (HostCapabilityVmDirectPathGen2UnsupportedReason c: HostCapabilityVmDirectPathGen2UnsupportedReason.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
using System;
using System.Collections.Generic;

namespace Astro.CQRS
{
    public class EventSourcedAggregateBase : IEventSourcedAggregate
    {
        private readonly List<IEvent> _uncommitedEvents = new List<IEvent>();
        private readonly Dictionary<Type, Action<IEvent>> _eventHandlers = new Dictionary<Type, Action<IEvent>>();

        public EventSourcedAggregateBase()
        {
            Version = -1;
        }

        public Guid Id { get; protected set; }

        public int Version { get; private set; }

        public void RaiseEvent(IEvent evt)
        {
            ApplyEvent(evt);
            _uncommitedEvents.Add(evt);
        }

        public void ApplyEvent(IEvent evt)
        {
            var eventType = evt.GetType();

            if (_eventHandlers.ContainsKey(eventType))
            {
                _eventHandlers[eventType](evt);
            }

            evt.Version = ++Version;
        }

        public IEnumerable<IEvent> UncommitedEvents()
        {
            return _uncommitedEvents;
        }

        public void ClearUncommitedEvents()
        {
            _uncommitedEvents.Clear();
        }

        protected void RegisterHandler<T>(Action<T> eventHandler) where T : class
        {
            _eventHandlers.Add(typeof(T), o => eventHandler(o as T));
        }
    }
}


text:
package com.esri.gpt.catalog.harvest.repository;

import com.esri.gpt.catalog.harvest.clients.exceptions.HRConnectionException;
import com.esri.gpt.catalog.harvest.clients.exceptions.HRInvalidProtocolException;
import com.esri.gpt.framework.context.RequestContext;

/**
 * Provides connection test request functionality.
 */
public class HrTestRequest extends HrRequest {

// class variables =============================================================

// instance variables ==========================================================
/** Repository to update. */
private HrRecord _repository = new HrRecord();

// constructors ================================================================

/**
 * Create instance of the request.
 * @param requestContext request context
 * @param record record to test
 */
public HrTestRequest(RequestContext requestContext, HrRecord record) {
  super(requestContext, new HrCriteria(), new HrResult());
  setRepository(record);
}

// properties ==================================================================

/**
 * Gets repository to update.
 * @return repository to update
 */
public HrRecord getRepository() {
  return _repository;
}

/**
 * Sets repository to update.
 * @param repository repository to update
 */
public void setRepository(HrRecord repository) {
  _repository = repository!=null? repository: new HrRecord();
}

// methods =====================================================================

/**
 * Executes request.
 * @throws HRInvalidProtocolException when protocol attributes are invalid
 * @throws HRConnectionException if connecting remote repository failed
 */
public void execute()
  throws HRInvalidProtocolException, HRConnectionException {
  getRepository().checkConnection();
}

}


text:
using System.Threading.Tasks;
using MailKit.Net.Smtp;
using MimeKit;

namespace StrawberrySass.Services
{
    public class MessageService : IEmailSender
    {
        public async Task SendEmailAsync(string email, string subject, string message)
        {
            var emailMessage = new MimeMessage();

            emailMessage.From.Add(new MailboxAddress("Strawberry Sass", "strawberrysass.info@gmail.com"));
            emailMessage.To.Add(new MailboxAddress("", email));
            emailMessage.Subject = subject;

            var bodyBuilder = new BodyBuilder { HtmlBody = message };
            emailMessage.Body = bodyBuilder.ToMessageBody();

            using (var client = new SmtpClient())
            {
                client.ServerCertificateValidationCallback = (s, c, h, e) => true;
                await client.ConnectAsync("smtp.gmail.com", 587);

                client.AuthenticationMechanisms.Remove("XOAUTH2");
                await client.AuthenticateAsync("strawberrysass.info@gmail.com", "Str=123!");

                await client.SendAsync(emailMessage);
                await client.DisconnectAsync(true);
            }
        }
    }
}


text:
const _ = require(`lodash`)
/**
 * Defines how a theme object is merged with the user's config
 */
module.exports = (a, b) => {
  // a and b are gatsby configs, If they have keys, that means there are values to merge
  const allGatsbyConfigKeysWithAValue = _.uniq(
    Object.keys(a).concat(Object.keys(b))
  )

  // reduce the array of mergable keys into a single gatsby config object
  const mergedConfig = allGatsbyConfigKeysWithAValue.reduce(
    (config, gatsbyConfigKey) => {
      // choose a merge function for the config key if there's one defined,
      // otherwise use the default value merge function
      const mergeFn = howToMerge[gatsbyConfigKey] || howToMerge.byDefault
      return {
        ...config,
        [gatsbyConfigKey]: mergeFn(a[gatsbyConfigKey], b[gatsbyConfigKey]),
      }
    },
    {}
  )

  // return the fully merged config
  return mergedConfig
}
const howToMerge = {
  /**
   * pick a truthy value by default.
   * This makes sure that if a single value is defined, that one it used.
   * We prefer the "right" value, because the user's config will be "on the right"
   */
  byDefault: (a, b) => b || a,
  siteMetadata: (objA, objB) => _.merge({}, objA, objB),
  // plugins are concatenated and uniq'd, so we don't get two of the same plugin value
  plugins: (a = [], b = []) => _.uniqWith(a.concat(b), _.isEqual),
  mapping: (objA, objB) => _.merge({}, objA, objB),
}


text:
function getCombinedScaleTrainData()

    dataset = open("./combined_scale")
    dataset = readall(dataset)
    dataset = filter(data -> length(data)>0, split(dataset, '\n'))
    dataset = map(data -> split(data, ' '), dataset)

    len = length(dataset)

    train_dataset = (Array{Float64,1}, Int64)[]

    for i in 1:len
        data = dataset[i]
        label = int(data[1])
        features = zeros(Float64, 100)
        for feature in data[2:end]
            if length(feature) == 0 continue end
            dim, val = split(feature, ':')
            features[int(dim)] = float64(val)
        end
        data = (features, label)
        push!(train_dataset, data)
    end

    # create passive aggresive instance
    numClass = 3
    numFeature = length(train_dataset[1][1])

    return (numClass, numFeature, train_dataset)
end

function getCombinedScaleTestData()

    dataset = open("./combined_scale.t")
    dataset = readall(dataset)
    dataset = filter(data -> length(data)>0, split(dataset, '\n'))
    dataset = map(data -> split(data, ' '), dataset)

    len = length(dataset)

    train_dataset = (Array{Float64,1}, Int64)[]

    for i in 1:len
        data = dataset[i]
        label = int(data[1])
        features = zeros(Float64, 100)
        for feature in data[2:end]
            if length(feature) == 0 continue end
            dim, val = split(feature, ':')
            features[int(dim)] = float64(val)
        end
        data = (features, label)
        push!(train_dataset, data)
    end

    # create passive aggresive instance
    numClass = 3
    numFeature = length(train_dataset[1][1])

    return (numClass, numFeature, train_dataset)
end


text:
#ifndef itkMaximumDecisionRule_h
#define itkMaximumDecisionRule_h

#include "itkDecisionRule.h"
#include "ITKStatisticsExport.h"

namespace itk
{
namespace Statistics
{
/** \class MaximumDecisionRule
 *  \brief A decision rule that returns the class label with the
 *  largest discriminant score.
 *
 * MaximumDecisionRule returns the class label with the largest
 * discriminant score. If the discriminant scores are likelihood
 * \f$p(x|i)\f$, then this decision rule is a maximum likelihood
 * decision rule.
 *
 * \ingroup ITKStatistics
 */

class ITKStatistics_EXPORT MaximumDecisionRule:public DecisionRule
{
public:
  /** Standard class type aliases */
  using Self = MaximumDecisionRule;
  using Superclass = DecisionRule;
  using Pointer = SmartPointer< Self >;
  using ConstPointer = SmartPointer< const Self >;

  /** Run-time type information (and related methods) */
  itkTypeMacro(MaximumDecisionRule, DecisionRule);

  /** Standard New() method support */
  itkNewMacro(Self);

  /** Types for discriminant values and vectors. */
  using MembershipValueType = Superclass::MembershipValueType;
  using MembershipVectorType = Superclass::MembershipVectorType;

  /** Types for class identifiers. */
  using ClassIdentifierType = Superclass::ClassIdentifierType;

  /**
   * Evaluate the decision rule, returning the class label associated
   * with the largest discriminant score.
   */
  ClassIdentifierType Evaluate(const MembershipVectorType & discriminantScores) const override;

protected:
  MaximumDecisionRule() = default;
  ~MaximumDecisionRule() override = default;

};  // end of class
} // end of namespace Statistics
} // end of namespace itk

#endif


text:
Topics are a lightweight tool to keep conversations organized. You should
start a new topic whenever you're not replying to an existing message.

### Start a new topic

{start_tabs}

1. Click on a stream in the left sidebar.

1. Click **New topic** at the bottom of the screen.

!!! warn ""
    **Keyboard tip**: Use `c` to start a new topic.

{end_tabs}

Don't worry about picking the perfect topic. The first 2-4 words that come
to mind are great.

Note that topics are not available for [private messages (PMs)](/help/private-messages). If you find
yourself wanting topics in a PM, we recommend
[creating a private stream](/help/create-a-stream).

## Related articles

* [Change the topic of a message](/help/change-the-topic-of-a-message)

* [Rename a topic](/help/rename-a-topic)

* [Require topics](/help/require-topics) for all stream messages


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.beanu.sf"
          xmlns:android="http://schemas.android.com/apk/res/android">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.layer1.OneActivity"
            android:label="@string/title_activity_one"
            android:theme="@style/AppTheme">
        </activity>
        <activity android:name=".ui.layer1.RxjavaActivity">
        </activity>
        <activity android:name=".ui.layer1.RetrofitActivity">
        </activity>
    </application>

</manifest>


text:
/**
 * @file binson_fuzz.c.c
 *
 * Description
 *
 */

/*======= Includes ==========================================================*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <stdint.h>
#include <assert.h>

#include "binson_parser.h"

/*======= Local Macro Definitions ===========================================*/
/*======= Type Definitions ==================================================*/
/*======= Local function prototypes =========================================*/
/*======= Local variable declarations =======================================*/

static bool parse_binson(const uint8_t *buffer, uint32_t size);

/*======= Global function implementations ===================================*/

bool fuzz_one_input(const uint8_t *data, size_t size)
{
    bool ret = parse_binson(data, size);
    if (ret)
    {
    if (ret) {
            for (size_t i = 0; i < size; i++) {
                printf("%02x", data[i]);
            } printf("\r\n");
        }
    }
    return ret;
}

/*======= Local function implementations ====================================*/

#define VERIFY(x) if(!(x)) return false

static bool parse_binson(const uint8_t *buffer, uint32_t size)
{

    BINSON_PARSER_DEF(p);

    binson_parser_init(&p, buffer, size);
    VERIFY(binson_parser_go_into_object(&p));
    assert(binson_parser_get_depth(&p) == 1);
    VERIFY(binson_parser_leave_object(&p));
    assert(binson_parser_get_depth(&p) == 0);
    VERIFY(binson_parser_verify(&p));

    printf("}");

    return true;
}


text:
<?php

namespace Spatie\SchemaOrg;

/**
 * A roofing contractor.
 *
 * @see http://schema.org/RoofingContractor
 *
 * @mixin \Spatie\SchemaOrg\HomeAndConstructionBusiness
 */
class RoofingContractor extends BaseType
{
}