text:
// Generated by Haxe 3.3.0
#include <hxcpp.h>

#ifndef INCLUDED_flixel_FlxBasic
#include <flixel/FlxBasic.h>
#endif
#ifndef INCLUDED_flixel_FlxCamera
#include <flixel/FlxCamera.h>
#endif
#ifndef INCLUDED_flixel_FlxG
#include <flixel/FlxG.h>
#endif
#ifndef INCLUDED_flixel_FlxGame
#include <flixel/FlxGame.h>
#endif
#ifndef INCLUDED_flixel_input_FlxInput
#include <flixel/input/FlxInput.h>
#endif
#ifndef INCLUDED_flixel_input_FlxPointer
#include <flixel/input/FlxPointer.h>
#endif
#ifndef INCLUDED_flixel_input_FlxSwipe
#include <flixel/input/FlxSwipe.h>
#endif
#ifndef INCLUDED_flixel_input_IFlxInput
#include <flixel/input/IFlxInput.h>
#endif
#ifndef INCLUDED_flixel_input_IFlxInputManager
#include <flixel/input/IFlxInputManager.h>
#endif
#ifndef INCLUDED_flixel_input_mouse_FlxMouse
#include <flixel/input/mouse/FlxMouse.h>
#endif
#ifndef INCLUDED_flixel_input_mouse_FlxMouseButton
#include <flixel/input/mouse/FlxMouseButton.h>
#endif
#ifndef INCLUDED_flixel_math_FlxPoint
#include <flixel/math/FlxPoint.h>
#endif
#ifndef INCLUDED_flixel_util_FlxDestroyUtil
#include <flixel/util/FlxDestroyUtil.h>
#endif
#ifndef INCLUDED_flixel_util_FlxPool_flixel_math_FlxPoint
#include <flixel/util/FlxPool_flixel_math_FlxPoint.h>
#endif
#ifndef INCLUDED_flixel_util_IFlxDestroyable
#include <flixel/util/IFlxDestroyable.h>
#endif
#ifndef INCLUDED_flixel_util_IFlxPool
#include <flixel/util/IFlxPool.h>
#endif
#ifndef INCLUDED_flixel_util_IFlxPooled
#include <flixel/util/IFlxPooled.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_DisplayObject
#include <openfl/_legacy/display/DisplayObject.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_DisplayObjectContainer
#include <openfl/_legacy/display/DisplayObjectContainer.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_IBitmapDrawable
#include <openfl/_legacy/display/IBitmapDrawable.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_InteractiveObject
#include <openfl/_legacy/display/InteractiveObject.h>
#endif
#ifndef INCLUDED_openfl__legacy_display_Sprite
#include <openfl/_legacy/display/Sprite.h>
#endif
#ifndef INCLUDED_openfl__legacy_events_EventDispatcher
#include <openfl/_legacy/events/EventDispatcher.h>
#endif
#ifndef INCLUDED_openfl__legacy_events_IEventDispatcher
#include <openfl/_legacy/events/IEventDispatcher.h>
#endif

namespace flixel{
namespace input{
namespace mouse{

void FlxMouseButton_obj::__construct(Int ID){
            	HX_STACK_FRAME("flixel.input.mouse.FlxMouseButton","new",0xa21f5d96,"flixel.input.mouse.FlxMouseButton.new","flixel/input/mouse/FlxMouseButton.hx",9,0x7fcdf6f7)
            	HX_STACK_THIS(this)
            	HX_STACK_ARG(ID,"ID")
HXLINE(  26)		this->justPressedTimeInTicks = ((Float)-1);
HXLINE(  25)		HX_VARI(  ::flixel::math::FlxPoint,point) = ::flixel::math::FlxPoint_obj::_pool->get()->set((int)0,(int)0);
HXDLIN(  25)		point->_inPool = false;
HXDLIN(  25)		this->justPressedPosition = point;
HXLINE(   9)		super::__construct(ID);
            	}

Dynamic FlxMouseButton_obj::__CreateEmpty() { return new FlxMouseButton_obj; }

hx::ObjectPtr< FlxMouseButton_obj > FlxMouseButton_obj::__new(Int ID)
{
	hx::ObjectPtr< FlxMouseButton_obj > _hx_result = new FlxMouseButton_obj();
	_hx_result->__construct(ID);
	return _hx_result;
}

Dynamic FlxMouseButton_obj::__Create(hx::DynamicArray inArgs)
{
	hx::ObjectPtr< FlxMouseButton_obj > _hx_result = new FlxMouseButton_obj();
	_hx_result->__construct(inArgs[0]);
	return _hx_result;
}

static ::flixel::util::IFlxDestroyable_obj _hx_flixel_input_mouse_FlxMouseButton__hx_flixel_util_IFlxDestroyable= {
	( void (hx::Object::*)())&::flixel::input::mouse::FlxMouseButton_obj::destroy,
};

void *FlxMouseButton_obj::_hx_getInterface(int inHash) {
	switch(inHash) {
		case (int)0xd4fe2fcd: return &_hx_flixel_input_mouse_FlxMouseButton__hx_flixel_util_IFlxDestroyable;
	}
	return super::_hx_getInterface(inHash);
}

void FlxMouseButton_obj::update(){
            	HX_STACK_FRAME("flixel.input.mouse.FlxMouseButton","update",0x2ce19e93,"flixel.input.mouse.FlxMouseButton.update","flixel/input/mouse/FlxMouseButton.hx",32,0x7fcdf6f7)
            	HX_STACK_THIS(this)
HXLINE(  33)		this->super::update();
HXLINE(  35)		Bool _hx_tmp = (this->current == (int)2);
HXDLIN(  35)		if (_hx_tmp) {
HXLINE(  37)			this->justPressedPosition->set(::flixel::FlxG_obj::mouse->screenX,::flixel::FlxG_obj::mouse->screenY);
HXLINE(  38)			this->justPressedTimeInTicks = ::flixel::FlxG_obj::game->ticks;
            		}
            		else {
HXLINE(  41)			Bool _hx_tmp1 = (this->current == (int)-1);
HXDLIN(  41)			if (_hx_tmp1) {
HXLINE(  43)				Int _hx_tmp2 = ( (Int)(this->ID) );
HXDLIN(  43)				 ::flixel::math::FlxPoint _hx_tmp3 = ::flixel::FlxG_obj::mouse->getScreenPosition(null(),null());
HXDLIN(  43)				::flixel::FlxG_obj::swipes->push( ::flixel::input::FlxSwipe_obj::__new(_hx_tmp2,this->justPressedPosition,_hx_tmp3,this->justPressedTimeInTicks));
            			}
            		}
            	}

void FlxMouseButton_obj::destroy(){
            	HX_STACK_FRAME("flixel.input.mouse.FlxMouseButton","destroy",0x9f3f8d30,"flixel.input.mouse.FlxMouseButton.destroy","flixel/input/mouse/FlxMouseButton.hx",50,0x7fcdf6f7)
            	HX_STACK_THIS(this)
HXLINE(  50)		this->justPressedPosition = ( ( ::flixel::math::FlxPoint)(::flixel::util::FlxDestroyUtil_obj::put(this->justPressedPosition)) );
            	}

HX_DEFINE_DYNAMIC_FUNC0(FlxMouseButton_obj,destroy,(void))

void FlxMouseButton_obj::onDown( ::Dynamic _){
            	HX_STACK_FRAME("flixel.input.mouse.FlxMouseButton","onDown",0x8ad419ab,"flixel.input.mouse.FlxMouseButton.onDown","flixel/input/mouse/FlxMouseButton.hx",70,0x7fcdf6f7)
            	HX_STACK_THIS(this)
            	HX_STACK_ARG(_,"_")
HXLINE(  70)		Bool _hx_tmp = ::flixel::FlxG_obj::mouse->enabled;
HXDLIN(  70)		if (_hx_tmp) {
HXLINE(  71)			this->press();
            		}
            	}

HX_DEFINE_DYNAMIC_FUNC1(FlxMouseButton_obj,onDown,(void))

void FlxMouseButton_obj::onUp( ::Dynamic _){
            	HX_STACK_FRAME("flixel.input.mouse.FlxMouseButton","onUp",0x3a027364,"flixel.input.mouse.FlxMouseButton.onUp","flixel/input/mouse/FlxMouseButton.hx",76,0x7fcdf6f7)
            	HX_STACK_THIS(this)
            	HX_STACK_ARG(_,"_")
HXLINE(  76)		Bool _hx_tmp = ::flixel::FlxG_obj::mouse->enabled;
HXDLIN(  76)		if (_hx_tmp) {
HXLINE(  77)			this->release();
            		}
            	}

HX_DEFINE_DYNAMIC_FUNC1(FlxMouseButton_obj,onUp,(void))

