text:
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Implements a particle system steam jet.
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "particle_prototype.h"
#include "particle_util.h"
#include "baseparticleentity.h"
#include "ClientEffectPrecacheSystem.h"
#include "fx.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

//NOTENOTE: Mirrored in dlls\steamjet.h
#define	STEAM_NORMAL	0
#define	STEAM_HEATWAVE	1

#define STEAMJET_NUMRAMPS			5
#define SF_EMISSIVE					0x00000001

//==================================================
// C_SteamJet
//==================================================

class C_SteamJet : public C_BaseParticleEntity, public IPrototypeAppEffect
{
public:
	DECLARE_CLIENTCLASS();
	DECLARE_CLASS( C_SteamJet, C_BaseParticleEntity );

	C_SteamJet();
	~C_SteamJet();

	class SteamJetParticle : public Particle
	{
	public:
		Vector			m_Velocity;
		float			m_flRoll;
		float			m_flRollDelta;
		float			m_Lifetime;
		float			m_DieTime;
		unsigned char	m_uchStartSize;
		unsigned char	m_uchEndSize;
	};

	int IsEmissive( void ) { return ( m_spawnflags & SF_EMISSIVE ); }

//C_BaseEntity
public:

	virtual void	OnDataChanged( DataUpdateType_t updateType );

//IPrototypeAppEffect
public:
	virtual void		Start(CParticleMgr *pParticleMgr, IPrototypeArgAccess *pArgs);
	virtual bool		GetPropEditInfo(RecvTable **ppTable, void **ppObj);

//IParticleEffect
public:
	virtual void	Update(float fTimeDelta);
	virtual void RenderParticles( CParticleRenderIterator *pIterator );
	virtual void SimulateParticles( CParticleSimulateIterator *pIterator );

//Stuff from the datatable
public:

	float			m_SpreadSpeed;
	float			m_Speed;
	float			m_StartSize;
	float			m_EndSize;
	float			m_Rate;
	float			m_JetLength;	// Length of the jet. Lifetime is derived from this.

	int				m_bEmit;		// Emit particles?
	int				m_nType;		// Type of particles to emit
	bool			m_bFaceLeft;	// For support of legacy env_steamjet entity, which faced left instead of forward.

	int				m_spawnflags;
	float			m_flRollSpeed;

private:

	void			UpdateLightingRamp();

private:

	// Stored the last time it updates the lighting ramp, so it can cache the values.
	Vector			m_vLastRampUpdatePos;
	QAngle			m_vLastRampUpdateAngles;

	float			m_Lifetime;		// Calculated from m_JetLength / m_Speed;

	// We sample the world to get these colors and ramp the particles.
	Vector			m_Ramps[STEAMJET_NUMRAMPS];

	CParticleMgr		*m_pParticleMgr;
	PMaterialHandle	m_MaterialHandle;
	TimedEvent		m_ParticleSpawn;

private:
					C_SteamJet( const C_SteamJet & );
};

// ------------------------------------------------------------------------- //
// Tables.
// ------------------------------------------------------------------------- //

// Expose to the particle app.
EXPOSE_PROTOTYPE_EFFECT(SteamJet, C_SteamJet);

// Datatable..
IMPLEMENT_CLIENTCLASS_DT(C_SteamJet, DT_SteamJet, CSteamJet)
	RecvPropFloat(RECVINFO(m_SpreadSpeed), 0),
	RecvPropFloat(RECVINFO(m_Speed), 0),
	RecvPropFloat(RECVINFO(m_StartSize), 0),
	RecvPropFloat(RECVINFO(m_EndSize), 0),
	RecvPropFloat(RECVINFO(m_Rate), 0),
	RecvPropFloat(RECVINFO(m_JetLength), 0),
	RecvPropInt(RECVINFO(m_bEmit), 0),
	RecvPropInt(RECVINFO(m_bFaceLeft), 0),
	RecvPropInt(RECVINFO(m_nType), 0),
	RecvPropInt( RECVINFO( m_spawnflags ) ),
	RecvPropFloat(RECVINFO(m_flRollSpeed), 0 ),
END_RECV_TABLE()

// ------------------------------------------------------------------------- //
// C_SteamJet implementation.
// ------------------------------------------------------------------------- //
C_SteamJet::C_SteamJet()
{
	m_pParticleMgr = NULL;
	m_MaterialHandle = INVALID_MATERIAL_HANDLE;

	m_SpreadSpeed = 15;
	m_Speed = 120;
	m_StartSize = 10;
	m_EndSize = 25;
	m_Rate = 26;
	m_JetLength = 80;
	m_bEmit = true;
	m_bFaceLeft = false;
	m_ParticleEffect.SetAlwaysSimulate( false ); // Don't simulate outside the PVS or frustum.

	m_vLastRampUpdatePos.Init( 1e24, 1e24, 1e24 );
	m_vLastRampUpdateAngles.Init( 1e24, 1e24, 1e24 );
}

C_SteamJet::~C_SteamJet()
{
	if(m_pParticleMgr)
		m_pParticleMgr->RemoveEffect( &m_ParticleEffect );
}

//-----------------------------------------------------------------------------
// Purpose: Called after a data update has occured
// Input  : bnewentity -
//-----------------------------------------------------------------------------
void C_SteamJet::OnDataChanged(DataUpdateType_t updateType)
{
	C_BaseEntity::OnDataChanged(updateType);

	if(updateType == DATA_UPDATE_CREATED)
	{
		Start(ParticleMgr(), NULL);
	}

	// Recalulate lifetime in case length or speed changed.
	m_Lifetime = m_JetLength / m_Speed;
	m_ParticleEffect.SetParticleCullRadius( max(m_StartSize, m_EndSize) );
}

//-----------------------------------------------------------------------------
// Purpose: Starts the effect
// Input  : *pParticleMgr -
//			*pArgs -
//-----------------------------------------------------------------------------
void C_SteamJet::Start(CParticleMgr *pParticleMgr, IPrototypeArgAccess *pArgs)
{
	pParticleMgr->AddEffect( &m_ParticleEffect, this );

	switch(m_nType)
	{
	case STEAM_NORMAL:
	default:
		m_MaterialHandle = g_Mat_DustPuff[0];
		break;

	case STEAM_HEATWAVE:
		m_MaterialHandle = m_ParticleEffect.FindOrAddMaterial("sprites/heatwave");
		break;
	}

	m_ParticleSpawn.Init(m_Rate);
	m_Lifetime = m_JetLength / m_Speed;
	m_pParticleMgr = pParticleMgr;

	UpdateLightingRamp();
}

//-----------------------------------------------------------------------------
// Purpose:
// Input  : **ppTable -
//			**ppObj -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool C_SteamJet::GetPropEditInfo( RecvTable **ppTable, void **ppObj )
{
	*ppTable = &REFERENCE_RECV_TABLE(DT_SteamJet);
	*ppObj = this;
	return true;
}

// This might be useful someday.
/*
void CalcFastApproximateRenderBoundsAABB( C_BaseEntity *pEnt, float flBloatSize, Vector *pMin, Vector *pMax )
{
	C_BaseEntity *pParent = pEnt->GetMoveParent();
	if ( pParent )
	{
		// Get the parent's abs space world bounds.
		CalcFastApproximateRenderBoundsAABB( pParent, 0, pMin, pMax );

		// Add the maximum of our local render bounds. This is making the assumption that we can be at any
		// point and at any angle within the parent's world space bounds.
		Vector vAddMins, vAddMaxs;
		pEnt->GetRenderBounds( vAddMins, vAddMaxs );

		flBloatSize += max( vAddMins.Length(), vAddMaxs.Length() );
	}
	else
	{
		// Start out with our own render bounds. Since we don't have a parent, this won't incur any nasty
		pEnt->GetRenderBoundsWorldspace( *pMin, *pMax );
	}

	// Bloat the box.
	if ( flBloatSize )
	{
		*pMin -= Vector( flBloatSize, flBloatSize, flBloatSize );
		*pMax += Vector( flBloatSize, flBloatSize, flBloatSize );
	}
}
*/

//-----------------------------------------------------------------------------
// Purpose:
// Input  : fTimeDelta -
//-----------------------------------------------------------------------------

void C_SteamJet::Update(float fTimeDelta)
{
	if(!m_pParticleMgr)
	{
		assert(false);
		return;
	}

	if( m_bEmit )
	{
		// Add new particles.
		int nToEmit = 0;
		float tempDelta = fTimeDelta;
		while( m_ParticleSpawn.NextEvent(tempDelta) )
			++nToEmit;

		if ( nToEmit > 0 )
		{
			Vector forward, right, up;
			AngleVectors(GetAbsAngles(), &forward, &right, &up);

			// Legacy env_steamjet entities faced left instead of forward.
			if (m_bFaceLeft)
			{
				Vector temp = forward;
				forward = -right;
				right = temp;
			}

			// EVIL: Ideally, we could tell the renderer our OBB, and let it build a big box that encloses
			// the entity with its parent so it doesn't have to setup its parent's bones here.
			Vector vEndPoint = GetAbsOrigin() + forward * m_Speed;
			Vector vMin, vMax;
			VectorMin( GetAbsOrigin(), vEndPoint, vMin );
			VectorMax( GetAbsOrigin(), vEndPoint, vMax );
			m_ParticleEffect.SetBBox( vMin, vMax );

			if ( m_ParticleEffect.WasDrawnPrevFrame() )
			{
				while ( nToEmit-- )
				{
					// Make a new particle.
					if( SteamJetParticle *pParticle = (SteamJetParticle*) m_ParticleEffect.AddParticle( sizeof(SteamJetParticle), m_MaterialHandle ) )
					{
						pParticle->m_Pos = GetAbsOrigin();

						pParticle->m_Velocity =
							FRand(-m_SpreadSpeed,m_SpreadSpeed) * right +
							FRand(-m_SpreadSpeed,m_SpreadSpeed) * up +
							m_Speed * forward;

						pParticle->m_Lifetime	= 0;
						pParticle->m_DieTime	= m_Lifetime;

						pParticle->m_uchStartSize	= m_StartSize;
						pParticle->m_uchEndSize		= m_EndSize;

						pParticle->m_flRoll = random->RandomFloat( 0, 360 );
						pParticle->m_flRollDelta = random->RandomFloat( -m_flRollSpeed, m_flRollSpeed );
					}
				}
			}

			UpdateLightingRamp();
		}
	}
}

