text:
package sc.iview.commands.demo;

import cleargl.GLVector;
import graphics.scenery.BoundingGrid;
import graphics.scenery.volumes.Volume;
import net.imglib2.Cursor;
import net.imglib2.RandomAccess;
import net.imglib2.Sampler;
import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImgs;
import net.imglib2.type.numeric.integer.UnsignedByteType;
import org.scijava.command.Command;
import org.scijava.command.InteractiveCommand;
import org.scijava.plugin.Menu;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;
import org.scijava.widget.Button;
import org.scijava.widget.NumberWidget;
import sc.iview.SciView;

import static sc.iview.commands.MenuWeights.DEMO;
import static sc.iview.commands.MenuWeights.DEMO_GAME_OF_LIFE;

/**
 * Conway's Game of Life—in 3D!
 *
 * @author Curtis Rueden
 */
@Plugin(type = Command.class, menuRoot = "SciView", //
        menu = { @Menu(label = "Demo", weight = DEMO), //
                 @Menu(label = "Game of Life 3D", weight = DEMO_GAME_OF_LIFE) })
public class GameOfLife3D extends InteractiveCommand {

    private static final int ALIVE = 255;
    private static final int DEAD = 16;

    private static final String SIX = "6-connected";
    private static final String EIGHTEEN = "18-connected";
    private static final String TWENTY_SIX = "26-connected";

    @Parameter
    private SciView sciView;

    @Parameter(label = "Starvation threshold", min = "0", max = "26", persist = false)
    private int starvation = 5;

    @Parameter(label = "Birth threshold", min = "0", max = "26", persist = false)
    private int birth = 6;

    @Parameter(label = "Suffocation threshold", min = "0", max = "26", persist = false)
    private int suffocation = 9;

    @Parameter(choices = { SIX, EIGHTEEN, TWENTY_SIX }, persist = false)
    private String connectedness = TWENTY_SIX;

    @Parameter(label = "Initial saturation % when randomizing", min = "1", max = "99", style = NumberWidget.SCROLL_BAR_STYLE, persist = false)
    private int saturation = 10;

    @Parameter(label = "Play speed", min = "1", max="100", style = NumberWidget.SCROLL_BAR_STYLE, persist = false)
    private int playSpeed = 10;

    @Parameter(callback = "iterate")
    private Button iterate;

    @Parameter(callback = "randomize")
    private Button randomize;

    @Parameter(callback = "play")
    private Button play;

    @Parameter(callback = "pause")
    private Button pause;

    private int w = 64, h = 64, d = 64;
    private Img<UnsignedByteType> field;
    private String name;
    private float[] voxelDims;
    private Volume volume;

    /** Temporary buffer for use while recomputing the image. */
    private boolean[] bits = new boolean[w * h * d];

    /** Repeatedly iterates the simulation until stopped **/
    public void play() {
        sciView.animate( playSpeed, () -> {
            iterate();
        } );
    }

    /** Stops the simulation **/
    public void pause() {
        sciView.stopAnimation();
    }

    /** Randomizes a new bit field. */
    public void randomize() {
        final Cursor<UnsignedByteType> cursor = field.localizingCursor();
        final double chance = saturation / 100d;
        while( cursor.hasNext() ) {
            final boolean alive = Math.random() <= chance;
            cursor.next().set( alive ? ALIVE : DEAD );
        }
        updateVolume();
    }

    /** Performs one iteration of the game. */
    public void iterate() {
        final int connected;
        switch( connectedness ) {
        case SIX: connected = 6; break;
        case EIGHTEEN: connected = 18; break;
        default: connected = 26; break;
        }

        // compute the new image field
        final RandomAccess<UnsignedByteType> access = field.randomAccess();
        for( int z = 0; z < d; z++ ) {
            for( int y = 0; y < h; y++ ) {
                for( int x = 0; x < w; x++ ) {
                    final int i = z * w * h + y * w + x;
                    final int n = neighbors( access, x, y, z, connected );
                    access.setPosition( x, 0 );
                    access.setPosition( y, 1 );
                    access.setPosition( y, 2 );
                    if( alive( access ) ) {
                        // Living cell stays alive within (starvation, suffocation).
                        bits[i] = n > starvation && n < suffocation;
                    } else {
                        // New cell forms within [birth, suffocation).
                        bits[i] = n >= birth && n < suffocation;
                    }
                }
            }
        }

        // write the new bit field into the image
        final Cursor<UnsignedByteType> cursor = field.localizingCursor();
        while( cursor.hasNext() ) {
            cursor.fwd();
            final int x = cursor.getIntPosition( 0 );
            final int y = cursor.getIntPosition( 1 );
            final int z = cursor.getIntPosition( 2 );
            final boolean alive = bits[z * w * h + y * w + x];
            cursor.get().set( alive ? ALIVE : DEAD );
        }

        updateVolume();
    }

    @Override
    public void run() {
        field = ArrayImgs.unsignedBytes( w, h, d );
        randomize();
    }

    // -- Previewable methods --

    @Override
    public void preview() {
        // NB: Do nothing when parameters are tuned.
    }

    // -- Helper methods --

    private int neighbors( RandomAccess<UnsignedByteType> access, int x, int y, int z, int connected ) {
        int n = 0;
        // six-connected
        n += val( access, x - 1, y, z );
        n += val( access, x + 1, y, z );
        n += val( access, x, y - 1, z );
        n += val( access, x, y + 1, z );
        n += val( access, x, y, z - 1 );
        n += val( access, x, y, z + 1 );
        // eighteen-connected
        if( connected >= 18 ) {
            n += val( access, x - 1, y - 1, z );
            n += val( access, x + 1, y - 1, z );
            n += val( access, x - 1, y + 1, z );
            n += val( access, x + 1, y + 1, z );
            n += val( access, x - 1, y, z - 1 );
            n += val( access, x + 1, y, z - 1 );
            n += val( access, x - 1, y, z + 1 );
            n += val( access, x + 1, y, z + 1 );
            n += val( access, x, y - 1, z - 1 );
            n += val( access, x, y + 1, z - 1 );
            n += val( access, x, y - 1, z + 1 );
            n += val( access, x, y + 1, z + 1 );
        }
        // twenty-six-connected
        if( connected == 26 ) {
            n += val( access, x - 1, y - 1, z - 1 );
            n += val( access, x + 1, y - 1, z - 1 );
            n += val( access, x - 1, y + 1, z - 1 );
            n += val( access, x + 1, y + 1, z - 1 );
            n += val( access, x - 1, y - 1, z + 1 );
            n += val( access, x + 1, y - 1, z + 1 );
            n += val( access, x - 1, y + 1, z + 1 );
            n += val( access, x + 1, y + 1, z + 1 );
        }
        return n;
    }

    private int val( RandomAccess<UnsignedByteType> access, int x, int y, int z ) {
        if( x < 0 || x >= w || y < 0 || y >= h || z < 0 || z >= d ) return 0;
        access.setPosition( x, 0 );
        access.setPosition( y, 1 );
        access.setPosition( z, 2 );
        return alive( access ) ? 1 : 0;
    }

    private boolean alive( final Sampler<UnsignedByteType> access ) {
        return access.get().get() == ALIVE;
    }

    private long tick;

    private void updateVolume() {
        if( volume == null ) {
            name = "Life Simulation";
            voxelDims = new float[] { 1, 1, 1 };
            volume = ( Volume ) sciView.addVolume( field, name, voxelDims );

            BoundingGrid bg = new BoundingGrid();
            bg.setNode( volume );

            volume.setRenderScale((float) 0.1);
            volume.putAbove(new GLVector(0.0f, 1.0f, 0.0f));

            sciView.getCamera().setPosition( new GLVector( 0.0f, 3.5f, 14.5f ) );
            volume.setName( "Game of Life 3D" );
        } else {
            // NB: Name must be unique each time.
            sciView.updateVolume( field, name + "-" + ++tick, voxelDims, volume );
        }
    }
}


text:
<?php

namespace IPS\forums\extensions\core\EditorLocations;

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * Editor Extension: Forums
 */
class _Forums
{
	/**
	 * Can we use HTML in this editor?
	 *
	 * @param	\IPS\Member	$member	The member
	 * @return	bool|null	NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
	 */
	public function canUseHtml( $member )
	{
		return NULL;
	}

	/**
	 * Can we use attachments in this editor?
	 *
	 * @param	\IPS\Member					$member	The member
	 * @param	\IPS\Helpers\Form\Editor	$field	The editor field
	 * @return	bool|null	NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
	 */
	public function canAttach( $member, $field )
	{
		return NULL;
	}

	/**
	 * Permission check for attachments
	 *
	 * @param	\IPS\Member	$member	The member
	 * @param	int|null	$id1	Primary ID
	 * @param	int|null	$id2	Secondary ID
	 * @param	string|null	$id3	Arbitrary data
	 * @param	array		$attachment	The attachment data
	 * @return	bool
	 */
	public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
	{
		try
		{
			if ( $id3 )
			{
				return \IPS\forums\Forum::load( $id1 )->can( 'attachments', $member );
			}
			elseif ( $id2 )
			{
				$topic = \IPS\forums\Topic::load( $id1 );

				if( $topic->isArchived() )
				{
					$post = \IPS\forums\Topic\ArchivedPost::load( $id2 );
				}
				else
				{
					$post = \IPS\forums\Topic\Post::load( $id2 );
				}

				/* Check forums attachments permission */
				if ( $post->container()->can( 'attachments', $member ) )
				{
					/* Can we view post? */
					return $post->canView( $member );
				}

				return FALSE;
			}
			else
			{
				$topic = \IPS\forums\Topic::load( $id1 );

				/* Check forums attachments permission */
				if ( $topic->container()->can( 'attachments', $member ) )
				{
					/* Can we view the topic? */
					return \IPS\forums\Topic::load( $id1 )->canView( $member );
				}

				return FALSE;
			}
		}
		catch ( \OutOfRangeException $e )
		{
			return FALSE;
		}
	}