 ::flixel::input::mouse::FlxMouseButton FlxMouseButton_obj::getByID(Int id){
            	HX_STACK_FRAME("flixel.input.mouse.FlxMouseButton","getByID",0x8e5f095e,"flixel.input.mouse.FlxMouseButton.getByID","flixel/input/mouse/FlxMouseButton.hx",13,0x7fcdf6f7)
            	HX_STACK_ARG(id,"id")
HXLINE(  13)		switch((int)(id)){
            			case (int)-3: {
HXLINE(  13)				return ::flixel::FlxG_obj::mouse->_rightButton;
            			}
            			break;
            			case (int)-2: {
HXLINE(  13)				return ::flixel::FlxG_obj::mouse->_middleButton;
            			}
            			break;
            			case (int)-1: {
HXLINE(  13)				return ::flixel::FlxG_obj::mouse->_leftButton;
            			}
            			break;
            		}
HXDLIN(  13)		return null();
            	}

STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxMouseButton_obj,getByID,return )

FlxMouseButton_obj::FlxMouseButton_obj()
{
}

void FlxMouseButton_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(FlxMouseButton);
	HX_MARK_MEMBER_NAME(justPressedPosition,"justPressedPosition");
	HX_MARK_MEMBER_NAME(justPressedTimeInTicks,"justPressedTimeInTicks");
	 ::flixel::input::FlxInput_obj::__Mark(HX_MARK_ARG);
	HX_MARK_END_CLASS();
}

void FlxMouseButton_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(justPressedPosition,"justPressedPosition");
	HX_VISIT_MEMBER_NAME(justPressedTimeInTicks,"justPressedTimeInTicks");
	 ::flixel::input::FlxInput_obj::__Visit(HX_VISIT_ARG);
}

hx::Val FlxMouseButton_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"onUp") ) { return hx::Val( onUp_dyn()); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"update") ) { return hx::Val( update_dyn()); }
		if (HX_FIELD_EQ(inName,"onDown") ) { return hx::Val( onDown_dyn()); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"destroy") ) { return hx::Val( destroy_dyn()); }
		break;
	case 19:
		if (HX_FIELD_EQ(inName,"justPressedPosition") ) { return hx::Val( justPressedPosition); }
		break;
	case 22:
		if (HX_FIELD_EQ(inName,"justPressedTimeInTicks") ) { return hx::Val( justPressedTimeInTicks); }
	}
	return super::__Field(inName,inCallProp);
}

bool FlxMouseButton_obj::__GetStatic(const ::String &inName, Dynamic &outValue, hx::PropertyAccess inCallProp)
{
	switch(inName.length) {
	case 7:
		if (HX_FIELD_EQ(inName,"getByID") ) { outValue = getByID_dyn(); return true; }
	}
	return false;
}

hx::Val FlxMouseButton_obj::__SetField(const ::String &inName,const hx::Val &inValue,hx::PropertyAccess inCallProp)
{
	switch(inName.length) {
	case 19:
		if (HX_FIELD_EQ(inName,"justPressedPosition") ) { justPressedPosition=inValue.Cast<  ::flixel::math::FlxPoint >(); return inValue; }
		break;
	case 22:
		if (HX_FIELD_EQ(inName,"justPressedTimeInTicks") ) { justPressedTimeInTicks=inValue.Cast< Float >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void FlxMouseButton_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_HCSTRING("justPressedPosition","\x9f","\x30","\x76","\xae"));
	outFields->push(HX_HCSTRING("justPressedTimeInTicks","\x8e","\xf9","\xc2","\x82"));
	super::__GetFields(outFields);
};

#if HXCPP_SCRIPTABLE
static hx::StorageInfo FlxMouseButton_obj_sMemberStorageInfo[] = {
	{hx::fsObject /*::flixel::math::FlxPoint*/ ,(int)offsetof(FlxMouseButton_obj,justPressedPosition),HX_HCSTRING("justPressedPosition","\x9f","\x30","\x76","\xae")},
	{hx::fsFloat,(int)offsetof(FlxMouseButton_obj,justPressedTimeInTicks),HX_HCSTRING("justPressedTimeInTicks","\x8e","\xf9","\xc2","\x82")},
	{ hx::fsUnknown, 0, null()}
};
static hx::StaticInfo *FlxMouseButton_obj_sStaticStorageInfo = 0;
#endif

static ::String FlxMouseButton_obj_sMemberFields[] = {
	HX_HCSTRING("justPressedPosition","\x9f","\x30","\x76","\xae"),
	HX_HCSTRING("justPressedTimeInTicks","\x8e","\xf9","\xc2","\x82"),
	HX_HCSTRING("update","\x09","\x86","\x05","\x87"),
	HX_HCSTRING("destroy","\xfa","\x2c","\x86","\x24"),
	HX_HCSTRING("onDown","\x21","\x01","\xf8","\xe4"),
	HX_HCSTRING("onUp","\x5a","\x71","\xb2","\x49"),
	::String(null()) };

static void FlxMouseButton_obj_sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(FlxMouseButton_obj::__mClass,"__mClass");
};

#ifdef HXCPP_VISIT_ALLOCS
static void FlxMouseButton_obj_sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(FlxMouseButton_obj::__mClass,"__mClass");
};

#endif

hx::Class FlxMouseButton_obj::__mClass;

static ::String FlxMouseButton_obj_sStaticFields[] = {
	HX_HCSTRING("getByID","\x28","\xa9","\xa5","\x13"),
	::String(null())
};

void FlxMouseButton_obj::__register()
{
	hx::Static(__mClass) = new hx::Class_obj();
	__mClass->mName = HX_HCSTRING("flixel.input.mouse.FlxMouseButton","\xa4","\x9a","\xd7","\xa8");
	__mClass->mSuper = &super::__SGetClass();
	__mClass->mConstructEmpty = &__CreateEmpty;
	__mClass->mConstructArgs = &__Create;
	__mClass->mGetStaticField = &FlxMouseButton_obj::__GetStatic;
	__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
	__mClass->mMarkFunc = FlxMouseButton_obj_sMarkStatics;
	__mClass->mStatics = hx::Class_obj::dupFunctions(FlxMouseButton_obj_sStaticFields);
	__mClass->mMembers = hx::Class_obj::dupFunctions(FlxMouseButton_obj_sMemberFields);
	__mClass->mCanCast = hx::TCanCast< FlxMouseButton_obj >;
#ifdef HXCPP_VISIT_ALLOCS
	__mClass->mVisitFunc = FlxMouseButton_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
	__mClass->mMemberStorageInfo = FlxMouseButton_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
	__mClass->mStaticStorageInfo = FlxMouseButton_obj_sStaticStorageInfo;
#endif
	hx::_hx_RegisterClass(__mClass->mName, __mClass);
}

} // end namespace flixel
} // end namespace input
} // end namespace mouse


text:
/**
 * Creates an injectable class.
 *
 * @export
 * @returns
 */
export declare function Injectable(): (target: any) => void;

redpajama_set_name: RedPajamaGithub


text:
package com.sap.pto.dao.entities;

import java.util.Date;

import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.joda.time.DateTime;

import com.sap.pto.services.util.JsonIgnore;

/**
 * Commonly needed attributes of all entities.
 *
 */
@MappedSuperclass
public abstract class BasicEntity {
    @Temporal(TemporalType.TIMESTAMP)
    @JsonIgnore
    private Date dateCreated;
    @Temporal(TemporalType.TIMESTAMP)
    @JsonIgnore
    private Date dateModified;

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public void setDateCreated(DateTime dateCreated) {
        this.dateCreated = dateCreated.toDate();
    }

    public Date getDateModified() {
        return dateModified;
    }

    @PreUpdate
    @PrePersist
    public void updateTimeStamps() {
        if (dateCreated == null) {
            dateCreated = new Date();
        }
        dateModified = new Date();
    }

}


text:
package org.kuali.mobility.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * A unit test for the Localisation Utility
 *
 * @author Kuali Mobility Team (mobility.collab@kuali.org)
 */
@RunWith(SpringJUnit4ClassRunner.class)
@DirtiesContext
@ContextConfiguration("classpath:/LocalisationSpringBeans.xml")
public class LocalisationUtilTest {

	private static final String TITLE_EN = "The very best of titles";
	private static final String TITLE_AF = "Die heel beste titel";
	private static final String TITLE_FIELD = "title";
	private static final String TITLE_LOC_FIELD = "mytool.home.title";

	/**
	 * A reference to the LocalisationUtil.
	 */
	@Autowired
	@Qualifier("localisationUtil")
	private LocalisationUtil localisationUtil;