// Render a quad on the screen where you pass in color and size.
// Normal is random and "flutters"
inline void RenderParticle_ColorSizePerturbNormal(
	ParticleDraw* pDraw,
	const Vector &pos,
	const Vector &color,
	const float alpha,
	const float size
	)
{
	// Don't render totally transparent particles.
	if( alpha < 0.001f )
		return;

	CMeshBuilder *pBuilder = pDraw->GetMeshBuilder();
	if( !pBuilder )
		return;

	unsigned char ubColor[4];
	ubColor[0] = (unsigned char)RoundFloatToInt( color.x * 254.9f );
	ubColor[1] = (unsigned char)RoundFloatToInt( color.y * 254.9f );
	ubColor[2] = (unsigned char)RoundFloatToInt( color.z * 254.9f );
	ubColor[3] = (unsigned char)RoundFloatToInt( alpha * 254.9f );

	Vector vNorm;

	vNorm.Random( -1.0f, 1.0f );

	// Add the 4 corner vertices.
	pBuilder->Position3f( pos.x-size, pos.y-size, pos.z );
	pBuilder->Color4ubv( ubColor );
	pBuilder->Normal3fv( vNorm.Base() );
	pBuilder->TexCoord2f( 0, 0, 1.0f );
 	pBuilder->AdvanceVertex();

	pBuilder->Position3f( pos.x-size, pos.y+size, pos.z );
	pBuilder->Color4ubv( ubColor );
	pBuilder->Normal3fv( vNorm.Base() );
	pBuilder->TexCoord2f( 0, 0, 0 );
 	pBuilder->AdvanceVertex();

	pBuilder->Position3f( pos.x+size, pos.y+size, pos.z );
	pBuilder->Color4ubv( ubColor );
	pBuilder->Normal3fv( vNorm.Base() );
	pBuilder->TexCoord2f( 0, 1.0f, 0 );
 	pBuilder->AdvanceVertex();

	pBuilder->Position3f( pos.x+size, pos.y-size, pos.z );
	pBuilder->Color4ubv( ubColor );
	pBuilder->Normal3fv( vNorm.Base() );
	pBuilder->TexCoord2f( 0, 1.0f, 1.0f );
 	pBuilder->AdvanceVertex();
}

void C_SteamJet::RenderParticles( CParticleRenderIterator *pIterator )
{
	const SteamJetParticle *pParticle = (const SteamJetParticle*)pIterator->GetFirst();
	while ( pParticle )
	{
		// Render.
		Vector tPos;
		TransformParticle(m_pParticleMgr->GetModelView(), pParticle->m_Pos, tPos);
		float sortKey = tPos.z;

		float lifetimeT = pParticle->m_Lifetime / (pParticle->m_DieTime + 0.001);
		float fRamp = lifetimeT * (STEAMJET_NUMRAMPS-1);
		int iRamp = (int)fRamp;
		float fraction = fRamp - iRamp;

		Vector vRampColor = m_Ramps[iRamp] + (m_Ramps[iRamp+1] - m_Ramps[iRamp]) * fraction;

		vRampColor[0] = min( 1.0f, vRampColor[0] );
		vRampColor[1] = min( 1.0f, vRampColor[1] );
		vRampColor[2] = min( 1.0f, vRampColor[2] );

		float sinLifetime = sin(pParticle->m_Lifetime * 3.14159f / pParticle->m_DieTime);

		if ( m_nType == STEAM_HEATWAVE )
		{
			RenderParticle_ColorSizePerturbNormal(
				pIterator->GetParticleDraw(),
				tPos,
				vRampColor,
				sinLifetime * (m_clrRender->a/255.0f),
				FLerp(m_StartSize, m_EndSize, pParticle->m_Lifetime));
		}
		else
		{
			RenderParticle_ColorSizeAngle(
				pIterator->GetParticleDraw(),
				tPos,
				vRampColor,
				sinLifetime * (m_clrRender->a/255.0f),
				FLerp(pParticle->m_uchStartSize, pParticle->m_uchEndSize, pParticle->m_Lifetime),
				pParticle->m_flRoll );
		}

		pParticle = (const SteamJetParticle*)pIterator->GetNext( sortKey );
	}
}

void C_SteamJet::SimulateParticles( CParticleSimulateIterator *pIterator )
{
	//Don't simulate if we're emiting particles...
	//This fixes the cases where looking away from a steam jet and then looking back would cause a break on the stream.
	if ( m_ParticleEffect.WasDrawnPrevFrame() == false && m_bEmit )
		return;

	SteamJetParticle *pParticle = (SteamJetParticle*)pIterator->GetFirst();
	while ( pParticle )
	{
		// Should this particle die?
		pParticle->m_Lifetime += pIterator->GetTimeDelta();

		if( pParticle->m_Lifetime > pParticle->m_DieTime )
		{
			pIterator->RemoveParticle( pParticle );
		}
		else
		{
			pParticle->m_flRoll += pParticle->m_flRollDelta * pIterator->GetTimeDelta();
			pParticle->m_Pos = pParticle->m_Pos + pParticle->m_Velocity * pIterator->GetTimeDelta();
		}

		pParticle = (SteamJetParticle*)pIterator->GetNext();
	}
}

void C_SteamJet::UpdateLightingRamp()
{
	if( VectorsAreEqual( m_vLastRampUpdatePos, GetAbsOrigin(), 0.1 ) &&
		QAnglesAreEqual( m_vLastRampUpdateAngles, GetAbsAngles(), 0.1 ) )
	{
		return;
	}

	m_vLastRampUpdatePos = GetAbsOrigin();
	m_vLastRampUpdateAngles = GetAbsAngles();

	// Sample the world lighting where we think the particles will be.
	Vector forward, right, up;
	AngleVectors(GetAbsAngles(), &forward, &right, &up);

	// Legacy env_steamjet entities faced left instead of forward.
	if (m_bFaceLeft)
	{
		Vector temp = forward;
		forward = -right;
		right = temp;
	}

	Vector startPos = GetAbsOrigin();
	Vector endPos = GetAbsOrigin() + forward * (m_Speed * m_Lifetime);

	for(int iRamp=0; iRamp < STEAMJET_NUMRAMPS; iRamp++)
	{
		float t = (float)iRamp / (STEAMJET_NUMRAMPS-1);
		Vector vTestPos = startPos + (endPos - startPos) * t;

		Vector *pRamp = &m_Ramps[iRamp];
		*pRamp = WorldGetLightForPoint(vTestPos, false);

		if ( IsEmissive() )
		{
			pRamp->x += (m_clrRender->r/255.0f);
			pRamp->y += (m_clrRender->g/255.0f);
			pRamp->z += (m_clrRender->b/255.0f);

			pRamp->x = clamp( pRamp->x, 0.0f, 1.0f );
			pRamp->y = clamp( pRamp->y, 0.0f, 1.0f );
			pRamp->z = clamp( pRamp->z, 0.0f, 1.0f );
		}
		else
		{
			pRamp->x *= (m_clrRender->r/255.0f);
			pRamp->y *= (m_clrRender->g/255.0f);
			pRamp->z *= (m_clrRender->b/255.0f);
		}

		// Renormalize?
		float maxVal = max(pRamp->x, max(pRamp->y, pRamp->z));
		if(maxVal > 1)
		{
			*pRamp = *pRamp / maxVal;
		}
	}
}


text:
require "chemtrail/reference_presenter"

class Chemtrail::Mapping
  attr_reader :id

  def initialize(id, entries = nil)
    @id = id
    @entries = entries
  end

  def entries
    @entries ||= {}
  end

  def find(top_level, second_level)
    Chemtrail::Function.new("Fn::FindInMap", id, top_level, second_level).to_hash
  end

  def to_hash
    {
      id => entries
    }
  end
end

redpajama_set_name: RedPajamaGithub


text:
package net.community.chest.jmx;

import javax.management.MBeanParameterInfo;

import net.community.chest.reflect.ClassUtil;

public class ReflectiveMBeanParameterInfo extends MBeanParameterInfo {
    /**
     *
     */
    private static final long serialVersionUID = -2469810142557520222L;
    private final Class<?>    _paramType;
    public final /* no cheating */ Class<?> getParameterClass ()
    {
        return _paramType;
    }

    public ReflectiveMBeanParameterInfo (String pName, Class<?> type, String pDesc) throws IllegalArgumentException
    {
        super(pName, (null == type) ? null : type.getName(), pDesc);

        if (null == (_paramType=type))
            throw new IllegalArgumentException(ClassUtil.getConstructorExceptionLocation(getClass()) + " no parameter type class specified");
    }

}