	/**
	 * Attachment lookup
	 *
	 * @param	int|null	$id1	Primary ID
	 * @param	int|null	$id2	Secondary ID
	 * @param	string|null	$id3	Arbitrary data
	 * @return	\IPS\Http\Url|\IPS\Content|\IPS\Node\Model
	 * @throws	\LogicException
	 */
	public function attachmentLookup( $id1, $id2, $id3 )
	{
		if ( $id3 )
		{
			return \IPS\forums\Forum::load( $id1 );
		}
		elseif ( $id2 )
		{
			$topic = \IPS\forums\Topic::load( $id1 );

			if( $topic->isArchived() )
			{
				return \IPS\forums\Topic\ArchivedPost::load( $id2 );
			}
			else
			{
				return \IPS\forums\Topic\Post::load( $id2 );
			}
		}
		else
		{
			return \IPS\forums\Topic::load( $id1 );
		}
	}

	/**
	 * Rebuild attachment images in non-content item areas
	 *
	 * @param	int|null	$offset	Offset to start from
	 * @param	int|null	$max	Maximum to parse
	 * @return	int			Number completed
	 * @note	This method is optional and will only be called if it exists
	 */
	public function rebuildAttachmentImages( $offset, $max )
	{
		return $this->performRebuild( $offset, $max, array( 'IPS\Text\Parser', 'rebuildAttachmentUrls' ) );
	}

	/**
	 * Rebuild content post-upgrade
	 *
	 * @param	int|null	$offset	Offset to start from
	 * @param	int|null	$max	Maximum to parse
	 * @return	int			Number completed
	 * @note	This method is optional and will only be called if it exists
	 */
	public function rebuildContent( $offset, $max )
	{
		return $this->performRebuild( $offset, $max, array( 'IPS\Text\LegacyParser', 'parseStatic' ) );
	}

	/**
	 * Perform rebuild - abstracted as the call for rebuildContent() and rebuildAttachmentImages() is nearly identical
	 *
	 * @param	int|null	$offset		Offset to start from
	 * @param	int|null	$max		Maximum to parse
	 * @param	callable	$callback	Method to call to rebuild content
	 * @return	int			Number completed
	 */
	protected function performRebuild( $offset, $max, $callback )
	{
		$did	= 0;

		/* Language bits */
		foreach( \IPS\Db::i()->select( '*', 'core_sys_lang_words', "word_key LIKE 'forums_forum_%_desc' OR word_key LIKE 'forums_forum_%_rules' OR word_key LIKE 'forums_forum_%_permerror'", 'word_id ASC', array( $offset, $max ) ) as $word )
		{
			$did++;

			try
			{
				$rebuilt	= call_user_func( $callback, $word['word_custom'] );
			}
			catch( \InvalidArgumentException $e )
			{
				if( $callback[1] == 'parseStatic' AND $e->getcode() == 103014 )
				{
					$rebuilt	= preg_replace( "#\[/?([^\]]+?)\]#", '', $word['word_custom'] );
				}
				else
				{
					throw $e;
				}
			}

			if( $rebuilt !== FALSE )
			{
				\IPS\Db::i()->update( 'core_sys_lang_words', array( 'word_custom' => $rebuilt ), 'word_id=' . $word['word_id'] );
			}
		}

		return $did;
	}

	/**
	 * Total content count to be used in progress indicator
	 *
	 * @return	int			Total Count
	 */
	public function contentCount()
	{
		return \IPS\Db::i()->select( 'COUNT(*)', 'core_sys_lang_words', "word_key LIKE 'forums_forum_%_desc' OR word_key LIKE 'forums_forum_%_rules' OR word_key LIKE 'forums_forum_%_permerror'" )->first();
	}
}

redpajama_set_name: RedPajamaGithub


text:
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.IntegrationEvents.EventHandling;

public class OrderPaymentFailedIntegrationEventHandler :
    IIntegrationEventHandler<OrderPaymentFailedIntegrationEvent>
{
    private readonly IMediator _mediator;
    private readonly ILogger<OrderPaymentFailedIntegrationEventHandler> _logger;

    public OrderPaymentFailedIntegrationEventHandler(
        IMediator mediator,
        ILogger<OrderPaymentFailedIntegrationEventHandler> logger)
    {
        _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator));
        _logger = logger ?? throw new ArgumentNullException(nameof(logger));
    }

    public async Task Handle(OrderPaymentFailedIntegrationEvent @event)
    {
        using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
        {
            _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);

            var command = new CancelOrderCommand(@event.OrderId);

            _logger.LogInformation(
                "----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
                command.GetGenericTypeName(),
                nameof(command.OrderNumber),
                command.OrderNumber,
                command);

            await _mediator.Send(command);
        }
    }
}


text:
This is project form my course Web Basics in Softuni.
.


text:
from __future__ import print_function
from antlr4.error.ErrorStrategy import DefaultErrorStrategy
from antlr4.Recognizer import Recognizer
from antlr4.Token import Token
from antlr4.Lexer import Lexer
from antlr4.atn.ATNDeserializer import ATNDeserializer
from antlr4.atn.ATNDeserializationOptions import ATNDeserializationOptions
from antlr4.error.Errors import UnsupportedOperationException
from antlr4.tree.ParseTreePatternMatcher import ParseTreePatternMatcher
from antlr4.tree.Tree import ParseTreeListener

class TraceListener(ParseTreeListener):

    def __init__(self, parser):
        self._parser = parser

    def enterEveryRule(self, ctx):
        print("enter   " + self._parser.ruleNames[ctx.getRuleIndex()] + ", LT(1)=" + self._parser._input.LT(1).text)

    def visitTerminal(self, node):
        print("consume " + str(node.symbol) + " rule " + self._parser.ruleNames[self._parser._ctx.getRuleIndex()])

    def visitErrorNode(self, node):
        pass

    def exitEveryRule(self, ctx):
        print("exit    " + self._parser.ruleNames[ctx.getRuleIndex()] + ", LT(1)=" + self._parser._input.LT(1).text)

# self is all the parsing support code essentially; most of it is error recovery stuff.#
class Parser (Recognizer):

    # self field maps from the serialized ATN string to the deserialized {@link ATN} with
    # bypass alternatives.
    #
    # @see ATNDeserializationOptions#isGenerateRuleBypassTransitions()
    #
    bypassAltsAtnCache = dict()

    def __init__(self, input):
        super(Parser, self).__init__()
        # The input stream.
        self._input = None
        # The error handling strategy for the parser. The default value is a new
        # instance of {@link DefaultErrorStrategy}.
        self._errHandler = DefaultErrorStrategy()
        self._precedenceStack = list()
        self._precedenceStack.append(0)
        # The {@link ParserRuleContext} object for the currently executing rule.
        # self is always non-null during the parsing process.
        self._ctx = None
        # Specifies whether or not the parser should construct a parse tree during
        # the parsing process. The default value is {@code true}.
        self.buildParseTrees = True
        # When {@link #setTrace}{@code (true)} is called, a reference to the
        # {@link TraceListener} is stored here so it can be easily removed in a
        # later call to {@link #setTrace}{@code (false)}. The listener itself is
        # implemented as a parser listener so self field is not directly used by
        # other parser methods.
        self._tracer = None
        # The list of {@link ParseTreeListener} listeners registered to receive
        # events during the parse.
        self._parseListeners = None
        # The number of syntax errors reported during parsing. self value is
        # incremented each time {@link #notifyErrorListeners} is called.
        self._syntaxErrors = 0
        self.setInputStream(input)

    # reset the parser's state#
    def reset(self):
        if self._input is not None:
            self._input.seek(0)
        self._errHandler.reset(self)
        self._ctx = None
        self._syntaxErrors = 0
        self.setTrace(False)
        self._precedenceStack = list()
        self._precedenceStack.append(0)
        if self._interp is not None:
            self._interp.reset()

    # Match current input symbol against {@code ttype}. If the symbol type
    # matches, {@link ANTLRErrorStrategy#reportMatch} and {@link #consume} are
    # called to complete the match process.
    #
    #
If the symbol type does not match,
    # {@link ANTLRErrorStrategy#recoverInline} is called on the current error
    # strategy to attempt recovery. If {@link #getBuildParseTree} is
    # {@code true} and the token index of the symbol returned by
    # {@link ANTLRErrorStrategy#recoverInline} is -1, the symbol is added to
    # the parse tree by calling {@link ParserRuleContext#addErrorNode}.

    #
    # @param ttype the token type to match
    # @return the matched symbol
    # @throws RecognitionException if the current input symbol did not match
    # {@code ttype} and the error strategy could not recover from the
    # mismatched symbol

    def match(self, ttype):
        t = self.getCurrentToken()
        if t.type==ttype:
            self._errHandler.reportMatch(self)
            self.consume()
        else:
            t = self._errHandler.recoverInline(self)
            if self.buildParseTrees and t.tokenIndex==-1:
                # we must have conjured up a new token during single token insertion
                # if it's not the current symbol
                self._ctx.addErrorNode(t)
        return t

    # Match current input symbol as a wildcard. If the symbol type matches
    # (i.e. has a value greater than 0), {@link ANTLRErrorStrategy#reportMatch}
    # and {@link #consume} are called to complete the match process.
    #
    #
If the symbol type does not match,
    # {@link ANTLRErrorStrategy#recoverInline} is called on the current error
    # strategy to attempt recovery. If {@link #getBuildParseTree} is
    # {@code true} and the token index of the symbol returned by
    # {@link ANTLRErrorStrategy#recoverInline} is -1, the symbol is added to
    # the parse tree by calling {@link ParserRuleContext#addErrorNode}.

    #
    # @return the matched symbol
    # @throws RecognitionException if the current input symbol did not match
    # a wildcard and the error strategy could not recover from the mismatched
    # symbol

    def matchWildcard(self):
        t = self.getCurrentToken()
        if t.type > 0:
            self._errHandler.reportMatch(self)
            self.consume()
        else:
            t = self._errHandler.recoverInline(self)
            if self.buildParseTrees and t.tokenIndex == -1:
                # we must have conjured up a new token during single token insertion
                # if it's not the current symbol
                self._ctx.addErrorNode(t)

        return t

    def getParseListeners(self):
        return list() if self._parseListeners is None else self._parseListeners

    # Registers {@code listener} to receive events during the parsing process.
    #
    #