	/**
	 * Test that the localised property code is what we expect to have returned
	 */
	@Test
	public void testGetLocalisedCode() {
		HttpServletRequest request = createFormSubmit();
		String code = localisationUtil.getLocalisedStringCode(TITLE_FIELD, request);
		assertEquals(TITLE_LOC_FIELD, code);
	}

	/**
	 * Test that we get the Strings per language that we expected
	 */
	@Test
	public void testGetLanguages() {
		HttpServletRequest request = createFormSubmit();
		Map<String, String> strings = localisationUtil.getLocalisedString(TITLE_FIELD, request);

		assertEquals(strings.get("en"), TITLE_EN);
		assertEquals(strings.get("af"), TITLE_AF);
	}

	/**
	 * Test that the utility only uses the languages that we are
	 * supporting
	 */
	public void testSupportedLanguages() {
		HttpServletRequest request = createFormSubmit();
		Map<String, String> strings = localisationUtil.getLocalisedString(TITLE_FIELD, request);
		for (String language : strings.keySet()) {
			assertTrue("We do not expect to support language : " + language, localisationUtil.isSupportedLanguage(language));
		}
	}

	/**
	 * Creates a dummy form submit request.
	 *
	 * @return
	 */
	private HttpServletRequest createFormSubmit() {
		MockHttpServletRequest r = new MockHttpServletRequest();
		r.setParameter(TITLE_FIELD + ".code", TITLE_LOC_FIELD);
		r.setParameter(TITLE_FIELD + ".en", TITLE_EN);
		r.setParameter(TITLE_FIELD + ".af", TITLE_AF);
		r.setParameter(TITLE_FIELD + ".ch", "I dont know chinese");

		return r;
	}
}


text:
package org.wso2.das.integration.common.ui.page.main;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.wso2.das.integration.common.ui.page.util.UIElementMapper;

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

public class WebAppListPage {
    private static final Log log = LogFactory.getLog(WebAppListPage.class);
    private WebDriver driver;

    public WebAppListPage(WebDriver driver) throws IOException {
        this.driver = driver;
        UIElementMapper uiElementMapper = UIElementMapper.getInstance();
        // Check that we're on the right page.
        driver.findElement(By.xpath(uiElementMapper.getElement("webapp.list.xpath"))).click();

        if (!driver.findElement(By.id(uiElementMapper.getElement("webapp.list.page.middle"))).
                getText().contains("Running Applications")) {

            throw new IllegalStateException("This is not the Running Web Applications Page");
        }
    }

    public boolean findWebApp(String webAppContext) {
        WebElement table_element = driver.findElement(By.id("webappsTable"));
        List<WebElement> tr_collection = table_element.findElement(By.tagName("tbody"))
                .findElements(By.tagName("tr"));

        log.info("Number of rows in webapp table = " + tr_collection.size());
        if (tr_collection.size() == 0) {
            return false;
        }
        int row_num, col_num;
        row_num = 1;
        for (WebElement trElement : tr_collection) {
            List<WebElement> td_collection = trElement.findElements(By.tagName("td"));
            col_num = 1;
            for (WebElement tdElement : td_collection) {
                log.info("row # " + row_num + ", col # " + col_num + "text=" + tdElement.getText());
                if (tdElement.getText().equals(webAppContext)) {
                    log.info("Webapp context found");
                    return true;
                }
                col_num++;
            }
            row_num++;
        }
        return false;
    }

    public boolean deleteWebApp(String webAppContext) throws Exception {
        WebElement table_element = driver.findElement(By.id("webappsTable"));
        List<WebElement> tr_collection = table_element.findElement(By.tagName("tbody"))
                .findElements(By.tagName("tr"));
        if (tr_collection.size() == 0) {
            throw new Exception("Web App you are trying to delete not exists");
        }
        List<WebElement> td_collection;
        for (WebElement tr : tr_collection) {
            td_collection = tr.findElements(By.tagName("td"));
            if (webAppContext.equals(td_collection.get(1).getText())) {
                td_collection.get(0).findElement(By.tagName("input")).click();
                driver.findElement(By.id("delete2")).click();
                Assert.assertEquals(driver.findElement(By.id("messagebox-confirm")).getText()
                        , "Do you want to delete the selected applications?", "Delete Confirmation message mismatched");
                List<WebElement> buttons = driver.findElements(By.tagName("button"));
                for (WebElement button : buttons) {
                    if ("yes".equalsIgnoreCase(button.getText())) {
                        button.click();
                        break;
                    }
                }

                Assert.assertEquals(driver.findElement(By.id("messagebox-info")).getText()
                        , "Successfully deleted selected applications", "Web Application deletion failed" +
                                ". Message box content mis matched");
                driver.findElement(By.xpath("/html/body/div[3]/div[2]/button")).click();
                return true;
            }
        }
        throw new Exception("Web App you are trying to delete not exists");
    }

    public void loadWebAppURL(String URL) {
        driver.get(URL);
    }
}


text:
<?xml version="1.0"?>
<!--

-->
<config>
    <modules>
        <Ffuenf_StockControl>
            <version>1.0.0</version>
        </Ffuenf_StockControl>
    </modules>
    <global>
        <blocks>
            <stockcontrol>
                <class>Ffuenf_StockControl_Block</class>
            </stockcontrol>
        </blocks>
        <helpers>
            <ffuenf_stockcontrol>
                <class>Ffuenf_StockControl_Helper</class>
            </ffuenf_stockcontrol>
        </helpers>
        <models>
            <stockcontrol>
                <class>Ffuenf_StockControl_Model</class>
            </stockcontrol>
        </models>
        <resources>
            <stockcontrol_setup>
                <setup>
                    <module>Ffuenf_StockControl</module>
                </setup>
            </stockcontrol_setup>
        </resources>
    </global>
    <adminhtml>
        <layout>
            <updates>
                <stockcontrol>
                    <file>ffuenf/stockcontrol.xml</file>
                </stockcontrol>
            </updates>
        </layout>
        <translate>
            <modules>
                <Ffuenf_StockControl>
                    <files>
                        <default>Ffuenf_StockControl.csv</default>
                    </files>
                </Ffuenf_StockControl>
            </modules>
        </translate>
    </adminhtml>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <stockcontrol before="Mage_Adminhtml">Ffuenf_StockControl_Adminhtml</stockcontrol>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <default>
        <stockcontrol>
            <general>
              <enabled>1</enabled>
              <change_status>1</change_status>
              <sort_by>entity_id</sort_by>
              <order>asc</order>
              <inline_edit>0</inline_edit>
            </general>
        </stockcontrol>
    </default>
    <phpunit>
        <suite>
            <modules>
                <Ffuenf_StockControl/>
            </modules>
        </suite>
    </phpunit>
</config>


text:
#!/usr/bin/python

class InvalidCharacterException ( Exception ):
  def __str__(self):
    return "Line cannot contain carriage return character"

class TypeMismatchException (Exception):
  def __init__(self, actual, expected):
    self.actual = actual
    self.expected = expected

  def __str__(self):
    return "Expected " + self.expected + " but got " + self.actual

class CodeProducer:
  tab = " " * 2
  def generate( self ):
    raise NotImplementedError

  def scope( self ):
    raise NotImplementedError

class SegmentProducer ( CodeProducer ):
  def __init__( self, string ):
    self.value = str( string )

  def generate( self ):
    return self.value;

  def scope(self):
    pass

  def __add__(self, other):
    if not isinstance( other, CodeProducer ):
      raise TypeMismatchException( other.__class__.__name__, CodeProducer )
    return SegmentProducer( self.value + other.generate() )

class LineProducer ( SegmentProducer ):
  def __init__( self, string ):

    self.value = string

  def generate( self ):
    return self.value + "\n"

class CommentProducer ( LineProducer ):
  def __init__( self, string ):
    self.value = string

  def generate( self ):
    return "/* " + self.value + " */\n"

class SequenceOfProducers ( CodeProducer ):
  def __init__( self ):
    self.producers = []

  def append(self, producer ):
    self.producers.append( producer )
    return self

  def prepend( self, producer ):
    temp = [ producer ]
    temp.extend( self.producers )
    self.producers = temp
    return self

  def insert( self, idx, producer ):
    self.producers.insert( idx, producer )
    return self

  def len( self ):
    return len( self.producers )

  def scope(self ):
    for producer in self.producers:
      producer.scope()

  def generate( self ):
    string = str()
    for producer in self.producers:
      string += producer.generate()
    return string;