text:
Go back to index
| <a href="<?php echo $_SERVER["REQUEST_URI"];?>">Refresh

<title>Popup</title>

Popup

  When creating a window, the ["application"]["dpi_aware"] setting is taken
  into account. If it's set to true, then application window will be resized
  automatically using the current OS DPI settings.

    window.open('index.php', '', 'width=800,height=600')

target="_blank"


text:
package com.github.xose.xml.dom.gwt;

import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.TypeInfo;

public class ElementImpl extends NodeImpl implements Element {

	protected ElementImpl() {
	}

	@Override
	public final native String getTagName() /*-{
		return this.tagName;
	}-*/;

	@Override
	public final native String getAttribute(String name) /*-{
		return this.getAttribute(name);
	}-*/;

	@Override
	public final native void setAttribute(String name, String value) throws DOMException /*-{
		try {
			this.setAttribute(name, value);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native void removeAttribute(String name) throws DOMException /*-{
		try {
			this.removeAttribute(name);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native Attr getAttributeNode(String name) /*-{
		return this.getAttributeNode(name);
	}-*/;

	@Override
	public final native Attr setAttributeNode(Attr newAttr) throws DOMException /*-{
		try {
			return this.setAttributeNode(newAttr);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native Attr removeAttributeNode(Attr oldAttr) throws DOMException /*-{
		try {
			return this.removeAttributeNode(oldAttr);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native NodeList getElementsByTagName(String name) /*-{
		return this.getElementsByTagName(name);
	}-*/;

	@Override
	public final native NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException /*-{
		try {
			return this.getElementsByTagNameNS(namespaceURI, localName);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native String getAttributeNS(String namespaceURI, String localName) throws DOMException /*-{
		try {
			return this.getAttributeNS(namespaceURI, localName);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException /*-{
		try {
			this.setAttributeNS(namespaceURI, qualifiedName, value);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native void removeAttributeNS(String namespaceURI, String localName) throws DOMException /*-{
		try {
			this.removeAttributeNS(namespaceURI, localName);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException /*-{
		try {
			return this.getAttributeNodeNS(namespaceURI, localName);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native Attr setAttributeNodeNS(Attr newAttr) throws DOMException /*-{
		try {
			this.setAttributeNodeNS(newAttr);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final native boolean hasAttribute(String name) /*-{
		return this.hasAttribute(name);
	}-*/;

	@Override
	public final native boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException /*-{
		try {
			return this.hasAttributeNS(namespaceURI, localName);
		} catch (e) {
			@com.github.xose.xml.dom.gwt.DOMExceptionUtil::raise(*)(e);
		}
	}-*/;

	@Override
	public final TypeInfo getSchemaTypeInfo() {
		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
	}

	@Override
	public final void setIdAttribute(String name, boolean isId) throws DOMException {
		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
	}

	@Override
	public final void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
	}

	@Override
	public final void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
		throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
	}

}


text:
package com.jamescoggan.droidcon2016;

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

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.refactor.library.SmoothCheckBox;

public class InterestPickerAdapter extends RecyclerView.Adapter<InterestPickerAdapter.InterestViewHolder> {

    private List<String> mInterests = new ArrayList<>();
    private Set<String> mUserSelectedInterests = new HashSet<>();

    public InterestPickerAdapter() {

    }

    public void setItemsToAdapter(List<String> userInterests, List<String> interests) {
        mUserSelectedInterests.addAll(userInterests);
        mInterests = interests;

        notifyDataSetChanged();
    }

    public Set<String> getUserSelectedInterests() {
        return mUserSelectedInterests;
    }

    @Override
    public InterestViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view;
        view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_interest_picker, parent, false);
        return new InterestViewHolder(view);
    }

    @Override
    public void onBindViewHolder(InterestViewHolder holder, int position) {
        String interest = mInterests.get(position);
        holder.interest.setText(interest);

        boolean isItemChecked = mUserSelectedInterests != null && mUserSelectedInterests.contains(interest);
        holder.smoothCheckBox.setChecked(isItemChecked, false);
    }

    @Override
    public int getItemCount() {
        return mInterests.size();
    }

    class InterestViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.interest_title)
        TextView interest;
        @BindView(R.id.interest_checkbox)
        SmoothCheckBox smoothCheckBox;

        InterestViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);

            smoothCheckBox.setFocusable(false);
            smoothCheckBox.setClickable(false);
            interest.setClickable(false);
            interest.setFocusable(false);
        }

        @OnClick
        void onClick() {
            // TODO: This might cause a race condition in some cases, leading to duplicate entries in the db.
            String interestValue = interest.getText().toString();
            if (mUserSelectedInterests != null) {
                if (smoothCheckBox.isChecked() && mUserSelectedInterests.contains(interestValue)) {
                    smoothCheckBox.setChecked(false, true);
                    mUserSelectedInterests.remove(interestValue);
                } else {
                    smoothCheckBox.setChecked(true, true);
                    mUserSelectedInterests.add(interestValue);
                }
            }
        }
    }
}


text:
module.exports = tokenize

var repeat = require('string-repeat')
var times = require('./times')
var tokenizeContent = require('./tokenize-content')

var ALL_SPACE = /^\s*$/
var COMMENT = /^\s*#/
var INITIAL_SPACE = /^( *)/
var INDENT_WIDTH = 4
var NEWLINE = /\r\n?|\n/g

// Takes a string and returns an array of objects like:
//
//     { type: String, line: Number, column: Number, string: String }
//
// Line and column numbers are 1-indexed. (1 is the first line and the
// first column in each line.) String values for certain tokens, like
// outdents, are empty. Token type values are defined in tokens.json.
function tokenize (text) {
  // Track the indentation of the last-seen line. This it the
  // context-dependency that keeps us from using a generated lexer.
  var lastIndentation = 0
  var lastLine = 0
  var lastColumn = 0
  return text
  // Split into lines.
    .split(NEWLINE)
  // For each line, create Array of tokens for indentation and content.
    .map(function (line, index) {
      if (ALL_SPACE.test(line) || COMMENT.test(line)) {
        return []
      } else {
        lastColumn = 0
        var lineNumber = index + 1
        // Indentation
        var indentation = indentationOf(line, lineNumber)
        var indentationLength = (indentation * INDENT_WIDTH)
        var indentationSpaces = repeat(' ', indentationLength)
        // Content
        var content = line.substring(indentationSpaces.length)
        var contentColumn = indentationLength + 1
        var contentTokens = tokenizeContent(
          content, lineNumber, contentColumn
        )
        var arrayOfTokens = []
        // Same indentation as last line
        if (indentation === lastIndentation) {
          arrayOfTokens = arrayOfTokens.concat(contentTokens)
          // Indented further than last line
        } else if (indentation > lastIndentation) {
        // Any line may be indented at most 1 level deeper.
        //
        // This is legal:
        //
        //     1| A
        //     2|     B
        //
        // This is illegal:
        //
        //     1| A
        //     2|         B
          if (indentation - lastIndentation > 1) {
            throw new Error(
              'Line ' + lineNumber + ' is indented too far.'
            )
          } else {
            var indentToken = {
              type: 'INDENT',
              line: lineNumber,
              column: 1,
              string: indentationSpaces
            }
            arrayOfTokens = arrayOfTokens
              .concat(indentToken)
              .concat(contentTokens)
          }
          // Indented less than last line
        } else if (indentation < lastIndentation) {
        // This line may be indented any number of levels less than the
        // preceding line, as in:
        //
        //     1| A
        //     2|     B
        //     3|         C
        //     4| D
        //
        //  Line 4 is indented 2 levels less than line 3.
        //
        //  The tokens for line 4 will begin with 2 OUTDENT tokens.
        //
        //  All together, in pseudo-tokens:
        //
        //      "A"
        //      INDENT  "B"
        //      INDENT  "C"
        //      OUTDENT  OUTDENT  "D"
          var outdentCount = lastIndentation - indentation
          var outdents = []
          for (var i = 1; i <= outdentCount; i++) {
            outdents.push({
              type: 'OUTDENT',
              line: lineNumber,
              column: 1,
              string: indentationSpaces
            })
          }
          arrayOfTokens = arrayOfTokens
            .concat(outdents)
            .concat(contentTokens)
        }
        lastIndentation = indentation
        lastColumn = (contentColumn + content.length)
        lastLine = lineNumber
        return arrayOfTokens
      }
    })
  // Flatten array of arrays of tokens into one long array of tokens.
    .reduce(function (tokens, array) {
      return tokens.concat(array)
    }, [])
  // Add OUTDENT tokens for any INDENT tokens that haven't been
  // cancelled out by an OUTDENT token yet.
    .concat(
      times(
        {
          type: 'OUTDENT',
          line: lastLine,
          column: lastColumn,
          string: ''
        },
        lastIndentation
      )
    )
  // Add the terminal END token, sometimes called EOF or ENDMARKER.
    .concat({
      type: 'END',
      line: lastLine,
      column: lastColumn,
      string: ''
    })
}

function indentationOf (line, lineNumber) {
  var initialSpace = INITIAL_SPACE.exec(line)[1].length
  if (initialSpace === 0) {
    return 0
  } else {
    if (initialSpace % INDENT_WIDTH === 0) {
      return (initialSpace / INDENT_WIDTH)
    } else {
      throw new Error('Invalid indentation on line ' + lineNumber)
    }
  }
}


text:
"""
project.instance

Create and expose the Flask application
"""
from flask import Flask