To support output-preserving grammar transformations (including but not
    # limited to left-recursion removal, automated left-factoring, and
    # optimized code generation), calls to listener methods during the parse
    # may differ substantially from calls made by
    # {@link ParseTreeWalker#DEFAULT} used after the parse is complete. In
    # particular, rule entry and exit events may occur in a different order
    # during the parse than after the parser. In addition, calls to certain
    # rule entry methods may be omitted.

    #
    #
With the following specific exceptions, calls to listener events are
    # deterministic, i.e. for identical input the calls to listener
    # methods will be the same.

    #
    #

    #
Alterations to the grammar used to generate code may change the
    # behavior of the listener calls.

    #
Alterations to the command line options passed to ANTLR 4 when
    # generating the parser may change the behavior of the listener calls.

    #
Changing the version of the ANTLR Tool used to generate the parser
    # may change the behavior of the listener calls.

    #

    #
    # @param listener the listener to add
    #
    # @throws NullPointerException if {@code} listener is {@code null}
    #
    def addParseListener(self, listener):
        if listener is None:
            raise ReferenceError("listener")
        if self._parseListeners is None:
            self._parseListeners = []
        self._parseListeners.append(listener)

    #
    # Remove {@code listener} from the list of parse listeners.
    #
    #
If {@code listener} is {@code null} or has not been added as a parse
    # listener, self method does nothing.

    # @param listener the listener to remove
    #
    def removeParseListener(self, listener):
        if self._parseListeners is not None:
            self._parseListeners.remove(listener)
            if len(self._parseListeners)==0:
                    self._parseListeners = None

    # Remove all parse listeners.
    def removeParseListeners(self):
        self._parseListeners = None

    # Notify any parse listeners of an enter rule event.
    def triggerEnterRuleEvent(self):
        if self._parseListeners is not None:
            for listener in self._parseListeners:
                listener.enterEveryRule(self._ctx)
                self._ctx.enterRule(listener)

    #
    # Notify any parse listeners of an exit rule event.
    #
    # @see #addParseListener
    #
    def triggerExitRuleEvent(self):
        if self._parseListeners is not None:
            # reverse order walk of listeners
            for listener in reversed(self._parseListeners):
                self._ctx.exitRule(listener)
                listener.exitEveryRule(self._ctx)

    def getTokenFactory(self):
        return self._input.tokenSource._factory

    # Tell our token source and error strategy about a new way to create tokens.#
    def setTokenFactory(self, factory):
        self._input.tokenSource._factory = factory

    # The ATN with bypass alternatives is expensive to create so we create it
    # lazily.
    #
    # @throws UnsupportedOperationException if the current parser does not
    # implement the {@link #getSerializedATN()} method.
    #
    def getATNWithBypassAlts(self):
        serializedAtn = self.getSerializedATN()
        if serializedAtn is None:
            raise UnsupportedOperationException("The current parser does not support an ATN with bypass alternatives.")
        result = self.bypassAltsAtnCache.get(serializedAtn, None)
        if result is None:
            deserializationOptions = ATNDeserializationOptions()
            deserializationOptions.generateRuleBypassTransitions = True
            result = ATNDeserializer(deserializationOptions).deserialize(serializedAtn)
            self.bypassAltsAtnCache[serializedAtn] = result
        return result

    # The preferred method of getting a tree pattern. For example, here's a
    # sample use:
    #
    #

    # ParseTree t = parser.expr();
    # ParseTreePattern p = parser.compileParseTreePattern("<ID>+0", MyParser.RULE_expr);
    # ParseTreeMatch m = p.match(t);
    # String id = m.get("ID");
    #

    #
    def compileParseTreePattern(self, pattern, patternRuleIndex, lexer = None):
        if lexer is None:
            if self.getTokenStream() is not None:
                tokenSource = self.getTokenStream().getTokenSource()
            if isinstance( tokenSource, Lexer ):
                lexer = tokenSource
        if lexer is None:
            raise UnsupportedOperationException("Parser can't discover a lexer to use")

        m = ParseTreePatternMatcher(lexer, self)
        return m.compile(pattern, patternRuleIndex)

    def getInputStream(self):
        return self.getTokenStream()

    def setInputStream(self, input):
        self.setTokenStream(input)

    def getTokenStream(self):
        return self._input

    # Set the token stream and reset the parser.#
    def setTokenStream(self, input):
        self._input = None
        self.reset()
        self._input = input

    # Match needs to return the current input symbol, which gets put
    #  into the label for the associated token ref; e.g., x=ID.
    #
    def getCurrentToken(self):
        return self._input.LT(1)

    def notifyErrorListeners(self, msg, offendingToken = None, e = None):
        if offendingToken is None:
            offendingToken = self.getCurrentToken()
        self._syntaxErrors += 1
        line = offendingToken.line
        column = offendingToken.column
        listener = self.getErrorListenerDispatch()
        listener.syntaxError(self, offendingToken, line, column, msg, e)

    #
    # Consume and return the {@linkplain #getCurrentToken current symbol}.
    #
    #
E.g., given the following input with {@code A} being the current
    # lookahead symbol, self function moves the cursor to {@code B} and returns
    # {@code A}.

    #
    #

    #  A B
    #  ^
    #

    #
    # If the parser is not in error recovery mode, the consumed symbol is added
    # to the parse tree using {@link ParserRuleContext#addChild(Token)}, and
    # {@link ParseTreeListener#visitTerminal} is called on any parse listeners.
    # If the parser is in error recovery mode, the consumed symbol is
    # added to the parse tree using
    # {@link ParserRuleContext#addErrorNode(Token)}, and
    # {@link ParseTreeListener#visitErrorNode} is called on any parse
    # listeners.
    #
    def consume(self):
        o = self.getCurrentToken()
        if o.type != Token.EOF:
            self.getInputStream().consume()
        hasListener = self._parseListeners is not None and len(self._parseListeners)>0
        if self.buildParseTrees or hasListener:
            if self._errHandler.inErrorRecoveryMode(self):
                node = self._ctx.addErrorNode(o)
            else:
                node = self._ctx.addTokenNode(o)
            if hasListener:
                for listener in self._parseListeners:
                    listener.visitTerminal(node)
        return o

    def addContextToParseTree(self):
        # add current context to parent if we have a parent
        if self._ctx.parentCtx is not None:
            self._ctx.parentCtx.addChild(self._ctx)

    # Always called by generated parsers upon entry to a rule. Access field
    # {@link #_ctx} get the current context.
    #
    def enterRule(self, localctx , state , ruleIndex ):
        self.state = state
        self._ctx = localctx
        self._ctx.start = self._input.LT(1)
        if self.buildParseTrees:
            self.addContextToParseTree()
        if self._parseListeners  is not None:
            self.triggerEnterRuleEvent()

    def exitRule(self):
        self._ctx.stop = self._input.LT(-1)
        # trigger event on _ctx, before it reverts to parent
        if self._parseListeners is not None:
            self.triggerExitRuleEvent()
        self.state = self._ctx.invokingState
        self._ctx = self._ctx.parentCtx

    def enterOuterAlt(self, localctx, altNum):
        # if we have new localctx, make sure we replace existing ctx
        # that is previous child of parse tree
        if self.buildParseTrees and self._ctx != localctx:
            if self._ctx.parentCtx is not None:
                self._ctx.parentCtx.removeLastChild()
                self._ctx.parentCtx.addChild(localctx)
        self._ctx = localctx

    # Get the precedence level for the top-most precedence rule.
    #
    # @return The precedence level for the top-most precedence rule, or -1 if
    # the parser context is not nested within a precedence rule.
    #
    def getPrecedence(self):
        if len(self._precedenceStack)==0:
            return -1
        else:
            return self._precedenceStack[-1]

    def enterRecursionRule(self, localctx, state, ruleIndex, precedence):
        self.state = state
        self._precedenceStack.append(precedence)
        self._ctx = localctx
        self._ctx.start = self._input.LT(1)
        if self._parseListeners is not None:
            self.triggerEnterRuleEvent() # simulates rule entry for left-recursive rules

    #
    # Like {@link #enterRule} but for recursive rules.
    #
    def pushNewRecursionContext(self, localctx, state, ruleIndex):
        previous = self._ctx
        previous.parentCtx = localctx
        previous.invokingState = state
        previous.stop = self._input.LT(-1)

        self._ctx = localctx
        self._ctx.start = previous.start
        if self.buildParseTrees:
            self._ctx.addChild(previous)

        if self._parseListeners is not None:
            self.triggerEnterRuleEvent() # simulates rule entry for left-recursive rules

    def unrollRecursionContexts(self, parentCtx):
        self._precedenceStack.pop()
        self._ctx.stop = self._input.LT(-1)
        retCtx = self._ctx # save current ctx (return value)
        # unroll so _ctx is as it was before call to recursive method
        if self._parseListeners is not None:
            while self._ctx is not parentCtx:
                self.triggerExitRuleEvent()
                self._ctx = self._ctx.parentCtx
        else:
            self._ctx = parentCtx

        # hook into tree
        retCtx.parentCtx = parentCtx

        if self.buildParseTrees and parentCtx is not None:
            # add return ctx into invoking rule's tree
            parentCtx.addChild(retCtx)

    def getInvokingContext(self, ruleIndex):
        ctx = self._ctx
        while ctx is not None:
            if ctx.ruleIndex == ruleIndex:
                return ctx
            ctx = ctx.parentCtx
        return None

    def precpred(self, localctx , precedence):
        return precedence >= self._precedenceStack[-1]

    def inContext(self, context):
        # TODO: useful in parser?
        return False

    #
    # Checks whether or not {@code symbol} can follow the current state in the
    # ATN. The behavior of self method is equivalent to the following, but is
    # implemented such that the complete context-sensitive follow set does not
    # need to be explicitly constructed.
    #
    #

    # return getExpectedTokens().contains(symbol);
    #

    #
    # @param symbol the symbol type to check
    # @return {@code true} if {@code symbol} can follow the current state in
    # the ATN, otherwise {@code false}.
    #
    def isExpectedToken(self, symbol):
        atn = self._interp.atn
        ctx = self._ctx
        s = atn.states[self.state]
        following = atn.nextTokens(s)
        if symbol in following:
            return True
        if not Token.EPSILON in following:
            return False

        while ctx is not None and ctx.invokingState>=0 and Token.EPSILON in following:
            invokingState = atn.states[ctx.invokingState]
            rt = invokingState.transitions[0]
            following = atn.nextTokens(rt.followState)
            if symbol in following:
                return True
            ctx = ctx.parentCtx

        if Token.EPSILON in following and symbol == Token.EOF:
            return True
        else:
            return False

    # Computes the set of input symbols which could follow the current parser
    # state and context, as given by {@link #getState} and {@link #getContext},
    # respectively.
    #
    # @see ATN#getExpectedTokens(int, RuleContext)
    #
    def getExpectedTokens(self):
        return self._interp.atn.getExpectedTokens(self.state, self._ctx)

    def getExpectedTokensWithinCurrentRule(self):
        atn = self._interp.atn
        s = atn.states[self.state]
        return atn.nextTokens(s)

    # Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found.#
    def getRuleIndex(self, ruleName):
        ruleIndex = self.getRuleIndexMap().get(ruleName, None)
        if ruleIndex is not None:
            return ruleIndex
        else:
            return -1

    # Return List<String> of the rule names in your parser instance
    #  leading up to a call to the current rule.  You could override if
    #  you want more details such as the file/line info of where
    #  in the ATN a rule is invoked.
    #
    #  this is very useful for error messages.
    #
    def getRuleInvocationStack(self, p=None):
        if p is None:
            p = self._ctx
        stack = list()
        while p is not None:
            # compute what follows who invoked us
            ruleIndex = p.getRuleIndex()
            if ruleIndex<0:
                stack.append("n/a")
            else:
                stack.append(self.ruleNames[ruleIndex])
            p = p.parentCtx
        return stack

    # For debugging and other purposes.#
    def getDFAStrings(self):
        return [ unicode(dfa) for dfa in self._interp.decisionToDFA]

    # For debugging and other purposes.#
    def dumpDFA(self):
        seenOne = False
        for i in range(0, len(self._interp.decisionToDFA)):
            dfa = self._interp.decisionToDFA[i]
            if len(dfa.states)>0:
                if seenOne:
                    print()
                print("Decision " + str(dfa.decision) + ":")
                print(dfa.toString(self.literalNames, self.symbolicNames), end='')
                seenOne = True

    def getSourceName(self):
        return self._input.sourceName

    # During a parse is sometimes useful to listen in on the rule entry and exit
    #  events as well as token matches. self is for quick and dirty debugging.
    #
    def setTrace(self, trace):
        if not trace:
            self.removeParseListener(self._tracer)
            self._tracer = None
        else:
            if self._tracer is not None:
                self.removeParseListener(self._tracer)
            self._tracer = TraceListener(self)
            self.addParseListener(self._tracer)


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Extensions;

namespace Microsoft.CodeAnalysis.CSharp.UseExpressionBodyForLambda
{
    /// <summary>
    /// Helper class that allows us to share lots of logic between the diagnostic analyzer and the
    /// code refactoring provider.  Those can't share a common base class due to their own inheritance
    /// requirements with <see cref="DiagnosticAnalyzer"/> and <see cref="CodeRefactoringProvider"/>.
    /// </summary>
    internal static class UseExpressionBodyForLambdaHelpers
    {
        public static readonly LocalizableString UseExpressionBodyTitle = new LocalizableResourceString(nameof(FeaturesResources.Use_expression_body_for_lambda_expressions), FeaturesResources.ResourceManager, typeof(FeaturesResources));
        public static readonly LocalizableString UseBlockBodyTitle = new LocalizableResourceString(nameof(FeaturesResources.Use_block_body_for_lambda_expressions), FeaturesResources.ResourceManager, typeof(FeaturesResources));

        public static ExpressionSyntax GetExpressionBody(LambdaExpressionSyntax declaration)
            => declaration.Body as ExpressionSyntax;

        public static bool CanOfferUseExpressionBody(
            OptionSet optionSet, LambdaExpressionSyntax declaration, bool forAnalyzer)
        {
            var currentOptionValue = optionSet.GetOption(CSharpCodeStyleOptions.PreferExpressionBodiedLambdas);
            var preference = currentOptionValue.Value;
            var userPrefersExpressionBodies = preference != ExpressionBodyPreference.Never;
            var analyzerDisabled = currentOptionValue.Notification.Severity == ReportDiagnostic.Suppress;

            // If the user likes expression bodies, then we offer expression bodies from the diagnostic analyzer.
            // If the user does not like expression bodies then we offer expression bodies from the refactoring provider.
            // If the analyzer is disabled completely, the refactoring is enabled in both directions.
            if (userPrefersExpressionBodies == forAnalyzer || (!forAnalyzer && analyzerDisabled))
            {
                var expressionBody = GetExpressionBody(declaration);
                if (expressionBody == null)
                {
                    // They don't have an expression body.  See if we could convert the block they
                    // have into one.

                    var options = declaration.SyntaxTree.Options;
                    var conversionPreference = forAnalyzer ? preference : ExpressionBodyPreference.WhenPossible;

                    return TryConvertToExpressionBody(declaration, options, conversionPreference, out _, out _);
                }
            }

            return false;
        }

        private static bool TryConvertToExpressionBody(
            LambdaExpressionSyntax declaration,
            ParseOptions options, ExpressionBodyPreference conversionPreference,
            out ExpressionSyntax expressionWhenOnSingleLine,
            out SyntaxToken semicolonWhenOnSingleLine)
        {
            return TryConvertToExpressionBodyWorker(
                declaration, options, conversionPreference,
                out expressionWhenOnSingleLine, out semicolonWhenOnSingleLine);
        }

        private static bool TryConvertToExpressionBodyWorker(
            LambdaExpressionSyntax declaration, ParseOptions options, ExpressionBodyPreference conversionPreference,
            out ExpressionSyntax expressionWhenOnSingleLine, out SyntaxToken semicolonWhenOnSingleLine)
        {
            var body = declaration.Body as BlockSyntax;

            return body.TryConvertToExpressionBody(
                declaration.Kind(), options, conversionPreference,
                out expressionWhenOnSingleLine, out semicolonWhenOnSingleLine);
        }

        public static (bool canOffer, bool fixesError) CanOfferUseBlockBody(
            SemanticModel semanticModel, OptionSet optionSet,
            LambdaExpressionSyntax declaration, bool forAnalyzer,
            CancellationToken cancellationToken)
        {
            var expressionBodyOpt = GetExpressionBody(declaration);
            if (expressionBodyOpt == null)
            {
                return (canOffer: false, fixesError: false);
            }

            // We need to know what sort of lambda this is (void returning or not) in order to be
            // able to create the right sort of block body (i.e. with a return-statement or
            // expr-statement).  So, if we can't figure out what lambda type this is, we should not
            // proceed.
            var lambdaType = semanticModel.GetTypeInfo(declaration, cancellationToken).ConvertedType as INamedTypeSymbol;
            if (lambdaType == null || lambdaType.DelegateInvokeMethod == null)
            {
                return (canOffer: false, fixesError: false);
            }

            var canOffer = expressionBodyOpt.TryConvertToStatement(
                semicolonTokenOpt: default, createReturnStatementForExpression: false, out var statement) == true;
            if (!canOffer)
            {
                return (canOffer: false, fixesError: false);
            }

            var languageVersion = ((CSharpParseOptions)declaration.SyntaxTree.Options).LanguageVersion;
            if (expressionBodyOpt.IsKind(SyntaxKind.ThrowExpression) &&
                languageVersion < LanguageVersion.CSharp7)
            {
                // If they're using a throw expression in a declaration and it's prior to C# 7
                // then always mark this as something that can be fixed by the analyzer.  This way
                // we'll also get 'fix all' working to fix all these cases.
                return (canOffer, fixesError: true);
            }

            var currentOptionValue = optionSet.GetOption(CSharpCodeStyleOptions.PreferExpressionBodiedLambdas);
            var preference = currentOptionValue.Value;
            var userPrefersBlockBodies = preference == ExpressionBodyPreference.Never;
            var analyzerDisabled = currentOptionValue.Notification.Severity == ReportDiagnostic.Suppress;

            // If the user likes block bodies, then we offer block bodies from the diagnostic analyzer.
            // If the user does not like block bodies then we offer block bodies from the refactoring provider.
            // If the analyzer is disabled completely, the refactoring is enabled in both directions.
            canOffer = userPrefersBlockBodies == forAnalyzer || (!forAnalyzer && analyzerDisabled);
            return (canOffer, fixesError: false);
        }

        public static LambdaExpressionSyntax Update(
            SemanticModel semanticModel, bool useExpressionBody,
            LambdaExpressionSyntax originalDeclaration, LambdaExpressionSyntax currentDeclaration)
        {
            return UpdateWorker(semanticModel, useExpressionBody, originalDeclaration, currentDeclaration)
                .WithAdditionalAnnotations(Formatter.Annotation);
        }

        private static LambdaExpressionSyntax UpdateWorker(
            SemanticModel semanticModel, bool useExpressionBody,
            LambdaExpressionSyntax originalDeclaration, LambdaExpressionSyntax currentDeclaration)
        {
            return useExpressionBody
                ? WithExpressionBody(currentDeclaration)
                : WithBlockBody(semanticModel, originalDeclaration, currentDeclaration);
        }

        private static LambdaExpressionSyntax WithExpressionBody(LambdaExpressionSyntax declaration)
        {
            if (!TryConvertToExpressionBody(
                    declaration, declaration.SyntaxTree.Options, ExpressionBodyPreference.WhenPossible,
                    out var expressionBody, out _))
            {
                return declaration;
            }

            var updatedDecl = declaration.WithBody(expressionBody);

            // If there will only be whitespace between the arrow and the body, then replace that
            // with a single space so that the lambda doesn't have superfluous newlines in it.
            if (declaration.ArrowToken.TrailingTrivia.All(t => t.IsWhitespaceOrEndOfLine()) &&
                expressionBody.GetLeadingTrivia().All(t => t.IsWhitespaceOrEndOfLine()))
            {
                updatedDecl = updatedDecl.WithArrowToken(updatedDecl.ArrowToken.WithTrailingTrivia(SyntaxFactory.ElasticSpace));
            }

            return updatedDecl;
        }

        private static LambdaExpressionSyntax WithBlockBody(
            SemanticModel semanticModel, LambdaExpressionSyntax originalDeclaration, LambdaExpressionSyntax currentDeclaration)
        {
            var expressionBody = GetExpressionBody(currentDeclaration);
            var createReturnStatementForExpression = CreateReturnStatementForExpression(semanticModel, originalDeclaration);

            if (!expressionBody.TryConvertToStatement(
                    semicolonTokenOpt: default,
                    createReturnStatementForExpression,
                    out var statement))
            {

                return currentDeclaration;
            }

            // If the user is converting to a block, it's likely they intend to add multiple
            // statements to it.  So make a multi-line block so that things are formatted properly
            // for them to do so.
            return currentDeclaration.WithBody(SyntaxFactory.Block(
                SyntaxFactory.Token(SyntaxKind.OpenBraceToken).WithAppendedTrailingTrivia(SyntaxFactory.ElasticCarriageReturnLineFeed),
                SyntaxFactory.SingletonList(statement),
                SyntaxFactory.Token(SyntaxKind.CloseBraceToken)));
        }

        private static bool CreateReturnStatementForExpression(
            SemanticModel semanticModel, LambdaExpressionSyntax declaration)
        {
            var lambdaType = (INamedTypeSymbol)semanticModel.GetTypeInfo(declaration).ConvertedType;
            if (lambdaType.DelegateInvokeMethod.ReturnsVoid)
            {
                return false;
            }

            // 'async Task' is effectively a void-returning lambda.  we do not want to create
            // 'return statements' when converting.
            if (declaration.AsyncKeyword != default)
            {
                var returnType = lambdaType.DelegateInvokeMethod.ReturnType;
                if (returnType.IsErrorType())
                {
                    // "async Goo" where 'Goo' failed to bind.  If 'Goo' is 'Task' then it's
                    // reasonable to assume this is just a missing 'using' and that this is a true
                    // "async Task" lambda.  If the name isn't 'Task', then this looks like a
                    // real return type, and we should use return statements.
                    return returnType.Name != nameof(Task);
                }

                var taskType = semanticModel.Compilation.GetTypeByMetadataName(typeof(Task).FullName);
                if (returnType.Equals(taskType))
                {
                    // 'async Task'.  definitely do not create a 'return' statement;
                    return false;
                }
            }

            return true;
        }
    }
}


text:
package com.tle.web.api.item.interfaces;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;

@Produces({"application/json"})
@Path("item/{uuid}/{version}/lock")
@Api(value = "Item locks", description = "item-lock")
public interface ItemLockResource {
  @Path("")
  @GET
  @ApiOperation(value = "Get an existing lock for an item")
  public Response get(
      @Context UriInfo uriInfo, @PathParam("uuid") String uuid, @PathParam("version") int version);

  @Path("")
  @POST
  @ApiOperation(value = "Create a lock for an item")
  public Response lock(
      @Context UriInfo uriInfo, @PathParam("uuid") String uuid, @PathParam("version") int version);

  @Path("")
  @DELETE
  @ApiOperation(value = "Unlock a locked item")
  public Response unlock(@PathParam("uuid") String uuid, @PathParam("version") int version);
}


text:
package org.graylog2;

import java.util.Map;

public interface GelfMessageProvider {
    public boolean isExtractStacktrace();
    public String getOriginHost();
    public String getFacility();
    public Map<String, String> getFields();
    public boolean isAddExtendedInformation();
    public boolean isIncludeLocation();
    public Object transformExtendedField(String field, Object object);
}


text:
package org.workcraft.plugins.petri.dom;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.workcraft.dom.Connection;
import org.workcraft.exceptions.InvalidConnectionException;
import org.workcraft.plugins.petri.PetriNet;
import org.workcraft.plugins.petri.Place;
import org.workcraft.plugins.petri.Transition;

public class DOMTests {

    @Test
    public void test1() throws InvalidConnectionException {
        PetriNet petri = new PetriNet();

        Place p1 = new Place();
        Place p2 = new Place();
        Transition t1 = new Transition();

        petri.add(p1);
        petri.add(p2);
        petri.add(t1);
        Connection con1 = petri.connect(p1, t1);
        Connection con2 = petri.connect(t1, p2);

        assertSame(p1, petri.getNodeByReference(petri.getNodeReference(p1)));
        assertSame(p2, petri.getNodeByReference(petri.getNodeReference(p2)));

        assertTrue(petri.getPreset(p2).contains(t1));
        assertTrue(petri.getPostset(p1).contains(t1));

        assertTrue(petri.getConnections(p1).contains(con1));

        petri.remove(p1);

        assertTrue(petri.getConnections(t1).contains(con2));
        assertFalse(petri.getConnections(t1).contains(con1));

        boolean thrown = true;
        try {
            petri.getNodeReference(null);
            thrown = false;
        } catch (Throwable th) { }

        assertTrue(thrown);
    }

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Threading.Tasks.Channels
{
    /// <summary>Provides a base class for channels that support reading and writing elements of type <typeparamref name="T"/>.</summary>
    /// <typeparam name="T">Specifies the type of data readable and writable in the channel.</typeparam>
    public abstract class Channel<T> : Channel<T, T> { }
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

// UnityEngine.SocialPlatforms.IAchievement[]
struct IAchievementU5BU5D_t851122303;
// System.IAsyncResult
struct IAsyncResult_t537683269;
// System.AsyncCallback
struct AsyncCallback_t1363551830;
// System.Object
struct Il2CppObject;

#include "mscorlib_System_MulticastDelegate2585444626.h"
#include "mscorlib_System_Void2779279689.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Action`1<UnityEngine.SocialPlatforms.IAchievement[]>
struct  Action_1_t999575008  : public MulticastDelegate_t2585444626
{
public:

public:
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
title: 'Brackets Blog - The Free, Open Source Code Editor for the Web'
author: azu
layout: post
itemUrl: 'http://blog.brackets.io/2015/03/02/brackets-1-2-now-available/'
editJSONPath: 'https://github.com/jser/jser.info/edit/gh-pages/data/2015/03/index.json'
date: '2015-03-03T06:30:18+00:00'
tags:
  - JavaScript
  - editor
  - ReleaseNote
---
Brackets 1.2リリース


text:
package cz.req.ax.ui;

import com.vaadin.shared.MouseEventDetails;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.Window;
import com.vaadin.util.ReflectTools;
import cz.req.ax.Ax;

import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Objects;

/**
 * @author Jan Pikl
 *         Date: 15.2.2016
 */
public class AxWindowButton extends Button {

    private AxWindow window;
    private boolean closeAfterClick;
    private AxWindow.Align alignment = AxWindow.Align.RIGHT;
    private int order = 0;

    public AxWindowButton() {
        Ax.defaults(this);
    }

    public AxWindow getWindow() {
        return window;
    }

    public void setWindow(AxWindow window) {
        this.window = window;
    }

    public boolean isCloseAfterClick() {
        return closeAfterClick;
    }

    public void setCloseAfterClick(boolean close) {
        closeAfterClick = close;
    }

    public AxWindow.Align getAlignment() {
        return alignment;
    }

    public void setAlignment(AxWindow.Align newAlignment) {
        if (alignment != newAlignment) {
            alignment = Objects.requireNonNull(newAlignment);
            if (window != null) {
                window.setFooterComponentAlignment(this, alignment);
            }
        }
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int newOrder) {
        if (order != newOrder) {
            order = newOrder;
            if (window != null) {
                window.setFooterComponentOrder(this, order);
            }
        }
    }

    @Override
    protected void fireClick() {
        super.fireClick();
        fireWindowClick();
    }

    @Override
    protected void fireClick(MouseEventDetails details) {
        super.fireClick(details);
        fireWindowClick();
    }

    private void fireWindowClick() {
        if (window != null) {
            fireEvent(new ClickEvent(this, window));
            if (closeAfterClick) {
                window.close();
            }
        }
    }

    public void addWindowClickListener(ClickListener listener) {
        addListener(ClickEvent.class, listener, ClickListener.BUTTON_CLICK_METHOD);
    }

    public void removeWindowClickListener(ClickListener listener) {
        removeListener(ClickEvent.class, listener, ClickListener.BUTTON_CLICK_METHOD);
    }

    public static class ClickEvent extends Component.Event {

        private Window window;

        public ClickEvent(Component source, Window window) {
            super(source);
            this.window = window;
        }

        public Window getWindow() {
            return window;
        }

    }

    public interface ClickListener extends Serializable {

        Method BUTTON_CLICK_METHOD = ReflectTools.findMethod(ClickListener.class, "windowButtonClick", ClickEvent.class);

        void windowButtonClick(ClickEvent event);

    }

}


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package com.intellij.ide.projectView.impl;

import com.intellij.ide.dnd.aware.DnDAwareTree;
import com.intellij.ide.projectView.ProjectViewNode;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.newvfs.VfsPresentationUtil;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiDirectoryContainer;
import com.intellij.psi.PsiElement;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.ui.DirtyUI;
import com.intellij.ui.popup.HintUpdateSupply;
import com.intellij.ui.tabs.FileColorManagerImpl;
import com.intellij.util.ObjectUtils;
import com.intellij.util.ui.tree.TreeUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import java.awt.*;

/**
 * @author Konstantin Bulenkov
 */
public class ProjectViewTree extends DnDAwareTree {
  private static final Logger LOG = Logger.getInstance(ProjectViewTree.class);

  /**
   * @deprecated use another constructor instead
   */
  @Deprecated
  @SuppressWarnings("unused")
  @ApiStatus.ScheduledForRemoval(inVersion = "2022.2")
  protected ProjectViewTree(Project project, TreeModel model) {
    this(model);
  }

  public ProjectViewTree(TreeModel model) {
    super((TreeModel)null);
    setLargeModel(true);
    setModel(model);
    setCellRenderer(createCellRenderer());
    HintUpdateSupply.installDataContextHintUpdateSupply(this);
  }

  /**
   * @return custom renderer for tree nodes
   */
  @NotNull
  protected TreeCellRenderer createCellRenderer() {
    return new ProjectViewRenderer();
  }

  /**
   * @deprecated Not every tree employs {@link DefaultMutableTreeNode} so
   * use {@link #getSelectionPaths()} or {@link TreeUtil#getSelectedPathIfOne(JTree)} directly.
   */
  @Deprecated
  @ApiStatus.ScheduledForRemoval(inVersion = "2021.3")
  public DefaultMutableTreeNode getSelectedNode() {
    TreePath path = TreeUtil.getSelectedPathIfOne(this);
    return path == null ? null : ObjectUtils.tryCast(path.getLastPathComponent(), DefaultMutableTreeNode.class);
  }

  @Override
  public void setToggleClickCount(int count) {
    if (count != 2) LOG.info(new IllegalStateException("setToggleClickCount: unexpected count = " + count));
    super.setToggleClickCount(count);
  }

  @Override
  public boolean isFileColorsEnabled() {
    return isFileColorsEnabledFor(this);
  }

  public static boolean isFileColorsEnabledFor(JTree tree) {
    boolean enabled = FileColorManagerImpl._isEnabled() && FileColorManagerImpl._isEnabledForProjectView();
    boolean opaque = tree.isOpaque();
    if (enabled && opaque) {
      tree.setOpaque(false);
    }
    else if (!enabled && !opaque) {
      tree.setOpaque(true);
    }
    return enabled;
  }

  @DirtyUI
  @Nullable
  @Override
  public Color getFileColorFor(Object object) {
    if (object instanceof DefaultMutableTreeNode) {
      DefaultMutableTreeNode node = (DefaultMutableTreeNode)object;
      object = node.getUserObject();
    }
    if (object instanceof AbstractTreeNode) {
      AbstractTreeNode<?> node = (AbstractTreeNode<?>)object;
      Object value = node.getValue();
      if (value instanceof PsiElement) {
        return getColorForElement((PsiElement)value);
      }
    }
    if (object instanceof ProjectViewNode) {
      ProjectViewNode<?> node = (ProjectViewNode<?>)object;
      VirtualFile file = node.getVirtualFile();
      if (file != null) {
        Project project = node.getProject();
        if (project != null && !project.isDisposed()) {
          Color color = VfsPresentationUtil.getFileBackgroundColor(project, file);
          if (color != null) return color;
        }
      }
    }
    return null;
  }

  @Nullable
  public static Color getColorForElement(@Nullable PsiElement psi) {
    Color color = null;
    if (psi != null) {
      if (!psi.isValid()) return null;

      Project project = psi.getProject();
      final VirtualFile file = PsiUtilCore.getVirtualFile(psi);

      if (file != null) {
        color = VfsPresentationUtil.getFileBackgroundColor(project, file);
      }
      else if (psi instanceof PsiDirectory) {
        color = VfsPresentationUtil.getFileBackgroundColor(project, ((PsiDirectory)psi).getVirtualFile());
      }
      else if (psi instanceof PsiDirectoryContainer) {
        final PsiDirectory[] dirs = ((PsiDirectoryContainer)psi).getDirectories();
        for (PsiDirectory dir : dirs) {
          Color c = VfsPresentationUtil.getFileBackgroundColor(project, dir.getVirtualFile());
          if (c != null && color == null) {
            color = c;
          }
          else if (c != null) {
            color = null;
            break;
          }
        }
      }
    }
    return color;
  }
}


text:
template <typename Parameters>
void test_rtree_value_exceptions(Parameters const& parameters = Parameters())
{
    typedef std::pair<bg::model::point<float, 2, bg::cs::cartesian>, throwing_value> Value;
    typedef bgi::rtree<Value, Parameters> Tree;
    typedef typename Tree::bounds_type B;

    throwing_value::reset_calls_counter();
    throwing_value::set_max_calls((std::numeric_limits<size_t>::max)());
    std::vector<Value> input;
    B qbox;
    generate::input<2>::apply(input, qbox);

    for ( size_t i = 0 ; i < 50 ; i += 2 )
    {
        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(10000);

        Tree tree(parameters);

        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(i);

        BOOST_CHECK_THROW( tree.insert(input.begin(), input.end()), throwing_value_copy_exception );
    }

    for ( size_t i = 0 ; i < 20 ; i += 1 )
    {
        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(i);

        BOOST_CHECK_THROW( Tree tree(input.begin(), input.end(), parameters), throwing_value_copy_exception );
    }

    for ( size_t i = 0 ; i < 10 ; i += 1 )
    {
        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(10000);

        Tree tree(parameters);

        tree.insert(input.begin(), input.end());

        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(i);

        BOOST_CHECK_THROW( tree.remove(input.begin(), input.end()), throwing_value_copy_exception );
    }

    for ( size_t i = 0 ; i < 20 ; i += 2 )
    {
        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(10000);

        Tree tree(parameters);

        tree.insert(input.begin(), input.end());

        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(i);

        BOOST_CHECK_THROW( Tree tree2(tree), throwing_value_copy_exception );
    }

    for ( size_t i = 0 ; i < 20 ; i += 2 )
    {
        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(10000);

        Tree tree(parameters);
        Tree tree2(parameters);

        tree.insert(input.begin(), input.end());

        throwing_value::reset_calls_counter();
        throwing_value::set_max_calls(i);

        BOOST_CHECK_THROW(tree2 = tree, throwing_value_copy_exception );
    }
}

// test value exceptions
template <typename Parameters>
void test_rtree_elements_exceptions(Parameters const& parameters = Parameters())
{
    typedef std::pair<bg::model::point<float, 2, bg::cs::cartesian>, throwing_value> Value;
    typedef bgi::rtree<Value, Parameters> Tree;
    typedef typename Tree::bounds_type B;

    throwing_value::reset_calls_counter();
    throwing_value::set_max_calls((std::numeric_limits<size_t>::max)());

    std::vector<Value> input;
    B qbox;
    generate::input<2>::apply(input, qbox, 2);

    for ( size_t i = 0 ; i < 100 ; i += 2 )
    {
        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(10000);

        Tree tree(parameters);

        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(i);

        BOOST_CHECK_THROW( tree.insert(input.begin(), input.end()), throwing_varray_exception );
    }

    for ( size_t i = 0 ; i < 100 ; i += 2 )
    {
        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(i);

        throwing_nodes_stats::reset_counters();

        BOOST_CHECK_THROW( Tree tree(input.begin(), input.end(), parameters), throwing_varray_exception );

        BOOST_CHECK_EQUAL(throwing_nodes_stats::internal_nodes_count(), 0u);
        BOOST_CHECK_EQUAL(throwing_nodes_stats::leafs_count(), 0u);
    }

    for ( size_t i = 0 ; i < 50 ; i += 2 )
    {
        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(10000);

        Tree tree(parameters);

        tree.insert(input.begin(), input.end());

        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(i);

        BOOST_CHECK_THROW( tree.remove(input.begin(), input.end()), throwing_varray_exception );
    }

    for ( size_t i = 0 ; i < 50 ; i += 2 )
    {
        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(10000);

        Tree tree(parameters);

        tree.insert(input.begin(), input.end());

        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(i);

        BOOST_CHECK_THROW( Tree tree2(tree), throwing_varray_exception );
    }

    for ( size_t i = 0 ; i < 50 ; i += 2 )
    {
        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(10000);

        Tree tree(parameters);
        Tree tree2(parameters);

        tree.insert(input.begin(), input.end());

        throwing_varray_settings::reset_calls_counter();
        throwing_varray_settings::set_max_calls(i);

        BOOST_CHECK_THROW(tree2 = tree, throwing_varray_exception );
    }
}

#endif // BOOST_GEOMETRY_INDEX_TEST_RTREE_EXCEPTIONS_HPP


text:
require "karaoke/song/base"

module Karaoke
  module Song
    class Lyricsfreak < Base
      def self.matches?(lyrics_url)
        URI.parse(lyrics_url).host.end_with?("lyricsfreak.com")
      end

      def artist
        return @artist if defined?(@artist)

        el = document.css(%Q{a[data-tracking='\["Meta","Lyrics","ArtistName"\]']}).first
        return @artist = nil unless el

        @artist = el.text
      end

      def title
        return @title if defined?(@title)

        el = document.css(".song-info-panel h1").first
        return @title = nil unless el

        @title = el.text.match("^(.+?) Lyrics$")[1]
      end

      def lyrics
        return @lyrics if defined?(@lyrics)

        el = document.css("#content_h").first
        return @lyrics = nil unless el

        @lyrics = clean_html(el.inner_html)
      end
    end

    register_song_type Lyricsfreak
  end
end


text:
//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////

UNIX_FIFOPipeFile::UNIX_FIFOPipeFile(void)
{
}

UNIX_FIFOPipeFile::~UNIX_FIFOPipeFile(void)
{
}

Boolean UNIX_FIFOPipeFile::getInstanceID(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_INSTANCE_ID, getInstanceID());
	return true;
}

String UNIX_FIFOPipeFile::getInstanceID() const
{
	return String ("");
}

Boolean UNIX_FIFOPipeFile::getCaption(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_CAPTION, getCaption());
	return true;
}

String UNIX_FIFOPipeFile::getCaption() const
{
	return String ("");
}

Boolean UNIX_FIFOPipeFile::getDescription(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_DESCRIPTION, getDescription());
	return true;
}

String UNIX_FIFOPipeFile::getDescription() const
{
	return String ("");
}

Boolean UNIX_FIFOPipeFile::getElementName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_ELEMENT_NAME, getElementName());
	return true;
}