class ListProducer ( SequenceOfProducers ):
  def __init__( self, sep=", ", prefix = "", suffix = "" ):
    self.producers = []
    self.sep = sep
    self.prefix = prefix
    self.suffix = suffix

  def generate( self ):
    string = str( self.prefix )
    count_producers = len( self.producers )
    for i in range( count_producers ):
      producer = self.producers[i]
      string += producer.generate() + (self.sep if i < count_producers - 1 else "")
    string += self.suffix
    return string;

class ScopeProducer ( SequenceOfProducers ):

  def __init__ (self):
    self.producers = [] # list of CodeProducer objects
    self.depth = 0

  def append(self, producer ):
    if isinstance( producer, ScopeProducer ):
      for i in range( 1 + self.depth): producer.scope()
    self.producers.append( producer )
    return self

  def prepend( self, producer ):
    if isinstance( producer, ScopeProducer ):
      for i in range( 1 + self.depth): producer.scope()
    temp = [ producer ]
    temp.extend( self.producers )
    self.producers = temp
    return self

  def insert( self, idx, producer ):
    if isinstance( producer, ScopeProducer ):
      for i in range( 1 + self.depth): producer.scope()
    self.producers.insert( idx, producer )
    return self

  def len( self ):
    return len( self.producers )

  def scope( self ):
    self.depth += 1
    for producer in self.producers:
      producer.scope()

  def generate( self ):
    string = str()
    string += CodeProducer.tab*(self.depth) +LineProducer("{").generate()
    for producer in self.producers:
      if isinstance( producer, ScopeProducer ):
        string += producer.generate()
      else:
        string += CodeProducer.tab*(self.depth+1) + producer.generate()
    string += CodeProducer.tab*(self.depth) + LineProducer("}").generate()
    return string;


text:
namespace openmc {

inline void
set_errmsg(const char* message)
{
  std::strcpy(openmc_err_msg, message);
}

inline void
set_errmsg(const std::string& message)
{
  std::strcpy(openmc_err_msg, message.c_str());
}

inline void
set_errmsg(const std::stringstream& message)
{
  std::strcpy(openmc_err_msg, message.str().c_str());
}

[[noreturn]] void fatal_error(const std::string& message, int err=-1);

[[noreturn]] inline
void fatal_error(const std::stringstream& message)
{
  fatal_error(message.str());
}

[[noreturn]] inline
void fatal_error(const char* message)
{
  fatal_error(std::string{message, std::strlen(message)});
}

void warning(const std::string& message);

inline
void warning(const std::stringstream& message)
{
  warning(message.str());
}

void write_message(const std::string& message, int level=0);

inline
void write_message(const std::stringstream& message, int level)
{
  write_message(message.str(), level);
}

template<typename... Params>
void write_message(
  int level, const std::string& message, const Params&... fmt_args)
{
  if (settings::verbosity >= level) {
    write_message(fmt::format(message, fmt_args...));
  }
}

template<typename... Params>
void write_message(const std::string& message, const Params&... fmt_args)
{
  write_message(fmt::format(message, fmt_args...));
}

#ifdef OPENMC_MPI
extern "C" void abort_mpi(int code);
#endif

} // namespace openmc
#endif // OPENMC_ERROR_H


text:
<?php

namespace Brainfit\Examples;

use Brainfit\Daemonizer\DaemonizerInterface;
use React\EventLoop\LoopInterface;

class CronJobExample implements DaemonizerInterface
{
    public function getSchedule()
    {
        //Cron-liked style: "m h dom mon dow"
        //See https://github.com/mtdowling/cron-expression

        return '* * * * *';
    }

    public function bootstrap(LoopInterface $loop)
    {
        $this->demoLogger('Bootstrap CronJobExample');
    }

    public function run()
    {
        $this->demoLogger('Run CronJobExample (every minute)');
    }

    public function terminate()
    {
        $this->demoLogger('Terminate CronJobExample');
    }

    private function demoLogger($message)
    {
        file_put_contents(getcwd() . '/log.log', $message . PHP_EOL, FILE_APPEND + LOCK_EX);
    }
}


text:
<?php
	/**
	 * Created by PhpStorm.
	 * User: andreyshade
	 * Date: 05.02.16
	 * Time: 15:01
	 *
	 * @var $dataProvider ActiveDataProvider
	 * @var $model ToursDates
	 * @var $this \yii\web\View
 	 */

use yii\helpers\Html;
use yii\data\ActiveDataProvider;
use yii\grid\GridView;
use yii\grid\DataColumn;
use yii\grid\ActionColumn;
use app\models\Bookings;
use app\models\ToursDates;
use app\models\Tours;

$this->title = 'Booking results on ' . $model->date;
$this->params['breadcrumbs'][] = ['label' => 'Edit Tour', 'url' => ['edit-tour', Tours::FIELD_TOUR_ID => $model->tour_id]];
$this->params['breadcrumbs'][] = $this->title;
?>

<?php
foreach (Yii::$app->session->getAllFlashes() as $key => $message) {
        echo '
' . $message . '
';
}
?>

<?= Html::tag('h1', $this->title)?>

<?= GridView::widget([
	'dataProvider' => $dataProvider,
    'emptyText' => 'No available Booking places to display',
    'columns' => [
		Bookings::FIELD_NAME,
		Bookings::FIELD_ADULTS,
		Bookings::FIELD_CHILDREN,
		Bookings::FIELD_CHILDREN,
		Bookings::FIELD_BABIES,
		[
			'class' => ActionColumn::className(),
			'template' => '{delete}',
			'contentOptions' => ['class' => 'text-center'],
			'buttons' => [
				'delete' => function($url, $model, $key) {
                        /* @var $model Bookings */
                        return Html::a('', ['delete-booking',
							Bookings::FIELD_BOOKING_ID=> $model->booking_id],
							['data-confirm' => Yii::t('yii', 'Are you sure you want to delete booking record?')]);
                    }
			]
		]
	]
])?>


text:
<?php

namespace Aws\View\Helper;

use Aws\CloudFront\CloudFrontClient;
use Aws\View\Exception\InvalidDomainNameException;
use Zend\View\Helper\AbstractHelper;

/**
 * View helper that can render a link to a CloudFront object. It can also create signed URLs
 * using a canned policy
 */
class CloudFrontLink extends AbstractHelper
{
    /**
     * @var string The hostname for CloudFront domains
     */
    protected $hostname = '.cloudfront.net';

    /**
     * @var CloudFrontClient An instance of CloudFrontClient to be used by the helper
     */
    protected $client;

    /**
     * @var bool Whether or not to use SSl
     */
    protected $useSsl = true;

    /**
     * @var string The default CloudFront domain to use
     */
    protected $defaultDomain = '';

    /**
     * @param CloudFrontClient $client
     */
    public function __construct(CloudFrontClient $client)
    {
        $this->client = $client;
    }

    /**
     * Set the CloudFront hostname to use if you are using a custom hostname
     *
     * @param string $hostname
     *
     * @return self
     */
    public function setHostname($hostname)
    {
        $this->hostname = '.' . ltrim($hostname, '.');

        return $this;
    }

    /**
     * Get the CloudFront hostname being used
     *
     * @return string
     */
    public function getHostname()
    {
        return $this->hostname;
    }

    /**
     * Set if HTTPS should be used for generating URLs
     *
     * @param bool $useSsl
     *
     * @return self
     */
    public function setUseSsl($useSsl)
    {
        $this->useSsl = (bool) $useSsl;

        return $this;
    }

    /**
     * Get if HTTPS should be used for generating URLs
     *
     * @return bool
     */
    public function getUseSsl()
    {
        return $this->useSsl;
    }

    /**
     * Set the CloudFront domain to use if none is provided
     *
     * @param string $defaultDomain
     *
     * @return self
     */
    public function setDefaultDomain($defaultDomain)
    {
        $this->defaultDomain = (string) $defaultDomain;

        return $this;
    }

    /**
     * Get the CloudFront domain to use if none is provided
     *
     * @return string
     */
    public function getDefaultDomain()
    {
        return $this->defaultDomain;
    }

    /**
     * Create a link to a CloudFront object
     *
     * @param  string     $object
     * @param  string     $domain
     * @param  string|int $expiration
     *
     * @return string
     * @throws InvalidDomainNameException
     */
    public function __invoke($object, $domain = '', $expiration = '')
    {
        if (empty($domain)) {
            $domain = $this->getDefaultDomain();
        }

        // If $domain is still empty, we throw an exception as it makes no sense
        if (empty($domain)) {
            throw new InvalidDomainNameException('An empty CloudFront domain name was given');
        }

        $url = sprintf(
            '%s://%s%s/%s',
            $this->useSsl ? 'https' : 'http',
            // Remove hostname if provided as we include it already
            str_replace($this->hostname, '', rtrim($domain, '/')),
            $this->hostname,
            ltrim($object, '/')
        );

        if (empty($expiration)) {
            return $url;
        }

        return $this->client->getSignedUrl(array(
            'url'     => $url,
            'expires' => $expiration
        ));
    }
}