def create_app(package_name):
    app = Flask(package_name)

    from project.database import db_init
    app.db = db_init()

    from project.routes import routes_init
    routes_init(app)

    return app

app = create_app(__name__)


text:
COMP348
=======

Concordia University Course


text:
package nonapi.io.github.classgraph.fastzipfilereader;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Objects;

import nonapi.io.github.classgraph.fileslice.Slice;
import nonapi.io.github.classgraph.scanspec.AcceptReject.AcceptRejectLeafname;

/** A zipfile slice (a sub-range of bytes within a PhysicalZipFile. */
public class ZipFileSlice {
    /** The parent slice, or null if this is the toplevel slice (the whole zipfile). */
    private final ZipFileSlice parentZipFileSlice;
    /** The underlying physical zipfile. */
    protected final PhysicalZipFile physicalZipFile;
    /** For the toplevel zipfile slice, the zipfile path; For nested slices, the name/path of the zipfile entry. */
    private final String pathWithinParentZipFileSlice;
    /** The {@link Slice} containing the zipfile. */
    public Slice slice;

    /**
     * Create a ZipFileSlice that wraps a toplevel {@link PhysicalZipFile}.
     *
     * @param physicalZipFile
     *            the physical zipfile
     */
    ZipFileSlice(final PhysicalZipFile physicalZipFile) {
        this.parentZipFileSlice = null;
        this.physicalZipFile = physicalZipFile;
        this.slice = physicalZipFile.slice;
        this.pathWithinParentZipFileSlice = physicalZipFile.getPathStr();
    }

    /**
     * Create a ZipFileSlice that wraps a {@link PhysicalZipFile} that was extracted or inflated from a nested jar
     * to memory or disk.
     *
     * @param physicalZipFile
     *            a physical zipfile that has been extracted to RAM
     * @param zipEntry
     *            the zip entry
     */
    ZipFileSlice(final PhysicalZipFile physicalZipFile, final FastZipEntry zipEntry) {
        this.parentZipFileSlice = zipEntry.parentLogicalZipFile;
        this.physicalZipFile = physicalZipFile;
        this.slice = physicalZipFile.slice;
        this.pathWithinParentZipFileSlice = zipEntry.entryName;
    }

    /**
     * Create a ZipFileSlice that wraps a single stored (not deflated) {@link FastZipEntry}.
     *
     * @param zipEntry
     *            the zip entry
     * @throws IOException
     *             If an I/O exception occurs.
     * @throws InterruptedException
     *             If the thread was interrupted.
     */
    ZipFileSlice(final FastZipEntry zipEntry) throws IOException, InterruptedException {
        this.parentZipFileSlice = zipEntry.parentLogicalZipFile;
        this.physicalZipFile = zipEntry.parentLogicalZipFile.physicalZipFile;
        this.slice = zipEntry.getSlice();
        this.pathWithinParentZipFileSlice = zipEntry.entryName;
    }

    /**
     * Clone constructor.
     *
     * @param other
     *            the {@link ZipFileSlice} to clone.
     */
    ZipFileSlice(final ZipFileSlice other) {
        this.parentZipFileSlice = other.parentZipFileSlice;
        this.physicalZipFile = other.physicalZipFile;
        this.slice = other.slice;
        this.pathWithinParentZipFileSlice = other.pathWithinParentZipFileSlice;
    }

    /**
     * Check whether this zipfile slice and all of its parent slices are accepted and not rejected in the jarfile
     * accept/reject criteria.
     *
     * @param jarAcceptReject
     *            the jar accept/reject criteria
     * @return true if this zipfile slice and all of its parent slices are accepted and not rejected in the jarfile
     *         accept/reject criteria.
     */
    public boolean isAcceptedAndNotRejected(final AcceptRejectLeafname jarAcceptReject) {
        return jarAcceptReject.isAcceptedAndNotRejected(pathWithinParentZipFileSlice) //
                && (parentZipFileSlice == null || parentZipFileSlice.isAcceptedAndNotRejected(jarAcceptReject));
    }

    /**
     * Get the parent ZipFileslice, or return null if this is a toplevel slice (i.e. if this slice wraps an entire
     * physical zipfile).
     *
     * @return the parent ZipFileslice, or null if this is a toplevel slice.
     */
    public ZipFileSlice getParentZipFileSlice() {
        return parentZipFileSlice;
    }

    /**
     * Get the name of the slice (either the entry name/path within the parent zipfile slice, or the path of the
     * physical zipfile if this slice is a toplevel slice (i.e. if this slice wraps an entire physical zipfile).
     *
     * @return the name of the slice.
     */
    public String getPathWithinParentZipFileSlice() {
        return pathWithinParentZipFileSlice;
    }

    /**
     * Recursively append the path in top down ancestral order.
     *
     * @param buf
     *            the buf to append the path to
     */
    private void appendPath(final StringBuilder buf) {
        if (parentZipFileSlice != null) {
            parentZipFileSlice.appendPath(buf);
            if (buf.length() > 0) {
                buf.append("!/");
            }
        }
        buf.append(pathWithinParentZipFileSlice);
    }

    /**
     * Get the path of this zipfile slice, e.g. "/path/to/jarfile.jar!/nestedjar1.jar".
     *
     * @return the path of this zipfile slice.
     */
    public String getPath() {
        final StringBuilder buf = new StringBuilder();
        appendPath(buf);
        return buf.toString();
    }

    /**
     * Get the physical {@link File} that this ZipFileSlice is a slice of.
     *
     * @return the physical {@link File} that this ZipFileSlice is a slice of, or null if this file was downloaded
     *         from a URL directly to RAM.
     */
    public File getPhysicalFile() {
        final Path path = physicalZipFile.getPath();
        if (path != null) {
            try {
                return path.toFile();
            } catch (final UnsupportedOperationException e) {
                // Filesystem supports the Path API but not the File API
                return null;
            }
        } else {
            return physicalZipFile.getFile();
        }
    }

    /* (non-Javadoc)
     * @see nonapi.io.github.classgraph.fastzipfilereader.ZipFileSlice#equals(java.lang.Object)
     */
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof ZipFileSlice)) {
            return false;
        } else {
            final ZipFileSlice other = (ZipFileSlice) o;
            return Objects.equals(physicalZipFile, other.physicalZipFile) && Objects.equals(slice, other.slice)
                    && Objects.equals(pathWithinParentZipFileSlice, other.pathWithinParentZipFileSlice);
        }
    }

    /* (non-Javadoc)
     * @see nonapi.io.github.classgraph.fastzipfilereader.ZipFileSlice#hashCode()
     */
    @Override
    public int hashCode() {
        return Objects.hash(physicalZipFile, slice, pathWithinParentZipFileSlice);
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        final String path = getPath();
        String fileStr = physicalZipFile.getPath() == null ? null : physicalZipFile.getPath().toString();
        if (fileStr == null) {
            fileStr = physicalZipFile.getFile() == null ? null : physicalZipFile.getFile().toString();
        }
        return "[" + (fileStr != null && !fileStr.equals(path) ? path + " -> " + fileStr : path) + " ; byte range: "
                + slice.sliceStartPos + ".." + (slice.sliceStartPos + slice.sliceLength) + " / "
                + physicalZipFile.length() + "]";
    }
}


text:
package com.newatlanta.appengine.junit.locks;

import java.util.concurrent.TimeUnit;

import org.junit.Test;

import com.newatlanta.appengine.junit.LocalServiceTestCase;
import com.newatlanta.appengine.locks.ExclusiveLock;

/**
 * Tests com.newatlanta.appengine.locks.ExclusiveLock.
 *
 * @author Vince Bonfanti
 */
public class ExclusiveLockTestCase extends LocalServiceTestCase {

    private ExclusiveLock lock;

    @Override
    public void setUp() throws Exception {
        super.setUp();
        lock = new ExclusiveLock( "junit.exclusive.lock" );
    }

    @Test
    public void testTryLock() {
        Thread lockThread = LockingThread.createThread( lock, Long.MAX_VALUE );
        assertEquals( lockThread, lock.getOwner() );
        assertFalse( lock.isHeldByCurrentThread() );
        assertFalse( lock.tryLock() );
        try {
            lock.unlock();
            fail( "expected IllegalStateException: lock.unlock()" );
        } catch ( IllegalStateException e ) {
        }
        lockThread.interrupt(); // release the lock
        try {
            Thread.sleep( 100 ); // give lockThread a chance to run
        } catch ( InterruptedException e ) {
        }
        assertNull( lock.getOwner() );
        assertFalse( lock.isHeldByCurrentThread() );
        for ( int i = 0; i < 10; i++ ) {
            assertTrue( lock.tryLock() );
            assertEquals( Thread.currentThread(), lock.getOwner() );
            assertTrue( lock.isHeldByCurrentThread() );
        }
        for ( int i = 0; i < 9; i++ ) {
            lock.unlock();
            assertEquals( Thread.currentThread(), lock.getOwner() );
            assertTrue( lock.isHeldByCurrentThread() );
        }
        lock.unlock();
        assertNull( lock.getOwner() );
        assertFalse( lock.isHeldByCurrentThread() );
    }

    @Test
    public void testLock() {
        Thread lockThread = LockingThread.createThread( lock, 2000 );
        assertEquals( lockThread, lock.getOwner() );
        assertFalse( lock.isHeldByCurrentThread() );
        for ( int i = 0; i < 10; i++ ) {
            lock.lock();
            assertEquals( Thread.currentThread(), lock.getOwner() );
            assertTrue( lock.isHeldByCurrentThread() );
        }
        for ( int i = 0; i < 9; i++ ) {
            lock.unlock();
            assertEquals( Thread.currentThread(), lock.getOwner() );
            assertTrue( lock.isHeldByCurrentThread() );
        }
        lock.unlock();
        assertNull( lock.getOwner() );
        assertFalse( lock.isHeldByCurrentThread() );
    }