String UNIX_FIFOPipeFile::getElementName() const
{
	return String("FIFOPipeFile");
}

Boolean UNIX_FIFOPipeFile::getInstallDate(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_INSTALL_DATE, getInstallDate());
	return true;
}

CIMDateTime UNIX_FIFOPipeFile::getInstallDate() const
{
	struct tm* clock;			// create a time structure
	time_t val = time(NULL);
	clock = gmtime(&(val));	// Get the last modified time and put it into the time structure
	return CIMDateTime(
		clock->tm_year + 1900,
		clock->tm_mon + 1,
		clock->tm_mday,
		clock->tm_hour,
		clock->tm_min,
		clock->tm_sec,
		0,0,
		clock->tm_gmtoff);
}

Boolean UNIX_FIFOPipeFile::getName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_NAME, getName());
	return true;
}

String UNIX_FIFOPipeFile::getName() const
{
	return String ("");
}

Boolean UNIX_FIFOPipeFile::getOperationalStatus(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_OPERATIONAL_STATUS, getOperationalStatus());
	return true;
}

Array<Uint16> UNIX_FIFOPipeFile::getOperationalStatus() const
{
	Array<Uint16> as;

	return as;

}

Boolean UNIX_FIFOPipeFile::getStatusDescriptions(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_STATUS_DESCRIPTIONS, getStatusDescriptions());
	return true;
}