text:
{% extends '!layout.html' %}

{# Add github banner (from: https://github.com/blog/273-github-ribbons). #}
{% block header %}
  {{ super() }}
  {% if pagename == "index" %}

  {% endif %}
{% endblock %}


text:
package org.axway.grapes.server.db.datamodel;

import org.jongo.marshall.jackson.oid.Id;

/**
 * Database License
 *
 *
Class that define the representation of licenses stored in the database.
 * The name (short name) is use as an ID. A database index is created on it.

 * @author jdcoffre
 */
public class DbLicense {

    public static final String DATA_MODEL_VERSION = "datamodelVersion";
    private String datamodelVersion = DbCollections.datamodelVersion;

    @Id
	private String name = "";

	public static final String LONG_NAME_DB_FIELD = "longName";
	private String longName = "";

	public static final String URL_DB_FIELD = "url";
	private String url = "";

	public static final String COMMENTS_DB_FIELD = "comments";
	private String comments = "";

	public static final String REGEXP_DB_FIELD = "regexp";
	private String regexp = "";

	public static final String APPROVED_DB_FIELD = "approved";
	private Boolean approved = null;

    public void setDataModelVersion(final String newVersion){
        this.datamodelVersion = newVersion;
    }

    public String getDataModelVersion(){
        return datamodelVersion;
    }

	public final String getName() {
		return name;
	}

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

	public final String getLongName() {
		return longName;
	}

	public final void setLongName(final String longName) {
		this.longName = longName;
	}

	public final String getUrl() {
		return url;
	}

	public final void setUrl(final String url) {
		this.url = url;
	}

	public final String getComments() {
		return comments;
	}

	public final void setComments(final String comments) {
		this.comments = comments;
	}

	public final String getRegexp() {
		return regexp;
	}

	public final void setRegexp(final String regexp) {
		this.regexp = regexp;
	}

	public final Boolean isApproved() {
		return approved;
	}

	public final void setApproved(final Boolean approved) {
		this.approved = approved;
	}
}


text:
exports.mom = 'Christy';
exports.dad = 'Jeff';
exports.sister1 = 'Becky';
exports.sister2 = 'Elizabeth';


text:
import { selector } from 'rxjs/operator/multicast';
import { Component, OnInit } from "@angular/core";
import { Router, ActivatedRoute, NavigationEnd, Params, PRIMARY_OUTLET } from "@angular/router";
import { BreadcrumbService } from "./breadcrumb.service";

@Component({
    selector: "breadcrumb",
    templateUrl: "breadcrumb.component.html",
    styleUrls: ['./breadcrumb.component.scss'],
})

export class BreadcrumbComponent implements OnInit {

    public activePageTitle: string;
    //The breadcrumbs of the current route
    public currentBreadcrumbs: IBreadcrumb[];
    //All the breadcrumbs
    public breadcrumbs: IBreadcrumb[];

    constructor(private _breadcrumbService: BreadcrumbService, private _activatedRoute: ActivatedRoute, private _router: Router) {
        _breadcrumbService.get().subscribe((breadcrumbs: IBreadcrumb[]) => {
            this.breadcrumbs = breadcrumbs as IBreadcrumb[];
        });
    }

    ngOnInit() {
        //subscribe to the NavigationEnd event
        this._router.events.filter(event => event instanceof NavigationEnd).subscribe(event => {
            //reset currentBreadcrumbs
            this.currentBreadcrumbs = [];

            //get the root of the current route
            let currentRoute: ActivatedRoute = this._activatedRoute.root;

            //set the url to an empty string
            let url: string = "";

            let i = 0;
            //iterate from activated route to children
            while (currentRoute.children.length > 0) {
                let childrenRoutes: ActivatedRoute[] = currentRoute.children;
                var breadCrumbLabel: string = '';

                //iterate over each children
                childrenRoutes.forEach(route => {
                    // Set currentRoute to this route
                    currentRoute = route;

                    // Verify this is the primary route
                    if (route.outlet !== PRIMARY_OUTLET) {
                        return;
                    }

                    // Get the route's URL segment
                    let routeURL: string = route.snapshot.url.map(segment => segment.path).join("/");
                    if(!routeURL){
                        if(i != 0){
                            return;
                        }
                    }
                    else {
                        url += '/' + routeURL;
                    }

                    /*
                     Verify the custom data property "breadcrumb"
                     is specified on the route.
                     */
                    if (route.snapshot.data.hasOwnProperty("breadcrumb")) {
                        breadCrumbLabel = route.snapshot.data["breadcrumb"];
                    }
                    else if (i == 0){
                        breadCrumbLabel = 'Home';
                    }
                    else { //fallback
                        breadCrumbLabel = 'empty_breadcrumb_name';
                    }

                    // Add breadcrumb
                    let breadcrumb: IBreadcrumb = {
                        label: breadCrumbLabel,
                        url: url
                    };

                    this.currentBreadcrumbs.push(breadcrumb);
                });

                i++;
                this._breadcrumbService.store(this.currentBreadcrumbs);
            }
            this.activePageTitle = this.currentBreadcrumbs[this.currentBreadcrumbs.length - 1].label;
        });
    }
}

export interface IBreadcrumb {
    label: string,
    url: string;
}


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

<title>SimpleIpmServer</title>
<meta name="date" content="2014-03-18">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

com.blockhaus2000.plugin

Class SimpleIpmServer

java.lang.Object

com.blockhaus2000.plugin.SimpleIpmServer

All Implemented Interfaces:

IpmServer

public class SimpleIpmServer
extends java.lang.Object
implements IpmServer

An implementation of IpmServer.

Author:

Blockhaus2000

Constructor Summary

Constructors

Constructor and Description

SimpleIpmServer()

Method Summary

Methods

Modifier and Type
Method and Description

org.bukkit.Server
getBukkitServer()

static IpmServer
getInstance()

Will provide singleton.

IpmPluginManager
getPluginManager()

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleIpmServer

public SimpleIpmServer()

Method Detail

getPluginManager

public IpmPluginManager getPluginManager()

Specified by:

getPluginManager in interface IpmServer

Returns:

An instance of the IpmPluginManager.

See Also:

IpmServer.getPluginManager()

getBukkitServer

public org.bukkit.Server getBukkitServer()

Specified by:

getBukkitServer in interface IpmServer

Returns:

The Bukkit Server.

See Also:

IpmServer.getBukkitServer()

getInstance

public static IpmServer getInstance()

Will provide singleton.

Returns:

An instance of SimpleIpmServer.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD


text:
/* globals describe, it, expect, expectObservable, hot */
var Rx = require('../../dist/cjs/Rx');
var Observable = Rx.Observable;

describe('count', function () {
  it('should be never when source is never', function () {
    var e1 = Observable.never();
    var expected = '-';

    expectObservable(e1.count()).toBe(expected);
  });

  it('should be zero when source is empty', function () {
    var e1 = Observable.empty();
    var expected = '(w|)';

    expectObservable(e1.count()).toBe(expected, { w: 0 });
  });

  it('should be never when source doesn\'t complete', function () {
    var e1 = hot('--x--^--y--');
    var expected =    '------';

    expectObservable(e1.count()).toBe(expected);
  });

  it('should be zero when source doesn\'t have values', function () {
    var e1 = hot('-x-^---|');
    var expected =  '----(w|)';

    expectObservable(e1.count()).toBe(expected, { w: 0 });
  });

  it('should count the unique value of an observable', function () {
    var e1 = hot('-x-^--y--|');
    var expected =  '------(w|)';

    expectObservable(e1.count()).toBe(expected, { w: 1 });
  });

  it('should count the values of an observable', function () {
    var source = hot('--a--b--c--|');
    var expected =   '-----------(x|)';

    expectObservable(source.count()).toBe(expected, {x: 3});
  });

  it('should count the values of an ongoing hot observable', function () {
    var source = hot('--a-^-b--c--d--|');
    var expected =       '-----------(x|)';

    expectObservable(source.count()).toBe(expected, {x: 3});
  });

  it('should count a range() source observable', function (done) {
    Rx.Observable.range(1, 10).count().subscribe(
      function (value) {
        expect(value).toEqual(10);
      },
      done.fail,
      done
    );
  });

  it('should count a range().skip(1) source observable', function (done) {
    Rx.Observable.range(1, 10).skip(1).count().subscribe(
      function (value) {
        expect(value).toEqual(9);
      },
      done.fail,
      done
    );
  });

  it('should count a range().take(1) source observable', function (done) {
    Rx.Observable.range(1, 10).take(1).count().subscribe(
      function (value) {
        expect(value).toEqual(1);
      },
      done.fail,
      done
    );
  });

  it('should work with error', function () {
    var e1 = hot('-x-^--y--z--#', { x: 1, y: 2, z: 3 }, 'too bad');
    var expected =  '---------#';

    expectObservable(e1.count()).toBe(expected, null, 'too bad');
  });

  it('should work with throw', function () {
    var e1 = Observable.throw(new Error('too bad'));
    var expected = '#';

    expectObservable(e1.count()).toBe(expected, null, new Error('too bad'));
  });

  it('should handle an always-true predicate on an empty hot observable', function () {
    var e1 = hot('-x-^---|');
    var expected =  '----(w|)';
    var predicate = function () {
      return true;
    };

    expectObservable(e1.count(predicate)).toBe(expected, { w: 0 });
  });

  it('should handle an always-false predicate on an empty hot observable', function () {
    var e1 = hot('-x-^---|');
    var expected =  '----(w|)';
    var predicate = function () {
      return false;
    };

    expectObservable(e1.count(predicate)).toBe(expected, { w: 0 });
  });

  it('should handle an always-true predicate on a simple hot observable', function () {
    var e1 = hot('-x-^-a-|');
    var expected =  '----(w|)';
    var predicate = function () {
      return true;
    };

    expectObservable(e1.count(predicate)).toBe(expected, { w: 1 });
  });

  it('should handle an always-false predicate on a simple hot observable', function () {
    var e1 = hot('-x-^-a-|');
    var expected =  '----(w|)';
    var predicate = function () {
      return false;
    };

    expectObservable(e1.count(predicate)).toBe(expected, { w: 0 });
  });

  it('should handle a match-all predicate on observable with many values', function () {
    var e1 = hot('-1-^-2--3--4-|');
    var expected =  '----------(w|)';
    var predicate = function (value) {
      return parseInt(value) < 10;
    };

    expectObservable(e1.count(predicate)).toBe(expected, { w: 3 });
  });

  it('should handle a match-none predicate on observable with many values', function () {
    var e1 = hot('-1-^-2--3--4-|');
    var expected =  '----------(w|)';
    var predicate = function (value) {
      return parseInt(value) > 10;
    };

    expectObservable(e1.count(predicate)).toBe(expected, { w: 0 });
  });

  it('should handle an always-true predicate on observable that throws', function () {
    var e1 = hot('-1-^---#');
    var expected =  '----#';
    var predicate = function () {
      return true;
    };

    expectObservable(e1.count(predicate)).toBe(expected);
  });

  it('should handle an always-false predicate on observable that throws', function () {
    var e1 = hot('-1-^---#');
    var expected =  '----#';
    var predicate = function () {
      return false;
    };

    expectObservable(e1.count(predicate)).toBe(expected);
  });

  it('should handle an always-true predicate on a hot never-observable', function () {
    var e1 = hot('-x-^----');
    var expected =  '-----';
    var predicate = function () {
      return true;
    };

    expectObservable(e1.count(predicate)).toBe(expected);
  });

  it('should handle a predicate that throws, on observable with many values', function () {
    var e1 = hot('-1-^-2--3--|');
    var expected =  '-----#';
    var predicate = function (value) {
      if (value === '3') {
        throw 'error';
      }
      return true;
    };

    expectObservable(e1.count(predicate)).toBe(expected);
  });
});


text:
export type IReactComponent
 =
    | React.ClassicComponentClass

    | React.ComponentClass

    | React.FunctionComponent

    | React.ForwardRefExoticComponent


text:
namespace media {

class AudioFileReaderTest : public testing::Test {
 public:
  AudioFileReaderTest() : packet_verification_disabled_(false) {}
  ~AudioFileReaderTest() override {}

  void Initialize(const char* filename) {
    data_ = ReadTestDataFile(filename);
    protocol_.reset(
        new InMemoryUrlProtocol(data_->data(), data_->data_size(), false));
    reader_.reset(new AudioFileReader(protocol_.get()));
  }

  // Reads and the entire file provided to Initialize().
  void ReadAndVerify(const char* expected_audio_hash, int expected_frames) {
    scoped_ptr<AudioBus> decoded_audio_data =
        AudioBus::Create(reader_->channels(), reader_->GetNumberOfFrames());
    int actual_frames = reader_->Read(decoded_audio_data.get());
    ASSERT_LE(actual_frames, decoded_audio_data->frames());
    ASSERT_EQ(expected_frames, actual_frames);

    AudioHash audio_hash;
    audio_hash.Update(decoded_audio_data.get(), actual_frames);
    EXPECT_EQ(expected_audio_hash, audio_hash.ToString());
  }

  // Verify packets are consistent across demuxer runs.  Reads the first few
  // packets and then seeks back to the start timestamp and verifies that the
  // hashes match on the packets just read.
  void VerifyPackets() {
    const int kReads = 3;
    const int kTestPasses = 2;

    AVPacket packet;
    base::TimeDelta start_timestamp;
    std::vector<std::string> packet_md5_hashes_;
    for (int i = 0; i < kTestPasses; ++i) {
      for (int j = 0; j < kReads; ++j) {
        ASSERT_TRUE(reader_->ReadPacketForTesting(&packet));

        // Remove metadata from the packet data section before hashing.
        av_packet_split_side_data(&packet);

        // On the first pass save the MD5 hash of each packet, on subsequent
        // passes ensure it matches.
        const std::string md5_hash = base::MD5String(base::StringPiece(
            reinterpret_cast<char*>(packet.data), packet.size));
        if (i == 0) {
          packet_md5_hashes_.push_back(md5_hash);
          if (j == 0) {
            start_timestamp = ConvertFromTimeBase(
                reader_->codec_context_for_testing()->time_base, packet.pts);
          }
        } else {
          EXPECT_EQ(packet_md5_hashes_[j], md5_hash) << "j = " << j;
        }

        av_free_packet(&packet);
      }
      ASSERT_TRUE(reader_->SeekForTesting(start_timestamp));
    }
  }

  void RunTest(const char* fn,
               const char* hash,
               int channels,
               int sample_rate,
               base::TimeDelta duration,
               int frames,
               int trimmed_frames) {
    Initialize(fn);
    ASSERT_TRUE(reader_->Open());
    EXPECT_EQ(channels, reader_->channels());
    EXPECT_EQ(sample_rate, reader_->sample_rate());
    EXPECT_EQ(duration.InMicroseconds(),
              reader_->GetDuration().InMicroseconds());
    EXPECT_EQ(frames, reader_->GetNumberOfFrames());
    if (!packet_verification_disabled_)
      ASSERT_NO_FATAL_FAILURE(VerifyPackets());
    ReadAndVerify(hash, trimmed_frames);
  }

  void RunTestFailingDemux(const char* fn) {
    Initialize(fn);
    EXPECT_FALSE(reader_->Open());
  }

  void RunTestFailingDecode(const char* fn) {
    Initialize(fn);
    EXPECT_TRUE(reader_->Open());
    scoped_ptr<AudioBus> decoded_audio_data =
        AudioBus::Create(reader_->channels(), reader_->GetNumberOfFrames());
    EXPECT_EQ(reader_->Read(decoded_audio_data.get()), 0);
  }

  void disable_packet_verification() {
    packet_verification_disabled_ = true;
  }

 protected:
  scoped_refptr<DecoderBuffer> data_;
  scoped_ptr<InMemoryUrlProtocol> protocol_;
  scoped_ptr<AudioFileReader> reader_;
  bool packet_verification_disabled_;

  DISALLOW_COPY_AND_ASSIGN(AudioFileReaderTest);
};

TEST_F(AudioFileReaderTest, WithoutOpen) {
  Initialize("bear.ogv");
}

TEST_F(AudioFileReaderTest, InvalidFile) {
  RunTestFailingDemux("ten_byte_file");
}

TEST_F(AudioFileReaderTest, WithVideo) {
  RunTest("bear.ogv",
          "-2.49,-0.75,0.38,1.60,0.70,-1.22,",
          2,
          44100,
          base::TimeDelta::FromMicroseconds(1011520),
          44609,
          44609);
}

TEST_F(AudioFileReaderTest, Vorbis) {
  RunTest("sfx.ogg",
          "4.36,4.81,4.84,4.45,4.61,4.63,",
          1,
          44100,
          base::TimeDelta::FromMicroseconds(350001),
          15436,
          15436);
}

TEST_F(AudioFileReaderTest, WaveU8) {
  RunTest("sfx_u8.wav",
          "-1.23,-1.57,-1.14,-0.91,-0.87,-0.07,",
          1,
          44100,
          base::TimeDelta::FromMicroseconds(288414),
          12720,
          12719);
}

TEST_F(AudioFileReaderTest, WaveS16LE) {
  RunTest("sfx_s16le.wav",
          "3.05,2.87,3.00,3.32,3.58,4.08,",
          1,
          44100,
          base::TimeDelta::FromMicroseconds(288414),
          12720,
          12719);
}

TEST_F(AudioFileReaderTest, WaveS24LE) {
  RunTest("sfx_s24le.wav",
          "3.03,2.86,2.99,3.31,3.57,4.06,",
          1,
          44100,
          base::TimeDelta::FromMicroseconds(288414),
          12720,
          12719);
}

TEST_F(AudioFileReaderTest, WaveF32LE) {
  RunTest("sfx_f32le.wav",
          "3.03,2.86,2.99,3.31,3.57,4.06,",
          1,
          44100,
          base::TimeDelta::FromMicroseconds(288414),
          12720,
          12719);
}

#if defined(USE_PROPRIETARY_CODECS)
TEST_F(AudioFileReaderTest, MP3) {
  RunTest("sfx.mp3",
          "1.30,2.72,4.56,5.08,3.74,2.03,",
          1,
          44100,
          base::TimeDelta::FromMicroseconds(313470),
          13825,
          11025);
}

TEST_F(AudioFileReaderTest, CorruptMP3) {
  // Disable packet verification since the file is corrupt and FFmpeg does not
  // make any guarantees on packet consistency in this case.
  disable_packet_verification();
  RunTest("corrupt.mp3",
          "-4.95,-2.95,-0.44,1.16,0.31,-2.21,",
          1,
          44100,
          base::TimeDelta::FromMicroseconds(1018801),
          44930,
          44928);
}

TEST_F(AudioFileReaderTest, AAC) {
  RunTest("sfx.m4a",
          "1.81,1.66,2.32,3.27,4.46,3.36,",
          1,
          44100,
          base::TimeDelta::FromMicroseconds(312001),
          13760,
          13312);
}

TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) {
  RunTestFailingDecode("midstream_config_change.mp3");
}
#endif

TEST_F(AudioFileReaderTest, VorbisInvalidChannelLayout) {
  RunTestFailingDemux("9ch.ogg");
}

TEST_F(AudioFileReaderTest, WaveValidFourChannelLayout) {
  RunTest("4ch.wav",
          "131.71,38.02,130.31,44.89,135.98,42.52,",
          4,
          44100,
          base::TimeDelta::FromMicroseconds(100001),
          4411,
          4410);
}

}  // namespace media