     @Test
     public void testLockInterruptibly() {
         Thread lockThread = LockingThread.createThread( lock, 2000 );
         assertEquals( lockThread, lock.getOwner() );
         assertFalse( lock.isHeldByCurrentThread() );
         try {
             for ( int i = 0; i < 10; i++ ) {
                 lock.lockInterruptibly();
                 assertEquals( Thread.currentThread(), lock.getOwner() );
                 assertTrue( lock.isHeldByCurrentThread() );
             }
             for ( int i = 0; i < 9; i++ ) {
                 lock.unlock();
                 assertEquals( Thread.currentThread(), lock.getOwner() );
                 assertTrue( lock.isHeldByCurrentThread() );
             }
             lock.unlock();
             assertNull( lock.getOwner() );
             assertFalse( lock.isHeldByCurrentThread() );
        } catch ( InterruptedException e ) {
            fail( e.toString() );
        }
     }

     @Test
     public void testTryLockLongTimeUnit() throws InterruptedException {
         Thread lockThread = LockingThread.createThread( lock, Long.MAX_VALUE );
         assertEquals( lockThread, lock.getOwner() );
         assertFalse( lock.isHeldByCurrentThread() );
         assertFalse( lock.tryLock( 200, TimeUnit.MILLISECONDS ) );
         lockThread.interrupt(); // release the lock
         Thread.sleep( 100 ); // give lockThread a chance to run
         assertNull( lock.getOwner() );
         assertFalse( lock.isHeldByCurrentThread() );
         lockThread = LockingThread.createThread( lock, 1000 );
         assertEquals( lockThread, lock.getOwner() );
         assertFalse( lock.isHeldByCurrentThread() );
         assertTrue( lock.tryLock( 2, TimeUnit.SECONDS ) );
         assertTrue( lock.isHeldByCurrentThread() );
         lock.unlock();
         assertNull( lock.getOwner() );
         assertFalse( lock.isHeldByCurrentThread() );
     }
}


text:
using System.Text.Json.Serialization;

namespace CoreDocker.Shared.Models.Auth
{
    public class TokenResponseModel
    {
        [JsonPropertyName("access_token")]
        public string AccessToken { get; init; } = default!;

        [JsonPropertyName("token_type")]
        public string TokenType { get; init; } = default!;

        [JsonPropertyName("expires_in")]
        public int ExpiresIn { get; init; } = 0;
    }
}


text:
import { Answer } from '../../models/answer.model';
import * as actions from './answer.actions';
import Helper from '../helper';

const helper = new Helper();

export interface State {
  entities: Answer[];
  isLoading;
  groupedAnswers;
  isIndexedDBOpen;
}

export const initialState: State = {
  entities: [],
  isLoading: false,
  groupedAnswers: {},
  isIndexedDBOpen: false,
};

export function reducer(state = initialState, action: any): State {
  let newEntities;
  switch (action.type) {
    case actions.ActionTypes.LOAD:
    case actions.ActionTypes.UPDATE:
    case actions.ActionTypes.DELETE:
    case actions.ActionTypes.CREATE:
    case actions.ActionTypes.DELETE_ALL: {
      return { ...state, isLoading: true };
    }
    case actions.ActionTypes.OPEN_INDEXED_DB_SUCCESS: {
      return { ...state, isIndexedDBOpen: true };
    }
    case actions.ActionTypes.LOAD_SUCCESS:
      return {
        ...state,
        entities: action.payload,
        groupedAnswers: helper.groupAnswersByDate(action.payload),
        isLoading: false,
      };
    case actions.ActionTypes.UPDATE_SUCCESS:
      newEntities = onUpdateAnswer(state.entities, action.payload);
      return {
        ...state,
        entities: newEntities,
        groupedAnswers: helper.groupAnswersByDate(newEntities),
        isLoading: false,
      };
    case actions.ActionTypes.DELETE_SUCCESS:
      newEntities = onDeleteAnswer(state.entities, action.payload);
      return {
        ...state,
        entities: newEntities,
        groupedAnswers: helper.groupAnswersByDate(newEntities),
        isLoading: false,
      };
    case actions.ActionTypes.CREATE_SUCCESS:
      newEntities = onCreateAnswer(state.entities, action.payload);
      return {
        ...state,
        entities: newEntities,
        groupedAnswers: helper.groupAnswersByDate(newEntities),
        isLoading: false,
      };
    case actions.ActionTypes.DELETE_ALL_SUCCESS:
      return {
        ...state,
        entities: [],
        groupedAnswers: [],
        isLoading: false,
      };
    default: {
      return state;
    }
  }
}

function onUpdateAnswer(answers, answerToUpdate) {
  return answers.map(answer => {
    if (answer.id === answerToUpdate.id) {
      answer = { ...answerToUpdate };
    }
    return answer;
  });
}

function onDeleteAnswer(answers, answerToDelete) {
  return answers.filter(answer => {
    return answer.id !== answerToDelete;
  });
}

function onCreateAnswer(answers, answerToAdd) {
  return [...(answers || []), answerToAdd];
}

function onDeleteAllAnswers(answers) {
  return [];
}


text:
package com.pureperfect.purview.validators.net;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.pureperfect.purview.ValidationProblem;

/**
 * Mark a field as an IP address.
 *
 *

 * E.G:
 *

 *
 *

 *
 * public class MyClass
 * {
 *  //When validating fields
 *  @IPAddress
 *  private String value;
 *
 *  ...//or
 *
 *  //When validating method return values
 *  @IPAddress
 *  public String getValue() {
 *    ...
 *  };
 *
 *  ...//or
 *
 *  //When validating method parameters
 *  public static void foo(@IPAddress String bar) {
 *    ...
 *  }
 * }
 *

 *
 * @author J. Chris Folsom
 * @version 1.1
 * @since 1.0
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(
{ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER })
public @interface IPAddress
{
	/**
	 * Indicates an IP address is not valid.
	 *
	 * @author J. Chris Folsom
	 * @version 1.1
	 * @since 1.0
	 */
	public class Problem extends
			ValidationProblem<Object, IPAddress, Object, CharSequence>
	{
		Problem(final Object instance, final IPAddress annotation,
				final Object target, final CharSequence value)
		{
			super(instance, annotation, target, value);
		}
	}

	/**
	 * Validator for IP address.
	 *
	 * @author J. Chris Folsom
	 * @version 1.1
	 * @since 1.0
	 */
	public class Validator
			implements
			com.pureperfect.purview.Validator<Problem, Object, IPAddress, Object, CharSequence>
	{
        /**
         * {@inheritDoc}
         */
		public Problem validate(final Object instance,
				final IPAddress annotation, final Object target,
				final CharSequence address)
		{

			if (address == null || address.length() < 1)
			{
				if (annotation.required())
				{
					return new Problem(instance, annotation, target, address);
				}

				return null;
			}

			final String s = address.toString();

			final String[] octets = s.split("\\.");

			if (octets.length != 4)
			{
				return new Problem(instance, annotation, target, address);
			}

			for (final String o : octets)
			{
				if (!ValidationRoutines.isValidOctet(o))
				{
					return new Problem(instance, annotation, target, address);
				}
			}

			return null;
		}
	}

	/**
	 * Optional message key to use to define an i18n message.
	 *
	 * @return Optional message key to use to define an i18n message.
	 */
	String messageKey() default "";

	/**
	 * Whether or not the field is required. If it is not required, null values
	 * and empty strings will be allowed.
	 *
	 * @return Whether or not the field is required.
	 */
	boolean required() default false;

	/**
	 * The {@link IPAddress.Validator Validator} for this annotation.
	 *
	 * @return {@link IPAddress.Validator}
	 */
	Class<?> validator() default Validator.class;
}