Array<String> UNIX_FIFOPipeFile::getStatusDescriptions() const
{
	Array<String> as;

	return as;

}

Boolean UNIX_FIFOPipeFile::getStatus(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_STATUS, getStatus());
	return true;
}

String UNIX_FIFOPipeFile::getStatus() const
{
	return String(DEFAULT_STATUS);
}

Boolean UNIX_FIFOPipeFile::getHealthState(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_HEALTH_STATE, getHealthState());
	return true;
}

Uint16 UNIX_FIFOPipeFile::getHealthState() const
{
	return Uint16(DEFAULT_HEALTH_STATE);
}

Boolean UNIX_FIFOPipeFile::getCommunicationStatus(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_COMMUNICATION_STATUS, getCommunicationStatus());
	return true;
}

Uint16 UNIX_FIFOPipeFile::getCommunicationStatus() const
{
	return Uint16(0);
}

Boolean UNIX_FIFOPipeFile::getDetailedStatus(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_DETAILED_STATUS, getDetailedStatus());
	return true;
}

Uint16 UNIX_FIFOPipeFile::getDetailedStatus() const
{
	return Uint16(0);
}

Boolean UNIX_FIFOPipeFile::getOperatingStatus(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_OPERATING_STATUS, getOperatingStatus());
	return true;
}