text:
package ite6

import (
	"reflect"
	"testing"

	testdata "github.com/guacsec/guac/internal/testing/processor"
	"github.com/guacsec/guac/pkg/handler/processor"
)

var (
	badProvenance = `{
		"_type": ["https://in-toto.io/Statement/v0.1"],
		"subject": [{"name": "_", "digest": {"sha256": "5678..."}}],
	}`
	ite6SLSA = `{
		"_type": "https://in-toto.io/Statement/v0.1",
		"subject": [{"name": "_", "digest": {"sha256": "5678..."}}],
		"predicateType": "https://slsa.dev/provenance/v0.2",
		"predicate":
			{
				"builder": { "id": "https://github.com/Attestations/GitHubHostedActions@v1" },
				"buildType": "https://github.com/Attestations/GitHubActionsWorkflow@v1",
				"invocation": {
				  "configSource": {
					"uri": "git+https://github.com/curl/curl-docker@master",
					"digest": { "sha1": "d6525c840a62b398424a78d792f457477135d0cf" },
					"entryPoint": "build.yaml:maketgz"
				  }
				},
				"metadata": {
				  "completeness": {
					  "environment": true
				  }
				},
				"materials": [
				  {
					"uri": "git+https://github.com/curl/curl-docker@master",
					"digest": { "sha1": "d6525c840a62b398424a78d792f457477135d0cf" }
				  }, {
					"uri": "github_hosted_vm:ubuntu-18.04:20210123.1"
				  }
				]
			}
	}`
)