text:
\newcommand{\fhbig}{1.6cm}
\newcommand{\fwbig}{1.8cm}
\newcommand{\kernpic}[1]{\includegraphics[height=\fhbig,width=\fwbig]{../figures/structure_examples/#1}}
\newcommand{\kernpicr}[1]{\rotatebox{90}{\includegraphics[height=\fwbig,width=\fhbig]{../figures/structure_examples/#1}}}
\newcommand{\addkernpic}[1]{{\includegraphics[height=\fhbig,width=\fwbig]{../figures/additive_multi_d/#1}}}
\newcommand{\largeplus}{\tabbox{{\Large+}}}
\newcommand{\largeeq}{\tabbox{{\Large=}}}
\newcommand{\largetimes}{\tabbox{{\Large$\times$}}}
\begin{figure}
\centering
\renewcommand{\tabularxcolumn}[1]{>{\arraybackslash}m{#1}}
%\begin{tabular}{m{\fwbig}m{0.01\textwidth}m{\fwbig}m{0.01\textwidth}m{\fwbig}m{\fwbig}m{\fwbig}}
%\begin{tabular}{C{\fwbig}C{\fwbig}C{\fwbig}C{\fwbig}}%{m{\fwbig}m{\fwbig}m{\fwbig}}
\begin{tabularx}{\columnwidth}{XXXX}
%Composite & Draws from \gp{} & \gp{} posterior \\ \toprule
  \kernpic{se_kernel} & \kernpic{se_kernel_draws}
& \kernpic{per_kernel} & \kernpic{per_kernel_draws}
\\
  {\small Squared-exp (SE)} & {\small local variation}
& {\small Periodic (Per)} & {\small repeating structure}
\\
\midrule
  \kernpic{lin_kernel} & \kernpic{lin_kernel_draws}
& \kernpic{rq_kernel} & \kernpic{rq_kernel_draws}
\\
  {\small Linear (Lin)} & {\small linear functions}
& {\small Rational-Quadratic(RQ)} & {\small slow variation}
\\
\midrule
  \kernpic{se_times_per} & \kernpic{se_times_per_draws}
& \kernpic{lin_times_lin} & \kernpic{lin_times_lin_draws}
\\
  {\small SE  $\times$ Per} & {\small local periodic}
& {\small Lin $\times$ Lin} & {\small quadratic functions}
\\
\midrule
  \kernpic{se_plus_per} & \kernpic{se_plus_per_draws}
& \kernpic{lin_plus_per} & \kernpic{lin_plus_per_draws}
\\
  {\small SE + Per } & {\small periodic with noise}
& {\small Lin + Per} & {\small trend with period}
\\
\midrule
  \kernpic{se_times_lin} & \kernpic{se_times_lin_draws}
& \kernpic{lin_times_per} & \kernpic{lin_times_per_draws}
\\
  {\small Lin $\times$ SE} & {\small increasing variation}
& {\small Lin $\times$ Per} & {\small growing amplitude}
\\
\midrule
  \addkernpic{additive_kernel} & \addkernpic{additive_kernel_draw_sum}
& \addkernpic{sqexp_kernel}  & \addkernpic{sqexp_draw}
\\
  {\small $SE_1 + SE_2$} & {\small $f_1(x_1) + f_2(x_2)$}
& {\small $SE_1 \times SE_2$} & {\small $f(x_1, x_2)$}
\end{tabularx}
\caption{ Examples of structures expressible by
  composite kernels.
%The x-axis has the same scale for all plots.
  Left column and third columns: base and composite kernels.  Second and fourth columns: draws from a \gp{} with each repective kernel.  The x-axis has the same range on all plots.}
\label{fig:kernels}
\end{figure}


text:
namespace Glyph3
{
	class EvtMouseMove : public EvtMouseMsg
	{
	public:
		EvtMouseMove( HWND hwnd, unsigned int wparam, long lparam );
		virtual ~EvtMouseMove( );

		virtual std::wstring GetEventName( );
		virtual eEVENT GetEventType( );
	};

	typedef std::shared_ptr<EvtMouseMove> EvtMouseMovePtr;
};
//--------------------------------------------------------------------------------
#endif // EvtMouseMove_h


text:
layout: feature
title: 'Nomzr'
shortdef: 'nominalizer'
udver: '2'
---

  Values:
  Circ
  Pas
  DevPass
  Ag
  Rel
  CCirc
  Hab

### `Circ`: Circumstance

The nominalizer of circumstance can be roughly translated as 'way / place of x'

#### Examples

* _juká-saβ-a _ "way / place of killing"

### `Pas`: Pasive

The passive

#### Examples

* _i-juká-pɨr-a _ "the one who is/must be killed"

### `DevPass`: Deverbal Pasive

The passive deverbalizer prefix _emi-_ is a nominalizer with passive meaning. It is actually non different than the passive nominalizer suffix _-pɨr_ .

#### Examples

* _-emi-motar-a _ "wanted thing?"

### `Ag`: Agent

The agent nominalizer

#### Examples

* _juká-sar-a _ "way / Kill-er"

### `Rel`: Relativizer

The nominalizer of circumstance can be roughly translated as 'way / place of x'

#### Examples

* _juká-saβ-a _ "way / place of killing"

### `CCirc`: Complement of circunstance

The complement of circumstance 'the one who is (in)'

#### Examples

* _ɨβakɨpendwara _ "the one who is in heaven/in the sky"

### `Hab`: Habitual

The habitual nominalizer indicates that the subject often does X

#### Examples

* _kaɲem-βor _ "one who often flees"

## Diffs

### Prague Dependency Treebank

The PDT tagset does not distinguish `Ptan` from `Plur` and `Coll` from `Sing`,
therefore this distinction is not being made in the converted data.


text:
<!DOCTYPE html>

    <title>HelloWorld</title>
    <meta id="viewport" name="viewport" content="user-scalable=no, width=device-width" />
    <link href="styles.css" rel="stylesheet" type="text/css" />

Hello world, where am I?

            <button type="button" id="btnGPSDefault" onClick="getPosition('')">Get my coordinates</button>


text:
package com.nymph.annotation;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
 * Http协议的Post请求方式
 * @author LiuYang
 * @author LiangTianDong
 * @date 2017年10月22日下午3:18:25
 */
@Retention(RUNTIME)
@Target(METHOD)
@Request
public @interface POST {

	/**
	 * url的路径
	 * @return
	 */
	String value() default "";
}


text:
export let error;
try {
	require("remote/invalid");
} catch (err) {
	error = err;
}


text:
/*
 * This file is generated by jOOQ.
*/
package com.showka.table.public_.tables;

import com.showka.table.public_.Keys;
import com.showka.table.public_.Public;
import com.showka.table.public_.tables.records.T_URIAGE_RECORD;

import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;

import javax.annotation.Generated;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.TableImpl;

/**
 * This class is generated by jOOQ.
 */
@Generated(
    value = {
        "http://www.jooq.org",
        "jOOQ version:3.10.6"
    },
    comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class T_URIAGE extends TableImpl<T_URIAGE_RECORD> {

    private static final long serialVersionUID = 430294145;

    /**
     * The reference instance of PUBLIC.T_URIAGE
     */
    public static final T_URIAGE t_uriage = new T_URIAGE();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<T_URIAGE_RECORD> getRecordType() {
        return T_URIAGE_RECORD.class;
    }

    /**
     * The column PUBLIC.T_URIAGE.DENPYO_NUMBER.
     */
    public final TableField<T_URIAGE_RECORD, String> denpyo_number = createField("DENPYO_NUMBER", org.jooq.impl.SQLDataType.VARCHAR(5).nullable(false), this, "");

    /**
     * The column PUBLIC.T_URIAGE.KOKYAKU_ID.
     */
    public final TableField<T_URIAGE_RECORD, String> kokyaku_id = createField("KOKYAKU_ID", org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column PUBLIC.T_URIAGE.CREATE_FUNCTION.
     */
    public final TableField<T_URIAGE_RECORD, String> create_function = createField("CREATE_FUNCTION", org.jooq.impl.SQLDataType.VARCHAR(2147483647).nullable(false).defaultValue(org.jooq.impl.DSL.field("'default'", org.jooq.impl.SQLDataType.VARCHAR)), this, "");

    /**
     * The column PUBLIC.T_URIAGE.CREATE_TIMESTAMP.
     */
    public final TableField<T_URIAGE_RECORD, LocalDateTime> create_timestamp = createField("CREATE_TIMESTAMP", org.jooq.impl.SQLDataType.LOCALDATETIME.nullable(false).defaultValue(org.jooq.impl.DSL.field("CURRENT_TIMESTAMP()", org.jooq.impl.SQLDataType.LOCALDATETIME)), this, "");

    /**
     * The column PUBLIC.T_URIAGE.CREATE_USER_ID.
     */
    public final TableField<T_URIAGE_RECORD, String> create_user_id = createField("CREATE_USER_ID", org.jooq.impl.SQLDataType.VARCHAR(2147483647).nullable(false).defaultValue(org.jooq.impl.DSL.field("'default'", org.jooq.impl.SQLDataType.VARCHAR)), this, "");

    /**
     * The column PUBLIC.T_URIAGE.RECORD_ID.
     */
    public final TableField<T_URIAGE_RECORD, String> record_id = createField("RECORD_ID", org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column PUBLIC.T_URIAGE.UPDATE_FUNCTION.
     */
    public final TableField<T_URIAGE_RECORD, String> update_function = createField("UPDATE_FUNCTION", org.jooq.impl.SQLDataType.VARCHAR(2147483647).nullable(false).defaultValue(org.jooq.impl.DSL.field("'default'", org.jooq.impl.SQLDataType.VARCHAR)), this, "");

    /**
     * The column PUBLIC.T_URIAGE.UPDATE_TIMESTAMP.
     */
    public final TableField<T_URIAGE_RECORD, LocalDateTime> update_timestamp = createField("UPDATE_TIMESTAMP", org.jooq.impl.SQLDataType.LOCALDATETIME.nullable(false).defaultValue(org.jooq.impl.DSL.field("CURRENT_TIMESTAMP()", org.jooq.impl.SQLDataType.LOCALDATETIME)), this, "");

    /**
     * The column PUBLIC.T_URIAGE.UPDATE_USER_ID.
     */
    public final TableField<T_URIAGE_RECORD, String> update_user_id = createField("UPDATE_USER_ID", org.jooq.impl.SQLDataType.VARCHAR(2147483647).nullable(false).defaultValue(org.jooq.impl.DSL.field("'default'", org.jooq.impl.SQLDataType.VARCHAR)), this, "");

    /**
     * The column PUBLIC.T_URIAGE.VERSION.
     */
    public final TableField<T_URIAGE_RECORD, Integer> version = createField("VERSION", org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("1", org.jooq.impl.SQLDataType.INTEGER)), this, "");

    /**
     * The column PUBLIC.T_URIAGE.HANBAI_KUBUN.
     */
    public final TableField<T_URIAGE_RECORD, String> hanbai_kubun = createField("HANBAI_KUBUN", org.jooq.impl.SQLDataType.VARCHAR(2).nullable(false), this, "");

    /**
     * The column PUBLIC.T_URIAGE.KEIJO_DATE.
     */
    public final TableField<T_URIAGE_RECORD, LocalDateTime> keijo_date = createField("KEIJO_DATE", org.jooq.impl.SQLDataType.LOCALDATETIME.nullable(false), this, "");

    /**
     * The column PUBLIC.T_URIAGE.SHOHIZEIRITSU.
     */
    public final TableField<T_URIAGE_RECORD, Double> shohizeiritsu = createField("SHOHIZEIRITSU", org.jooq.impl.SQLDataType.DOUBLE.nullable(false), this, "");

    /**
     * The column PUBLIC.T_URIAGE.URIAGE_DATE.
     */
    public final TableField<T_URIAGE_RECORD, LocalDateTime> uriage_date = createField("URIAGE_DATE", org.jooq.impl.SQLDataType.LOCALDATETIME.nullable(false), this, "");

    /**
     * Create a PUBLIC.T_URIAGE table reference
     */
    public T_URIAGE() {
        this(DSL.name("T_URIAGE"), null);
    }

    /**
     * Create an aliased PUBLIC.T_URIAGE table reference
     */
    public T_URIAGE(String alias) {
        this(DSL.name(alias), t_uriage);
    }

    /**
     * Create an aliased PUBLIC.T_URIAGE table reference
     */
    public T_URIAGE(Name alias) {
        this(alias, t_uriage);
    }

    private T_URIAGE(Name alias, Table<T_URIAGE_RECORD> aliased) {
        this(alias, aliased, null);
    }

    private T_URIAGE(Name alias, Table<T_URIAGE_RECORD> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, "");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Schema getSchema() {
        return Public.PUBLIC;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public UniqueKey<T_URIAGE_RECORD> getPrimaryKey() {
        return Keys.CONSTRAINT_4D;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<UniqueKey<T_URIAGE_RECORD>> getKeys() {
        return Arrays.<UniqueKey<T_URIAGE_RECORD>>asList(Keys.CONSTRAINT_4D, Keys.UK_9F7L0VVJA040FK4UIR58IBQUN);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<ForeignKey<T_URIAGE_RECORD, ?>> getReferences() {
        return Arrays.<ForeignKey<T_URIAGE_RECORD, ?>>asList(Keys.FK12V4JQQCK1CDREC88PF37AU7D);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public T_URIAGE as(String alias) {
        return new T_URIAGE(DSL.name(alias), this);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public T_URIAGE as(Name alias) {
        return new T_URIAGE(alias, this);
    }

    /**
     * Rename this table
     */
    @Override
    public T_URIAGE rename(String name) {
        return new T_URIAGE(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public T_URIAGE rename(Name name) {
        return new T_URIAGE(name, null);
    }
}


text:
<?php

/**
 * @namespace
 */
namespace Zend\Crypt;

/**
 * @uses       Zend\Crypt\Rsa\PrivateKey
 * @uses       Zend\Crypt\Rsa\PublicKey
 * @category   Zend
 * @package    Zend_Crypt
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Rsa
{
    const BINARY = 'binary';
    const BASE64 = 'base64';

    protected $_privateKey;

    protected $_publicKey;

    /**
     * @var string
     */
    protected $_pemString;

    protected $_pemPath;

    protected $_certificateString;

    protected $_certificatePath;

    protected $_hashAlgorithm;

    protected $_passPhrase;

    /**
     * Class constructor
     *
     * @param array $options
     * @throws Zend\Crypt\Rsa\Exception
     */
    public function __construct(array $options = null)
    {
        if (!extension_loaded('openssl')) {
            throw new \Zend\Crypt\Rsa\Exception('Zend_Crypt_Rsa requires openssl extention to be loaded.');
        }

        // Set _hashAlgorithm property when we are sure, that openssl extension is loaded
        // and OPENSSL_ALGO_SHA1 constant is available
        $this->_hashAlgorithm = OPENSSL_ALGO_SHA1;

        if (isset($options)) {
            $this->setOptions($options);
        }
    }

    public function setOptions(array $options)
    {
        if (isset($options['passPhrase'])) {
            $this->_passPhrase = $options['passPhrase'];
        }
        foreach ($options as $option => $value) {
            switch ($option) {
                case 'pemString':
                    $this->setPemString($value);
                    break;
                case 'pemPath':
                    $this->setPemPath($value);
                    break;
                case 'certificateString':
                    $this->setCertificateString($value);
                    break;
                case 'certificatePath':
                    $this->setCertificatePath($value);
                    break;
                case 'hashAlgorithm':
                    $this->setHashAlgorithm($value);
                    break;
            }
        }
    }

    public function getPrivateKey()
    {
        return $this->_privateKey;
    }

    public function getPublicKey()
    {
        return $this->_publicKey;
    }

    /**
     * @param  string $data
     * @param  Zend\Crypt\Rsa\PrivateKey $privateKey
     * @param  string $format
     * @return string
     */
    public function sign($data, Rsa\PrivateKey $privateKey = null, $format = null)
    {
        $signature = '';
        if (isset($privateKey)) {
            $opensslKeyResource = $privateKey->getOpensslKeyResource();
        } else {
            $opensslKeyResource = $this->_privateKey->getOpensslKeyResource();
        }
        $result = openssl_sign(
            $data, $signature,
            $opensslKeyResource,
            $this->getHashAlgorithm()
        );
        if ($format == self::BASE64) {
            return base64_encode($signature);
        }
        return $signature;
    }

    /**
     * @param  string $data
     * @param  string $signature
     * @param  string $format
     * @return string
     */
    public function verifySignature($data, $signature, $format = null)
    {
        if ($format == self::BASE64) {
            $signature = base64_decode($signature);
        }
        $result = openssl_verify($data, $signature,
            $this->getPublicKey()->getOpensslKeyResource(),
            $this->getHashAlgorithm());
        return $result;
    }

    /**
     * @param string $data
     * @param Zend\Crypt\Rsa\Key $key
     * @param string $format
     * @return string
     */
    public function encrypt($data, Rsa\Key $key, $format = null)
    {
        $encrypted = '';
        $function = 'openssl_public_encrypt';
        if ($key instanceof Rsa\PrivateKey) {
            $function = 'openssl_private_encrypt';
        }
        $function($data, $encrypted, $key->getOpensslKeyResource());
        if ($format == self::BASE64) {
            return base64_encode($encrypted);
        }
        return $encrypted;
    }

    /**
     * @param string $data
     * @param \Zend\Crypt\Rsa\Key $key
     * @param string $format
     * @return string
     */
    public function decrypt($data, Rsa\Key $key, $format = null)
    {
        $decrypted = '';
        if ($format == self::BASE64) {
            $data = base64_decode($data);
        }
        $function = 'openssl_private_decrypt';
        if ($key instanceof Rsa\PublicKey) {
            $function = 'openssl_public_decrypt';
        }
        $function($data, $decrypted, $key->getOpensslKeyResource());
        return $decrypted;
    }

    public function generateKeys(array $configargs = null)
    {
        $config     = array();
        $passPhrase = $this->_passPhrase;
        $private    = $this->getPrivateKey();
        if ($configargs !== null) {
            if (isset($configargs['passPhrase'])) {
                $passPhrase = $configargs['passPhrase'];
                unset($configargs['passPhrase']);
            }
            $config = $this->_parseConfigArgs($configargs);
        }

        $privateKey = null;
        $publicKey  = null;
        $resource   = openssl_pkey_new($config);
        // above fails on PHP 5.3

        openssl_pkey_export($resource, $private, $passPhrase);

        $privateKey = new Rsa\PrivateKey($private, $passPhrase);
        $details    = openssl_pkey_get_details($resource);
        $publicKey  = new Rsa\PublicKey($details['key']);
        $return     = new \ArrayObject(array(
           'privateKey' => $privateKey,
           'publicKey'  => $publicKey
        ), \ArrayObject::ARRAY_AS_PROPS);
        return $return;
    }

    /**
     * @param string $value
     */
    public function setPemString($value)
    {
        $this->_pemString = $value;
        try {
            $this->_privateKey = new Rsa\PrivateKey($this->_pemString, $this->_passPhrase);
            $this->_publicKey = $this->_privateKey->getPublicKey();
        } catch (Exception $e) {
            $this->_privateKey = null;
            $this->_publicKey = new Rsa\PublicKey($this->_pemString);
        }
    }

    public function setPemPath($value)
    {
        $this->_pemPath = $value;
        $this->setPemString(file_get_contents($this->_pemPath));
    }

    public function setCertificateString($value)
    {
        $this->_certificateString = $value;
        $this->_publicKey = new Rsa\PublicKey($this->_certificateString, $this->_passPhrase);
    }

    public function setCertificatePath($value)
    {
        $this->_certificatePath = $value;
        $this->setCertificateString(file_get_contents($this->_certificatePath));
    }

    /**
     * @param string $name
     * @throws \Zend\Crypt\Exception
     */
    public function setHashAlgorithm($name)
    {
        switch (strtolower($name)) {
            case 'md2':
                // check if md2 digest is enabled on openssl just for backwards compatibility
                $digests = openssl_get_md_methods();
                if (!in_array(strtoupper($name), $digests)) {
                    throw new Zend\Crypt\Exception('Openssl md2 digest is not enabled  (deprecated)');
                }
                $this->_hashAlgorithm = OPENSSL_ALGO_MD2;
                break;
            case 'md4':
                $this->_hashAlgorithm = OPENSSL_ALGO_MD4;
                break;
            case 'md5':
                $this->_hashAlgorithm = OPENSSL_ALGO_MD5;
                break;
            case 'sha1':
                $this->_hashAlgorithm = OPENSSL_ALGO_SHA1;
                break;
            case 'dss1':
                $this->_hashAlgorithm = OPENSSL_ALGO_DSS1;
                break;
        }
    }

    /**
     * @return string
     */
    public function getPemString()
    {
        return $this->_pemString;
    }

    public function getPemPath()
    {
        return $this->_pemPath;
    }

    public function getCertificateString()
    {
        return $this->_certificateString;
    }

    public function getCertificatePath()
    {
        return $this->_certificatePath;
    }

    public function getHashAlgorithm()
    {
        return $this->_hashAlgorithm;
    }

    protected function _parseConfigArgs(array $config = null)
    {
        $configs = array();
        if (isset($config['privateKeyBits'])) {
            $configs['private_key_bits'] = $config['privateKeyBits'];
        }
        if (!empty($configs)) {
            return $configs;
        }
        return null;
    }

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. Soc. mycol. Fr. 48: 61 (1932)

#### Original name
Aleuria granulosa f. laricina R. Heim & L. Remy, 1932

### Remarks
null


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Podosporium glandicola Schwein.

### Remarks
null


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

namespace EED.Service.Controller.District_Type
{
    public interface IDistrictTypeServiceController
    {
        IEnumerable<DistrictType> FindAllDistrictTypesFromProject(int projectId);
        DistrictType FindDistrictType(int id);
        IEnumerable<DistrictType> FilterDistrictTypes(IEnumerable<DistrictType> districtTypes,
            string searchText);
        void SaveDistrictType(DistrictType districtType);
        void DeleteDistrictType(DistrictType districtType);
    }
}


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

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
Uses of Class org.springframework.security.providers.UsernamePasswordAuthenticationToken (Spring Security 2.0.4 API)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

Spring Security Framework

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.springframework.security.providers.UsernamePasswordAuthenticationToken

Packages that use UsernamePasswordAuthenticationToken

org.springframework.security.providers.dao
An authentication provider that relies upon a data access object.

org.springframework.security.providers.jaas
An authentication provider for JAAS.

org.springframework.security.providers.ldap

The LDAP authentication provider package.

org.springframework.security.ui.ntlm

org.springframework.security.ui.webapp
Authenticates users via HTTP properties, headers and session.

Uses of UsernamePasswordAuthenticationToken in org.springframework.security.providers.dao

Methods in org.springframework.security.providers.dao with parameters of type UsernamePasswordAuthenticationToken

protected  void
DaoAuthenticationProvider.additionalAuthenticationChecks(UserDetails userDetails,
                               UsernamePasswordAuthenticationToken authentication)

protected abstract  void
AbstractUserDetailsAuthenticationProvider.additionalAuthenticationChecks(UserDetails userDetails,
                               UsernamePasswordAuthenticationToken authentication)

          Allows subclasses to perform any additional checks of a returned (or cached) UserDetails
 for a given authentication request.

protected  UserDetails
DaoAuthenticationProvider.retrieveUser(String username,
             UsernamePasswordAuthenticationToken authentication)

protected abstract  UserDetails
AbstractUserDetailsAuthenticationProvider.retrieveUser(String username,
             UsernamePasswordAuthenticationToken authentication)

          Allows subclasses to actually retrieve the UserDetails from an implementation-specific
 location, with the option of throwing an AuthenticationException immediately if the presented
 credentials are incorrect (this is especially useful if it is necessary to bind to a resource as the user in
 order to obtain or generate a UserDetails).

Uses of UsernamePasswordAuthenticationToken in org.springframework.security.providers.jaas

Subclasses of UsernamePasswordAuthenticationToken in org.springframework.security.providers.jaas

 class
JaasAuthenticationToken

          UsernamePasswordAuthenticationToken extension to carry the Jaas LoginContext that the user was logged into

Methods in org.springframework.security.providers.jaas with parameters of type UsernamePasswordAuthenticationToken

protected  void
JaasAuthenticationProvider.publishFailureEvent(UsernamePasswordAuthenticationToken token,
                    SpringSecurityException ase)

          Publishes the JaasAuthenticationFailedEvent.

protected  void
JaasAuthenticationProvider.publishSuccessEvent(UsernamePasswordAuthenticationToken token)

          Publishes the JaasAuthenticationSuccessEvent.

Uses of UsernamePasswordAuthenticationToken in org.springframework.security.providers.ldap

Methods in org.springframework.security.providers.ldap with parameters of type UsernamePasswordAuthenticationToken

protected  Authentication
LdapAuthenticationProvider.createSuccessfulAuthentication(UsernamePasswordAuthenticationToken authentication,
                               UserDetails user)

Uses of UsernamePasswordAuthenticationToken in org.springframework.security.ui.ntlm

Subclasses of UsernamePasswordAuthenticationToken in org.springframework.security.ui.ntlm

 class
NtlmUsernamePasswordAuthenticationToken

          An NTLM-specific UsernamePasswordAuthenticationToken that allows any provider to bypass the problem of an
 empty password since NTLM does not retrieve the user's password from the PDC.

Uses of UsernamePasswordAuthenticationToken in org.springframework.security.ui.webapp

Methods in org.springframework.security.ui.webapp with parameters of type UsernamePasswordAuthenticationToken

protected  void
AuthenticationProcessingFilter.setDetails(HttpServletRequest request,
           UsernamePasswordAuthenticationToken authRequest)

          Provided so that subclasses may configure what is put into the authentication request's details
 property.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

Spring Security Framework

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2004-2008 SpringSource, Inc. All Rights Reserved.


text:
layout: sieutv
title: CN 14
tags: [CNtv]
thumb_re: otvcloud14
---
{% include otvcloud key="14" %}


text:
var Case = require('Case');
const DOM = require('DOM');
var LabelMustBeUnique = {
  run: function (test) {
    var labels = {};
    test.get('scope').forEach(function (scope) {
      let labelElements = DOM.scry('label[for]', scope);

      labelElements.forEach(function (element) {
        if (typeof labels[DOM.getAttribute(element, 'for')] === 'undefined') {
          labels[DOM.getAttribute(element, 'for')] = 0;
        }
        labels[DOM.getAttribute(element, 'for')]++;
      });

      labelElements.forEach(function (element) {
        var _case = Case({
          element: element,
          status: (labels[DOM.getAttribute(element, 'for')] === 1) ?
            'passed' :
            'failed'
        });
        test.add(_case);
      });
    });
  },

  meta: {
    testability: 1,
    title: {
      en: 'Every form input must have only one label',
      nl: 'Elk formulierinvoerveld heeft maar een label'
    },
    description: {
      en: 'Each form input should have only one label element.',
      nl: 'Elk formulierinvoerveld mag maar een label element hebben.'
    },
    guidelines: {
      wcag: {
        '1.3.1': {
          techniques: [
            'F17'
          ]
        },
        '4.1.1': {
          techniques: [
            'F17'
          ]
        }
      }
    },
    tags: [
      'form',
      'content'
    ]
  }
};
module.exports = LabelMustBeUnique;


text:
from sklearn.model_selection import GridSearchCV

def runGS(data, modelCore, modelOpt, parLabel, parRange, seqRegions, k=5, kInner= 4, pw=False, shuffle=True):

	dfDataset, featureBox = fu.CreateFeaturesFromData(data, seqRegions, pw, shuffle=shuffle)
	X = featureBox.values
	y = [math.sqrt(math.sqrt(u)) for u in dfDataset['mean_score']]

	parModel = mu.SetupModel(modelCore, modelOpt)
	parSet = mu.GetParameterSet(parLabel, parRange)

	model = mu.SelectModel(**parModel)
	GS = GridSearchCV(model, parSet, cv=k)
	GS.fit(X,y)

	fig1, ax = pu.ScatterPvT(GS, X, y)
	figures = [fig1]
	if len(parLabel) is 2:
		fig2, ax = pu.HeatmapCVDoublePar(GS)
		figures.append(fig2)
	if len(parLabel) is 1:
		fig2, ax = pu.HeatmapCVDoublePar(GS)
		figures.append(fig2)

	results = [str(GS.best_estimator_.get_params()),str(GS.best_score_),str(GS.cv_results_)]

	return results, figures


text:
import time
import sys
import os
import ultrasound
import obstacle
import relay_control
import controller
import json

sys.path.append("../pms5003t")
import weather_sensor

if __name__ == "__main__":
    distance = ultrasound.get_distance()
    obstacles = obstacle.has_obstacles()
    relay_status = relay_control.relay_status()
    motion = controller.motion_detect()
    # pm25=weather_sensor.readData()
    pm25 = None
    value = {"distance": distance, "obstacles": obstacles, "relay_on": relay_status, "motion_detected": motion,
             "weather": pm25}
    value = json.dumps(value, ensure_ascii=False)
    print(value)


text:
module Rotunda

  def rounded_link_to(name, options={}, html_options=nil)
    content_tag(:div, link_to("#{name}", options, html_options), :class => "rounded")
  end

  def rounded_link_to_function(name, *args, &block)
    content_tag(:div, link_to_function("#{name}", *args, &block), :class => "rounded")
  end

  def rounded_button(label)
    content_tag(:div, "<button>#{label}</button>", :class => "rounded")
  end

end