Uint16 UNIX_FIFOPipeFile::getOperatingStatus() const
{
	return Uint16(DEFAULT_OPERATING_STATUS);
}

Boolean UNIX_FIFOPipeFile::getPrimaryStatus(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_PRIMARY_STATUS, getPrimaryStatus());
	return true;
}

Uint16 UNIX_FIFOPipeFile::getPrimaryStatus() const
{
	return Uint16(DEFAULT_PRIMARY_STATUS);
}

Boolean UNIX_FIFOPipeFile::getCSCreationClassName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_CS_CREATION_CLASS_NAME, getCSCreationClassName());
	return true;
}

String UNIX_FIFOPipeFile::getCSCreationClassName() const
{
	return String("UNIX_ComputerSystem");
}

Boolean UNIX_FIFOPipeFile::getCSName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_CS_NAME, getCSName());
	return true;
}

String UNIX_FIFOPipeFile::getCSName() const
{
	return CIMHelper::HostName;
}

Boolean UNIX_FIFOPipeFile::getFSCreationClassName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_FS_CREATION_CLASS_NAME, getFSCreationClassName());
	return true;
}

String UNIX_FIFOPipeFile::getFSCreationClassName() const
{
	return String("UNIX_FileSystem");
}

Boolean UNIX_FIFOPipeFile::getFSName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_FS_NAME, getFSName());
	return true;
}