func TestITE6Processor_ValidateSchema(t *testing.T) {
	tests := []struct {
		name    string
		args    *processor.Document
		wantErr bool
	}{{
		name: "ITE6 Doc with unknown payload",
		args: &processor.Document{
			Blob:   []byte(badProvenance),
			Type:   processor.DocumentITE6Generic,
			Format: processor.FormatJSON,
			SourceInformation: processor.SourceInformation{
				Collector: "TestCollector",
				Source:    "TestSource",
			},
		},
		wantErr: true,
	}, {
		name: "ITE6 Doc with valid payload",
		args: &processor.Document{
			Blob:   []byte(ite6SLSA),
			Type:   processor.DocumentITE6SLSA,
			Format: processor.FormatJSON,
			SourceInformation: processor.SourceInformation{
				Collector: "TestCollector",
				Source:    "TestSource",
			},
		},
		wantErr: false,
	}, {
		name: "ITE6 CREV with valid payload",
		args: &processor.Document{
			Blob:   []byte(testdata.ITE6CREVExample),
			Type:   processor.DocumentITE6Generic,
			Format: processor.FormatJSON,
			SourceInformation: processor.SourceInformation{
				Collector: "TestCollector",
				Source:    "TestSource",
			},
		},
		wantErr: false,
	}, {
		name: "ITE6 Review with valid payload",
		args: &processor.Document{
			Blob:   []byte(testdata.ITE6ReviewExample),
			Type:   processor.DocumentITE6Generic,
			Format: processor.FormatJSON,
			SourceInformation: processor.SourceInformation{
				Collector: "TestCollector",
				Source:    "TestSource",
			},
		},
		wantErr: false,
	}, {
		name: "ITE6 OSV with valid payload",
		args: &processor.Document{
			Blob:   []byte(testdata.ITE6OSVExample),
			Type:   processor.DocumentITE6Vul,
			Format: processor.FormatJSON,
			SourceInformation: processor.SourceInformation{
				Collector: "TestCollector",
				Source:    "TestSource",
			},
		},
		wantErr: false,
	}}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			e := &ITE6Processor{}
			if err := e.ValidateSchema(tt.args); (err != nil) != tt.wantErr {
				t.Errorf("ITE6Processor.ValidateSchema() error = %v, wantErr %v", err, tt.wantErr)
			}
		})
	}
}

func TestITE6Processor_Unpack(t *testing.T) {
	tests := []struct {
		name    string
		args    *processor.Document
		want    []*processor.Document
		wantErr bool
	}{{
		name: "ITE6 Doc with valid payload",
		args: &processor.Document{
			Blob:   []byte(ite6SLSA),
			Type:   processor.DocumentITE6SLSA,
			Format: processor.FormatJSON,
			SourceInformation: processor.SourceInformation{
				Collector: "TestCollector",
				Source:    "TestSource",
			},
		},
		wantErr: false,
	}}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			e := &ITE6Processor{}
			got, err := e.Unpack(tt.args)
			if (err != nil) != tt.wantErr {
				t.Errorf("ITE6Processor.ValidateSchema() error = %v, wantErr %v", err, tt.wantErr)
			}
			if !reflect.DeepEqual(got, tt.want) {
				t.Errorf("DSSEProcessor.Unpack() = %v, expected %v", got, tt.want)
			}
		})
	}
}


text:
using System;
using System.Data;
using System.Data.Common;
using System.Diagnostics;
using StackExchange.Profiling;
using StackExchange.Profiling.Data;

namespace StackExchange.Opserver.Monitoring
{
    public class LightweightProfiler : IDbProfiler, Elastic.IProfiler
    {
        /// <summary>
        /// Can be a full <see cref="MiniProfiler"/>.
        /// </summary>
        readonly IDbProfiler _wrapped;

        readonly Stopwatch _sw = new Stopwatch();
        private readonly string _category; // future use for multiples
        public LightweightProfiler(IDbProfiler wrapped, string category)
        {
            _category = category;
            _wrapped = wrapped;
        }

        /// <summary>
        /// Number of statements executed on the request.
        /// </summary>
        public int Count { get; private set; }

        /// <summary>
        /// Aggregate time executing sql on the request.
        /// </summary>
        public long TotalMilliseconds => _sw.ElapsedMilliseconds;

        public void ExecuteStart(IDbCommand profiledDbCommand, SqlExecuteType executeType)
        {
            Count++;

            _wrapped?.ExecuteStart(profiledDbCommand, executeType);

            // This is subtle, avoid measure time gathering stack trace (that happens on execute start)
            _sw.Start();
        }

