text:
package org.codehaus.mojo.keytool.requests;

import java.io.File;

/**
 * Request Fixtures.
 *
 * @author tchemit
 * @since 1.3
 */
public class KeyToolRequestFixtures
{
    /**
     *
createKeyToolChangeAliasRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolChangeAliasRequest} object
     */
    public KeyToolChangeAliasRequest createKeyToolChangeAliasRequest( File keyStore )
    {
        KeyToolChangeAliasRequest request = new KeyToolChangeAliasRequest();
        request.setAlias( "foo_alias" );
        request.setDestalias( "new_alias" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setKeypass( "key-passwd" );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolPrintCRLFileRequest.

     *
     * @param file a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolPrintCRLFileRequest} object
     */
    public KeyToolPrintCRLFileRequest createKeyToolPrintCRLFileRequest( File file )
    {
        KeyToolPrintCRLFileRequest request = new KeyToolPrintCRLFileRequest();

        request.setFile( file );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolPrintCertificateRequestRequest.

     *
     * @param file a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolPrintCertificateRequestRequest} object
     */
    public KeyToolPrintCertificateRequestRequest createKeyToolPrintCertificateRequestRequest( File file )
    {
        KeyToolPrintCertificateRequestRequest request = new KeyToolPrintCertificateRequestRequest();

        request.setFile( file );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolPrintCertificateRequest.

     *
     * @param file a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolPrintCertificateRequest} object
     */
    public KeyToolPrintCertificateRequest createKeyToolPrintCertificateRequest( File file )
    {
        KeyToolPrintCertificateRequest request = new KeyToolPrintCertificateRequest();

        request.setFile( file );

        request.setVerbose( true );
        request.setRfc( true );
        return request;
    }

    /**
     *
createKeyToolListRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolListRequest} object
     */
    public KeyToolListRequest createKeyToolListRequest( File keyStore )
    {
        KeyToolListRequest request = new KeyToolListRequest();
        request.setAlias( "foo_alias" );

        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setVerbose( true );
        request.setRfc( false );
        return request;
    }

    /**
     *
createKeyToolImportKeystoreRequest.

     *
     * @param srcKeyStore a {@link java.io.File} object
     * @param destKeyStore a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolImportKeystoreRequest} object
     */
    public KeyToolImportKeystoreRequest createKeyToolImportKeystoreRequest( File srcKeyStore, File destKeyStore )
    {
        KeyToolImportKeystoreRequest request = new KeyToolImportKeystoreRequest();

        request.setSrcalias( "foo_alias" );
        request.setDestalias( "new_alias" );

        request.setSrcstoretype( "jks" );
        request.setDeststoretype( "jks" );

        request.setSrcstorepass( "changeit" );
        request.setDeststorepass( "changeit" );

        request.setSrckeystore( srcKeyStore.getAbsolutePath() );
        request.setDestkeystore( destKeyStore.getAbsolutePath() );

        request.setSrckeypass( "key-passwd" );
        request.setDestkeypass( "key-passwd" );
        request.setVerbose( true );
        request.setNoprompt( true );
        return request;
    }

    /**
     *
createKeyToolImportCertificateRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @param file a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolImportCertificateRequest} object
     */
    public KeyToolImportCertificateRequest createKeyToolImportCertificateRequest( File keyStore, File file )
    {
        KeyToolImportCertificateRequest request = new KeyToolImportCertificateRequest();
        request.setAlias( "foo_alias2" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setNoprompt( true );
        request.setVerbose( true );
        request.setTrustcacerts( true );
        request.setFile( file.getAbsolutePath() );
        request.setKeypass( "new-passwd" );
        return request;
    }

    /**
     *
createKeyToolGenerateSecretKeyRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolGenerateSecretKeyRequest} object
     */
    public KeyToolGenerateSecretKeyRequest createKeyToolGenerateSecretKeyRequest( File keyStore )
    {
        KeyToolGenerateSecretKeyRequest request = new KeyToolGenerateSecretKeyRequest();
        request.setAlias( "new_foo_alias" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setKeypass( "key-passwd" );
        request.setKeyalg( "DES" );
        request.setKeysize( "56" );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolGenerateKeyPairRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolGenerateKeyPairRequest} object
     */
    public KeyToolGenerateKeyPairRequest createKeyToolGenerateKeyPairRequest( File keyStore )
    {
        KeyToolGenerateKeyPairRequest request = new KeyToolGenerateKeyPairRequest();
        request.setAlias( "dest_foo_alias" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setKeypass( "key-passwd" );
        request.setSigalg( "SHA1withDSA" );
        request.setDname( "CN=Me, OU=Unknown, O=Codehaus, L=Unknown, ST=Unknown, C=France" );
        request.setVerbose( true );
        request.setValidity( "100" );
        request.setStartdate( "2011/11/11" );
        request.setKeyalg( "DSA" );
        request.setKeysize( "1024" );
        request.setExt( "" );
        return request;
    }

    /**
     *
createKeyToolGenerateCertificateRequestRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @param outputFile a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolGenerateCertificateRequestRequest} object
     */
    public KeyToolGenerateCertificateRequestRequest createKeyToolGenerateCertificateRequestRequest( File keyStore,
                                                                                File outputFile )
    {
        KeyToolGenerateCertificateRequestRequest request = new KeyToolGenerateCertificateRequestRequest();
        request.setAlias( "foo_alias" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setKeypass( "key-passwd" );
        request.setFile( outputFile );
        request.setSigalg( "SHA1withDSA" );
        request.setDname( "CN=Me, OU=Unknown, O=Codehaus, L=Unknown, ST=Unknown, C=France" );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolGenerateCertificateRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @param inFile a {@link java.io.File} object
     * @param outputFile a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolGenerateCertificateRequest} object
     */
    public KeyToolGenerateCertificateRequest createKeyToolGenerateCertificateRequest( File keyStore, File inFile,
                                                                                File outputFile )
    {
        KeyToolGenerateCertificateRequest request = new KeyToolGenerateCertificateRequest();
        request.setAlias( "foo_alias" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setKeypass( "key-passwd" );
        request.setRfc( true );

        request.setInfile( inFile );
        request.setOutfile( outputFile );
        request.setSigalg( "SHA1withDSA" );
        request.setDname( "CN=Me, OU=Unknown, O=Codehaus, L=Unknown, ST=Unknown, C=France" );
        request.setStartdate( "2011/11/11" );
        request.setExt( "" );
        request.setValidity( "100" );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolExportCertificateRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @param outputFile a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolExportCertificateRequest} object
     */
    public KeyToolExportCertificateRequest createKeyToolExportCertificateRequest( File keyStore, File outputFile )
    {
        KeyToolExportCertificateRequest request = new KeyToolExportCertificateRequest();
        request.setAlias( "foo_alias" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setRfc( true );
        request.setFile( outputFile.getAbsolutePath() );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolDeleteRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolDeleteRequest} object
     */
    public KeyToolDeleteRequest createKeyToolDeleteRequest( File keyStore )
    {
        KeyToolDeleteRequest request = new KeyToolDeleteRequest();
        request.setAlias( "foo_alias" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolChangeStorePasswordRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolChangeStorePasswordRequest} object
     */
    public KeyToolChangeStorePasswordRequest createKeyToolChangeStorePasswordRequest( File keyStore )
    {
        KeyToolChangeStorePasswordRequest request = new KeyToolChangeStorePasswordRequest();
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setNewPassword( "new-changeit" );
        request.setVerbose( true );
        return request;
    }

    /**
     *
createKeyToolChangeKeyPasswordRequest.

     *
     * @param keyStore a {@link java.io.File} object
     * @return a {@link org.codehaus.mojo.keytool.requests.KeyToolChangeKeyPasswordRequest} object
     */
    public KeyToolChangeKeyPasswordRequest createKeyToolChangeKeyPasswordRequest( File keyStore )
    {
        KeyToolChangeKeyPasswordRequest request = new KeyToolChangeKeyPasswordRequest();
        request.setAlias( "foo_alias" );
        request.setStoretype( "jks" );
        request.setStorepass( "changeit" );
        request.setKeystore( keyStore.getAbsolutePath() );
        request.setKeypass( "key-passwd" );
        request.setNewPassword( "new-key-passwd" );
        request.setVerbose( true );
        return request;
    }
}


text:
package org.secnod.dropwizard.shiro;

import io.dropwizard.ConfiguredBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;

import javax.servlet.DispatcherType;
import javax.servlet.Filter;

import org.apache.shiro.realm.Realm;
import org.apache.shiro.web.env.IniWebEnvironment;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.apache.shiro.web.mgt.WebSecurityManager;
import org.apache.shiro.web.servlet.AbstractShiroFilter;
import org.glassfish.jersey.server.ResourceConfig;
import org.secnod.shiro.jersey.AuthInjectionBinder;
import org.secnod.shiro.jersey.AuthorizationFilterFeature;
import org.secnod.shiro.jersey.SubjectFactory;

/**
 * A Dropwizard bundle for Apache Shiro.
 */
public abstract class ShiroBundle<T> implements ConfiguredBundle<T> {

    @Override
    public void initialize(Bootstrap<?> bootstrap) {

    }

    @Override
    public void run(T configuration, Environment environment) {
        ShiroConfiguration shiroConfig = narrow(configuration);
        ResourceConfig resourceConfig = environment.jersey().getResourceConfig();

        resourceConfig.register(new AuthorizationFilterFeature());
        resourceConfig.register(new SubjectFactory());
        resourceConfig.register(new AuthInjectionBinder());

        Filter shiroFilter = createFilter(configuration);
        environment.servlets()
            .addFilter("ShiroFilter", shiroFilter)
            .addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, shiroConfig.filterUrlPattern());
    }

    /**
     * Narrow down the complete configuration to just the Shiro configuration.
     */
    protected abstract ShiroConfiguration narrow(T configuration);

    /**
     * Create the Shiro filter. Overriding this method allows for complete customization of how Shiro is initialized.
     */
    protected Filter createFilter(final T configuration) {
        ShiroConfiguration shiroConfig = narrow(configuration);
        final IniWebEnvironment shiroEnv = new IniWebEnvironment();
        shiroEnv.setConfigLocations(shiroConfig.iniConfigs());
        shiroEnv.init();

        AbstractShiroFilter shiroFilter = new AbstractShiroFilter() {
            @Override
            public void init() throws Exception {
                Collection<Realm> realms = createRealms(configuration);
                WebSecurityManager securityManager = realms.isEmpty()
                        ? shiroEnv.getWebSecurityManager()
                        : new DefaultWebSecurityManager(realms);
                setSecurityManager(securityManager);
                setFilterChainResolver(shiroEnv.getFilterChainResolver());
            }
        };
        return shiroFilter;
    }

    /**
     * Create and configure the Shiro realms. Override this method in order to
     * add realms that require configuration.
     *
     * @return a non-null list of realms. If empty, no realms will be added, but depending on the content of the INI
     *         file Shiro might still add its automatic IniRealm.
     */
    protected Collection<Realm> createRealms(T configuration) {
        return Collections.emptyList();
    }
}

redpajama_set_name: RedPajamaGithub


text:
try:
    import astroquery
except ImportError:
    print('-----------------------------------------------------------')
    print('-----------------------------------------------------------')
    print('WARNING: Not loading modules in xastropy.obs except radec.  \n Install astroquery if you want them')
    print('-----------------------------------------------------------')
else:
    import finder
    import keck
    import lick
    import x_getsdssimg

# Non-dependent modules
import radec


text:
package com.planet_ink.coffee_mud.Abilities.Spells;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

public class Spell_Repulsion extends Spell
{

	@Override
	public String ID()
	{
		return "Spell_Repulsion";
	}

	private final static String localizedName = CMLib.lang().L("Repulsion");

	@Override
	public String name()
	{
		return localizedName;
	}

	private final static String localizedStaticDisplay = CMLib.lang().L("(Repulsion)");

	@Override
	public String displayText()
	{
		return localizedStaticDisplay;
	}

	@Override
	public int maxRange()
	{
		return adjustedMaxInvokerRange(3);
	}

	@Override
	public int abstractQuality()
	{
		return Ability.QUALITY_MALICIOUS;
	}

	@Override
	protected int canAffectCode()
	{
		return CAN_MOBS;
	}

	@Override
	public int classificationCode()
	{
		return Ability.ACODE_SPELL|Ability.DOMAIN_ABJURATION;
	}

	@Override
	public long flags()
	{
		return Ability.FLAG_MOVING;
	}

	public int amountRemaining=0;

	@Override
	public boolean okMessage(final Environmental myHost, final CMMsg msg)
	{
		if(!(affected instanceof MOB))
			return true;

		final MOB mob=(MOB)affected;

		// when this spell is on a MOBs Affected list,
		// it should consistantly prevent the mob
		// from trying to do ANYTHING except sleep
		if(msg.amISource(mob))
		{
			if(msg.sourceMinor()==CMMsg.TYP_ADVANCE)
			{
				if(mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> struggle(s) against the repulsion field.")))
				{
					amountRemaining-=mob.charStats().getStat(CharStats.STAT_STRENGTH);
					if(amountRemaining<0)
						unInvoke();
				}
				return false;
			}
		}
		return super.okMessage(myHost,msg);
	}

	@Override
	public boolean tick(final Tickable ticking, final int tickID)
	{
		if(tickID == Tickable.TICKID_MOB)
		{
			final Room R=CMLib.map().roomLocation(affected);
			if((R!=null)
			&&(invoker!=null)
			&&((!R.isInhabitant(invoker))||(!invoker.isInCombat())))
			{
				unInvoke();
				return false;
			}
		}
		return super.tick(ticking, tickID);
	}

	@Override
	public void unInvoke()
	{
		// undo the affects of this spell
		if(!(affected instanceof MOB))
			return;
		final MOB mob=(MOB)affected;

		super.unInvoke();
		final Room R=mob.location();
		if(canBeUninvoked()
		&&(R != null))
		{
			R.show(mob,null,CMMsg.MSG_NOISYMOVEMENT,L("<S-NAME> manage(s) to break <S-HIS-HER> way free of the repulsion field."));
			CMLib.commands().postStand(mob,true, false);
		}
	}

	@Override
	public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel)
	{
		final Set<MOB> h=properTargets(mob,givenTarget,auto);
		if((h==null)||(h.size()==0))
		{
			mob.tell(L("There doesn't appear to be anyone here worth repelling."));
			return false;
		}

		if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
			return false;

		boolean success=proficiencyCheck(mob,0,auto);

		if(success)
		{
			if(mob.location().show(mob,null,this,somanticCastCode(mob,null,auto),auto?"":L("^S<S-NAME> wave(s) <S-HIS-HER> arms and cast(s) a spell.^?")))
			{
				for (final Object element : h)
				{
					final MOB target=(MOB)element;

					final CMMsg msg=CMClass.getMsg(mob,target,this,somanticCastCode(mob,target,auto),null);
					if((mob.location().okMessage(mob,msg))&&(target.fetchEffect(this.ID())==null))
					{
						mob.location().send(mob,msg);
						if(msg.value()<=0)
						{
							amountRemaining=130;
							amountRemaining=(int)Math.round(CMath.mul(amountRemaining, target.basePhyStats().speed()));
							if(target.location()==mob.location())
							{
								success=maliciousAffect(mob,target,asLevel,((mob.phyStats().level()+(2*getXLEVELLevel(mob)))*10),-1)!=null;
								int level=2;
								if((CMLib.ableMapper().qualifyingClassLevel(mob,this)>0)&&((adjustedLevel(mob,asLevel)-CMLib.ableMapper().qualifyingClassLevel(mob,this))>10))
									level+=((adjustedLevel(mob,asLevel)-CMLib.ableMapper().qualifyingClassLevel(mob,this))-10)/10;
								if(level<2)
									level=2;
								target.location().show(target,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> become(s) repelled!"));
								if((target.getVictim()!=null)&&(target.rangeToTarget()>0))
									target.setRangeToTarget(target.rangeToTarget());
								else
								if(target.location().maxRange()<level)
									target.setRangeToTarget(target.location().maxRange());
								else
									target.setRangeToTarget(level);
								if(target.getVictim()!=null)
									target.getVictim().setRangeToTarget(target.rangeToTarget());
								if(mob.getVictim()==null)
									mob.setVictim(null); // correct range
								if(target.getVictim()==null)
									target.setVictim(null); // correct range
							}
						}
					}
				}
			}
		}
		else
			return maliciousFizzle(mob,null,L("<S-NAME> wave(s) <S-HIS-HER> arms, but the spell fizzles."));

		// return whether it worked
		return success;
	}
}


text:
define(['../helpers/bind', '../helpers/reduce_polyfill',
		'../helpers/extend',
		'json!./main.json', 'json!./generator.json',
        'json!./login.json', 'json!./errorMessages.json',
        'json!./entry.json', 'json!./edit.json',
        'json!./overview.json',
        'json!./register.json'],
       /*function(__, __, extend, main, generator, login,
                errorMessages, entry, edit, overview,
                register) {*/
         function(__, __, extend) {

var localizations = Array.prototype.slice.call(arguments, 3);

/*var localizations = [main, generator, login,
      errorMessages, entry, edit, overview, register];*/

var locale = (navigator.language || navigator.userLanguage).substring(0, 2);

// Combine all localizations into one object
var localized = localizations.reduce(function(acc, addition) {
	return extend(acc, addition[locale]);
}, {});

return localized;

});


text:
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public string Description { get; set; }
```

### Property Value
Type: System.String

## See also
- [Feature](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.Feature.md)
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)


text:
--[[**********************************
*
*	Multi Theft Auto - Admin Panel
*
*	admin_commands.lua
*
*	Original File by lil_Toady
*
**************************************]]

_commands = {}

function getPlayerWildcard ( string )
	local player = getPlayerFromName ( string )
	if ( player ) then return player end
	local matches = {}
	for id, player in ipairs ( getElementsByType ( "player" ) ) do
		if ( string.find ( string.gsub ( string.upper ( getPlayerName ( player ) ), '#%x%x%x%x%x%x', '' ), string.upper ( string ), 1, true ) ) then
			table.insert(matches,player)
		end
	end
	if #matches == 0 then
		return false, "'" .. string .. "' matches no players."
	elseif #matches == 1 then
		return matches[1]
	else
		return false, "'" .. string .. "' matches ".. tostring(#matches) .. " players."
	end
end

-- Yet to be finished
function aSetupCommands()
	local node = xmlLoadFile ( "conf\\commands.xml" )
	if ( node ) then
		for id, type in ipairs ( _types ) do
			local subnode = xmlFindChild ( node, type, 0 )
			if ( subnode ) then
				local commands = 0
				while ( xmlFindChild ( subnode, "command", commands ) ~= false ) do
					local command = xmlFindChild ( subnode, "command", commands )
					local handler = xmlNodeGetAttribute ( command, "handler" )
					local call = xmlNodeGetAttribute ( command, "call" )
					local args = xmlNodeGetAttribute ( command, "args" )
					_commands[handler] = {}
					_commands[handler].type = type
					_commands[handler].action = call
					if ( args ) then _commands[handler].args = args end
					addCommandHandler ( handler, aCommand, true )
					commands = commands + 1
				end
			end
		end
		xmlUnloadFile ( node )
	end

end

function aCommand ( admin, command, ... )
	local call = _commands[command]
	if ( call ) then
		if ( ( aclGetAccount ( admin ) ) and ( hasObjectPermissionTo ( aclGetAccount ( admin ), "command."..call.action ) ) ) then
			local arg, errormsg = aCommandToArgs ( { ... }, call.args )
			if not errormsg then
				if ( call.type == "player" ) then
					if isObjectInACLGroup( aclGetAccount ( admin ), aclGetGroup ("Killers") ) and not isObjectInACLGroup( aclGetAccount ( admin ), aclGetGroup ("Admin") ) then
						if tonumber(arg[3]) and tonumber(arg[3]) > 3600 or not arg[3] then
							arg[3] = 3600
						end
						triggerEvent ( "aPlayer", admin, arg[1], call.action, arg[2], arg[3], arg[4] )
					else
						triggerEvent ( "aPlayer", admin, arg[1], call.action, arg[2], arg[3], arg[4] )
					end
				elseif ( call.type == "vehicle" ) then triggerEvent ( "aVehicle", admin, arg[1], call.action, arg[2], arg[3], arg[4] )
				else triggerEvent ( "a"..string.upper ( string.sub ( call.type, 1, 1 ) )..string.sub ( call.type, 2 ), admin, call.action, arg[1], arg[2], arg[3], arg[4] )
				end
			else
				outputChatBox ( "Error: "..errormsg, admin, 255, 0, 0 )
			end
		else
			outputChatBox ( "Access denied for '"..tostring ( call.action ).."'", admin, 255, 168, 0 )
		end
	end
end

function aCommandToArgs ( argv, args )
	local errormsg
	for id, argt in ipairs ( split ( args, 44 ) ) do
		if argv[id] == nil then break end
		if ( argt == "T" ) then argv[id] = getTeamFromName ( argv[id] )
		elseif ( argt == "P" ) then argv[id], errormsg = getPlayerWildcard ( argv[id] )
		elseif ( argt == "t" ) then argv[id] = { argv[id] }
		elseif ( argt == "s" ) then argv[id] = tostring ( argv[id] )
		elseif ( argt == "i" ) then argv[id] = tonumber ( argv[id] )
		elseif ( argt == "t-" ) then
			local atable = {}
			for i = id, #argv do table.insert ( atable, argv[id] ) table.remove ( argv, id ) end
			argv[id] = atable
		elseif ( argt == "s-" ) then
			local string = ""
			for i = id, #argv do string = string.." "..argv[i] table.remove ( argv, i ) end
			argv[id] = string
		end
	end
	return argv, errormsg
end


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

namespace Kostassoid.Nerve.EventStore.Specs.Tools
{
	using System;
	using Machine.Specifications;
	using Nerve.EventStore.Tools;

	// ReSharper disable InconsistentNaming
	// ReSharper disable UnusedMember.Local
	public class MemoizedFuncSpecs
    {
		[Subject(typeof(MemoizedFunc))]
		[Tags("Unit")]
		public class when_using_memoized_function_without_params
		{
			It should_return_cached_value = () =>
				{
					var counter = 0;
					Func<int> func = () =>
						{
							counter++;
							return 13;
						};

					var memoizedFunc = func.AsMemoized();

					memoizedFunc().ShouldEqual(13);
					memoizedFunc().ShouldEqual(13);
					memoizedFunc().ShouldEqual(13);

					counter.ShouldEqual(1);
				};
		}

		[Subject(typeof(MemoizedFunc))]
		[Tags("Unit")]
		public class when_using_memoized_function_with_one_param
		{
			It should_return_cached_values =
				() =>
					{
						var counter = 0;
						Func<int, int> func = x =>
							{
								counter++;
								return x*x;
							};

						var memoizedFunc = func.AsMemoized();

						memoizedFunc(5).ShouldEqual(25);
						memoizedFunc(4).ShouldEqual(16);
						memoizedFunc(4).ShouldEqual(16);
						memoizedFunc(5).ShouldEqual(25);
						memoizedFunc(4).ShouldEqual(16);
						memoizedFunc(5).ShouldEqual(25);

						counter.ShouldEqual(2);
					};
		}

		[Subject(typeof(MemoizedFunc))]
		[Tags("Unit")]
		public class when_using_memoized_function_with_two_params
		{
			It should_return_cached_values = () =>
				{
					var counter = 0;
					Func<int, int, int> func = (x, y) =>
						{
							counter++;
							return x*y;
						};

					var memoizedFunc = func.AsMemoized();

					memoizedFunc(2, 3).ShouldEqual(6);
					memoizedFunc(2, 5).ShouldEqual(10);
					memoizedFunc(4, 3).ShouldEqual(12);
					memoizedFunc(2, 3).ShouldEqual(6);
					memoizedFunc(2, 5).ShouldEqual(10);
					memoizedFunc(4, 3).ShouldEqual(12);

					counter.ShouldEqual(3);
				};
		}

		[Subject(typeof(MemoizedFunc))]
		[Tags("Unit")]
		public class when_using_memoized_function_with_three_params
		{
			It should_return_cached_values = () =>
				{
					var counter = 0;
					Func<int, int, int, int> func = (x, y, z) =>
						{
							counter++;
							return x*y*z;
						};

					var memoizedFunc = func.AsMemoized();

					memoizedFunc(2, 3, 4).ShouldEqual(24);
					memoizedFunc(2, 3, 5).ShouldEqual(30);
					memoizedFunc(2, 4, 3).ShouldEqual(24);
					memoizedFunc(2, 3, 5).ShouldEqual(30);
					memoizedFunc(2, 3, 4).ShouldEqual(24);
					memoizedFunc(2, 4, 3).ShouldEqual(24);

					counter.ShouldEqual(3);
				};
		}
    }
    // ReSharper restore InconsistentNaming
	// ReSharper restore UnusedMember.Local
}


text:
import ConfigParser

class ConfigFileManager:

    def __init__(self, logger, configFile=r"/etc/turtles/Turtle.cfg"):

        self.logger = logger

        self.config = ConfigParser.RawConfigParser()

        # Writing our configuration file to 'example.cfg'
        self.configFile = configFile

        self.config.read(self.configFile)

        if not self.config.has_section('TurtleInfo'):
            self.logger.info('Turtle Info Not Found')
            self.config.add_section('TurtleInfo')
            self.config.set('TurtleInfo', 'turtle_name', 'unnamed_turtle')
            self.config.set('TurtleInfo', 'turtle_id', '-99')
            self.config.set('TurtleInfo', 'ip_address', '1.1.1.1')

            with open(self.configFile, 'wb') as configfile:
                self.config.write(configfile)
        pass

    def WriteParams(self, turtle_name, turtle_id, local_ip_address):
        self.config.read(self.configFile)

        self.config.set('TurtleInfo', 'turtle_name', turtle_name)
        self.config.set('TurtleInfo', 'turtle_id', turtle_id)
        self.config.set('TurtleInfo', 'ip_address', local_ip_address)

        self.logger.info('Writing Turtle Info:')
        self.logger.info('   Name: '+str(turtle_name))
        self.logger.info('     Id: '+str(turtle_id))
        self.logger.info('IP Addr: '+str(local_ip_address))

        with open(self.configFile, 'wb') as configfile:
            self.config.write(configfile)

    def ReadParams(self):
        self.config.read(self.configFile)

        return self.config.get('TurtleInfo', 'turtle_name'),self.config.get('TurtleInfo', 'turtle_id'), self.config.get('TurtleInfo', 'ip_address')

    def SetId(self, turtle_id):
        self.config.read(self.configFile)

        self.config.set('TurtleInfo', 'turtle_id', turtle_id)

        with open(self.configFile, 'wb') as configfile:
            self.config.write(configfile)

if(__name__ == '__main__'):
    cm = ConfigFileManager()
    print cm

    turtle_name, turtle_id, turtle_ipAddress = cm.ReadParams()
    print('Turtle Name: '+turtle_name)
    print('Turtle ID: '+turtle_id)
    print('Turtle IP Address: '+turtle_ipAddress)


text:
Update Customer Information

<form action="update_customer.php" method="get"/>

<?php
// Enable error logging:
error_reporting(E_ALL ^ E_NOTICE);
// mysqli connection via user-defined function

include('./my_connect1.php');
$mysqli = get_mysqli_conn();

// SQL statement
$sql = "SELECT a.customer_id, a.address, a.email, a.credit_rating, a.f_name "
. "FROM Customer a "
. "WHERE a.customer_id = ?";

// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);

// Prepared statement, stage 2: bind and execute
$customer_id = $_GET['customer_id'];

// "i" for integer, "d" for double, "s" for string, "b" for blob
$stmt->bind_param('i', $customer_id);
$stmt->execute();

// Bind result variables
$stmt->bind_result($customer_id, $address, $email, $credit_rating, $f_name);

/* fetch values */
if ($stmt->fetch())
{
echo '<input type="hidden" name="customer_id" value="' . $customer_id . '"/>';
echo ' ' . $f_name . 's address is '.$address.'.

 Enter the new address you would like to update to: ';
echo '<input type="text" name="address" value="'.$address.'"/>
';

echo '

<input type="hidden" name="customer_id" value="' . $customer_id . '"/>';
echo 'The email address is currently set to '.$email.'.

 Enter the new email address you would like to update
  to: ';
echo '<input type="text" name="email" value="'.$email.'"/>
';

echo '

<input type="hidden" name="customer_id" value="' . $customer_id . '"/>';
echo ' The most up to date credit score rating is '.$credit_rating.'.

 Enter the new credit score if it has been changed: ';
echo '<input type="text" name="credit_rating" value="'.$credit_rating.'"/>
';
}
else
{
echo 'Record not found';
}
/* close statement and connection*/
$stmt->close();
$mysqli->close();
?>

<input type="submit" value="Update"/>

</form>


text:
package com.rollsoftware.br.common.db.entity;

/**
 *
 * @author Rogério
 * @date November, 2016
 */
public interface ObjectInterface {

    public void generateUUID();

    public String getUUID();

    public Integer getId();

    public <T extends ObjectDataInterfacePK> T getODPK();

    public boolean equalsODPK(ObjectDataInterfacePK odpk);

    public static interface ObjectDataInterfacePK {
    }
}


text:
package io.github.markbernard.jnotepad;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Desktop;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.RandomAccessFile;
import java.io.Writer;
import java.net.URI;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.swing.BorderFactory;
import javax.swing.InputMap;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JToolBar;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.EtchedBorder;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.PlainDocument;
import javax.swing.undo.UndoManager;

import io.github.markbernard.jnotepad.action.EditAction;
import io.github.markbernard.jnotepad.action.FileAction;
import io.github.markbernard.jnotepad.action.FormatAction;
import io.github.markbernard.jnotepad.action.HelpAction;
import io.github.markbernard.jnotepad.action.ViewAction;
import io.github.markbernard.jnotepad.dialog.AboutDialog;
import io.github.markbernard.jnotepad.dialog.FontDialog;
import io.github.markbernard.jnotepad.dialog.SearchDialog;
import io.github.markbernard.jnotepad.dialog.GoToDialog;

/**
 * Main application class.
 *
 * @author Mark Bernard
 */
public class JNotepad extends JPanel implements WindowListener, DocumentListener, KeyListener {
    private static final long serialVersionUID = -2119311360500754201L;
    private static final String APPLICATION_TITLE = "JNotepad";
    private static final String NEW_FILE_NAME = "Untitled";
    private static final DateFormat DATE_FORMAT = new SimpleDateFormat("hh:mm aa yyyy-MM-dd");
    private static final String FILE_SEPARATOR = System.getProperty("file.separator");

    private JFrame parentFrame;
    private JTextArea textArea;
    private JPanel statusBarPanel;
    private JLabel positionLabel;
    private JLabel capsLockLabel;
    private JLabel insertLabel;
    private JLabel readOnlyLabel;
    private UndoManager undoManager;
    private JCheckBoxMenuItem formatWordWrap;
    private JToolBar toolbar;

    private boolean dirty;
    private String fileName;
    private PrintRequestAttributeSet printRequestAttributeSet;
    private String findTerm;
    private String replaceTerm;
    private boolean findDownDirection;
    private boolean matchCase;
    private boolean insertMode = true;
    private boolean readOnly = false;

    /**
     * Set up the application before showing the window.
     *
     * @param parentFrame The main application window.
     */
    public JNotepad(JFrame parentFrame) {
        this.parentFrame = parentFrame;
        fileName = NEW_FILE_NAME;
        ApplicationPreferences.loadPrefs(parentFrame);
        dirty = false;
        setTitle();
        parentFrame.addWindowListener(this);
        setLayout(new BorderLayout());
        textArea = new JTextArea();
        textArea.addKeyListener(this);
        textArea.setLineWrap(ApplicationPreferences.isWordWrap());
        textArea.setWrapStyleWord(true);
        PlainDocument document = (PlainDocument)textArea.getDocument();
        document.addDocumentListener(this);
        document.setDocumentFilter(new InsertDocumentFilter(this));
        undoManager = new UndoManager();
        textArea.getDocument().addUndoableEditListener(undoManager);
        textArea.setFont(ApplicationPreferences.getCurrentFont());
        textArea.addCaretListener(new CaretListener() {
            @Override
            public void caretUpdate(CaretEvent e) {
                updateStatusBar(e.getDot());
            }
        });
        removeKeyStrokes(textArea);
        JScrollPane scroll = new JScrollPane(textArea);
        add(scroll, BorderLayout.CENTER);
        createMenus();
        createStatusBar();
        createToolbar();

        parentFrame.add(this, BorderLayout.CENTER);
        parentFrame.setVisible(true);
        textArea.requestFocusInWindow();
        parentFrame.setIconImages(IconGenerator.loadImages("/res/icons/JNotepadIconSmall.png", "/res/icons/JNotepadIcon.png"));
    }

    private void createMenus() {
        JMenuBar bar = new JMenuBar();
        parentFrame.setJMenuBar(bar);

        JMenu fileMenu = new JMenu(new FileAction());
        bar.add(fileMenu);
        JMenuItem fileNewItem = new JMenuItem(new FileAction.NewAction(this));
        fileMenu.add(fileNewItem);
        JMenuItem fileOpenItem = new JMenuItem(new FileAction.OpenAction(this));
        fileMenu.add(fileOpenItem);
        JMenuItem fileSaveItem = new JMenuItem(new FileAction.SaveAction(this));
        fileMenu.add(fileSaveItem);
        JMenuItem fileSaveAsItem = new JMenuItem(new FileAction.SaveAsAction(this));
        fileMenu.add(fileSaveAsItem);
        fileMenu.addSeparator();
        JMenuItem filePageSetupItem = new JMenuItem(new FileAction.PageSetupAction(this));
        fileMenu.add(filePageSetupItem);
        JMenuItem filePrintItem = new JMenuItem(new FileAction.PrintAction(this));
        fileMenu.add(filePrintItem);
        fileMenu.addSeparator();
        JMenuItem fileExitItem = new JMenuItem(new FileAction.ExitAction(this));
        fileMenu.add(fileExitItem);

        JMenu editMenu = new JMenu(new EditAction());
        bar.add(editMenu);
        JMenuItem editUndoItem = new JMenuItem(new EditAction.UndoAction(this));
        editMenu.add(editUndoItem);
        editMenu.addSeparator();
        JMenuItem editCutItem = new JMenuItem(new EditAction.CutAction(this));
        editMenu.add(editCutItem);
        JMenuItem editCopyItem = new JMenuItem(new EditAction.CopyAction(this));
        editMenu.add(editCopyItem);
        JMenuItem editPasteItem = new JMenuItem(new EditAction.PasteAction(this));
        editMenu.add(editPasteItem);
        JMenuItem editDeleteItem = new JMenuItem(new EditAction.DeleteAction(this));
        editMenu.add(editDeleteItem);
        editMenu.addSeparator();
        JMenuItem editFindItem = new JMenuItem(new EditAction.FindAction(this));
        editMenu.add(editFindItem);
        JMenuItem editFindNextItem = new JMenuItem(new EditAction.FindNextAction(this, null));
        editMenu.add(editFindNextItem);
        JMenuItem editReplaceItem = new JMenuItem(new EditAction.ReplaceAction(this));
        editMenu.add(editReplaceItem);
        JMenuItem editGoToItem = new JMenuItem(new EditAction.GoToAction(this));
        editMenu.add(editGoToItem);
        editMenu.addSeparator();
        JMenuItem editSelectAllItem = new JMenuItem(new EditAction.SelectAllAction(this));
        editMenu.add(editSelectAllItem);
        JMenuItem editTimeDateItem = new JMenuItem(new EditAction.TimeDateAction(this));
        editMenu.add(editTimeDateItem);

        JMenu formatMenu = new JMenu(new FormatAction());
        bar.add(formatMenu);
        formatWordWrap = new JCheckBoxMenuItem(FormatAction.WordWrapAction.getInstance(this));
        formatMenu.add(formatWordWrap);
        formatWordWrap.setSelected(ApplicationPreferences.isWordWrap());
        JMenuItem formatFont = new JMenuItem(new FormatAction.FontAction(this));
        formatMenu.add(formatFont);

        JMenu viewMenu = new JMenu(new ViewAction());
        bar.add(viewMenu);
        JCheckBoxMenuItem viewStatus = new JCheckBoxMenuItem(ViewAction.StatusAction.getInstance(this));
        viewStatus.setSelected(ApplicationPreferences.isStatusBar());
        viewMenu.add(viewStatus);

        JMenu helpMenu = new JMenu(new HelpAction());
        bar.add(helpMenu);
        JMenuItem helpViewHelp = new JMenuItem(new HelpAction.ViewHelpAction(this));
        helpMenu.add(helpViewHelp);
        helpMenu.addSeparator();
        JMenuItem helpAbout = new JMenuItem(new HelpAction.AboutAction(this));
        helpMenu.add(helpAbout);
    }

    private void createStatusBar() {
        statusBarPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
        JPanel positionPanel = new JPanel(new BorderLayout());
        statusBarPanel.add(positionPanel);
        setStausBorder(positionPanel);
        positionLabel = new JLabel();
        positionPanel.add(positionLabel, BorderLayout.WEST);
        positionLabel.setFont(new Font("Consolas", Font.PLAIN, 14));

        JPanel capsLockPanel = new JPanel(new BorderLayout());
        statusBarPanel.add(capsLockPanel);
        setStausBorder(capsLockPanel);
        capsLockLabel = new JLabel("CAPS OFF");
        capsLockPanel.add(capsLockLabel, BorderLayout.WEST);
        capsLockLabel.setFont(new Font("Consolas", Font.PLAIN, 14));

        JPanel insertPanel = new JPanel(new BorderLayout());
        statusBarPanel.add(insertPanel);
        setStausBorder(insertPanel);
        insertLabel = new JLabel("INS");
        insertPanel.add(insertLabel, BorderLayout.WEST);
        insertLabel.setFont(new Font("Consolas", Font.PLAIN, 14));

        JPanel readOnlyPanel = new JPanel(new BorderLayout());
        statusBarPanel.add(readOnlyPanel);
        setStausBorder(readOnlyPanel);
        readOnlyLabel = new JLabel("Read/Write");
        readOnlyPanel.add(readOnlyLabel, BorderLayout.WEST);
        readOnlyLabel.setFont(new Font("Consolas", Font.PLAIN, 14));

        if (ApplicationPreferences.isStatusBar()) {
            add(statusBarPanel, BorderLayout.SOUTH);
        }
        updateStatusBar(textArea.getCaretPosition());
    }

    private void setStausBorder(JPanel panel) {
        panel.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createEtchedBorder(EtchedBorder.RAISED),
                BorderFactory.createEmptyBorder(1, 3, 1, 3)));
    }

    private void updateStatusBar(int position) {
        SwingUtilities.invokeLater(() -> {
            updateCursorLocation(position);
            updateCapsLock();
            updateInsertMode();
            updateReadOnly();
        });
    }

    private void updateCursorLocation(int position) {
        try {
            int line = textArea.getLineOfOffset(position);
            int column = position - textArea.getLineStartOffset(line);
            positionLabel.setText(String.format("Ln %d, Col %d",
                    (line + 1), (column + 1)));
        } catch (Exception e) {
            //not critical if the position in the
            //status bar does not get updated.
            e.printStackTrace();
        }
    }

    private void updateCapsLock() {
        if (Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)) {
            capsLockLabel.setForeground(Color.BLACK);
            capsLockLabel.setText("CAPS ON ");
        } else {
            capsLockLabel.setForeground(Color.LIGHT_GRAY);
            capsLockLabel.setText("CAPS OFF");
        }
    }

    private void updateInsertMode() {
        if (insertMode) {
            insertLabel.setForeground(Color.LIGHT_GRAY);
            insertLabel.setText("INS");
        } else {
            insertLabel.setForeground(Color.BLACK);
            insertLabel.setText("OVR");
        }
    }

    private void updateReadOnly() {
        if (readOnly) {
            readOnlyLabel.setForeground(Color.BLACK);
            readOnlyLabel.setText("Read Only ");
        } else {
            readOnlyLabel.setForeground(Color.LIGHT_GRAY);
            readOnlyLabel.setText("Read/Write");
        }
    }

    private void createToolbar() {
        toolbar = new JToolBar();
        parentFrame.add(toolbar, BorderLayout.NORTH);

        toolbar.add(new FileAction.NewAction(this));
        toolbar.add(new FileAction.OpenAction(this));
        toolbar.add(new FileAction.SaveAction(this));

        toolbar.addSeparator();
        toolbar.add(new FileAction.ExitAction(this));

        toolbar.addSeparator();
        toolbar.add(new EditAction.CutAction(this));
        toolbar.add(new EditAction.CopyAction(this));
        toolbar.add(new EditAction.PasteAction(this));

        toolbar.addSeparator();
        toolbar.add(new EditAction.FindAction(this));
        toolbar.add(new EditAction.ReplaceAction(this));

        toolbar.addSeparator();
        toolbar.add(FormatAction.WordWrapAction.getInstance(this));
        toolbar.addSeparator();
        toolbar.add(new HelpAction.ViewHelpAction(this));
    }
    @Override
    public void windowActivated(WindowEvent e) {}

    @Override
    public void windowClosed(WindowEvent e) {}

    @Override
    public void windowClosing(WindowEvent e) {
        exit();
    }

    @Override
    public void windowDeactivated(WindowEvent e) {}

    @Override
    public void windowDeiconified(WindowEvent e) {}

    @Override
    public void windowIconified(WindowEvent e) {}

    @Override
    public void windowOpened(WindowEvent e) {}

    @Override
    public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_CAPS_LOCK) {
            updateCapsLock();
        } else if (e.getKeyCode() == KeyEvent.VK_INSERT) {
            insertMode = !insertMode;
            updateInsertMode();
        }
    }

    @Override
    public void keyReleased(KeyEvent e) {
    }

    @Override
    public void keyTyped(KeyEvent e) {
    }

    @Override
    public void changedUpdate(DocumentEvent e) {
        documentUpdated();
    }

    @Override
    public void insertUpdate(DocumentEvent e) {
        documentUpdated();
    }

    @Override
    public void removeUpdate(DocumentEvent e) {
        documentUpdated();
    }

    private void documentUpdated() {
        if (!dirty) {
            dirty = true;
            setTitle();
        }
    }

    /**
     * If overwrite mode is active then characters are removed when new characters are typed.
     *
     * @param position
     * @param length
     */
    public void processInsert(int position, int length) {
        if (!insertMode) {
            Document document = textArea.getDocument();
            insertMode = true;
            try {
                int trimLength = length;
                if (position + trimLength > textArea.getText().length()) {
                    trimLength = textArea.getText().length() - position;
                }
                if (trimLength > 0) {
                    document.remove(position, trimLength);
                }
            } catch (BadLocationException e) {
                e.printStackTrace();
            }
            insertMode = false;
        }
    }
    /**
     * Exits the application with cleanup.
     */
    public void exit() {
        DirtyStatus status = isDirty();

        boolean saveCompleted = true;
        if (status.equals(DirtyStatus.SAVE_FILE)) {
            saveCompleted = save();
        } else if (status.equals(DirtyStatus.CANCEL_ACTION)) {
            saveCompleted = false;
        }

        if (saveCompleted) {
            ApplicationPreferences.savePrefs(parentFrame);
            System.exit(0);
        }
    }

    /**
     * Create a new document while checking to see if the current document is saved.
     */
    public void newDocument() {
        DirtyStatus status = isDirty();

        boolean saveCompleted = true;
        if (status.equals(DirtyStatus.SAVE_FILE)) {
            saveCompleted = save();
        } else if (status.equals(DirtyStatus.CANCEL_ACTION)) {
            saveCompleted = false;
        }

        if (saveCompleted) {
            fileName = NEW_FILE_NAME;
            textArea.setText("");
            dirty = false;
            readOnly = false;
            updateReadOnly();
            setTitle();
        }
        updateCursorLocation(textArea.getCaretPosition());
    }

    /**
     * Show a file dialog and load the selected file.
     */
    public void load() {
        DirtyStatus result = isDirty();

        boolean saveSuccessful = true;
        if (result.equals(DirtyStatus.SAVE_FILE)) {
            saveSuccessful = save();
        } else if (result.equals(DirtyStatus.CANCEL_ACTION)) {
            saveSuccessful = false;
        }

        if (saveSuccessful) {
            String filePath = ApplicationPreferences.getCurrentFilePath();
            JFileChooser fileChooser = new JFileChooser(filePath);
            if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File selectedFile = fileChooser.getSelectedFile();
                fileName = selectedFile.getName();
                ApplicationPreferences.setCurrentFilePath(
                        selectedFile.getParentFile().getAbsolutePath());
                loadFile(selectedFile);
                updateStatusBar(textArea.getCaretPosition());
            }
        }
    }

    /**
     * Save an existing document. If there is no existing document then call saveAs.
     * If a call to saveAs is made and the user cancels during the file save dialog
     * then false will be returned.
     *
     * @return true if the save was not interrupted, false otherwise
     */
    public boolean save() {
        if (fileName.equals(NEW_FILE_NAME)) {
            return saveAs();
        } else {
            saveFile(ApplicationPreferences.getCurrentFilePath() + FILE_SEPARATOR + fileName);
            dirty = false;
            setTitle();

            return true;
        }
    }

    private void saveFile(String path) {
        final JComponent parentComponent = this;
        SwingUtilities.invokeLater(() -> {
            Writer out = null;

            try {
                out = new OutputStreamWriter(new FileOutputStream(path), StandardCharsets.UTF_8);
                out.write(textArea.getText());
            } catch (FileNotFoundException e) {
                JOptionPane.showMessageDialog(parentComponent, "Unable to create the file: " + path + "\n" + e.getMessage(), "Error loading file", JOptionPane.ERROR_MESSAGE);
            } catch (IOException e) {
                JOptionPane.showMessageDialog(parentComponent, "Unable to save the file: " + path, "Error loading file", JOptionPane.ERROR_MESSAGE);
            } finally {
                ResourceCleanup.close(out);
            }
        });
    }

    /**
     * Display a dialog to the user asking for a location and name of the file
     * to save. If the user cancels the dialog then return false.
     *
     * @return false if the user cancels the file save dialog, true otherwise
     */
    public boolean saveAs() {
        boolean result = true;

        String filePath = ApplicationPreferences.getCurrentFilePath();
        JFileChooser fileChooser = new JFileChooser(filePath);
        if (fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
            File selectedFile = fileChooser.getSelectedFile();
            fileName = selectedFile.getName();
            ApplicationPreferences.setCurrentFilePath(
                    selectedFile.getParentFile().getAbsolutePath().replace("\\", "/"));
            saveFile(selectedFile.getAbsolutePath());
            dirty = false;
            setTitle();
        } else {
            result = false;
        }

        return result;
    }

    private DirtyStatus isDirty() {
        DirtyStatus result = DirtyStatus.DONT_SAVE_FILE;

        if (dirty) {
            String filePath = (fileName.equals(NEW_FILE_NAME) ? fileName :
                ApplicationPreferences.getCurrentFilePath() + FILE_SEPARATOR + fileName);
            int choice = JOptionPane.showOptionDialog(this,
                    "Do you want to save changes to " + filePath + "?",
                    "JNotepad",
                    JOptionPane.YES_NO_CANCEL_OPTION,
                    JOptionPane.PLAIN_MESSAGE,
                    null,
                    new String[] {"Save", "Don't Save", "Cancel"},
                    "Save");
            if (choice == JOptionPane.YES_OPTION) {
                result = DirtyStatus.SAVE_FILE;
            } else if (choice == JOptionPane.NO_OPTION) {
                result = DirtyStatus.DONT_SAVE_FILE;
            } else if (choice == JOptionPane.CANCEL_OPTION) {
                result = DirtyStatus.CANCEL_ACTION;
            }
        }

        return result;
    }

    /**
     * Load the file at the specified path while checking to see if the current document is saved.
     *
     * @param path
     */
    public void loadFile(File path) {
        InputStreamReader in = null;

        try {
            in = new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8);
            StringBuilder content = new StringBuilder();
            char[] buffer = new char[32768];
            int read = -1;
            while ((read = in.read(buffer)) > -1) {
                content.append(buffer, 0, read);
            }
            in.close();
            textArea.setText(content.toString());
            undoManager.discardAllEdits();
            dirty = false;
            readOnly = !path.canWrite();
            if (!readOnly) {
                RandomAccessFile rout = null;
                FileLock lock = null;
                try {
                    rout = new RandomAccessFile(path, "rw");
                    FileChannel channel = rout.getChannel();
                    lock = channel.tryLock();
                } catch (Exception e) {
                    readOnly = true;
                } finally {
                    if (lock != null) {
                        lock.release();
                    }
                    ResourceCleanup.close(rout);
                }
            }
            updateReadOnly();
            setTitle();
        } catch (FileNotFoundException e) {
            JOptionPane.showMessageDialog(this, "Unable to find the file: " + path, "Error loading file", JOptionPane.ERROR_MESSAGE);
        } catch (IOException e) {
            JOptionPane.showMessageDialog(this, "Unable to load the file: " + path, "Error loading file", JOptionPane.ERROR_MESSAGE);
        } finally {
            ResourceCleanup.close(in);
        }
    }

    private void setTitle() {
        SwingUtilities.invokeLater(() -> parentFrame.setTitle((dirty ? "*" : "") + fileName + " - " + APPLICATION_TITLE));
    }

    /**
     * Show the user the page setup dialog and store the users settings.
     */
    public void pageSetup() {
        if (printRequestAttributeSet == null) {
            printRequestAttributeSet = new HashPrintRequestAttributeSet();
        }
        PrinterJob.getPrinterJob().pageDialog(printRequestAttributeSet);
    }

    /**
     * Perform the printing request.
     */
    public void doPrint() {
        try {
            if (printRequestAttributeSet == null) {
                printRequestAttributeSet = new HashPrintRequestAttributeSet();
            }
            textArea.print(null,
                    new MessageFormat("page {0}"),
                    true,
                    PrinterJob.getPrinterJob().getPrintService(),
                    printRequestAttributeSet,
                    true);
        } catch (PrinterException e) {
            e.printStackTrace();
        }
    }

    /**
     * Undo the last text input
     */
    public void undo() {
        if (undoManager.canUndo()) {
            undoManager.undo();
        }
    }

    /**
     * Cut the selected text and place it in the system clipboard
     */
    public void cut() {
        SwingUtilities.invokeLater(() -> {
            int start = textArea.getSelectionStart();
            textArea.cut();
            textArea.setSelectionStart(start);
            textArea.setSelectionEnd(start);
        });
    }

    /**
     * Copy the selected text and place it in the system clipboard
     */
    public void copy() {
        SwingUtilities.invokeLater(() -> textArea.copy());
    }

    /**
     * Take contents of the system clipboard, if it is text, and place it at the cursor.
     */
    public void paste() {
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        DataFlavor[] flavors = clipboard.getAvailableDataFlavors();
        for (DataFlavor flavor : flavors) {
            if (flavor.isFlavorTextType() && flavor.isMimeTypeSerializedObject()) {
                performPaste(flavor, clipboard);
            }
        }
    }

    private void performPaste(DataFlavor flavor, Clipboard clipboard) {
        SwingUtilities.invokeLater(() -> {
            try {
                String data = (String)clipboard.getData(flavor);
                int start = textArea.getSelectionStart();
                int end = textArea.getSelectionEnd();
                int length = end - start;
                Document doc = textArea.getDocument();
                try {
                    if (length > 0) {
                        doc.remove(start, length);
                    }
                    doc.insertString(start, data, null);
                    int location = start + data.length();
                    textArea.setSelectionStart(location);
                    textArea.setSelectionEnd(location);
                } catch (BadLocationException e) {
                    //looks like there is nothing to remove
                    //if a mistake occurs we can still try standard paste
                    textArea.paste();
                }
            } catch (UnsupportedFlavorException e) {
                // generally this should not happen since we checked before hand if the flavor passed in was available.
                //if a mistake occurs we can still try standard paste
                textArea.paste();
            } catch (IOException e) {
                //if a mistake occurs we can still try standard paste
                textArea.paste();
            }
        });
    }

    /**
     * Delete the selected text.
     */
    public void delete() {
        SwingUtilities.invokeLater(() -> {
            int start = textArea.getSelectionStart();
            int end = textArea.getSelectionEnd();
            if (start != end) {
                textArea.replaceRange("", start, end);
                textArea.setSelectionEnd(start);
                textArea.setSelectionStart(start);
            }
        });
    }

    /**
     * Display a dialog for the user to search the text for something
     */
    public void find() {
        JNotepad self = this;
        SwingUtilities.invokeLater(() -> {
            SearchDialog dialog = new SearchDialog(parentFrame, self, false);
            dialog.setVisible(true);
        });
    }

    /**
     * Due to nesting issues this method does not use SwingUtilities.invokeLater.
     * Calling methods should wrap any calls to this method in SwingUtilities.invokeLater to make sure it runs on the EDT
     */
    public void findNext() {
        if (findTerm != null && !findTerm.isEmpty()) {
            String localFindTerm = findTerm;
            if (!matchCase) {
                localFindTerm = localFindTerm.toLowerCase();
            }
            if (findDownDirection) {
                int findStart = textArea.getSelectionEnd();
                String text = textArea.getText();
                if (!matchCase) {
                    text = text.toLowerCase();
                }
                int index = text.indexOf(localFindTerm, findStart);
                if (index > -1) {
                    textArea.setSelectionStart(index);
                    textArea.setSelectionEnd(index + findTerm.length());
                }
            } else {
                int findStart = textArea.getSelectionStart();
                String text = textArea.getText().substring(0, findStart);
                if (!matchCase) {
                    text = text.toLowerCase();
                }
                int index = text.lastIndexOf(localFindTerm);
                if (index > -1) {
                    textArea.setSelectionStart(index);
                    textArea.setSelectionEnd(index + findTerm.length());
                }
            }
        } else {
            find();
        }
    }

    /**
     *
     */
    public void replace() {
        JNotepad self = this;
        SwingUtilities.invokeLater(() -> {
            SearchDialog dialog = new SearchDialog(parentFrame, self, true);
            dialog.setVisible(true);
        });
    }

    /**
     *
     */
    public void performReplace() {
        SwingUtilities.invokeLater(() -> {
            if (findTerm != null && replaceTerm != null && !findTerm.isEmpty() &&
                    textArea.getSelectionStart() != textArea.getSelectionEnd()) {
                String selectedText = textArea.getSelectedText();
                if ((matchCase && findTerm.equals(selectedText)) ||
                        (!matchCase && findTerm.equalsIgnoreCase(selectedText))) {
                    textArea.replaceSelection(replaceTerm);
                    textArea.setSelectionStart(textArea.getSelectionEnd());
                    findNext();
                }
            }
        });
    }

    /**
     *
     */
    public void replaceAll() {
        SwingUtilities.invokeLater(() -> {
            if (findTerm != null && replaceTerm != null && !findTerm.isEmpty()) {
                textArea.setCaretPosition(0);
                findDownDirection = true;
                findNext();
                while (findTerm.equals(textArea.getSelectedText())) {
                    textArea.replaceSelection(replaceTerm);
                    textArea.setSelectionStart(textArea.getSelectionEnd());
                    findNext();
                }
            }
        });
    }

    /**
     * Place the cursor on the beginning of the line number select by the user.
     */
    public void goTo() {
        JNotepad self = this;
        SwingUtilities.invokeLater(() -> {
            GoToDialog goToDialog = new GoToDialog(parentFrame, self);
            if (goToDialog.showDialog()) {
                int lineNumber = goToDialog.getLineNumber() - 1;

                if (lineNumber >= 0 && lineNumber <= textArea.getLineCount()) {
                    try {
                        textArea.setCaretPosition(textArea.getLineStartOffset(lineNumber));
                    } catch (BadLocationException e) {
                        // should not occur since we already
                        // checked if the lineNumber is in range.
                        e.printStackTrace();
                    }
                }
            }
            goToDialog.dispose();
        });
    }

    /**
     * Selects all text in the JTextArea.
     */
    public void selectAll() {
        SwingUtilities.invokeLater(() -> {
            textArea.setSelectionStart(0);
            textArea.setSelectionEnd(textArea.getText().length());
        });
    }

    /**
     * Insert the time and date into the text a the current cursor location.
     */
    public void timeDate() {
        SwingUtilities.invokeLater(() -> {
            String timeDateString = DATE_FORMAT.format(new Date());
            int start = textArea.getSelectionStart();
            textArea.replaceSelection(timeDateString);
            textArea.setCaretPosition(start + timeDateString.length());
        });
    }

    /**
     * Show customizable settings dialog.
     */
    public void settings() {

    }
    /**
     * @param findTerm the findTerm to set
     */
    public void setFindTerm(String findTerm) {
        this.findTerm = findTerm;
    }

    /**
     * @param replaceTerm the replaceTerm to set
     */
    public void setReplaceTerm(String replaceTerm) {
        this.replaceTerm = replaceTerm;
    }

    /**
     * @param matchCase the matchCase to set
     */
    public void setMatchCase(boolean matchCase) {
        this.matchCase = matchCase;
    }

    /**
     * @return the insertMode
     */
    public boolean isInsertMode() {
        return insertMode;
    }

    /**
     * @param findDownDirection the findDownDirection to set
     */
    public void setFindDownDirection(boolean findDownDirection) {
        this.findDownDirection = findDownDirection;
    }

    private void removeKeyStrokes(JTextArea textArea) {
        InputMap targetMap = null;
        InputMap parentMap = textArea.getInputMap();

        while (parentMap != null) {
            targetMap = parentMap;
            parentMap = targetMap.getParent();
        }

        targetMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_DOWN_MASK));
        targetMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_DOWN_MASK));
        targetMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK));
        targetMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK));
    }

    /**
     * Toggle word wrapping
     */
    public void wordWrap() {
        SwingUtilities.invokeLater(() -> {
            formatWordWrap.setSelected(ApplicationPreferences.isWordWrap());
            formatWordWrap.repaint();
            toolbar.repaint();
            textArea.setLineWrap(ApplicationPreferences.isWordWrap());
        });
    }

    /**
     * Set the font to be used for editing and printing.
     */
    public void font() {
        SwingUtilities.invokeLater(() -> {
            FontDialog fontDialog = new FontDialog(parentFrame,
                    ApplicationPreferences.getCurrentFont());
            if (fontDialog.showFontDialog()) {
                Font selectedFont = fontDialog.getSelectedFont();
                ApplicationPreferences.setCurrentFont(selectedFont);
                textArea.setFont(selectedFont);
            }
            fontDialog.dispose();
        });
    }

    /**
     * Toggle the status bar on or off
     */
    public void status() {
        SwingUtilities.invokeLater(() -> {
            if (ApplicationPreferences.isStatusBar()) {
                add(statusBarPanel, BorderLayout.SOUTH);
            } else {
                remove(statusBarPanel);
            }
            validate();
            repaint();
        });
    }

    /**
     * Show extensive help
     */
    public void help() {
        try {
            Desktop.getDesktop().browse(new URI("https://www.google.ca/"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * Show simple about dialog.
     */
    public void about() {
        SwingUtilities.invokeLater(() -> {
            AboutDialog aboutDialog = new AboutDialog(parentFrame);
            aboutDialog.setVisible(true);
        });
    }

    /**
     * Main application starting point.
     *
     * @param args
     */
    public static void main(String[] args) {
        try {
            // Make the application look native.
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            // System look and feel is always present.
        }

        SwingUtilities.invokeLater(() -> {
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
            frame.setLayout(new BorderLayout());
            new JNotepad(frame);
        });
    }

    enum DirtyStatus {
        SAVE_FILE, DONT_SAVE_FILE, CANCEL_ACTION;
    }
}


text:
(function() {
  var E, ie;

  ie = require('iced-error');

  exports.E = E = ie.make_errors({
    GENERIC: "Generic error",
    INVAL: "Invalid value",
    NOT_FOUND: "Key not found",
    LOOKUP_NOT_FOUND: "Lookup failed",
    BAD_QUERY: "Bad query",
    DUPLICATE: "Duplicated value",
    BAD_MAC: "Message authentication failure",
    BAD_SIZE: "Wrong size",
    BAD_PREAMBLE: "Premable mismatch or bad file magic",
    BAD_IO: "bad input/output operation",
    BAD_HEADER: "Bad metadata in file",
    BAD_VALUE: "bad value",
    BAD_SEQNO: "wrong sequence number",
    BAD_PAYLOAD_HASH: "bad payload hash from server",
    INTERNAL: "internal assertion failed",
    MSGPACK: "Message pack format failure",
    BAD_PW_OR_MAC: "Bad password or file was corrupted",
    INIT: "Initialization error",
    ARGS: "Error in argument parsing",
    UNIMPLEMENTED: "Feature not implemented",
    CONFIG: "Configuration file error",
    HTTP: "HTTP status code error",
    KEYBASE: "Server-side failure",
    CANCEL: "Operation canceled",
    GPG: "Command line error",
    NOT_LOGGED_IN: "Not logged in",
    CORRUPTION: "Corruption",
    VERSION_ROLLBACK: "Verion rollback detected",
    NO_REMOTE_KEY: "No remote key found",
    NO_LOCAL_KEY: "No local key found",
    IMPORT: "Error importing key",
    VERIFY: "Signature verification problem",
    SCRAPE: "Scraper error",
    REMOTE_CHECK: "Remote check failure",
    PGP_ID_COLLISION: "PGP ID collision error",
    UID_MISMATCH: "userIDs didn't match",
    USERNAME_MISMATCH: "usernames didn't match",
    REMOTE_PROOF: "error in sanity checking a remote proof",
    UNTRACK: "error in untracking",
    UNKNOWN_SERVICE: "unknown service",
    PROOF_NOT_AVAILABLE: "proof isn't available",
    WRONG_SIGNER: "Expected a signature, but by someone else",
    REQUIRED_UPGRADE: "Software upgrade required",
    BAD_ASSERTION: "Bad assertion",
    KEY_EXISTS: "Key already exists",
    GENERATE: "key generation error",
    MISSING_PW: "missing passphrase",
    PROOF_EXISTS: "Proof already exists",
    SELF: "Can't perform this action on yourself",
    NO_USERNAME: "Your username isn't known",
    CLEAN_CANCEL: "Cleanly bailed out",
    PATCH: "Key patching failed",
    LOOPBACK: "Error in HKP loopback",
    NOT_CONFIGURED: "No user configured",
    HOST: "Host is down",
    SECURITY: "Security error",
    REQ_NOT_FOUND: "host not found",
    REQ_CONN_REFUSED: "connection refused",
    REQ_GENERIC: "generic error",
    KEY_NOT_TRUSTED: "key not trusted",
    KEY_NOT_FOUND: "key not found",
    REVOKED: "revoked",
    REVOKE: "error in revocation",
    BAD_MERKLE_LEAF: "bad merkle leaf found"
  });

}).call(this);


text:
package org.apereo.cas.authentication.mfa.trigger;

import org.apereo.cas.authentication.AuthenticationException;
import org.apereo.cas.authentication.DefaultMultifactorAuthenticationProviderResolver;
import org.apereo.cas.authentication.MultifactorAuthenticationPrincipalResolver;
import org.apereo.cas.authentication.MultifactorAuthenticationProviderSelector;
import org.apereo.cas.authentication.mfa.MultifactorAuthenticationTestUtils;
import org.apereo.cas.authentication.mfa.TestMultifactorAuthenticationProvider;
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.util.scripting.WatchableGroovyScriptResource;

import lombok.val;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.springframework.core.io.ClassPathResource;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

/**
 * This is {@link GroovyScriptMultifactorAuthenticationTriggerTests}.
 *
 * @author Misagh Moayyed
 * @since 6.1.0
 */
@Tag("Groovy")
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class GroovyScriptMultifactorAuthenticationTriggerTests extends BaseMultifactorAuthenticationTriggerTests {
    @Test
    @Order(1)
    public void verifyOperationByProvider() {
        val trigger = buildGroovyTrigger();
        var result = trigger.isActivated(authentication, registeredService,
            this.httpRequest, this.httpResponse, mock(Service.class));
        assertTrue(result.isPresent());

        val service = MultifactorAuthenticationTestUtils.getService("nomfa");
        result = trigger.isActivated(authentication, registeredService,
            this.httpRequest, this.httpResponse, service);
        assertFalse(result.isPresent());
    }

    @Test
    @Order(2)
    public void verifyCompositeProvider() {
        val trigger = buildGroovyTrigger();
        val service = MultifactorAuthenticationTestUtils.getService("composite");
        val result = trigger.isActivated(authentication, registeredService,
            this.httpRequest, this.httpResponse, service);
        assertTrue(result.isPresent());
    }

    @Test
    @Order(3)
    public void verifyBadInputParameters() {
        val trigger = buildGroovyTrigger();
        var result = trigger.isActivated(null, registeredService,
            this.httpRequest, this.httpResponse, mock(Service.class));
        assertFalse(result.isPresent());

        result = trigger.isActivated(authentication, null,
            this.httpRequest, this.httpResponse, mock(Service.class));
        assertTrue(result.isPresent());

        result = trigger.isActivated(authentication, registeredService,
            this.httpRequest, this.httpResponse, null);
        assertTrue(result.isPresent());
        trigger.destroy();
    }

    @Test
    @Order(0)
    @Tag("DisableProviderRegistration")
    public void verifyNoProvider() {
        val trigger = buildGroovyTrigger();
        assertThrows(AuthenticationException.class,
            () -> trigger.isActivated(authentication, registeredService,
                this.httpRequest, this.httpResponse, mock(Service.class)));
        assertDoesNotThrow(trigger::destroy);
        assertNotNull(trigger.getApplicationContext());
        assertNotNull(trigger.getMultifactorAuthenticationProviderResolver());
        assertNotNull(trigger.getMultifactorAuthenticationProviderSelector());
        assertNotNull(trigger.getWatchableScript());
    }

    private GroovyScriptMultifactorAuthenticationTrigger buildGroovyTrigger() {
        val selector = mock(MultifactorAuthenticationProviderSelector.class);
        when(selector.resolve(any(), any(), any())).thenReturn(new TestMultifactorAuthenticationProvider());
        return new GroovyScriptMultifactorAuthenticationTrigger(
            new WatchableGroovyScriptResource(new ClassPathResource("GroovyMfaTrigger.groovy")),
            applicationContext,
            new DefaultMultifactorAuthenticationProviderResolver(MultifactorAuthenticationPrincipalResolver.identical()),
            selector);
    }

}


text:
module StarterCode
  extend ActiveSupport::Concern

  # rubocop:disable MethodLength
  def starter_code_repository_id(repo_name)
    return unless repo_name.present?

    if repo_name =~ %r{^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$}
      begin
        github_repository = GitHubRepository.new(current_user.github_client, nil)
        github_repository.repository(repo_name).id
      rescue ArgumentError => err
        raise GitHub::Error, err.message
      end
    else
      raise GitHub::Error, 'Invalid repository name, use the format owner/name'
    end
  end
  # rubocop:enable MethodLength

  def validate_starter_code_repository_id(repo_id)
    if repo_id.is_a?(Integer) || (repo_id.is_a?(String) && repo_id =~ /^[0-9]+$/)
      begin
        GitHubRepository.new(current_user.github_client, repo_id.to_i).repository.id
      rescue ArgumentError => err
        raise GitHub::Error, err.message
      end
    else
      raise GitHub::Error, 'Invalid repository name, please check it again'
    end
  end
end


text:
An Angular.js directive which allows you to perform any javascript actions (in the controller, or on the element) when an element is scrolled into or out of, the users viewport, without requiring any other dependencies.

[![Build Status](https://secure.travis-ci.org/rpocklin/angular-scroll-animate.svg)](http:/travis-ci.org/rpocklin/angular-scroll-animate)

# Motivation

`ngAnimate` is great if you want animations based on showing or hiding elements based on some behaviour, but what if you want to trigger behaviour when an element is scrolled into, or out of the user's view?

The goal of this directive is to be small and focused around behaviour that changes when scrolled in and out of view, without requiring jQuery.  You can add / remove CSS classes in the callbacks, or execute any arbitrary javascript you want such as pre-loading of data, images or anything else.

# Demo

[Demo](http://rpocklin.github.io/angular-scroll-animate/example/index.html)

# NG Docs

[link](http://rpocklin.github.io/angular-scroll-animate/docs/#/api/angular-scroll-animate.directive:when-visible)

# Inspiration
- [ngAnimate](https://docs.angularjs.org/api/ngAnimate)
- [angular-inview](https://github.com/thenikso/angular-inview)

## Installation

1. Install the plugin into your Angular.js project, manually or via

  `bower install angular-scroll-animate --save`

1. Include `angular-scroll-animate.js` in your app:

  `<script src="bower_components/angular-scroll-animate/dist/angular-scroll-animate.js"></script>`

1. Add `angular-scroll-animate` as a new module dependency in your angular app.

  `var myapp = angular.module('myapp', ['angular-scroll-animate']);`

1. Ensure you have a CSS class to mask the visibility of an element eg.
  ```css
  .hidden {
    visibility: hidden;
  }
  ```

  Add this to the elements class if you want it to be hidden initially when out of a user's view,
  and remove it on the `animateElementIn` callback and add it back on `animateElementOut` callback.

Example markup:
  ```html
    <!-- angular view -->
    <div ng-repeat="car in cars"
      when-visible="animateElementIn"
      when-not-visible="animateElementOut" class="hidden car">
    ...
    </div>
  ```

  ```javascript
    // controller
    $scope.cars = [ ... ];

    $scope.animateElementIn = function($el) {
    $el.removeClass('hidden');
    $el.addClass('animated fadeInUp'); // this example leverages animate.css classes
  };

  $scope.animateElementOut = function($el) {
    $el.addClass('hidden');
    $el.removeClass('animated fadeInUp'); // this example leverages animate.css classes
  };
  ```

## Notes

- `when-visible($el)`: [required] function (executed in the controller scope) which is called when the element
  is scrolled into view.
- `when-not-visible($el)`: [optional] function (executed in the controller scope) which is called when the element is
   moved out of view via scrolling.

- `delay-percent="0.50"`: [optional] decimal value which represents how much of the element should be in the users viewport before triggering the bound callback.  `0.25` is set as a default, a lower value will make it more eager, a higher value will make it lazier.

- `bind-scroll-to=".classname"`: [optional] If you are using `overflow: auto` in a container and the elements are not appearing when they should set  replace `classname` with the class you have applied `overflow: auto` to.

-  To ensure fast CSS3 transition rules are used for animations, I recommend either [velocity.js](http://julian.com/research/velocity/) or
  [animate.css](https://daneden.github.io/animate.css/) which come with many pre-built and tested CSS animation classes.

- Default event bindings are on `scroll` `resize` and `orientationchange` of the `document` element this directive is loaded in.

## Running Locally

1. Checkout git repository locally: `git clone git@github.com:rpocklin/angular-scroll-animate.git`
1. `npm install`
1. `bower install`
1. `grunt serve`
1. View `http://localhost:9000/example/` in your browser to see the example.

## Contributing

1. Fork it
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Beautify (`grunt beautify`)
1. Ensure it passes code-checks / tests (`grunt`)
1. Commit your changes (`git commit -am 'Added some feature'`)
1. Push to the branch (`git push origin my-new-feature`)
1. Create a new Pull Request

## History

* 0.9.8 Added override attribute of `bind-scroll-to` to bind scroll events to custom parents - see [#3](/../../issues/3)).
* 0.9.8 Optimised reflow / repaints to use `requestAnimationFrame` for performance reasons.
* 0.9.4 Re-fixed `when-not-visible` so it is truely optional (thanks @jagged3dge)
* 0.9.3 Changed `Number.isNaN` to use `!angular.isNumber` instead (original function not available in all browsers yet) (see [#2](/../../issues/2)).
* 0.9.2 Fixed error when not defining `when-not-visible` attributes and updated NG Docs (see [#1](/../../issues/1)).
* 0.9.1 Removed (incorrectly) namespaced events, not supported in JQ-Lite.
* 0.9.0 Fixed event unbinding when removing bound elements from the DOM.
* 0.8.0 Initial release

## TODO
- Get more feedback and feedback on different browsers (especially mobile / tablets).
- Add debounce timing
- Consider using events instead?
- Add some tests

## License

Released under the MIT License. See the [LICENSE][license] file for further details.

[license]: https://github.com/rpocklin/angular-timeline/blob/master/LICENSE


text:
<?php
/**
 * @author Roman Ozana <ozana@omdesign.cz>
 */
require_once __DIR__ . '/ShrinkPHP.php';
$shrink = new ShrinkPHP();
$shrink->useNamespaces = true;
$shrink->addDir(__DIR__ . '/../envtesting/');

file_put_contents(__DIR__ . '/../Envtesting.php', $shrink->getOutput());


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=utf-8">
<title>Uses of Class org.apache.lucene.index.NumericDocValues (Lucene 6.0.1 API)</title>
<meta name="date" content="2016-05-23">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.lucene.index.NumericDocValues

Packages that use NumericDocValues

Package
Description

org.apache.lucene.codecs

Codecs API: API for customization of the encoding and structure of the index.

org.apache.lucene.index

Code to maintain and access indices.

org.apache.lucene.search

Code to search indices.

org.apache.lucene.util

Some utility classes.

org.apache.lucene.util.packed

Packed integer arrays and streams.

Uses of NumericDocValues in org.apache.lucene.codecs

Methods in org.apache.lucene.codecs that return NumericDocValues

Modifier and Type
Method and Description

abstract NumericDocValues
NormsProducer.getNorms(FieldInfo field)

Returns NumericDocValues for this field.

abstract NumericDocValues
DocValuesProducer.getNumeric(FieldInfo field)

Returns NumericDocValues for this field.

Method parameters in org.apache.lucene.codecs with type arguments of type NumericDocValues

Modifier and Type
Method and Description

void
NormsConsumer.mergeNormsField(FieldInfo fieldInfo,
               MergeState mergeState,
               List<NumericDocValues> toMerge)

Merges the norms from toMerge.

void
DocValuesConsumer.mergeNumericField(FieldInfo fieldInfo,
                 MergeState mergeState,
                 List<NumericDocValues> toMerge,
                 List<Bits> docsWithField)

Merges the numeric docvalues from toMerge.

Uses of NumericDocValues in org.apache.lucene.index

Methods in org.apache.lucene.index that return NumericDocValues

Modifier and Type
Method and Description

static NumericDocValues
DocValues.emptyNumeric()

An empty NumericDocValues which returns zero for every document

static NumericDocValues
MultiDocValues.getNormValues(IndexReader r,
             String field)

Returns a NumericDocValues for a reader's norms (potentially merging on-the-fly).

NumericDocValues
ParallelLeafReader.getNormValues(String field)

abstract NumericDocValues
LeafReader.getNormValues(String field)

Returns NumericDocValues representing norms
  for this field, or null if no NumericDocValues
  were indexed.

NumericDocValues
CodecReader.getNormValues(String field)

NumericDocValues
FilterLeafReader.getNormValues(String field)

static NumericDocValues
DocValues.getNumeric(LeafReader reader,
          String field)

Returns NumericDocValues for the field, or DocValues.emptyNumeric() if it has none.

NumericDocValues
ParallelLeafReader.getNumericDocValues(String field)

abstract NumericDocValues
LeafReader.getNumericDocValues(String field)

Returns NumericDocValues for this field, or
  null if no NumericDocValues were indexed for
  this field.

NumericDocValues
CodecReader.getNumericDocValues(String field)

NumericDocValues
FilterLeafReader.getNumericDocValues(String field)

static NumericDocValues
MultiDocValues.getNumericValues(IndexReader r,
                String field)

Returns a NumericDocValues for a reader's docvalues (potentially merging on-the-fly)

static NumericDocValues
DocValues.unwrapSingleton(SortedNumericDocValues dv)

Returns a single-valued view of the SortedNumericDocValues, if it was previously
 wrapped with DocValues.singleton(NumericDocValues, Bits), or null.

Methods in org.apache.lucene.index with parameters of type NumericDocValues

Modifier and Type
Method and Description

static SortedNumericDocValues
DocValues.singleton(NumericDocValues dv,
         Bits docsWithField)

Returns a multi-valued view over the provided NumericDocValues

Uses of NumericDocValues in org.apache.lucene.search

Fields in org.apache.lucene.search declared as NumericDocValues

Modifier and Type
Field and Description

protected NumericDocValues
FieldComparator.NumericComparator.currentReaderValues

Methods in org.apache.lucene.search that return NumericDocValues

Modifier and Type
Method and Description

protected NumericDocValues
FieldComparator.NumericComparator.getNumericDocValues(LeafReaderContext context,
                   String field)

Retrieves the NumericDocValues for the field in this segment

static NumericDocValues
SortedNumericSelector.wrap(SortedNumericDocValues sortedNumeric,
    SortedNumericSelector.Type selector,
    SortField.Type numericType)

Wraps a multi-valued SortedNumericDocValues as a single-valued view, using the specified selector
 and numericType.

Uses of NumericDocValues in org.apache.lucene.util

Subclasses of NumericDocValues in org.apache.lucene.util

Modifier and Type
Class and Description

class
LongValues

Abstraction over an array of longs.

Uses of NumericDocValues in org.apache.lucene.util.packed

Subclasses of NumericDocValues in org.apache.lucene.util.packed

Modifier and Type
Class and Description

class
BlockPackedReader

Provides random access to a stream written with BlockPackedWriter.

class
GrowableWriter

Implements PackedInts.Mutable, but grows the
 bit count of the underlying packed ints on-demand.

class
MonotonicBlockPackedReader

Provides random access to a stream written with
 MonotonicBlockPackedWriter.

static class
PackedInts.Mutable

A packed integer array that can be modified.

static class
PackedInts.NullReader

A PackedInts.Reader which has all its values equal to 0 (bitsPerValue = 0).

static class
PackedInts.Reader

A read-only random access array of positive integers.

class
PackedLongValues

Utility class to compress integers into a LongValues instance.

class
PagedGrowableWriter

A PagedGrowableWriter.

class
PagedMutable

A PagedMutable.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev

Next

Frames

No Frames

All Classes

          Copyright © 2000-2016 Apache Software Foundation.  All Rights Reserved.


text:
use std::error;

use clap;

use crate::config;

use super::executer::{Executer, ExecuterOptions};

pub struct Command<'c> {
    config: &'c config::command::Config,
    name: Option<&'c str>,
    no_wait: bool,
    all: bool,
}

impl<'c> Command<'c> {
    pub fn from_args(config: &'c config::command::Config, args: &'c clap::ArgMatches<'c>) -> Self {
        trace!("command::service::stop::Command::from_args");

        Command {
            config: config,
            name: args.value_of("NAME"),
            no_wait: args.is_present("NO_WAIT"),
            all: args.is_present("ALL"),
        }
    }

    pub fn new(
        config: &'c config::command::Config,
        name: Option<&'c str>,
        no_wait: bool,
        all: bool,
    ) -> Self {
        trace!("command::service::stop::Command::new");

        Command {
            config: config,
            name: name,
            no_wait: no_wait,
            all: all,
        }
    }

    pub async fn run(&self) -> Result<(), Box<dyn error::Error>> {
        trace!("command::service::stop::Command::run");

        if let Some(service_config_group) = self.config.service.as_ref() {
            for service_config in service_config_group {
                let mut runnable: bool = false;
                if let Some(name) = self.name {
                    if name == service_config.name {
                        runnable = true;
                    }
                }
                if self.all {
                    runnable = true;
                }
                if !runnable {
                    continue;
                }

                let options = ExecuterOptions {
                    no_wait: self.no_wait,
                };
                let ecs_stop_cmd = Executer::from_config(&service_config, &options);
                ecs_stop_cmd.run().await?;
            }
        }

        Ok(())
    }
}


text:
package com.intellij.ide.impl;

import com.intellij.facet.*;
import com.intellij.ide.JavaUiBundle;
import com.intellij.ide.SelectInContext;
import com.intellij.ide.SelectInTarget;
import com.intellij.ide.StandardTargetWeights;
import com.intellij.ide.highlighter.ModuleFileType;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileTypes.FileTypeRegistry;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.OrderEntry;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.roots.libraries.LibraryUtil;
import com.intellij.openapi.roots.ui.configuration.ModulesConfigurator;
import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
import java.util.Iterator;

public class ProjectStructureSelectInTarget implements SelectInTarget, DumbAware {
  @Override
  public boolean canSelect(SelectInContext context) {
    ProjectFileIndex fileIndex = ProjectRootManager.getInstance(context.getProject()).getFileIndex();
    VirtualFile file = context.getVirtualFile();
    if (file instanceof FacetAsVirtualFile) {
      return ((FacetAsVirtualFile)file).findFacet() != null;
    }
    return fileIndex.isInContent(file) || fileIndex.isInLibrary(file)
           || FileTypeRegistry.getInstance().isFileOfType(file, ModuleFileType.INSTANCE) && findModuleByModuleFile(context.getProject(), file) != null;
  }

  @Override
  public void selectIn(final SelectInContext context, final boolean requestFocus) {
    Project project = context.getProject();
    VirtualFile file = context.getVirtualFile();

    Module module;
    Facet<?> facet;
    if (file instanceof FacetAsVirtualFile) {
      facet = ((FacetAsVirtualFile)file).findFacet();
      module = facet == null? null : facet.getModule();
    }
    else {
      Module moduleByIml = FileTypeRegistry.getInstance().isFileOfType(file, ModuleFileType.INSTANCE) ? findModuleByModuleFile(project, file) : null;
      ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
      module = moduleByIml != null ? moduleByIml : fileIndex.getModuleForFile(file);
      facet = fileIndex.isInSourceContent(file) ? null : findFacet(project, file);
    }
    if (module != null || facet != null) {
      ApplicationManager.getApplication().invokeLater(() -> {
        if (facet != null) {
          ModulesConfigurator.showFacetSettingsDialog(facet, null);
        }
        else {
          ProjectSettingsService.getInstance(project).openModuleSettings(module);
        }
      });
      return;
    }

    OrderEntry orderEntry = LibraryUtil.findLibraryEntry(file, project);
    if (orderEntry != null) {
      ApplicationManager.getApplication().invokeLater(
        () -> ProjectSettingsService.getInstance(project).openLibraryOrSdkSettings(orderEntry));
    }
  }

  @Nullable
  private static Module findModuleByModuleFile(@NotNull Project project, @NotNull VirtualFile file) {
    for (Module module : ModuleManager.getInstance(project).getModules()) {
      if (ModuleUtilCore.isModuleFile(module, file)) {
        return module;
      }
    }
    return null;
  }

  @Nullable
  private static Facet<?> findFacet(final @NotNull Project project, final @NotNull VirtualFile file) {
    for (FacetTypeId<?> id : FacetTypeRegistry.getInstance().getFacetTypeIds()) {
      if (hasFacetWithRoots(project, id)) {
        Facet<?> facet = FacetFinder.getInstance(project).findFacet(file, (FacetTypeId)id);
        if (facet != null) {
          return facet;
        }
      }
    }
    return null;
  }

  private static <F extends Facet<?>> boolean hasFacetWithRoots(final @NotNull Project project, final @NotNull FacetTypeId<F> id) {
    for (Module module : ModuleManager.getInstance(project).getModules()) {
      Collection<? extends Facet<?>> facets = FacetManager.getInstance(module).getFacetsByType(id);
      Iterator<? extends Facet<?>> iterator = facets.iterator();
      if (iterator.hasNext()) {
        return iterator.next() instanceof FacetRootsProvider;
      }
    }
    return false;
  }

  public String toString() {
    return JavaUiBundle.message("select.in.project.settings");
  }

  @Override
  public float getWeight() {
    return StandardTargetWeights.PROJECT_SETTINGS_WEIGHT;
  }
}