String UNIX_FIFOPipeFile::getFSName() const
{
	return String ("");
}

Boolean UNIX_FIFOPipeFile::getCreationClassName(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_CREATION_CLASS_NAME, getCreationClassName());
	return true;
}

String UNIX_FIFOPipeFile::getCreationClassName() const
{
	return String("UNIX_FIFOPipeFile");
}

Boolean UNIX_FIFOPipeFile::getFileSize(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_FILE_SIZE, getFileSize());
	return true;
}

Uint64 UNIX_FIFOPipeFile::getFileSize() const
{
	return Uint64(0);
}

Boolean UNIX_FIFOPipeFile::getCreationDate(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_CREATION_DATE, getCreationDate());
	return true;
}

CIMDateTime UNIX_FIFOPipeFile::getCreationDate() const
{
	struct tm* clock;			// create a time structure
	time_t val = time(NULL);
	clock = gmtime(&(val));	// Get the last modified time and put it into the time structure
	return CIMDateTime(
		clock->tm_year + 1900,
		clock->tm_mon + 1,
		clock->tm_mday,
		clock->tm_hour,
		clock->tm_min,
		clock->tm_sec,
		0,0,
		clock->tm_gmtoff);
}

Boolean UNIX_FIFOPipeFile::getLastModified(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_LAST_MODIFIED, getLastModified());
	return true;
}

CIMDateTime UNIX_FIFOPipeFile::getLastModified() const
{
	struct tm* clock;			// create a time structure
	time_t val = time(NULL);
	clock = gmtime(&(val));	// Get the last modified time and put it into the time structure
	return CIMDateTime(
		clock->tm_year + 1900,
		clock->tm_mon + 1,
		clock->tm_mday,
		clock->tm_hour,
		clock->tm_min,
		clock->tm_sec,
		0,0,
		clock->tm_gmtoff);
}

Boolean UNIX_FIFOPipeFile::getLastAccessed(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_LAST_ACCESSED, getLastAccessed());
	return true;
}

CIMDateTime UNIX_FIFOPipeFile::getLastAccessed() const
{
	struct tm* clock;			// create a time structure
	time_t val = time(NULL);
	clock = gmtime(&(val));	// Get the last modified time and put it into the time structure
	return CIMDateTime(
		clock->tm_year + 1900,
		clock->tm_mon + 1,
		clock->tm_mday,
		clock->tm_hour,
		clock->tm_min,
		clock->tm_sec,
		0,0,
		clock->tm_gmtoff);
}

Boolean UNIX_FIFOPipeFile::getReadable(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_READABLE, getReadable());
	return true;
}

Boolean UNIX_FIFOPipeFile::getReadable() const
{
	return Boolean(false);
}

Boolean UNIX_FIFOPipeFile::getWriteable(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_WRITEABLE, getWriteable());
	return true;
}

Boolean UNIX_FIFOPipeFile::getWriteable() const
{
	return Boolean(false);
}

Boolean UNIX_FIFOPipeFile::getExecutable(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_EXECUTABLE, getExecutable());
	return true;
}

Boolean UNIX_FIFOPipeFile::getExecutable() const
{
	return Boolean(false);
}

Boolean UNIX_FIFOPipeFile::getCompressionMethod(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_COMPRESSION_METHOD, getCompressionMethod());
	return true;
}

String UNIX_FIFOPipeFile::getCompressionMethod() const
{
	return String ("");
}

Boolean UNIX_FIFOPipeFile::getEncryptionMethod(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_ENCRYPTION_METHOD, getEncryptionMethod());
	return true;
}

String UNIX_FIFOPipeFile::getEncryptionMethod() const
{
	return String ("");
}

Boolean UNIX_FIFOPipeFile::getInUseCount(CIMProperty &p) const
{
	p = CIMProperty(PROPERTY_IN_USE_COUNT, getInUseCount());
	return true;
}

Uint64 UNIX_FIFOPipeFile::getInUseCount() const
{
	return Uint64(0);
}

Boolean UNIX_FIFOPipeFile::initialize()
{
	return false;
}

Boolean UNIX_FIFOPipeFile::load(int &pIndex)
{
	return false;
}

Boolean UNIX_FIFOPipeFile::finalize()
{
	return false;
}