        public void ExecuteFinish(IDbCommand profiledDbCommand, SqlExecuteType executeType, DbDataReader reader)
        {
            if (reader == null)
            {
                _sw.Stop();
            }
            _wrapped?.ExecuteFinish(profiledDbCommand, executeType, reader);
        }

        public void ReaderFinish(IDataReader reader)
        {
            _sw.Stop();
            _wrapped?.ReaderFinish(reader);
        }

        public void OnError(IDbCommand profiledDbCommand, SqlExecuteType executeType, Exception e)
        {
            var formatter = new Profiling.SqlFormatters.SqlServerFormatter();
            var parameters = SqlTiming.GetCommandParameters(profiledDbCommand);
            e.Data["SQL"] = formatter.FormatSql(profiledDbCommand.CommandText, parameters);
        }

        public bool IsActive => true;

        IDisposable Elastic.IProfiler.Profile(string name, string command)
        {
            MiniProfiler profiler;
            CustomTiming timing = null;
            if ((profiler = MiniProfiler.Current) != null)
            {
                timing = profiler.CustomTiming("elastic", command, name);
            }
            return new InnerProfileObject(this, timing);
        }
        sealed class InnerProfileObject : IDisposable
        {
            private LightweightProfiler _parent;
            private readonly IDisposable _timing;
            public InnerProfileObject(LightweightProfiler parent, IDisposable timing)
            {
                if (parent != null)
                {
                    parent.Count++;
                    parent._sw.Start();
                }
                _timing = timing;
                _parent = parent;
            }
            void IDisposable.Dispose()
            {
                if (_parent != null)
                {
                    _parent._sw.Stop();
                    _parent = null;
                }
                _timing?.Dispose();
            }
        }
    }
}


text:
namespace flutter {
namespace testing {

TEST_F(ShellTest, PathVolatilityOldPathsBecomeNonVolatile) {
  auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();

  auto native_validate_path = [message_latch](Dart_NativeArguments args) {
    auto handle = Dart_GetNativeArgument(args, 0);
    intptr_t peer = 0;
    Dart_Handle result = Dart_GetNativeInstanceField(
        handle, tonic::DartWrappable::kPeerIndex, &peer);
    EXPECT_FALSE(Dart_IsError(result));
    CanvasPath* path = reinterpret_cast<CanvasPath*>(peer);
    EXPECT_TRUE(path);
    EXPECT_TRUE(path->path().isVolatile());
    std::shared_ptr<VolatilePathTracker> tracker =
        UIDartState::Current()->GetVolatilePathTracker();
    EXPECT_TRUE(tracker);

    for (int i = 0; i < VolatilePathTracker::kFramesOfVolatility; i++) {
      EXPECT_TRUE(path->path().isVolatile());
      tracker->OnFrame();
    }
    EXPECT_FALSE(path->path().isVolatile());
    message_latch->Signal();
  };

  Settings settings = CreateSettingsForFixture();
  TaskRunners task_runners("test",                  // label
                           GetCurrentTaskRunner(),  // platform
                           CreateNewThread(),       // raster
                           CreateNewThread(),       // ui
                           CreateNewThread()        // io
  );

  AddNativeCallback("ValidatePath", CREATE_NATIVE_ENTRY(native_validate_path));

  std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);

  ASSERT_TRUE(shell->IsSetup());
  auto configuration = RunConfiguration::InferFromSettings(settings);
  configuration.SetEntrypoint("createPath");

  shell->RunEngine(std::move(configuration), [](auto result) {
    ASSERT_EQ(result, Engine::RunStatus::Success);
  });

  message_latch->Wait();

  DestroyShell(std::move(shell), task_runners);
}

TEST_F(ShellTest, PathVolatilityGCRemovesPathFromTracker) {
  static_assert(VolatilePathTracker::kFramesOfVolatility > 1);
  auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();

  auto native_validate_path = [message_latch](Dart_NativeArguments args) {
    auto handle = Dart_GetNativeArgument(args, 0);
    intptr_t peer = 0;
    Dart_Handle result = Dart_GetNativeInstanceField(
        handle, tonic::DartWrappable::kPeerIndex, &peer);
    EXPECT_FALSE(Dart_IsError(result));
    CanvasPath* path = reinterpret_cast<CanvasPath*>(peer);
    EXPECT_TRUE(path);
    EXPECT_TRUE(path->path().isVolatile());
    std::shared_ptr<VolatilePathTracker> tracker =
        UIDartState::Current()->GetVolatilePathTracker();
    EXPECT_TRUE(tracker);
    EXPECT_EQ(GetLiveTrackedPathCount(tracker), 1ul);
    EXPECT_TRUE(path->path().isVolatile());

    tracker->OnFrame();
    EXPECT_EQ(GetLiveTrackedPathCount(tracker), 1ul);
    EXPECT_TRUE(path->path().isVolatile());

    // simulate GC
    path->Release();
    EXPECT_EQ(GetLiveTrackedPathCount(tracker), 0ul);

    tracker->OnFrame();
    EXPECT_EQ(GetLiveTrackedPathCount(tracker), 0ul);

    message_latch->Signal();
  };

  Settings settings = CreateSettingsForFixture();
  TaskRunners task_runners("test",                  // label
                           GetCurrentTaskRunner(),  // platform
                           CreateNewThread(),       // raster
                           CreateNewThread(),       // ui
                           CreateNewThread()        // io
  );

  AddNativeCallback("ValidatePath", CREATE_NATIVE_ENTRY(native_validate_path));

  std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);

  ASSERT_TRUE(shell->IsSetup());
  auto configuration = RunConfiguration::InferFromSettings(settings);
  configuration.SetEntrypoint("createPath");

  shell->RunEngine(std::move(configuration), [](auto result) {
    ASSERT_EQ(result, Engine::RunStatus::Success);
  });

  message_latch->Wait();

  DestroyShell(std::move(shell), task_runners);
}

// Screen diffing tests use deterministic rendering. Allowing a path to be
// volatile or not for an individual frame can result in minor pixel differences
// that cause the test to fail.
// If deterministic rendering is enabled, the tracker should be disabled and
// paths should always be non-volatile.
TEST_F(ShellTest, DeterministicRenderingDisablesPathVolatility) {
  auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();

  auto native_validate_path = [message_latch](Dart_NativeArguments args) {
    auto handle = Dart_GetNativeArgument(args, 0);
    intptr_t peer = 0;
    Dart_Handle result = Dart_GetNativeInstanceField(
        handle, tonic::DartWrappable::kPeerIndex, &peer);
    EXPECT_FALSE(Dart_IsError(result));
    CanvasPath* path = reinterpret_cast<CanvasPath*>(peer);
    EXPECT_TRUE(path);
    EXPECT_FALSE(path->path().isVolatile());
    std::shared_ptr<VolatilePathTracker> tracker =
        UIDartState::Current()->GetVolatilePathTracker();
    EXPECT_TRUE(tracker);
    EXPECT_FALSE(tracker->enabled());

    for (int i = 0; i < VolatilePathTracker::kFramesOfVolatility; i++) {
      tracker->OnFrame();
      EXPECT_FALSE(path->path().isVolatile());
    }
    EXPECT_FALSE(path->path().isVolatile());
    message_latch->Signal();
  };

  Settings settings = CreateSettingsForFixture();
  settings.skia_deterministic_rendering_on_cpu = true;
  TaskRunners task_runners("test",                  // label
                           GetCurrentTaskRunner(),  // platform
                           CreateNewThread(),       // raster
                           CreateNewThread(),       // ui
                           CreateNewThread()        // io
  );

  AddNativeCallback("ValidatePath", CREATE_NATIVE_ENTRY(native_validate_path));

  std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);

  ASSERT_TRUE(shell->IsSetup());
  auto configuration = RunConfiguration::InferFromSettings(settings);
  configuration.SetEntrypoint("createPath");

  shell->RunEngine(std::move(configuration), [](auto result) {
    ASSERT_EQ(result, Engine::RunStatus::Success);
  });

  message_latch->Wait();

  DestroyShell(std::move(shell), task_runners);
}

}  // namespace testing
}  // namespace flutter


text:
NOMAN=	# defined

PROG=	retest
SRCS=	regexp.c retest.c
.PATH:	${.CURDIR}/..

# do not install test programs
proginstall::

.include <bsd.prog.mk>


text:
CREATE TRIGGER AddMD5Key BEFORE INSERT  ON jobs
FOR EACH
ROW  SET NEW.key = UUID(  ) ;


text:
package comparison.methods;

public class Final {

    public void finalMethod() {

    }

    public final void nonFinalMethod() {

    }
}