Boolean UNIX_FIFOPipeFile::find(Array<CIMKeyBinding> &kbArray)
{
	CIMKeyBinding kb;
	String cSCreationClassNameKey;
	String cSNameKey;
	String fSCreationClassNameKey;
	String fSNameKey;
	String creationClassNameKey;
	String nameKey;

	for(Uint32 i = 0; i < kbArray.size(); i++)
	{
		kb = kbArray[i];
		CIMName keyName = kb.getName();
		if (keyName.equal(PROPERTY_CS_CREATION_CLASS_NAME)) cSCreationClassNameKey = kb.getValue();
		else if (keyName.equal(PROPERTY_CS_NAME)) cSNameKey = kb.getValue();
		else if (keyName.equal(PROPERTY_FS_CREATION_CLASS_NAME)) fSCreationClassNameKey = kb.getValue();
		else if (keyName.equal(PROPERTY_FS_NAME)) fSNameKey = kb.getValue();
		else if (keyName.equal(PROPERTY_CREATION_CLASS_NAME)) creationClassNameKey = kb.getValue();
		else if (keyName.equal(PROPERTY_NAME)) nameKey = kb.getValue();
	}

/* EXecute find with extracted keys */

	return false;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true" android:drawable="@drawable/title_back_selected" />
    <item android:state_selected="true" android:drawable="@drawable/title_back_selected" />
    <item android:state_pressed="true" android:drawable="@drawable/title_back_selected" />
    <item android:drawable="@drawable/title_back_normal" />
</selector>


text:
<?php
require __DIR__ . '/vendor/autoload.php';

$mysqlgrid1 = new mysqlgridspace\Mysqlgridmain([
    'sql' => "select * from Mytable1",
    'gridId' => 'grid1',
    'paginationId' => 'pagination1'
]);

$mysqlgrid2 = new mysqlgridspace\Mysqlgridmain([
    'sql' => "select * from Mytable2",
    'gridId' => 'grid2',
    'paginationId' => 'pagination2'
]);
?>


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for /home/ubuntu/workspace/Earls/RhinoReport/DependencyInjection/Configuration.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="../css/bootstrap.min.css" rel="stylesheet">
  <link href="../css/style.css" rel="stylesheet">

/home/ubuntu/workspace/Earls/RhinoReport

DependencyInjection

Configuration.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

           100.00% covered (success)

100.00%

1 / 1

           100.00% covered (success)

100.00%

1 / 1

      CRAP

           100.00% covered (success)

100.00%

3 / 3

      Configuration

           100.00% covered (success)

100.00%

1 / 1

           100.00% covered (success)

100.00%

1 / 1

      1

           100.00% covered (success)

100.00%

3 / 3

       getConfigTreeBuilder

           100.00% covered (success)

100.00%

1 / 1

      1

           100.00% covered (success)

100.00%

3 / 3

1
	<?php

2

3
	namespace Earls\RhinoReportBundle\DependencyInjection;

4

5
	use Symfony\Component\Config\Definition\Builder\TreeBuilder;

6
	use Symfony\Component\Config\Definition\ConfigurationInterface;

7

8
	/**

9
	 * This class contains the configuration information for the bundle.

10
	 *

11
	 * This information is solely responsible for how the different configuration

12
	 * sections are normalized, and merged.

13
	 */

14
	class Configuration implements ConfigurationInterface

15
	{

16
	    /**

17
	     * {@inheritdoc}

18
	     */

19
	    public function getConfigTreeBuilder()

20
	    {

21
	        $treeBuilder = new TreeBuilder();

22
	        $rootNode = $treeBuilder->root('earls_rhino_report');

23

24
	        // Here you should define the parameters that are allowed to

25
	        // configure your bundle. See the documentation linked above for

26
	        // more information on that topic.

27
	        return $treeBuilder;

28
	    }

29
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by PHP_CodeCoverage 2.2.4 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 4.8.26 at Fri Jun 10 11:13:20 UTC 2016.


text:
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>[ #505770] Unclosed <option> tag causing problems</TITLE>

<form name="myhand">
<input type="text" disabled size="30" value="Top
Card on Discard Pile -- None" name="topcard">

<select ondblclick="parent.master.aGame.Hand.Cards
[this.selectedIndex].ShowCard();"
onChange="document.myhand.cardtext.value = this
[this.selectedIndex].value" name="handselect" size="7">
<option value="">-------------Empty Hand---------
----
<option value="">
<option value="">
<option value="">
<option value="">
<option value="">
<option value="">
</select>
<textarea disabled rows=5 cols=28 title="Selected
Card Text" name="cardtext">Selected Card Text
</textarea>

<input type="button" value="Discard & Draw">

<input type="button" value="Discard & Draw from
Discard">
</form>


text:
function [d imFnames]=smoothingandekf()
full_fname = 'logs/cf2/kalmanTesting0316/round2/smoothingandekf.mat';
fname = '/home/blandry/code/crazyflie-tools/logs/cf2/kalmanTesting0316/round2/smoothingandekf.mat';
if (exist(full_fname,'file'))
    filename = full_fname;
else
    filename = fname;
end
d = load(filename);


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'Person'
        db.create_table('people_person', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('is_live', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('show_in_lists', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('first_name', self.gf('django.db.models.fields.CharField')(max_length=128)),
            ('last_name', self.gf('django.db.models.fields.CharField')(max_length=128)),
            ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
            ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)),
            ('twitter_username', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)),
            ('twitter_bio', self.gf('django.db.models.fields.TextField')(blank=True)),
            ('twitter_profile_image_url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)),
            ('github_username', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)),
            ('github_repos_num', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
            ('github_gists_num', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
        ))
        db.send_create_signal('people', ['Person'])

        # Adding M2M table for field organizations on 'Person'
        db.create_table('people_person_organizations', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('person', models.ForeignKey(orm['people.person'], null=False)),
            ('organization', models.ForeignKey(orm['people.organization'], null=False))
        ))
        db.create_unique('people_person_organizations', ['person_id', 'organization_id'])

        # Adding model 'PersonLink'
        db.create_table('people_personlink', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['people.Person'])),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=128)),
            ('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
        ))
        db.send_create_signal('people', ['PersonLink'])

        # Adding model 'Organization'
        db.create_table('people_organization', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('is_live', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('show_in_lists', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
            ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)),
            ('twitter_username', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)),
            ('github_username', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)),
            ('github_repos_num', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
            ('github_gists_num', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
            ('homepage', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)),
            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
            ('address', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
            ('city', self.gf('django.db.models.fields.CharField')(max_length=64, blank=True)),
            ('state', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)),
            ('country', self.gf('django.db.models.fields.CharField')(max_length=32, blank=True)),
            ('logo', self.gf('sorl.thumbnail.fields.ImageField')(max_length=100, null=True, blank=True)),
        ))
        db.send_create_signal('people', ['Organization'])

        # Adding model 'OrganizationLink'
        db.create_table('people_organizationlink', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('organization', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['people.Organization'])),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=128)),
            ('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
        ))
        db.send_create_signal('people', ['OrganizationLink'])

    def backwards(self, orm):
        # Deleting model 'Person'
        db.delete_table('people_person')

        # Removing M2M table for field organizations on 'Person'
        db.delete_table('people_person_organizations')

        # Deleting model 'PersonLink'
        db.delete_table('people_personlink')

        # Deleting model 'Organization'
        db.delete_table('people_organization')

        # Deleting model 'OrganizationLink'
        db.delete_table('people_organizationlink')

    models = {
        'people.organization': {
            'Meta': {'ordering': "('name',)", 'object_name': 'Organization'},
            'address': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'city': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}),
            'country': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'github_gists_num': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'github_repos_num': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'github_username': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
            'homepage': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_live': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'logo': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'show_in_lists': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
            'state': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
            'twitter_username': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'})
        },
        'people.organizationlink': {
            'Meta': {'ordering': "('organization', 'name')", 'object_name': 'OrganizationLink'},
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'organization': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['people.Organization']"}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
        },
        'people.person': {
            'Meta': {'ordering': "('last_name', 'first_name')", 'object_name': 'Person'},
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'github_gists_num': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'github_repos_num': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'github_username': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_live': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'organizations': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['people.Organization']", 'null': 'True', 'blank': 'True'}),
            'show_in_lists': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
            'twitter_bio': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'twitter_profile_image_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
            'twitter_username': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'})
        },
        'people.personlink': {
            'Meta': {'ordering': "('person', 'name')", 'object_name': 'PersonLink'},
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['people.Person']"}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
        }
    }

    complete_apps = ['people']


text:
Open Arrow is an open-source font that contains 112 arrow symbols from U+2190 to U+21ff

## How to use

1. To embed `open-arrow`, copy this code into the `<head>` of your HTML document.
    ```html
    <style>
      @font-face {
        font-family: 'open-arrow';
        src: url('path-to-font-file/OpenArrow-Regular.eot') format('embedded-opentype'),
             url('path-to-font-file/OpenArrow-Regular.woff2') format('woff2'),
             url('path-to-font-file/OpenArrow-Regular.woff') format('woff'),
             url('path-to-font-file/OpenArrow-Regular.otf') format('opentype'),
             url('path-to-font-file/OpenArrow-Regular.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
        unicode-range: U+2190-21ff;
      }
    </style>
    ```
2. Specify `open-arrow` at the top of the `font-family`
    ```css
    font-family: 'open-arrow', Helvetica, sans-serif;
    ```
3. Use it like this:
    ```
    &#x2192 Use it like this &#x2190
    ```


text:
package com.jyore.spring.scope.route.example.beans;

public interface RouteScopedTest {
	public Object get();
	public void set(Object o);
}


text:
<!DOCTYPE html>

<title>Lemonade Stand Supply</title>
<link href="/css/app.css" rel="stylesheet" />

Lemonade Stand Supply

					 login

							Home

							Shop

							Stand Locator

Supplying young businesses since 1908

From a child's first business to the most cutting edge
					stands, LSS is ready to support you with ingredients, supplies and
					advertising supplies.

Sales

Shop

Members

			Follow us


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*=============================================================
**
** Source:  virtualprotect.c
**
** Purpose: Positive test the VirtualProtect API.
**          Call VirtualProtect to set new protect as
**          PAGE_EXECUTE_READ
**
**
**============================================================*/
#include <palsuite.h>

#define REGIONSIZE 1024

int __cdecl main(int argc, char *argv[])
{
    int err;
    LPVOID lpVirtualAddress;
    DWORD OldProtect;

    //Initialize the PAL environment
    err = PAL_Initialize(argc, argv);
    if(0 != err)
    {
        ExitProcess(FAIL);
    }

    //Allocate the physical storage in memory or in the paging file on disk
    lpVirtualAddress = VirtualAlloc(NULL,//determine where to allocate the region
            REGIONSIZE,      //specify the size
            MEM_COMMIT,      //allocation type
            PAGE_READONLY);  //access protection
    if(NULL == lpVirtualAddress)
    {
        Fail("\nFailed to call VirtualAlloc API!\n");
    }

    OldProtect = PAGE_READONLY;
    //Set new access protection
    err = VirtualProtect(lpVirtualAddress,
                      REGIONSIZE,  //specify the region size
                      PAGE_EXECUTE_READ,//desied access protection
                      &OldProtect);//old access protection
    if(0 == err)
    {
        Trace("\nFailed to call VirtualProtect API!\n");
        err = VirtualFree(lpVirtualAddress,REGIONSIZE,MEM_DECOMMIT);
        if(0 == err)
        {
            Fail("\nFailed to call VirtualFree API!\n");
        }
        Fail("");
    }

    //decommit the specified region
    err = VirtualFree(lpVirtualAddress,REGIONSIZE,MEM_DECOMMIT);
    if(0 == err)
    {
        Fail("\nFailed to call VirtualFree API!\n");
    }

    PAL_Terminate();
    return PASS;
}


text:
Applies To	: WSO2 GW 1.0.0

Test case	: https://testlink.wso2.com/linkto.php?tprojectPrefix=GW&item=testcase&id=GW-33

Created by	: Asanthi Kulasinghe

DESCRIPTION
===========

To test the ability of WSO2 Gateway to give priority to route definitions in custom route files over route definitions in camel-context.xml, when routes with the same routeId exist in both camel-context.xml and a custom route file. (Using 2 different endpoints in the 2 route configurations containing the same routeId)

INSTRUCTIONS
============

1. Copy request.xml to the path where the Curl command is executed.

2. Start 2 WSO2 Application Servers instances with port offsets set to 10 and 20. Make sure the axis2 service 'HelloService' is available on both servers.

3. Replace <GW_home>/conf/camel/camel-context.xml file with camel-context.xml

4. Copy test_route.xml to <GW_home>/conf/camel/

5. Restart the server

6. Setup a tcpmon to intercept the calls between

    	Gateway and the Application server with port offset 10 : Forward calls to port 1010 to 9773
    	Gateway and the Application server with port offset 20 : Forward calls to port 2020 to 9783

7. Run the following curl command to observe the route in the custom route file being invoked.

	curl http://localhost:9090/test_route  -d @request.xml  -H "SOAPAction: urn::greet" -H "Content-Type: text/xml"