text:
package techreborn.blockentity.machine.tier1;

import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import reborncore.api.IToolDrop;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import reborncore.common.screen.BuiltScreenHandler;
import reborncore.common.screen.BuiltScreenHandlerProvider;
import reborncore.common.screen.builder.ScreenHandlerBuilder;
import reborncore.common.util.WorldUtils;
import techreborn.blocks.machine.tier1.PlayerDetectorBlock;
import techreborn.blocks.machine.tier1.PlayerDetectorBlock.PlayerDetectorType;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;

public class PlayerDetectorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, BuiltScreenHandlerProvider {

	public String ownerUdid = "";
	boolean redstone = false;
	int radius = 16;

	public PlayerDetectorBlockEntity(BlockPos pos, BlockState state) {
		super(TRBlockEntities.PLAYER_DETECTOR, pos, state);
	}

	public boolean isProvidingPower() {
		return redstone;
	}

	public void handleGuiInputFromClient(int amount) {
		radius += amount;

		if (radius > TechRebornConfig.playerDetectorMaxRadius) {
			radius = TechRebornConfig.playerDetectorMaxRadius;
		}
		if (radius <= 1) {
			radius = 1;
		}
	}

	// PowerAcceptorBlockEntity
	@Override
	public void tick(World world, BlockPos pos, BlockState state, MachineBaseBlockEntity blockEntity) {
		super.tick(world, pos, state, blockEntity);

		if (world == null || world.isClient) {
			return;
		}

		if (world.getTime() % 20 != 0) {
			return;
		}

		boolean lastRedstone = redstone;
		redstone = false;
		if (getStored() > TechRebornConfig.playerDetectorEuPerTick) {
			for (PlayerEntity player : world.getPlayers()) {
				if (MathHelper.sqrt((float)player.squaredDistanceTo(pos.getX(), pos.getY(), pos.getZ())) <= (float)radius ) {
					PlayerDetectorType type = world.getBlockState(pos).get(PlayerDetectorBlock.TYPE);
					if (type == PlayerDetectorType.ALL) {// ALL
						redstone = true;
					} else if (type == PlayerDetectorType.OTHERS) {// Others
						if (!ownerUdid.isEmpty() && !ownerUdid.equals(player.getUuid().toString())) {
							redstone = true;
						}
					} else {// You
						if (!ownerUdid.isEmpty() && ownerUdid.equals(player.getUuid().toString())) {
							redstone = true;
						}
					}
				}
			}
			useEnergy(TechRebornConfig.playerDetectorEuPerTick);
		}
		if (lastRedstone != redstone) {
			WorldUtils.updateBlock(world, pos);
			world.updateNeighborsAlways(pos, world.getBlockState(pos).getBlock());
		}
	}

	@Override
	public long getBaseMaxPower() {
		return TechRebornConfig.playerDetectorMaxEnergy;
	}

	@Override
	public boolean canProvideEnergy(@Nullable Direction side) {
		return false;
	}

	@Override
	public long getBaseMaxOutput() {
		return 0;
	}

	@Override
	public long getBaseMaxInput() {
		return TechRebornConfig.playerDetectorMaxInput;
	}

	@Override
	public void readNbt(NbtCompound tag) {
		super.readNbt(tag);
		ownerUdid = tag.getString("ownerID");
		radius = tag.getInt("radius");
	}

	@Override
	public void writeNbt(NbtCompound tag) {
		super.writeNbt(tag);
		tag.putString("ownerID", ownerUdid);
		tag.putInt("radius", radius);
	}

	// MachineBaseBlockEntity
	@Override
	public boolean hasSlotConfig() {
		return false;
	}

	@Override
	public boolean canBeUpgraded() {
		return false;
	}

	// IToolDrop
	@Override
	public ItemStack getToolDrop(PlayerEntity p0) {
		return TRContent.Machine.PLAYER_DETECTOR.getStack();
	}

	// BuiltScreenHandlerProvider
	@Override
	public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) {
		return new ScreenHandlerBuilder("player_detector")
				.player(player.getInventory())
				.inventory().hotbar().addInventory()
				.blockEntity(this)
				.syncEnergyValue()
				.sync(this::getCurrentRadius, this::setCurrentRadius)
				.addInventory().create(this, syncID);
	}

	public int getCurrentRadius() {
		return radius;
	}

	public void setCurrentRadius(int radius) {
		this.radius = radius;
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.drools</groupId>
    <artifactId>drools-examples-api</artifactId>
    <version>8.0.0-SNAPSHOT</version>
  </parent>

  <artifactId>kiebase-inclusion</artifactId>
  <name>Drools API examples - KieBase Inclusion</name>

  <dependencies>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-compiler</artifactId>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>named-kiesession</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
    </dependency>
  </dependencies>

</project>

redpajama_set_name: RedPajamaGithub


text:
#ifndef ART_COMPILER_OPTIMIZING_NON_TEMPORAL_MOVE_H_
#define ART_COMPILER_OPTIMIZING_NON_TEMPORAL_MOVE_H_

#include "driver/compiler_driver.h"
#include "optimization_x86.h"

namespace art {

class DexCompilationUnit;

class HNonTemporalMove : public HOptimization_X86 {
 public:
  explicit HNonTemporalMove(HGraph* graph, CompilerDriver* driver,
                            OptimizingCompilerStats* stats = nullptr)
      : HOptimization_X86(graph, kNonTemporalMovePassName, stats), driver_(driver) {}

  void Run() OVERRIDE;

 private:
  static constexpr const char* kNonTemporalMovePassName = "non_temporal_move";

  static constexpr int kDefaultMinNonTemporalIterations = 131072;

  typedef std::set<HArraySet*> ArraySets;

  /*
   * @brief Is this loop a candidate for non-temporal-move replacement?
   * @param loop_info Candidate loop information.
   * @param array_sets ArraySet instructions found in the loop are added to array_sets.
   * @returns 'true' if the loop should use non-temporal moves.
   */
  bool Gate(HLoopInformation_X86* loop_info, ArraySets& array_sets) const;

  const CompilerDriver* const driver_;

  DISALLOW_COPY_AND_ASSIGN(HNonTemporalMove);
};

}  // namespace art

#endif  // ART_COMPILER_OPTIMIZING_NON_TEMPORAL_MOVE_H_


text:
import sys
from command_line import CLI
from methods import Method, MethodResult

# TODO: HTML version with Bootstrap and bootstrap-table;
# f-strings should work as simple-templates; option "show in browser"?
# or we could use jupiter notebooks?
def render_text_table(method: Method, results: MethodResult):
    print(f'Results of {method.name} run')

    print(results.description)

    print('\t'.join(results.columns))

    for result in results.scored_list:
        for column in results.columns:
            v = getattr(result, column)
            print(v, end='\t')
        print()

    if results.files:
        print('There are additional output files in following locations:')
        print(results.files)

    # TODO: method.parameters?

def run(argv):
    args = CLI().parse_args(argv[1:])
    results = args.method.run(args.experiment)
    render_text_table(args.method, results)
    return results

if __name__ == '__main__':
    run(sys.argv)


text:
namespace Microsoft.Azure.Management.Graph.RBAC.Fluent
{
    using Microsoft.Azure.Management.Graph.RBAC.Fluent.ActiveDirectoryUser.Definition;
    using Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions;
    using Microsoft.Azure.Management.ResourceManager.Fluent.Core;

    /// <summary>
    /// Entry point to AD user management API.
    /// </summary>
    public interface IActiveDirectoryUsers :
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.IBeta,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsGettingById<Microsoft.Azure.Management.Graph.RBAC.Fluent.IActiveDirectoryUser>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsGettingByName<Microsoft.Azure.Management.Graph.RBAC.Fluent.IActiveDirectoryUser>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsListing<Microsoft.Azure.Management.Graph.RBAC.Fluent.IActiveDirectoryUser>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsCreating<ActiveDirectoryUser.Definition.IBlank>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.CollectionActions.ISupportsDeletingById,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.IHasManager<Microsoft.Azure.Management.Graph.RBAC.Fluent.GraphRbacManager>,
        Microsoft.Azure.Management.ResourceManager.Fluent.Core.IHasInner<Microsoft.Azure.Management.Graph.RBAC.Fluent.IUsersOperations>
    {
    }
}


text:
package ro.nextreports.designer.action;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import ro.nextreports.designer.Globals;
import ro.nextreports.designer.NamePatternPanel;
import ro.nextreports.designer.ui.BaseDialog;
import ro.nextreports.designer.util.I18NSupport;
import ro.nextreports.designer.util.ImageUtil;
import ro.nextreports.designer.util.Show;
import ro.nextreports.designer.util.TreeUtil;

public class NamePatternAction extends AbstractAction {

	public static final byte TABLE_NAME_PATTERN = 1;
	public static final byte VIEW_NAME_PATTERN = 2;
	public static final byte PROCEDURE_NAME_PATTERN = 4;

	private byte type = TABLE_NAME_PATTERN;

	private static final Log LOG = LogFactory.getLog(NamePatternAction.class);

    public NamePatternAction(byte type) {
        putValue(Action.NAME, I18NSupport.getString("pattern.action"));
        putValue(Action.SMALL_ICON, ImageUtil.getImageIcon("pattern"));
        putValue(Action.SHORT_DESCRIPTION, I18NSupport.getString("pattern.action"));
        putValue(Action.LONG_DESCRIPTION, I18NSupport.getString("pattern.action"));
        this.type = type;
    }

    public void actionPerformed(ActionEvent ev) {
    	NamePatternPanel panel = new NamePatternPanel(getPattern(type));
        BaseDialog dialog = new BaseDialog(panel, getTitle(type));
    	Show.centrateComponent(Globals.getMainFrame(), dialog);
        dialog.setVisible(true);
        if (dialog.okPressed()) {
        	String pattern = panel.getPattern();
			switch (type) {
				case TABLE_NAME_PATTERN:
					Globals.setTableNamePattern(pattern);
					break;
				case VIEW_NAME_PATTERN:
					Globals.setViewNamePattern(pattern);
					break;
				case PROCEDURE_NAME_PATTERN:
					Globals.setProcedureNamePattern(pattern);
					break;
				default:
					break;
			}
			try {
				TreeUtil.refreshDatabase();
			} catch (Exception e) {
				e.printStackTrace();
				LOG.error(e.getMessage(), e);
			}
        }
	}

    private String getPattern(byte type) {
    	switch (type) {
			case TABLE_NAME_PATTERN:
				return Globals.getTableNamePattern();
			case VIEW_NAME_PATTERN:
				return Globals.getViewNamePattern();
			case PROCEDURE_NAME_PATTERN:
				return Globals.getProcedureNamePattern();
			default:
				return null;
    	}
	}

    private String getTitle(byte type) {
    	switch (type) {
			case TABLE_NAME_PATTERN:
				return I18NSupport.getString("pattern.table");
			case VIEW_NAME_PATTERN:
				return I18NSupport.getString("pattern.view");
			case PROCEDURE_NAME_PATTERN:
				return I18NSupport.getString("pattern.procedure");
			default:
				return "";
		}
    }

}


text:
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json

BASE_FEE=Decimal("0.001")

def check_json_precision():
    """Make sure json library being used does not lose precision converting PLC values"""
    n = Decimal("20000000.00000003")
    satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
    if satoshis != 2000000000000003:
        raise RuntimeError("JSON encode/decode loses precision")

def determine_db_dir():
    """Return the default location of the bitcoin data directory"""
    if platform.system() == "Darwin":
        return os.path.expanduser("~/Library/Application Support/Bitcoin/")
    elif platform.system() == "Windows":
        return os.path.join(os.environ['APPDATA'], "Bitcoin")
    return os.path.expanduser("~/.bitcoin")

def read_polcoin.config(dbdir):
    """Read the polcoin.conf file from dbdir, returns dictionary of settings"""
    from ConfigParser import SafeConfigParser

    class FakeSecHead(object):
        def __init__(self, fp):
            self.fp = fp
            self.sechead = '[all]\n'
        def readline(self):
            if self.sechead:
                try: return self.sechead
                finally: self.sechead = None
            else:
                s = self.fp.readline()
                if s.find('#') != -1:
                    s = s[0:s.find('#')].strip() +"\n"
                return s

    config_parser = SafeConfigParser()
    config_parser.readfp(FakeSecHead(open(os.path.join(dbdir, "polcoin.conf"))))
    return dict(config_parser.items("all"))

def connect_JSON(config):
    """Connect to a bitcoin JSON-RPC server"""
    testnet = config.get('testnet', '0')
    testnet = (int(testnet) > 0)  # 0/1 in config file, convert to True/False
    if not 'rpcport' in config:
        config['rpcport'] = 19337 if testnet else 9337
    connect = "http://%s:%s@127.0.0.1:%s"%(config['rpcuser'], config['rpcpassword'], config['rpcport'])
    try:
        result = ServiceProxy(connect)
        # ServiceProxy is lazy-connect, so send an RPC command mostly to catch connection errors,
        # but also make sure the polcoind we're talking to is/isn't testnet:
        if result.getmininginfo()['testnet'] != testnet:
            sys.stderr.write("RPC server at "+connect+" testnet setting mismatch\n")
            sys.exit(1)
        return result
    except:
        sys.stderr.write("Error connecting to RPC server at "+connect+"\n")
        sys.exit(1)

def unlock_wallet(polcoind):
    info = polcoind.getinfo()
    if 'unlocked_until' not in info:
        return True # wallet is not encrypted
    t = int(info['unlocked_until'])
    if t <= time.time():
        try:
            passphrase = getpass.getpass("Wallet is locked; enter passphrase: ")
            polcoind.walletpassphrase(passphrase, 5)
        except:
            sys.stderr.write("Wrong passphrase\n")

    info = polcoind.getinfo()
    return int(info['unlocked_until']) > time.time()

def list_available(polcoind):
    address_summary = dict()

    address_to_account = dict()
    for info in polcoind.listreceivedbyaddress(0):
        address_to_account[info["address"]] = info["account"]

    unspent = polcoind.listunspent(0)
    for output in unspent:
        # listunspent doesn't give addresses, so:
        rawtx = polcoind.getrawtransaction(output['txid'], 1)
        vout = rawtx["vout"][output['vout']]
        pk = vout["scriptPubKey"]

        # This code only deals with ordinary pay-to-bitcoin-address
        # or pay-to-script-hash outputs right now; anything exotic is ignored.
        if pk["type"] != "pubkeyhash" and pk["type"] != "scripthash":
            continue

        address = pk["addresses"][0]
        if address in address_summary:
            address_summary[address]["total"] += vout["value"]
            address_summary[address]["outputs"].append(output)
        else:
            address_summary[address] = {
                "total" : vout["value"],
                "outputs" : [output],
                "account" : address_to_account.get(address, "")
                }

    return address_summary

def select_coins(needed, inputs):
    # Feel free to improve this, this is good enough for my simple needs:
    outputs = []
    have = Decimal("0.0")
    n = 0
    while have < needed and n < len(inputs):
        outputs.append({ "txid":inputs[n]["txid"], "vout":inputs[n]["vout"]})
        have += inputs[n]["amount"]
        n += 1
    return (outputs, have-needed)

def create_tx(polcoind, fromaddresses, toaddress, amount, fee):
    all_coins = list_available(polcoind)

    total_available = Decimal("0.0")
    needed = amount+fee
    potential_inputs = []
    for addr in fromaddresses:
        if addr not in all_coins:
            continue
        potential_inputs.extend(all_coins[addr]["outputs"])
        total_available += all_coins[addr]["total"]

    if total_available < needed:
        sys.stderr.write("Error, only %f PLC available, need %f\n"%(total_available, needed));
        sys.exit(1)

    #
    # Note:
    # Python's json/jsonrpc modules have inconsistent support for Decimal numbers.
    # Instead of wrestling with getting json.dumps() (used by jsonrpc) to encode
    # Decimals, I'm casting amounts to float before sending them to polcoind.
    #
    outputs = { toaddress : float(amount) }
    (inputs, change_amount) = select_coins(needed, potential_inputs)
    if change_amount > BASE_FEE:  # don't bother with zero or tiny change
        change_address = fromaddresses[-1]
        if change_address in outputs:
            outputs[change_address] += float(change_amount)
        else:
            outputs[change_address] = float(change_amount)

    rawtx = polcoind.createrawtransaction(inputs, outputs)
    signed_rawtx = polcoind.signrawtransaction(rawtx)
    if not signed_rawtx["complete"]:
        sys.stderr.write("signrawtransaction failed\n")
        sys.exit(1)
    txdata = signed_rawtx["hex"]

    return txdata

def compute_amount_in(polcoind, txinfo):
    result = Decimal("0.0")
    for vin in txinfo['vin']:
        in_info = polcoind.getrawtransaction(vin['txid'], 1)
        vout = in_info['vout'][vin['vout']]
        result = result + vout['value']
    return result

def compute_amount_out(txinfo):
    result = Decimal("0.0")
    for vout in txinfo['vout']:
        result = result + vout['value']
    return result

def sanity_test_fee(polcoind, txdata_hex, max_fee):
    class FeeError(RuntimeError):
        pass
    try:
        txinfo = polcoind.decoderawtransaction(txdata_hex)
        total_in = compute_amount_in(polcoind, txinfo)
        total_out = compute_amount_out(txinfo)
        if total_in-total_out > max_fee:
            raise FeeError("Rejecting transaction, unreasonable fee of "+str(total_in-total_out))

        tx_size = len(txdata_hex)/2
        kb = tx_size/1000  # integer division rounds down
        if kb > 1 and fee < BASE_FEE:
            raise FeeError("Rejecting no-fee transaction, larger than 1000 bytes")
        if total_in < 0.01 and fee < BASE_FEE:
            raise FeeError("Rejecting no-fee, tiny-amount transaction")
        # Exercise for the reader: compute transaction priority, and
        # warn if this is a very-low-priority transaction

    except FeeError as err:
        sys.stderr.write((str(err)+"\n"))
        sys.exit(1)

def main():
    import optparse

    parser = optparse.OptionParser(usage="%prog [options]")
    parser.add_option("--from", dest="fromaddresses", default=None,
                      help="addresses to get bitcoins from")
    parser.add_option("--to", dest="to", default=None,
                      help="address to get send bitcoins to")
    parser.add_option("--amount", dest="amount", default=None,
                      help="amount to send")
    parser.add_option("--fee", dest="fee", default="0.0",
                      help="fee to include")
    parser.add_option("--datadir", dest="datadir", default=determine_db_dir(),
                      help="location of polcoin.conf file with RPC username/password (default: %default)")
    parser.add_option("--testnet", dest="testnet", default=False, action="store_true",
                      help="Use the test network")
    parser.add_option("--dry_run", dest="dry_run", default=False, action="store_true",
                      help="Don't broadcast the transaction, just create and print the transaction data")

    (options, args) = parser.parse_args()

    check_json_precision()
    config = read_polcoin.config(options.datadir)
    if options.testnet: config['testnet'] = True
    polcoind = connect_JSON(config)

    if options.amount is None:
        address_summary = list_available(polcoind)
        for address,info in address_summary.iteritems():
            n_transactions = len(info['outputs'])
            if n_transactions > 1:
                print("%s %.8f %s (%d transactions)"%(address, info['total'], info['account'], n_transactions))
            else:
                print("%s %.8f %s"%(address, info['total'], info['account']))
    else:
        fee = Decimal(options.fee)
        amount = Decimal(options.amount)
        while unlock_wallet(polcoind) == False:
            pass # Keep asking for passphrase until they get it right
        txdata = create_tx(polcoind, options.fromaddresses.split(","), options.to, amount, fee)
        sanity_test_fee(polcoind, txdata, amount*Decimal("0.01"))
        if options.dry_run:
            print(txdata)
        else:
            txid = polcoind.sendrawtransaction(txdata)
            print(txid)

if __name__ == '__main__':
    main()


text:
package org.scijava.display.event.input;

import org.scijava.display.Display;
import org.scijava.input.InputModifiers;

/**
 * An event indicating a mouse button was released in a display.
 *
 * @author Curtis Rueden
 */
public class MsReleasedEvent extends MsButtonEvent {

	public MsReleasedEvent(final Display<?> display,
		final InputModifiers modifiers, final int x, final int y,
		final int button, final int numClicks, final boolean isPopupTrigger)
	{
		super(display, modifiers, x, y, button, numClicks, isPopupTrigger);
	}

}


text:
interactive-d3-radar-chart
==========================


text:
const NSInteger maxLength = 1200;

@interface RecordingVisualiserView () {
    CADisplayLink* displayLink;
}

@property (strong, nonatomic) NSMutableArray<NSNumber*>* points;

@end

@implementation RecordingVisualiserView

-(instancetype)initWithCoder:(NSCoder *)aDecoder {
    if(self = [super initWithCoder:aDecoder]) {
        _points = [[NSMutableArray alloc] init];
    }
    return self;
}

- (void)drawRect:(CGRect)rect {
    [super drawRect:rect];

    [[UIColor blackColor] setStroke];

    CGFloat pointDistance = rect.size.width / self.points.count;
    CGFloat maxHeight = rect.size.height / 2.f;

    UIBezierPath* path = [[UIBezierPath alloc] init];
    [path setLineWidth:2.f];
    [path moveToPoint:CGPointMake(0.f, maxHeight)];
    CGFloat x = 0.f;
    NSArray<NSNumber*>* p = nil;
    @synchronized(self.points) {
        p = self.points.copy;
    }
    for(NSNumber* point in p) {
        float y = maxHeight + (point.floatValue * maxHeight);
        [path addLineToPoint:CGPointMake(x, y)];
        x+=pointDistance;
    }

    [path stroke];
}

-(IBAction)redraw:(id)sender {
    [self setNeedsDisplay];
}

-(void)start {
    displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(redraw:)];
    [displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
}

-(void)stop {
    [displayLink invalidate];
    displayLink = nil;
}

-(void)addFloats:(NSArray<NSNumber *> *)floats {
    @synchronized(self.points) {
        [self.points addObjectsFromArray:floats];
        NSInteger diff = self.points.count - maxLength;
        if(diff > 0) {
            self.points = [[self.points subarrayWithRange:NSMakeRange(diff, self.points.count - diff)] mutableCopy];
        }
    }
}

-(void)clear {
    NSMutableArray* arr = [[NSMutableArray alloc] init];
    for(int x = 0; x < maxLength; x++) {
        [arr addObject:@(0)];
    }
    @synchronized(self.points) {
        self.points = arr;
    }
    [self setNeedsDisplay];
}

@end


text:
using Ellipse.DataDictionary.Readers;

namespace Ellipse.DataDictionary.Parsers.Lines
{
    public class OptionalLineMatcher : ILineMatcher
    {
        private readonly ILineMatcher lineMatcher;

        public OptionalLineMatcher(ILineMatcher lineMatcher)
        {
            this.lineMatcher = lineMatcher;
        }

        public bool Matches(IReader reader, int offset, out int linesRead)
        {
            int optionalLines;
            if (lineMatcher.Matches(reader, offset, out optionalLines))
            {
                linesRead = optionalLines;
                return true;
            }
            linesRead = 0;
            return true;
        }

    }
}


text:
'use strict';

var Bed = require('..');

describe('bed', function() {
  describe('a basic github api', function() {
    var bed = new Bed();
    bed.auth('basic', 'foo', 'bar');
    bed.base('https://api.github.com');
    bed.type('application/json');
    bed.accept('application/vnd.github.v3+json');

    var gh = {
      test: bed.head('/').make(),
      listUsers: bed.get('/users').make(),
      getUser: bed.get('/users/<id>').make(),
      createUser: bed.post('/users').make()
    };

    it('should fail to authorize', function() {
      return gh.test().should.eventually.be.rejectedWith(/Unauthorized/);
    });

  });

  describe('a httpbin.org api', function() {
    var bed = new Bed();
    bed.auth('basic', 'foo', 'bar');
    bed.base('http://httpbin.org');

    var bin = {
      auth: bed.get('/basic-auth/<user>/bar').make(),
      multiAuth: bed.get('/basic-auth/<user>/<pass>').make(),
      failAuth: bed.get('/basic-auth/foo/baz').make(),
      get: bed.get('/get').make(),
      post: bed.post('/post').make()
    };

    it('should fail to authorize', function() {
      return bin.failAuth().should.eventually.be.rejectedWith(/Unauthorized/);
    });

    it('should fail without required user arg', function() {
      return bin.auth().should.be.rejected;
    });

    it('should successfully authorize', function() {
      return bin.auth('foo').should.eventually.have.deep.property('body.authenticated', true);
    });

    it('should successfully authorize with multiple required args', function() {
      return bin.multiAuth('foo', 'bar').should.eventually.have.deep.property('body.authenticated', true);
    });

    it('should get back query args', function() {
      return bin.get({q: 1}).should.eventually.have.deep.property('body.args.q', '1');
    });

    it('should get back body and query args', function() {
      return bin.post({data: 1}, {q: 1}).should.eventually.have.deep.property('body.json.data', 1);
    });

  });

// yield exports.listUsers();
// yield exports.getUser(); // throws argument error (missing "id")
// yield exports.createUser({});
});


text:
require 'mkmf'

dir_config("http11")
have_library("c", "main")

create_makefile("http11")


text:
from generateWasm import *
import optparse
import sys

parser = optparse.OptionParser(usage="usage: %prog <wasm.json> <WasmOps.h>")
(options, args) = parser.parse_args(sys.argv[0:])
if len(args) != 3:
    parser.error(parser.usage)

wasm = Wasm(args[0], args[1])
opcodes = wasm.opcodes
wasmValidateInlinesHFile = open(args[2], "w")

def cppType(name):
    result = {
        "bool": "I32",
        "addr": "I32",
        "i32": "I32",
        "i64": "I64",
        "f32": "F32",
        "f64": "F64",
    }.get(name, None)
    if result == None:
        raise ValueError("Unknown type name: " + name)
    return result

def toCpp(name):
    return wasm.toCpp(name)

def unaryMacro(name):
    op = opcodes[name]
    return """
template<> auto Validate::addOp<OpType::""" + toCpp(name) + """>(ExpressionType value, ExpressionType& result) -> Result
{
    if (UNLIKELY(value != """ + cppType(op["parameter"][0]) + """))
        return UnexpectedType<Result::ErrorType>("validation failed: """ + name + """ value type mismatch");

    result = """ + cppType(op["return"][0]) + """;
    return { };
}
"""

def binaryMacro(name):
    op = opcodes[name]
    return """
template<> auto Validate::addOp<OpType::""" + toCpp(name) + """>(ExpressionType left, ExpressionType right, ExpressionType& result) -> Result
{
    if (UNLIKELY(left != """ + cppType(op["parameter"][0]) + """))
        return UnexpectedType<Result::ErrorType>("validation failed: """ + name + """ left value type mismatch");

    if (UNLIKELY(right != """ + cppType(op["parameter"][1]) + """))
        return UnexpectedType<Result::ErrorType>("validation failed: """ + name + """ right value type mismatch");

    result = """ + cppType(op["return"][0]) + """;
    return { };
}
"""

def loadMacro(name):
    op = opcodes[name]
    return """
    case LoadOpType::""" + toCpp(name) + """: {
        if (UNLIKELY(pointer != """ + cppType(op["parameter"][0]) + """))
            return UnexpectedType<Result::ErrorType>("validation failed: """ + name + """ pointer type mismatch");

        result = """ + cppType(op["return"][0]) + """;
        return { };
    }"""

def storeMacro(name):
    op = opcodes[name]
    return """
    case StoreOpType::""" + toCpp(name) + """: {
        if (UNLIKELY(pointer != """ + cppType(op["parameter"][0]) + """))
            return UnexpectedType<Result::ErrorType>("validation failed: """ + name + """ pointer type mismatch");

        if (UNLIKELY(value != """ + cppType(op["parameter"][1]) + """))
            return UnexpectedType<Result::ErrorType>("validation failed: """ + name + """ value type mismatch");

        return { };
    }"""

unarySpecializations = "".join([op for op in wasm.opcodeIterator(isUnary, unaryMacro)])
binarySpecializations = "".join([op for op in wasm.opcodeIterator(isBinary, binaryMacro)])
loadCases = "".join([op for op in wasm.opcodeIterator(lambda op: op["category"] == "memory" and len(op["return"]) == 1, loadMacro)])
storeCases = "".join([op for op in wasm.opcodeIterator(lambda op: op["category"] == "memory" and len(op["return"]) == 0, storeMacro)])

contents = wasm.header + """
// This file is intended to be inlined by WasmValidate.cpp only! It should not be included elsewhere.

#pragma once

#if ENABLE(WEBASSEMBLY)

#include <wtf/StdLibExtras.h>

#if COMPILER(GCC) && ASSERT_DISABLED
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type"
#endif // COMPILER(GCC) && ASSERT_DISABLED

namespace JSC { namespace Wasm {

""" + unarySpecializations + binarySpecializations + """

auto Validate::load(LoadOpType op, ExpressionType pointer, ExpressionType& result, uint32_t) -> Result
{
    if (UNLIKELY(!hasMemory()))
        return UnexpectedType<Result::ErrorType>("validation failed: load instruction without memory");

    switch (op) {
""" + loadCases + """
    }
    ASSERT_NOT_REACHED();
}

auto Validate::store(StoreOpType op, ExpressionType pointer, ExpressionType value, uint32_t) -> Result
{
    if (UNLIKELY(!hasMemory()))
        return UnexpectedType<Result::ErrorType>("validation failed: store instruction without memory");

    switch (op) {
""" + storeCases + """
    }
    ASSERT_NOT_REACHED();
}

} } // namespace JSC::Wasm

#if COMPILER(GCC) && ASSERT_DISABLED
#pragma GCC diagnostic pop
#endif // COMPILER(GCC) && ASSERT_DISABLED

#endif // ENABLE(WEBASSEMBLY)

"""

wasmValidateInlinesHFile.write(contents)
wasmValidateInlinesHFile.close()


text:
Contributes an output widget to Theia that shows output from extensions to the user.
This output is usually comes from external commands run by the backend, e.g. `git` or language servers.
This deserves a bit more of the user's attention than log messages. As opposed to UI messages, it tends
to be more verbose and a does not require the user to react on it.

See [here](https://github.com/theia-ide/theia) for a detailed documentation on Theia.

## License
[Apache-2.0](https://github.com/theia-ide/theia/blob/master/LICENSE)


text:
package com.easemob.ChuangKeYuan.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Chronometer;

public class MyChronometer extends Chronometer{

    public MyChronometer(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public MyChronometer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyChronometer(Context context) {
        super(context);
    }

    @Override
    protected void onWindowVisibilityChanged(int visibility) {
        //屏幕隐藏时继续计时
        visibility = View.VISIBLE;
        super.onWindowVisibilityChanged(visibility);
    }
}


text:
package org.archive.wayback.resourceindex.cdxserver;

import org.archive.cdxserver.auth.AuthToken;
import org.archive.cdxserver.filter.CDXAccessFilter;
import org.archive.cdxserver.filter.FilenamePrefixFilter;
import org.archive.wayback.resourceindex.filters.ExclusionFilter;
import org.archive.wayback.webapp.AccessPoint;

public class WaybackAPAuthChecker extends WaybackAuthChecker {

	@Override
	public CDXAccessFilter createAccessFilter(AuthToken token)
	{
		APContextAuthToken apToken = null;

		if (!(token instanceof APContextAuthToken)) {
			return super.createAccessFilter(apToken);
		}

		apToken = (APContextAuthToken)token;

		AccessPoint ap = apToken.ap;

		FilenamePrefixFilter include = null, exclude = null;

		if (ap.getFileIncludePrefixes() != null) {
			include = new FilenamePrefixFilter();
			include.setExclusion(false);
			include.setPrefixList(ap.getFileIncludePrefixes());
		}

		if (ap.getFileExcludePrefixes() != null) {
			exclude = new FilenamePrefixFilter();
			exclude.setExclusion(true);
			exclude.setPrefixList(ap.getFileExcludePrefixes());
		}

		ExclusionFilter adminFilter = null;
		if (adminExclusions != null) {
			adminFilter = adminExclusions.get();
		}

		ExclusionFilter robotsFilter = null;
		if (robotsExclusions != null) {
			robotsFilter = robotsExclusions.get();
		}

		return new AccessCheckFilter(token, adminFilter, robotsFilter, include, exclude);
	}
}


text:
package com.bitmonlab.osiris.api.core.map.assemblers;

import javax.inject.Named;

import com.bitmonlab.osiris.api.core.map.transferobject.MetaDataDTO;
import com.bitmonlab.osiris.commons.map.model.geojson.MetaData;
import com.bitmonlab.osiris.core.assembler.AssemblyException;
import com.bitmonlab.osiris.core.assembler.SimpleAssembler;

@Named("MetaDataAssembler")
public class MetaDataAssemblerImpl extends SimpleAssembler<MetaDataDTO, MetaData>{

	public MetaDataAssemblerImpl() {
		super(MetaDataDTO.class, MetaData.class);
	}

	@Override
	public MetaData createDomainObject(MetaDataDTO metaDataDTO) throws AssemblyException{

		MetaData metaData = new MetaData();

		metaData.setOSMChecksum(metaDataDTO.getOSMChecksum());
		metaData.setRoutingChecksum(metaDataDTO.getRoutingChecksum());
		metaData.setMaxlat(Double.valueOf(metaDataDTO.getMaxLatitude()));
		metaData.setMaxlon(Double.valueOf(metaDataDTO.getMaxLongitude()));
		metaData.setMinlon(Double.valueOf(metaDataDTO.getMinLongitude()));
		metaData.setMinlat(Double.valueOf(metaDataDTO.getMinLatitude()));

		return metaData;

	}

	@Override
	public MetaDataDTO createDataTransferObject(MetaData metaData) throws AssemblyException{

		MetaDataDTO metaDataDTO = new MetaDataDTO();

		metaDataDTO.setOSMChecksum(metaData.getOSMChecksum());
		metaDataDTO.setRoutingChecksum(metaData.getRoutingChecksum());
		metaDataDTO.setMaxLatitude(String.valueOf(metaData.getMaxlat()));
		metaDataDTO.setMaxLongitude(String.valueOf(metaData.getMaxlon()));
		metaDataDTO.setMinLatitude(String.valueOf(metaData.getMinlat()));
		metaDataDTO.setMinLongitude(String.valueOf(metaData.getMinlon()));
		metaDataDTO.setAppId(metaData.getAppId());

		return metaDataDTO;

	}

}


text:
define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/on", "dojo/has", "put-selector/put", "./List", "./util/misc", "dojo/_base/sniff"],
function(kernel, declare, listen, has, put, List, miscUtil){
	var contentBoxSizing = has("ie") < 8 && !has("quirks");
	var invalidClassChars = /[^\._a-zA-Z0-9-]/g;
	function appendIfNode(parent, subNode){
		if(subNode && subNode.nodeType){
			parent.appendChild(subNode);
		}
	}

	var Grid = declare(List, {
		columns: null,
		// cellNavigation: Boolean
		//		This indicates that focus is at the cell level. This may be set to false to cause
		//		focus to be at the row level, which is useful if you want only want row-level
		//		navigation.
		cellNavigation: true,
		tabableHeader: true,
		showHeader: true,
		column: function(target){
			// summary:
			//		Get the column object by node, or event, or a columnId
			if(typeof target != "object"){
				return this.columns[target];
			}else{
				return this.cell(target).column;
			}
		},
		listType: "grid",
		cell: function(target, columnId){
			// summary:
			//		Get the cell object by node, or event, id, plus a columnId

			if(target.column && target.element){ return target; }

			if(target.target && target.target.nodeType){
				// event
				target = target.target;
			}
			var element;
			if(target.nodeType){
				var object;
				do{
					if(this._rowIdToObject[target.id]){
						break;
					}
					var colId = target.columnId;
					if(colId){
						columnId = colId;
						element = target;
						break;
					}
					target = target.parentNode;
				}while(target && target != this.domNode);
			}
			if(!element && typeof columnId != "undefined"){
				var row = this.row(target),
					rowElement = row && row.element;
				if(rowElement){
					var elements = rowElement.getElementsByTagName("td");
					for(var i = 0; i < elements.length; i++){
						if(elements[i].columnId == columnId){
							element = elements[i];
							break;
						}
					}
				}
			}
			if(target != null){
				return {
					row: row || this.row(target),
					column: columnId && this.column(columnId),
					element: element
				};
			}
		},

		createRowCells: function(tag, each, subRows, object){
			// summary:
			//		Generates the grid for each row (used by renderHeader and and renderRow)
			var row = put("table.dgrid-row-table[role=presentation]"),
				cellNavigation = this.cellNavigation,
				// IE < 9 needs an explicit tbody; other browsers do not
				tbody = (has("ie") < 9 || has("quirks")) ? put(row, "tbody") : row,
				tr,
				si, sl, i, l, // iterators
				subRow, column, id, extraClasses, className,
				cell, innerCell, colSpan, rowSpan; // used inside loops

			// Allow specification of custom/specific subRows, falling back to
			// those defined on the instance.
			subRows = subRows || this.subRows;

			for(si = 0, sl = subRows.length; si < sl; si++){
				subRow = subRows[si];
				// for single-subrow cases in modern browsers, TR can be skipped
				// http://jsperf.com/table-without-trs
				tr = put(tbody, "tr");
				if(subRow.className){
					put(tr, "." + subRow.className);
				}

				for(i = 0, l = subRow.length; i < l; i++){
					// iterate through the columns
					column = subRow[i];
					id = column.id;

					extraClasses = column.field ? ".field-" + column.field : "";
					className = typeof column.className === "function" ?
						column.className(object) : column.className;
					if(className){
						extraClasses += "." + className;
					}

					cell = put(tag + (
							".dgrid-cell.dgrid-cell-padding" +
							(id ? ".dgrid-column-" + id : "") +
							extraClasses.replace(/ +/g, ".")
						).replace(invalidClassChars,"-") +
						"[role=" + (tag === "th" ? "columnheader" : "gridcell") + "]");
					cell.columnId = id;
					if(contentBoxSizing){
						// The browser (IE7-) does not support box-sizing: border-box, so we emulate it with a padding div
						innerCell = put(cell, "!dgrid-cell-padding div.dgrid-cell-padding");// remove the dgrid-cell-padding, and create a child with that class
						cell.contents = innerCell;
					}else{
						innerCell = cell;
					}
					colSpan = column.colSpan;
					if(colSpan){
						cell.colSpan = colSpan;
					}
					rowSpan = column.rowSpan;
					if(rowSpan){
						cell.rowSpan = rowSpan;
					}
					each(innerCell, column);
					// add the td to the tr at the end for better performance
					tr.appendChild(cell);
				}
			}
			return row;
		},

		left: function(cell, steps){
			if(!cell.element){ cell = this.cell(cell); }
			return this.cell(this._move(cell, -(steps || 1), "dgrid-cell"));
		},
		right: function(cell, steps){
			if(!cell.element){ cell = this.cell(cell); }
			return this.cell(this._move(cell, steps || 1, "dgrid-cell"));
		},

		renderRow: function(object, options){
			var self = this;
			var row = this.createRowCells("td", function(td, column){
				var data = object;
				// Support get function or field property (similar to DataGrid)
				if(column.get){
					data = column.get(object);
				}else if("field" in column && column.field != "_item"){
					data = data[column.field];
				}

				if(column.renderCell){
					// A column can provide a renderCell method to do its own DOM manipulation,
					// event handling, etc.
					appendIfNode(td, column.renderCell(object, data, td, options));
				}else{
					defaultRenderCell.call(column, object, data, td, options);
				}
			}, options && options.subRows, object);
			// row gets a wrapper div for a couple reasons:
			//	1. So that one can set a fixed height on rows (heights can't be set on <table>'s AFAICT)
			// 2. So that outline style can be set on a row when it is focused, and Safari's outline style is broken on <table>
			return put("div[role=row]>", row);
		},
		renderHeader: function(){
			// summary:
			//		Setup the headers for the grid
			var
				grid = this,
				columns = this.columns,
				headerNode = this.headerNode,
				i = headerNode.childNodes.length;

			headerNode.setAttribute("role", "row");

			// clear out existing header in case we're resetting
			while(i--){
				put(headerNode.childNodes[i], "!");
			}

			var row = this.createRowCells("th", function(th, column){
				var contentNode = column.headerNode = th;
				if(contentBoxSizing){
					// we're interested in the th, but we're passed the inner div
					th = th.parentNode;
				}
				var field = column.field;
				if(field){
					th.field = field;
				}
				// allow for custom header content manipulation
				if(column.renderHeaderCell){
					appendIfNode(contentNode, column.renderHeaderCell(contentNode));
				}else if("label" in column || column.field){
					contentNode.appendChild(document.createTextNode(
						"label" in column ? column.label : column.field));
				}
				if(column.sortable !== false && field && field != "_item"){
					th.sortable = true;
					th.className += " dgrid-sortable";
				}
			}, this.subRows && this.subRows.headerRows);
			this._rowIdToObject[row.id = this.id + "-header"] = this.columns;
			headerNode.appendChild(row);

			// If the columns are sortable, re-sort on clicks.
			// Use a separate listener property to be managed by renderHeader in case
			// of subsequent calls.
			if(this._sortListener){
				this._sortListener.remove();
			}
			this._sortListener = listen(row, "click,keydown", function(event){
				// respond to click, space keypress, or enter keypress
				if(event.type == "click" || event.keyCode == 32 /* space bar */ || (!has("opera") && event.keyCode == 13) /* enter */){
					var target = event.target,
						field, sort, newSort, eventObj;
					do{
						if(target.sortable){
							// If the click is on the same column as the active sort,
							// reverse sort direction
							newSort = [{
								attribute: (field = target.field || target.columnId),
								descending: (sort = grid._sort[0]) && sort.attribute == field &&
									!sort.descending
							}];

							// Emit an event with the new sort
							eventObj = {
								bubbles: true,
								cancelable: true,
								grid: grid,
								parentType: event.type,
								sort: newSort
							};

							if (listen.emit(event.target, "dgrid-sort", eventObj)){
								// Stash node subject to DOM manipulations,
								// to be referenced then removed by sort()
								grid._sortNode = target;
								grid.set("sort", newSort);
							}

							break;
						}
					}while((target = target.parentNode) && target != headerNode);
				}
			});
		},

		resize: function(){
			// extension of List.resize to allow accounting for
			// column sizes larger than actual grid area
			var
				headerTableNode = this.headerNode.firstChild,
				contentNode = this.contentNode,
				width;

			this.inherited(arguments);

			if(!has("ie") || (has("ie") > 7 && !has("quirks"))){
				// Force contentNode width to match up with header width.
				// (Old IEs don't have a problem due to how they layout.)

				contentNode.style.width = ""; // reset first

				if(contentNode && headerTableNode){
					if((width = headerTableNode.offsetWidth) != contentNode.offsetWidth){
						// update size of content node if necessary (to match size of rows)
						// (if headerTableNode can't be found, there isn't much we can do)
						contentNode.style.width = width + "px";
					}
				}
			}
		},

		destroy: function(){
			// Run _destroyColumns first to perform any column plugin tear-down logic.
			this._destroyColumns();
			if(this._sortListener){
				this._sortListener.remove();
			}

			this.inherited(arguments);
		},

		_setSort: function(property, descending){
			// summary:
			//		Extension of List.js sort to update sort arrow in UI

			// Normalize _sort first via inherited logic, then update the sort arrow
			this.inherited(arguments);
			this.updateSortArrow(this._sort);
		},

		updateSortArrow: function(sort, updateSort){
			// summary:
			//		Method responsible for updating the placement of the arrow in the
			//		appropriate header cell.  Typically this should not be called (call
			//		set("sort", ...) when actually updating sort programmatically), but
			//		this method may be used by code which is customizing sort (e.g.
			//		by reacting to the dgrid-sort event, canceling it, then
			//		performing logic and calling this manually).
			// sort: Array
			//		Standard sort parameter - array of object(s) containing attribute
			//		and optionally descending property
			// updateSort: Boolean?
			//		If true, will update this._sort based on the passed sort array
			//		(i.e. to keep it in sync when custom logic is otherwise preventing
			//		it from being updated); defaults to false

			// Clean up UI from any previous sort
			if(this._lastSortedArrow){
				// Remove the sort classes from the parent node
				put(this._lastSortedArrow, "<!dgrid-sort-up!dgrid-sort-down");
				// Destroy the lastSortedArrow node
				put(this._lastSortedArrow, "!");
				delete this._lastSortedArrow;
			}

			if(updateSort){ this._sort = sort; }
			if(!sort[0]){ return; } // nothing to do if no sort is specified

			var prop = sort[0].attribute,
				desc = sort[0].descending,
				target = this._sortNode, // stashed if invoked from header click
				columns, column, i;

			delete this._sortNode;

			if(!target){
				columns = this.columns;
				for(i in columns){
					column = columns[i];
					if(column.field == prop){
						target = column.headerNode;
						break;
					}
				}
			}
			// skip this logic if field being sorted isn't actually displayed
			if(target){
				target = target.contents || target;
				// place sort arrow under clicked node, and add up/down sort class
				this._lastSortedArrow = put(target.firstChild, "-div.dgrid-sort-arrow.ui-icon[role=presentation]");
				this._lastSortedArrow.innerHTML = " ";
				put(target, desc ? ".dgrid-sort-down" : ".dgrid-sort-up");
				// call resize in case relocation of sort arrow caused any height changes
				this.resize();
			}
		},

		styleColumn: function(colId, css){
			// summary:
			//		Dynamically creates a stylesheet rule to alter a column's style.

			return this.addCssRule("#" + miscUtil.escapeCssIdentifier(this.domNode.id) +
				" .dgrid-column-" + colId, css);
		},

		/*=====
		_configColumn: function(column, columnId, rowColumns, prefix){
			// summary:
			//		Method called when normalizing base configuration of a single
			//		column.  Can be used as an extension point for behavior requiring
			//		access to columns when a new configuration is applied.
		},=====*/

		_configColumns: function(prefix, rowColumns){
			// configure the current column
			var subRow = [],
				isArray = rowColumns instanceof Array;

			function configColumn(column, columnId){
				if(typeof column == "string"){
					rowColumns[columnId] = column = {label:column};
				}
				if(!isArray && !column.field){
					column.field = columnId;
				}
				columnId = column.id = column.id || (isNaN(columnId) ? columnId : (prefix + columnId));
				if(isArray){ this.columns[columnId] = column; }

				// allow further base configuration in subclasses
				if(this._configColumn){
					this._configColumn(column, columnId, rowColumns, prefix);
				}

				// add grid reference to each column object for potential use by plugins
				column.grid = this;
				if(typeof column.init === "function"){ column.init(); }

				subRow.push(column); // make sure it can be iterated on
			}

			miscUtil.each(rowColumns, configColumn, this);
			return isArray ? rowColumns : subRow;
		},

		_destroyColumns: function(){
			// summary:
			//		Iterates existing subRows looking for any column definitions with
			//		destroy methods (defined by plugins) and calls them.  This is called
			//		immediately before configuring a new column structure.

			var subRows = this.subRows,
				// if we have column sets, then we don't need to do anything with the missing subRows, ColumnSet will handle it
				subRowsLength = subRows && subRows.length,
				i, j, column, len;

			// First remove rows (since they'll be refreshed after we're done),
			// so that anything aspected onto removeRow by plugins can run.
			// (cleanup will end up running again, but with nothing to iterate.)
			this.cleanup();

			for(i = 0; i < subRowsLength; i++){
				for(j = 0, len = subRows[i].length; j < len; j++){
					column = subRows[i][j];
					if(typeof column.destroy === "function"){ column.destroy(); }
				}
			}
		},

		configStructure: function(){
			// configure the columns and subRows
			var subRows = this.subRows,
				columns = this._columns = this.columns;

			// Reset this.columns unless it was already passed in as an object
			this.columns = !columns || columns instanceof Array ? {} : columns;

			if(subRows){
				// Process subrows, which will in turn populate the this.columns object
				for(var i = 0; i < subRows.length; i++){
					subRows[i] = this._configColumns(i + "-", subRows[i]);
				}
			}else{
				this.subRows = [this._configColumns("", columns)];
			}
		},

		_getColumns: function(){
			// _columns preserves what was passed to set("columns"), but if subRows
			// was set instead, columns contains the "object-ified" version, which
			// was always accessible in the past, so maintain that accessibility going
			// forward.
			return this._columns || this.columns;
		},
		_setColumns: function(columns){
			this._destroyColumns();
			// reset instance variables
			this.subRows = null;
			this.columns = columns;
			// re-run logic
			this._updateColumns();
		},

		_setSubRows: function(subrows){
			this._destroyColumns();
			this.subRows = subrows;
			this._updateColumns();
		},

		setColumns: function(columns){
			kernel.deprecated("setColumns(...)", 'use set("columns", ...) instead', "dgrid 0.4");
			this.set("columns", columns);
		},
		setSubRows: function(subrows){
			kernel.deprecated("setSubRows(...)", 'use set("subRows", ...) instead', "dgrid 0.4");
			this.set("subRows", subrows);
		},

		_updateColumns: function(){
			// summary:
			//		Called when columns, subRows, or columnSets are reset

			this.configStructure();
			this.renderHeader();

			this.refresh();
			// re-render last collection if present
			this._lastCollection && this.renderArray(this._lastCollection);

			// After re-rendering the header, re-apply the sort arrow if needed.
			if(this._started){
				if(this._sort && this._sort.length){
					this.updateSortArrow(this._sort);
				} else {
					// Only call resize directly if we didn't call updateSortArrow,
					// since that calls resize itself when it updates.
					this.resize();
				}
			}
		}
	});

	function defaultRenderCell(object, data, td, options){
		if(this.formatter){
			// Support formatter, with or without formatterScope
			var formatter = this.formatter,
				formatterScope = this.grid.formatterScope;
			td.innerHTML = typeof formatter === "string" && formatterScope ?
				formatterScope[formatter](data, object) : this.formatter(data, object);
		}else if(data != null){
			td.appendChild(document.createTextNode(data));
		}
	}

	// expose appendIfNode and default implementation of renderCell,
	// e.g. for use by column plugins
	Grid.appendIfNode = appendIfNode;
	Grid.defaultRenderCell = defaultRenderCell;

	return Grid;
});


text:
/*-------------------------------------------------------------------------------*/
/* ACCORDS Platform                                                              */
/* copyright 2012 ,Hamid MEDJAHE & Elyes ZEKRI  (hmedjahed@prologue.fr) Prologue */
/*-------------------------------------------------------------------------------*/
/* Licensed under the Apache License, Version 2.0 (the "License");               */
/* you may not use this file except in compliance with the License.              */
/* You may obtain a copy of the License at                                       */
/*                                                                               */
/*       http://www.apache.org/licenses/LICENSE-2.0                              */
/*                                                                               */
/* Unless required by applicable law or agreed to in writing, software           */
/* distributed under the License is distributed on an "AS IS" BASIS,             */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.      */
/* See the License for the specific language governing permissions and           */
/* limitations under the License.                                                */
/*-------------------------------------------------------------------------------*/

#include <Python.h>
#include "component.c"

/*--------------------------------------------------------------------------------*/
/* Function to launch a new accords module (component)                            */
/*--------------------------------------------------------------------------------*/
static PyObject *pycompdev_launchModule(PyObject *self, PyObject *args)
{
 char * categoryNameList;
 char * categoryActionNumberList;
 char **argv;
 int argc;
 char *moduleName;
 int a;
 int i;
 PyObject * listObj; /* the list of strings */
 PyObject * strObj;  /* one string in the list */
 int numLines;

 if (! PyArg_ParseTuple( args,"iO!ss", &argc,&PyList_Type, &listObj,&moduleName, &categoryNameList)) return NULL;
 numLines = PyList_Size(listObj);

 if (numLines < 0)   return NULL;
 argv = (char**) malloc(sizeof (char*) * numLines);
  for(i = 0; i < numLines; i++)
      argv= (char*) malloc(sizeof (char) * 1024);

 for (i=0; i<numLines; i++)
 {

  strObj = PyList_GetItem(listObj, i);
  argv[i] = PyString_AsString( strObj );

 }

 a=module_main(argc,argv,moduleName,categoryNameList);

 return Py_BuildValue("i",a);
}

static PyMethodDef ModMethods[] = {
    {"launchModule",pycompdev_launchModule, METH_VARARGS, "Function to launch a module"},
    {NULL,NULL,0,NULL}
};

PyMODINIT_FUNC initpycompdev(void)
{
    PyObject *m;
    m = Py_InitModule("pycompdev",ModMethods);
    if (m == NULL)
    return;
}


text:
/*global define, angular */

'use strict';

require(['angular', './controllers', './directives', './filters', './services', 'angular-route'],
  function(angular, controllers) {

    // Declare app level module which depends on filters, and services

    angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', 'ngRoute']).
      config(['$routeProvider', function($routeProvider) {
        $routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: controllers.MyCtrl1});
        $routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: controllers.MyCtrl2});
        $routeProvider.otherwise({redirectTo: '/view1'});
    }]);

    angular.bootstrap(document, ['myApp']);

});


text:
#include "config.h"
#include "core/html/HTMLPlugInElement.h"

#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/npruntime_impl.h"
#include "core/CSSPropertyNames.h"
#include "core/HTMLNames.h"
#include "core/dom/Document.h"
#include "core/dom/Node.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/html/HTMLContentElement.h"
#include "core/html/HTMLImageLoader.h"
#include "core/html/PluginDocument.h"
#include "core/loader/FrameLoaderClient.h"
#include "core/page/EventHandler.h"
#include "core/page/Page.h"
#include "core/plugins/PluginView.h"
#include "core/rendering/RenderEmbeddedObject.h"
#include "core/rendering/RenderImage.h"
#include "core/rendering/RenderWidget.h"
#include "platform/Logging.h"
#include "platform/MIMETypeFromURL.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/Widget.h"
#include "platform/plugins/PluginData.h"

namespace blink {

using namespace HTMLNames;

HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& doc, bool createdByParser, PreferPlugInsForImagesOption preferPlugInsForImagesOption)
    : HTMLFrameOwnerElement(tagName, doc)
    , m_isDelayingLoadEvent(false)
    , m_NPObject(0)
    , m_isCapturingMouseEvents(false)
    // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay
    // widget updates until after all children are parsed. For HTMLEmbedElement
    // this delay is unnecessary, but it is simpler to make both classes share
    // the same codepath in this class.
    , m_needsWidgetUpdate(!createdByParser)
    , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages)
{
    setHasCustomStyleCallbacks();
}

HTMLPlugInElement::~HTMLPlugInElement()
{
    ASSERT(!m_pluginWrapper); // cleared in detach()
    ASSERT(!m_isDelayingLoadEvent);

    if (m_NPObject) {
        _NPN_ReleaseObject(m_NPObject);
        m_NPObject = 0;
    }
}

void HTMLPlugInElement::trace(Visitor* visitor)
{
    visitor->trace(m_imageLoader);
    HTMLFrameOwnerElement::trace(visitor);
}

bool HTMLPlugInElement::canProcessDrag() const
{
    return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(pluginWidget())->canProcessDrag();
}

bool HTMLPlugInElement::willRespondToMouseClickEvents()
{
    if (isDisabledFormControl())
        return false;
    RenderObject* r = renderer();
    return r && (r->isEmbeddedObject() || r->isWidget());
}

void HTMLPlugInElement::removeAllEventListeners()
{
    HTMLFrameOwnerElement::removeAllEventListeners();
    if (RenderWidget* renderer = existingRenderWidget()) {
        if (Widget* widget = renderer->widget())
            widget->eventListenersRemoved();
    }
}

void HTMLPlugInElement::didMoveToNewDocument(Document& oldDocument)
{
    if (m_imageLoader)
        m_imageLoader->elementDidMoveToNewDocument();
    HTMLFrameOwnerElement::didMoveToNewDocument(oldDocument);
}

void HTMLPlugInElement::attach(const AttachContext& context)
{
    HTMLFrameOwnerElement::attach(context);

    if (!renderer() || useFallbackContent())
        return;

    if (isImageType()) {
        if (!m_imageLoader)
            m_imageLoader = HTMLImageLoader::create(this);
        m_imageLoader->updateFromElement();
    } else if (needsWidgetUpdate()
        && renderEmbeddedObject()
        && !renderEmbeddedObject()->showsUnavailablePluginIndicator()
        && !wouldLoadAsNetscapePlugin(m_url, m_serviceType)
        && !m_isDelayingLoadEvent) {
        m_isDelayingLoadEvent = true;
        document().incrementLoadEventDelayCount();
        document().loadPluginsSoon();
    }
}

void HTMLPlugInElement::updateWidget()
{
    RefPtrWillBeRawPtr<HTMLPlugInElement> protector(this);
    updateWidgetInternal();
    if (m_isDelayingLoadEvent) {
        m_isDelayingLoadEvent = false;
        document().decrementLoadEventDelayCount();
    }
}

void HTMLPlugInElement::requestPluginCreationWithoutRendererIfPossible()
{
    if (m_serviceType.isEmpty())
        return;

    if (!document().frame()
        || !document().frame()->loader().client()->canCreatePluginWithoutRenderer(m_serviceType))
        return;

    if (renderer() && renderer()->isWidget())
        return;

    createPluginWithoutRenderer();
}

void HTMLPlugInElement::createPluginWithoutRenderer()
{
    ASSERT(document().frame()->loader().client()->canCreatePluginWithoutRenderer(m_serviceType));

    KURL url;
    Vector<String> paramNames;
    Vector<String> paramValues;

    paramNames.append("type");
    paramValues.append(m_serviceType);

    bool useFallback = false;
    loadPlugin(url, m_serviceType, paramNames, paramValues, useFallback, false);
}

bool HTMLPlugInElement::shouldAccelerate() const
{
    if (Widget* widget = ownedWidget())
        return widget->isPluginView() && toPluginView(widget)->platformLayer();
    return false;
}

void HTMLPlugInElement::detach(const AttachContext& context)
{
    // Update the widget the next time we attach (detaching destroys the plugin).
    // FIXME: None of this "needsWidgetUpdate" related code looks right.
    if (renderer() && !useFallbackContent())
        setNeedsWidgetUpdate(true);
    if (m_isDelayingLoadEvent) {
        m_isDelayingLoadEvent = false;
        document().decrementLoadEventDelayCount();
    }

    // Only try to persist a plugin widget we actually own.
    Widget* plugin = ownedWidget();
    if (plugin && plugin->pluginShouldPersist())
        m_persistedPluginWidget = plugin;
#if ENABLE(OILPAN)
    else if (plugin)
        plugin->detach();
#endif
    resetInstance();
    // FIXME - is this next line necessary?
    setWidget(nullptr);

    if (m_isCapturingMouseEvents) {
        if (LocalFrame* frame = document().frame())
            frame->eventHandler().setCapturingMouseEventsNode(nullptr);
        m_isCapturingMouseEvents = false;
    }

    if (m_NPObject) {
        _NPN_ReleaseObject(m_NPObject);
        m_NPObject = 0;
    }

    HTMLFrameOwnerElement::detach(context);
}

RenderObject* HTMLPlugInElement::createRenderer(RenderStyle* style)
{
    // Fallback content breaks the DOM->Renderer class relationship of this
    // class and all superclasses because createObject won't necessarily
    // return a RenderEmbeddedObject, RenderPart or even RenderWidget.
    if (useFallbackContent())
        return RenderObject::createObject(this, style);

    if (isImageType()) {
        RenderImage* image = new RenderImage(this);
        image->setImageResource(RenderImageResource::create());
        return image;
    }

    return new RenderEmbeddedObject(this);
}

void HTMLPlugInElement::willRecalcStyle(StyleRecalcChange)
{
    // FIXME: Why is this necessary? Manual re-attach is almost always wrong.
    if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageType())
        reattach();
}

void HTMLPlugInElement::finishParsingChildren()
{
    HTMLFrameOwnerElement::finishParsingChildren();
    if (useFallbackContent())
        return;

    setNeedsWidgetUpdate(true);
    if (inDocument())
        setNeedsStyleRecalc(SubtreeStyleChange);
}

void HTMLPlugInElement::resetInstance()
{
    m_pluginWrapper.clear();
}

SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper()
{
    LocalFrame* frame = document().frame();
    if (!frame)
        return 0;

    // If the host dynamically turns off JavaScript (or Java) we will still
    // return the cached allocated Bindings::Instance. Not supporting this
    // edge-case is OK.
    if (!m_pluginWrapper) {
        Widget* plugin;

        if (m_persistedPluginWidget)
            plugin = m_persistedPluginWidget.get();
        else
            plugin = pluginWidget();

        if (plugin)
            m_pluginWrapper = frame->script().createPluginWrapper(plugin);
    }
    return m_pluginWrapper.get();
}

Widget* HTMLPlugInElement::pluginWidget() const
{
    if (RenderWidget* renderWidget = renderWidgetForJSBindings())
        return renderWidget->widget();
    return 0;
}

bool HTMLPlugInElement::isPresentationAttribute(const QualifiedName& name) const
{
    if (name == widthAttr || name == heightAttr || name == vspaceAttr || name == hspaceAttr || name == alignAttr)
        return true;
    return HTMLFrameOwnerElement::isPresentationAttribute(name);
}

void HTMLPlugInElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
    if (name == widthAttr) {
        addHTMLLengthToStyle(style, CSSPropertyWidth, value);
    } else if (name == heightAttr) {
        addHTMLLengthToStyle(style, CSSPropertyHeight, value);
    } else if (name == vspaceAttr) {
        addHTMLLengthToStyle(style, CSSPropertyMarginTop, value);
        addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value);
    } else if (name == hspaceAttr) {
        addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value);
        addHTMLLengthToStyle(style, CSSPropertyMarginRight, value);
    } else if (name == alignAttr) {
        applyAlignmentAttributeToStyle(value, style);
    } else {
        HTMLFrameOwnerElement::collectStyleForPresentationAttribute(name, value, style);
    }
}

void HTMLPlugInElement::defaultEventHandler(Event* event)
{
    // Firefox seems to use a fake event listener to dispatch events to plug-in
    // (tested with mouse events only). This is observable via different order
    // of events - in Firefox, event listeners specified in HTML attributes
    // fires first, then an event gets dispatched to plug-in, and only then
    // other event listeners fire. Hopefully, this difference does not matter in
    // practice.

    // FIXME: Mouse down and scroll events are passed down to plug-in via custom
    // code in EventHandler; these code paths should be united.

    RenderObject* r = renderer();
    if (!r || !r->isWidget())
        return;
    if (r->isEmbeddedObject()) {
        if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator())
            return;
    }
    RefPtr<Widget> widget = toRenderWidget(r)->widget();
    if (!widget)
        return;
    widget->handleEvent(event);
    if (event->defaultHandled())
        return;
    HTMLFrameOwnerElement::defaultEventHandler(event);
}

RenderWidget* HTMLPlugInElement::renderWidgetForJSBindings() const
{
    // Needs to load the plugin immediatedly because this function is called
    // when JavaScript code accesses the plugin.
    // FIXME: Check if dispatching events here is safe.
    document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
    return existingRenderWidget();
}

bool HTMLPlugInElement::isKeyboardFocusable() const
{
    if (!document().isActive())
        return false;
    return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(pluginWidget())->supportsKeyboardFocus();
}

bool HTMLPlugInElement::hasCustomFocusLogic() const
{
    return !hasAuthorShadowRoot();
}

bool HTMLPlugInElement::isPluginElement() const
{
    return true;
}

bool HTMLPlugInElement::rendererIsFocusable() const
{
    if (HTMLFrameOwnerElement::supportsFocus() && HTMLFrameOwnerElement::rendererIsFocusable())
        return true;

    if (useFallbackContent() || !renderer() || !renderer()->isEmbeddedObject())
        return false;
    return !toRenderEmbeddedObject(renderer())->showsUnavailablePluginIndicator();
}

NPObject* HTMLPlugInElement::getNPObject()
{
    ASSERT(document().frame());
    if (!m_NPObject)
        m_NPObject = document().frame()->script().createScriptObjectForPluginElement(this);
    return m_NPObject;
}

bool HTMLPlugInElement::isImageType()
{
    if (m_serviceType.isEmpty() && protocolIs(m_url, "data"))
        m_serviceType = mimeTypeFromDataURL(m_url);

    if (LocalFrame* frame = document().frame()) {
        KURL completedURL = document().completeURL(m_url);
        return frame->loader().client()->objectContentType(completedURL, m_serviceType, shouldPreferPlugInsForImages()) == ObjectContentImage;
    }

    return Image::supportsType(m_serviceType);
}

RenderEmbeddedObject* HTMLPlugInElement::renderEmbeddedObject() const
{
    // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers
    // when using fallback content.
    if (!renderer() || !renderer()->isEmbeddedObject())
        return 0;
    return toRenderEmbeddedObject(renderer());
}

// We don't use m_url, as it may not be the final URL that the object loads,
// depending on <param> values.
bool HTMLPlugInElement::allowedToLoadFrameURL(const String& url)
{
    KURL completeURL = document().completeURL(url);
    if (contentFrame() && protocolIsJavaScript(completeURL)
        && !document().securityOrigin()->canAccess(contentDocument()->securityOrigin()))
        return false;
    return document().frame()->isURLAllowed(completeURL);
}

// We don't use m_url, or m_serviceType as they may not be the final values
// that <object> uses depending on <param> values.
bool HTMLPlugInElement::wouldLoadAsNetscapePlugin(const String& url, const String& serviceType)
{
    ASSERT(document().frame());
    KURL completedURL;
    if (!url.isEmpty())
        completedURL = document().completeURL(url);
    return document().frame()->loader().client()->objectContentType(completedURL, serviceType, shouldPreferPlugInsForImages()) == ObjectContentNetscapePlugin;
}

bool HTMLPlugInElement::requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
{
    if (url.isEmpty() && mimeType.isEmpty())
        return false;

    // FIXME: None of this code should use renderers!
    RenderEmbeddedObject* renderer = renderEmbeddedObject();
    ASSERT(renderer);
    if (!renderer)
        return false;

    KURL completedURL = document().completeURL(url);
    if (!pluginIsLoadable(completedURL, mimeType))
        return false;

    bool useFallback;
    bool requireRenderer = true;
    if (shouldUsePlugin(completedURL, mimeType, hasFallbackContent(), useFallback))
        return loadPlugin(completedURL, mimeType, paramNames, paramValues, useFallback, requireRenderer);

    // If the plug-in element already contains a subframe,
    // loadOrRedirectSubframe will re-use it. Otherwise, it will create a new
    // frame and set it as the RenderPart's widget, causing what was previously
    // in the widget to be torn down.
    return loadOrRedirectSubframe(completedURL, getNameAttribute(), true);
}

bool HTMLPlugInElement::loadPlugin(const KURL& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback, bool requireRenderer)
{
    LocalFrame* frame = document().frame();

    if (!frame->loader().allowPlugins(AboutToInstantiatePlugin))
        return false;

    RenderEmbeddedObject* renderer = renderEmbeddedObject();
    // FIXME: This code should not depend on renderer!
    if ((!renderer && requireRenderer) || useFallback)
        return false;

    WTF_LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data());
    WTF_LOG(Plugins, "   Loaded URL: %s", url.string().utf8().data());
    m_loadedUrl = url;

    RefPtr<Widget> widget = m_persistedPluginWidget;
    if (!widget) {
        bool loadManually = document().isPluginDocument() && !document().containsPlugins() && toPluginDocument(document()).shouldLoadPluginManually();
        FrameLoaderClient::DetachedPluginPolicy policy = requireRenderer ? FrameLoaderClient::FailOnDetachedPlugin : FrameLoaderClient::AllowDetachedPlugin;
        widget = frame->loader().client()->createPlugin(this, url, paramNames, paramValues, mimeType, loadManually, policy);
    }

    if (!widget) {
        if (renderer && !renderer->showsUnavailablePluginIndicator())
            renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginMissing);
        return false;
    }

    if (renderer) {
        setWidget(widget);
        m_persistedPluginWidget = nullptr;
    } else if (widget != m_persistedPluginWidget) {
        m_persistedPluginWidget = widget;
    }
    document().setContainsPlugins();
    scheduleSVGFilterLayerUpdateHack();
    return true;
}

bool HTMLPlugInElement::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback)
{
    // Allow other plug-ins to win over QuickTime because if the user has
    // installed a plug-in that can handle TIFF (which QuickTime can also
    // handle) they probably intended to override QT.
    if (document().frame()->page() && (mimeType == "image/tiff" || mimeType == "image/tif" || mimeType == "image/x-tiff")) {
        const PluginData* pluginData = document().frame()->page()->pluginData();
        String pluginName = pluginData ? pluginData->pluginNameForMimeType(mimeType) : String();
        if (!pluginName.isEmpty() && !pluginName.contains("QuickTime", false))
            return true;
    }

    ObjectContentType objectType = document().frame()->loader().client()->objectContentType(url, mimeType, shouldPreferPlugInsForImages());
    // If an object's content can't be handled and it has no fallback, let
    // it be handled as a plugin to show the broken plugin icon.
    useFallback = objectType == ObjectContentNone && hasFallback;
    return objectType == ObjectContentNone || objectType == ObjectContentNetscapePlugin || objectType == ObjectContentOtherPlugin;

}

void HTMLPlugInElement::dispatchErrorEvent()
{
    if (document().isPluginDocument() && document().ownerElement())
        document().ownerElement()->dispatchEvent(Event::create(EventTypeNames::error));
    else
        dispatchEvent(Event::create(EventTypeNames::error));
}

bool HTMLPlugInElement::pluginIsLoadable(const KURL& url, const String& mimeType)
{
    LocalFrame* frame = document().frame();
    Settings* settings = frame->settings();
    if (!settings)
        return false;

    if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType) && !settings->javaEnabled())
        return false;

    if (document().isSandboxed(SandboxPlugins))
        return false;

    if (!document().securityOrigin()->canDisplay(url)) {
        FrameLoader::reportLocalLoadFailed(frame, url.string());
        return false;
    }

    AtomicString declaredMimeType = document().isPluginDocument() && document().ownerElement() ?
        document().ownerElement()->fastGetAttribute(HTMLNames::typeAttr) :
        fastGetAttribute(HTMLNames::typeAttr);
    if (!document().contentSecurityPolicy()->allowObjectFromSource(url)
        || !document().contentSecurityPolicy()->allowPluginType(mimeType, declaredMimeType, url)) {
        renderEmbeddedObject()->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy);
        return false;
    }

    return frame->loader().mixedContentChecker()->canRunInsecureContent(document().securityOrigin(), url);
}

void HTMLPlugInElement::didAddUserAgentShadowRoot(ShadowRoot&)
{
    userAgentShadowRoot()->appendChild(HTMLContentElement::create(document()));
}

void HTMLPlugInElement::willAddFirstAuthorShadowRoot()
{
    lazyReattachIfAttached();
}

bool HTMLPlugInElement::hasFallbackContent() const
{
    return false;
}

bool HTMLPlugInElement::useFallbackContent() const
{
    return hasAuthorShadowRoot();
}

}


text:
package tokenfile

import (
	"go/ast"
	"go/token"
	"reflect"

	"golang.org/x/tools/go/analysis"
)

var Analyzer = &analysis.Analyzer{
	Name: "tokenfileanalyzer",
	Doc:  "creates a mapping of *token.File to *ast.File",
	Run: func(pass *analysis.Pass) (interface{}, error) {
		m := map[*token.File]*ast.File{}
		for _, af := range pass.Files {
			tf := pass.Fset.File(af.Pos())
			m[tf] = af
		}
		return m, nil
	},
	RunDespiteErrors: true,
	ResultType:       reflect.TypeOf(map[*token.File]*ast.File{}),
}


text:
namespace MoodBox
{

GetCommandsResultData::GetCommandsResultData() : QSharedData()
{
}
GetCommandsResultData::GetCommandsResultData(CommandPackage result) : QSharedData()
{
    this->result = result;
}

GetCommandsResultData::~GetCommandsResultData()
{
}

GetCommandsResult::GetCommandsResult() : TransportableObject()
{
}
GetCommandsResult::GetCommandsResult(CommandPackage result) : TransportableObject()
{
    d = new GetCommandsResultData(result);
}

GetCommandsResult::~GetCommandsResult()
{
}

void GetCommandsResult::resultCall(Callback callback, QVariant state)
{
    GetCommandsResultCallbackCaller::call(callback, state, getResult());
}

CommandPackage GetCommandsResult::getResult() const
{
    Q_ASSERT_X(!isNull(), "GetCommandsResult::getResult", "Getter call on object which isNull");
    return this->d->result;
}
void GetCommandsResult::setResult(CommandPackage value)
{
    Q_ASSERT_X(!isNull(), "GetCommandsResult::setResult", "Setter call on object which isNull");
    this->d->result = value;
}

qint32 GetCommandsResult::getRepresentedTypeId()
{
    return 10050;
}

qint32 GetCommandsResult::getTypeId() const
{
    return 10050;
}
void GetCommandsResult::writeProperties(PropertyWriter *writer)
{
    TransportableObject::writeProperties(writer);

    writer->writeProperty(this, 1, &this->d->result);
}
PropertyReadResult GetCommandsResult::readProperty(qint32 propertyId, qint32 typeId, PropertyReader *reader)
{
    PropertyReadResult result = TransportableObject::readProperty(propertyId, typeId, reader);
    if(result.getIsPropertyFound())
        return result;

    switch(propertyId)
    {
        case 1:
            this->d->result = CommandPackage::empty();
            return PropertyReadResult(&this->d->result);
    }

    return PropertyReadResult(false);
}

}


text:
package io.vertx.ext.apex.handler;

import io.vertx.core.http.HttpMethod;
import io.vertx.ext.apex.ApexTestBase;
import org.junit.Test;

/**
 *
 * Kind of hard to test this!
 *
 * @author Tim Fox
 */
public class LoggerHandlerTest extends ApexTestBase {

  @Override
  public void setUp() throws Exception {
    super.setUp();

  }

  @Test
  public void testLogger1() throws Exception {
    LoggerHandler logger = LoggerHandler.create();
    testLogger(logger);
  }

  @Test
  public void testLogger2() throws Exception {
    LoggerHandler logger = LoggerHandler.create(LoggerHandler.Format.TINY);
    testLogger(logger);
  }

  @Test
  public void testLogger3() throws Exception {
    LoggerHandler logger = LoggerHandler.create(true, LoggerHandler.Format.TINY);
    testLogger(logger);
  }

  private void testLogger(LoggerHandler logger) throws Exception {
    router.route().handler(logger);
    router.route().handler(rc -> rc.response().end());
    testRequest(HttpMethod.GET, "/somedir", 200, "OK");
  }

}


text:
package it.unipi.di.acube.smaph.linkback;

import it.unipi.di.acube.batframework.data.Annotation;
import it.unipi.di.acube.batframework.data.Tag;
import it.unipi.di.acube.batframework.utils.WikipediaApiInterface;
import it.unipi.di.acube.smaph.QueryInformation;
import it.unipi.di.acube.smaph.linkback.bindingGenerator.BindingGenerator;
import it.unipi.di.acube.smaph.linkback.bindingGenerator.DefaultBindingGenerator;

import java.util.*;

import static org.junit.Assert.*;

import org.junit.Test;

public class CollectiveLinkBackTest {

	@Test
	public void testGetAllBindings() throws Exception {

		BindingGenerator bg = new DefaultBindingGenerator();

		String query = "metronome satting of allegro";

		HashMap<Tag, List<String>> entityToBolds = new HashMap<>();
		entityToBolds.put(new Tag(88771), Arrays.asList("metronome", "metronomes", "Set", "Metronome", "allegro"));
		entityToBolds.put(new Tag(30967), Arrays.asList("allegro", "Metronome", "metronome", "of allegro"));
		entityToBolds.put(new Tag(3564116), Arrays.asList("set", "setting"));

		QueryInformation qi = new QueryInformation();
		qi.entityToBoldsSA = entityToBolds;
		List<HashSet<Annotation>> possibleBindings = bg.getBindings(query, qi, new HashSet<Tag>(entityToBolds.keySet()), new WikipediaApiInterface(null, null));

		assertEquals(24, possibleBindings.size());
		HashSet<Integer> verified = new HashSet<>();

		for (HashSet<Annotation> binding : possibleBindings) {
			if (binding.isEmpty())
				verified.add(0);
			if (binding.size() == 1
					&& binding.contains(new Annotation(0, 9, 88771)))
				verified.add(1);
			if (binding.size() == 1
					&& binding.contains(new Annotation(0, 9, 30967)))
				verified.add(2);
			if (binding.size() == 1
					&& binding.contains(new Annotation(0, 9, 88771)))
				verified.add(3);
			if (binding.size() == 1
					&& binding.contains(new Annotation(21, 7, 88771)))
				verified.add(4);
			if (binding.size() == 1
					&& binding.contains(new Annotation(21, 7, 30967)))
				verified.add(5);
			if (binding.size() == 2
					&& binding.contains(new Annotation(21, 7, 30967))
					&& binding.contains(new Annotation(10, 7, 3564116)))
				verified.add(6);
			if (binding.size() == 2
					&& binding.contains(new Annotation(21, 7, 88771))
					&& binding.contains(new Annotation(10, 7, 3564116)))
				verified.add(7);
			if (binding.size() == 3
					&& binding.contains(new Annotation(0, 9, 88771))
					&& binding.contains(new Annotation(21, 7, 88771))
					&& binding.contains(new Annotation(10, 7, 3564116)))
				verified.add(8);
			if (binding.size() == 3
					&& binding.contains(new Annotation(0, 9, 30967))
					&& binding.contains(new Annotation(21, 7, 88771))
					&& binding.contains(new Annotation(10, 7, 3564116)))
				verified.add(9);
			if (binding.size() == 3
					&& binding.contains(new Annotation(0, 9, 88771))
					&& binding.contains(new Annotation(21, 7, 30967))
					&& binding.contains(new Annotation(10, 7, 3564116)))
				verified.add(10);
			if (binding.size() == 3
					&& binding.contains(new Annotation(0, 9, 30967))
					&& binding.contains(new Annotation(21, 7, 30967))
					&& binding.contains(new Annotation(10, 7, 3564116)))
				verified.add(11);
		}

		assertEquals(true, verified.contains(0));
		assertEquals(true, verified.contains(1));
		assertEquals(true, verified.contains(2));
		assertEquals(true, verified.contains(3));
		assertEquals(true, verified.contains(4));
		assertEquals(true, verified.contains(5));
		assertEquals(true, verified.contains(6));
		assertEquals(true, verified.contains(7));
		assertEquals(true, verified.contains(8));
		assertEquals(true, verified.contains(9));
		assertEquals(true, verified.contains(10));
		assertEquals(true, verified.contains(11));

	}

}


text:
"""
    This is part of shot detector.
    Produced by w495 at 2017.05.04 04:18:27
"""

from __future__ import absolute_import, division, print_function

from ..base_extractor import BaseExtractor

class LumaExtractor(BaseExtractor):
    """
        ...
    """

    @staticmethod
    def av_format(**_):
        """

        :return:
        """
        return 'rgb24'

    def transcode_frame_images(self, image_seq, **kwargs):
        """

        :type image_seq: collections.Iterable
        :param image_seq:
        :return:
        """
        image_seq = self.convert_to_luminosity(image_seq, **kwargs)
        return image_seq


text:
import javax.swing.JOptionPane;

/**
 * The prime factors of 13195 are 5, 7, 13 and 29.
 *
 * What is the largest prime factor of the number 600851475143?
 *
 * @author Matthew Van der Bijl
 */
public final class Problem_3 implements Runnable {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        new Problem_3().run();
    }

    @Override
    public void run() {
        long num = 600851475143L;
        int largestPrimeFactor = 0;

        for (int i = 1; i < Math.sqrt(600851475143L); i++) {
            if ((num % i) == 0) {
                num /= i;
                largestPrimeFactor = i;
            }
        }

//        System.out.println(largestPrimeFactor);
        JOptionPane.showMessageDialog(null, largestPrimeFactor);
    }
}


text:
package client

import (
	"fmt"

	"github.com/caprioska/caprioska/api"
)

func (cli *CaprioskaCli) CmdHelp(args ...string) error {
	if len(args) > 0 {
		method, exists := cli.getMethod(args[0])
		if !exists {
			fmt.Fprintf(cli.err, "Error: Command not found: %s\n", args[0])
		} else {
			method("--help")
			return nil
		}
	}
	help := fmt.Sprint("Usage: lmdtfy [OPTIONS] COMMAND [arg...] \n")
	for _, command := range [][]string{
		{"version", "Show the Docker version information"},
		{"test", "Show the test version information"},
	} {
		help += fmt.Sprintf("    %-10.10s%s\n", command[0], command[1])
	}
	fmt.Fprintf(cli.err, "%s\n", help)
	return nil
}

func (cli *CaprioskaCli) CmdVersion(args ...string) error {
	fmt.Fprintf(cli.out, "Client API version: %s\n", api.APIVERSION)

	return nil
}


text:
<%#
 Copyright 2013-2017 the original author or authors.

 This file is part of the JHipster project, see https://jhipster.github.io/
 for more information.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-%>
import { Component, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';

@Component({
    selector: '<%=jhiPrefix%>-metrics-modal',
    templateUrl: './metrics-modal.component.html'
})
export class <%=jhiPrefixCapitalized%>MetricsMonitoringModalComponent implements OnInit {

    threadDumpFilter: any;
    threadDump: any;
    threadDumpAll = 0;
    threadDumpBlocked = 0;
    threadDumpRunnable = 0;
    threadDumpTimedWaiting = 0;
    threadDumpWaiting = 0;

    constructor(public activeModal: NgbActiveModal) {}

    ngOnInit() {
        this.threadDump.forEach((value) => {
            if (value.threadState === 'RUNNABLE') {
                this.threadDumpRunnable += 1;
            } else if (value.threadState === 'WAITING') {
                this.threadDumpWaiting += 1;
            } else if (value.threadState === 'TIMED_WAITING') {
                this.threadDumpTimedWaiting += 1;
            } else if (value.threadState === 'BLOCKED') {
                this.threadDumpBlocked += 1;
            }
        });

        this.threadDumpAll = this.threadDumpRunnable + this.threadDumpWaiting +
            this.threadDumpTimedWaiting + this.threadDumpBlocked;
    }

    getBadgeClass(threadState) {
        if (threadState === 'RUNNABLE') {
            return 'badge-success';
        } else if (threadState === 'WAITING') {
            return 'badge-info';
        } else if (threadState === 'TIMED_WAITING') {
            return 'badge-warning';
        } else if (threadState === 'BLOCKED') {
            return 'badge-danger';
        }
    }
}


text:
def find_rule(major_info):
    """Find appropriate rule set for major_info

    Args:
        major_info: list containing {'type': x, 'field': y}

    Returns:
        rule set filename (excluding '.yml')
    """
    # TODO:
    return major_info, 'sample_cse_2016'


text:
<?php

namespace Ulff\UserBundle\Form\Type;

use Symfony\Component\Form\FormBuilderInterface;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;

class RegistrationFormType extends BaseType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);

        $builder->add('firstname', null, array('label' => 'form.firstname', 'translation_domain' => 'FOSUserBundle'));
        $builder->add('lastname', null, array('label' => 'form.lastname', 'translation_domain' => 'FOSUserBundle'));
    }

    public function getName()
    {
        return 'ulff_user_registration';
    }
}


text:
import type { UploadToken } from '.';
import type { GenerateStyle } from '../../theme/internal';
import { clearFix, textEllipsis } from '../../style';

const genListStyle: GenerateStyle<UploadToken> = (token) => {
  const { componentCls, antCls, iconCls, fontSize, lineHeight } = token;
  const itemCls = `${componentCls}-list-item`;
  const actionsCls = `${itemCls}-actions`;
  const actionCls = `${itemCls}-action`;
  const listItemHeightSM = Math.round(fontSize * lineHeight);

  return {
    [`${componentCls}-wrapper`]: {
      [`${componentCls}-list`]: {
        ...clearFix(),
        lineHeight: token.lineHeight,

        [itemCls]: {
          position: 'relative',
          height: token.lineHeight * fontSize,
          marginTop: token.marginXS,
          fontSize,
          display: 'flex',
          alignItems: 'center',
          transition: `background-color ${token.motionDurationSlow}`,

          '&:hover': {
            backgroundColor: token.controlItemBgHover,
          },

          [`${itemCls}-name`]: {
            ...textEllipsis,
            padding: `0 ${token.paddingXS}px`,
            lineHeight,
            flex: 'auto',
            transition: `all ${token.motionDurationSlow}`,
          },

          [actionsCls]: {
            [actionCls]: {
              opacity: 0,
            },

            [`${actionCls}${antCls}-btn-sm`]: {
              height: listItemHeightSM,
              border: 0,
              lineHeight: 1,
              // FIXME: should not override small button
              '> span': {
                transform: 'scale(1)',
              },
            },

            [`
              ${actionCls}:focus,
              &.picture ${actionCls}
            `]: {
              opacity: 1,
            },

            [iconCls]: {
              color: token.colorTextDescription,
              transition: `all ${token.motionDurationSlow}`,
            },

            [`&:hover ${iconCls}`]: {
              color: token.colorText,
            },
          },

          [`${componentCls}-icon ${iconCls}`]: {
            color: token.colorTextDescription,
            fontSize,
          },

          [`${itemCls}-progress`]: {
            position: 'absolute',
            bottom: -token.uploadProgressOffset,
            width: '100%',
            paddingInlineStart: fontSize + token.paddingXS,
            fontSize,
            lineHeight: 0,
            pointerEvents: 'none',

            '> div': {
              margin: 0,
            },
          },
        },

        [`${itemCls}:hover ${actionCls}`]: {
          opacity: 1,
          color: token.colorText,
        },

        [`${itemCls}-error`]: {
          color: token.colorError,
          [`${itemCls}-name, ${componentCls}-icon ${iconCls}`]: {
            color: token.colorError,
          },

          [actionsCls]: {
            [`${iconCls}, ${iconCls}:hover`]: {
              color: token.colorError,
            },

            [actionCls]: {
              opacity: 1,
            },
          },
        },

        [`${componentCls}-list-item-container`]: {
          transition: `opacity ${token.motionDurationSlow}, height ${token.motionDurationSlow}`,

          // For smooth removing animation
          '&::before': {
            display: 'table',
            width: 0,
            height: 0,
            content: '""',
          },
        },
      },
    },
  };
};

export default genListStyle;


text:
package edu.northwestern.bioinformatics.studycalendar.tools.osgi;

import edu.northwestern.bioinformatics.studycalendar.StudyCalendarSystemException;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkEvent;
import org.osgi.framework.FrameworkListener;
import org.osgi.framework.ServiceReference;
import org.osgi.service.startlevel.StartLevel;

/**
* @author Rhett Sutphin
*/
class StartupWatcher extends Thread implements FrameworkListener {
    private int expectedStartLevel, currentStartLevel;
    private Throwable error;

    StartupWatcher(int expectedStartLevel) {
        this.expectedStartLevel = expectedStartLevel;
        this.currentStartLevel = 0;
    }

    public synchronized void frameworkEvent(FrameworkEvent frameworkEvent) {
        if (isOfType(frameworkEvent, FrameworkEvent.ERROR)) {
            error = frameworkEvent.getThrowable();
        } else if (isOfType(frameworkEvent, FrameworkEvent.STARTLEVEL_CHANGED)) {
            currentStartLevel = getStartLevelService(frameworkEvent.getBundle().getBundleContext()).getStartLevel();
        }

        if (error != null || isAtExpectedStartLevel()) {
            this.notify();
        }
    }

    private boolean isOfType(FrameworkEvent frameworkEvent, int type) {
        return (frameworkEvent.getType() & type) != 0;
    }

    public synchronized void waitForStart(long timeoutMilliseconds) {
        if (!isAtExpectedStartLevel()) {
            try {
                this.wait(timeoutMilliseconds);
            } catch (InterruptedException e) {
                throw new StudyCalendarSystemException(
                    "Wait for embedded OSGi framework to start was interrupted", e);
            }
            if (error != null) {
                throw new StudyCalendarSystemException(
                    "Embedded OSGi framework startup failed", error);
            } else if (!isAtExpectedStartLevel()) {
                throw new StudyCalendarSystemException(
                    "Embedded OSGi framework did not start within %dms", timeoutMilliseconds);
            }
        }
    }

    public synchronized boolean isAtExpectedStartLevel() {
        return error == null && currentStartLevel >= expectedStartLevel;
    }

    private static StartLevel getStartLevelService(BundleContext bundleContext) {
        ServiceReference ref =
            bundleContext.getServiceReference(StartLevel.class.getName());
        if (ref == null) {
            throw new StudyCalendarSystemException(
                "Could not get a reference to an instance of the start level service");
        }
        return (StartLevel) bundleContext.getService(ref);
    }
}


text:
'use strict';

import type CodegenDirectory from './CodegenDirectory';

export type CompileResult = 'HAS_CHANGES' | 'NO_CHANGES' | 'ERROR';

export type File = {
  relPath: string,
  hash: string,
};

export interface FileWriterInterface {
  writeAll(): Promise<Map<string, CodegenDirectory>>;
}


text:
<?php namespace Payu\Test;

use Payu\Client;
use Payu\Configuration;
use Payu\Response\PaymentResponse;
use Payu\Builder\PaymentRequestBuilder;
use Payu\Response\LoyaltyInquiryResponse;
use Payu\Builder\LoyaltyInquiryRequestBuilder;

class ClientTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Payu\Client
     */
    protected $client;
    /**
     * @var \Payu\Configuration
     */
    protected $configuration;

    public function setUp()
    {
        $configuration = new Configuration();
        $configuration->setMerchantId('MY_MERCHANT_01')
            ->setSecretKey('SECRET_KEY')
            ->setPaymentEndpointUrl('https://secure.payu.com.tr/order/alu/v3')
            ->setLoyaltyInquiryEndPointUrl('https://secure.payu.com.tr/api/loyalty-points/check');
        $this->configuration = $configuration;
        $this->client = new Client($configuration);
    }

    public function testCreatePaymentRequestBuilder()
    {
        $this->assertTrue($this->client->createPaymentRequestBuilder() instanceof PaymentRequestBuilder);
    }

    public function testCreateLoyaltyInquiryRequestBuilder()
    {
        $this->assertTrue($this->client->createLoyaltyInquiryRequestBuilder() instanceof LoyaltyInquiryRequestBuilder);
    }

    public function testMakePayment()
    {
        $request = $this->client->createPaymentRequestBuilder()
            ->buildCard('4282209027132016', '123', 5, 2019)
            ->buildOrder('ORDERNO123456', '127.0.0.1')
            ->buildBilling('John', 'Smith', 'test@test.net', '05321231212')
            ->buildAndAddProduct('The Product', 'PR1', 1, 10)
            ->build();
        $result = $this->client->makePayment($request);
        $this->assertTrue($result instanceof PaymentResponse);
    }

    public function testMakeLoyaltyInquiry()
    {
        $request = $this->client->createLoyaltyInquiryRequestBuilder()
            ->buildCard('4282209027132016', '123', '5', '2019')
            ->buildCurrency('TRY')
            ->build();
        $result = $this->client->makeLoyaltyInquiry($request);
        $this->assertTrue($result instanceof LoyaltyInquiryResponse);
    }
}


text:
@interface AFLViewController : UIViewController

@end


text:
package com.github.weisj.darklaf.properties.parser;

import java.util.Arrays;
import java.util.List;

public final class Parser {

    public static final Object EMPTY_VALUE = new Object();

    private static final List<PropertyParser> steps = Arrays.asList(
            new NullParser(),
            new FallbackParser(),
            new ReferenceParser(),
            new PrimitiveParser(),
            new InsetParser(),
            new LazyObjectParser(),
            new ActiveObjectParser(),
            new FontParser(),
            new IconParser(),
            new DimensionParser(),
            new ListParser(),
            new MapParser());

    private static boolean debugMode;

    public static void setDebugMode(final boolean debugMode) {
        Parser.debugMode = debugMode;
    }

    public static boolean isDebugMode() {
        return debugMode;
    }

    public static ParseResult parse(final ParseResult parseResult, final ParserContext context) {
        ParseResult p = parseResult;
        String savedValue = parseResult.value;
        for (PropertyParser step : steps) {
            if (p.finished) return p;
            p = step.parse(p, context);
        }
        if (!p.finished) {
            for (String warning : p.warnings) {
                ParserUtil.warning(warning);
            }
            ParserUtil.setNonNull(p, savedValue);
        }
        return p;
    }

    public static ParseResult createParseResult(final String key, final String value) {
        if (isDebugMode()) {
            return new DebugParseResult(key, value);
        } else {
            return new ParseResult(key, value);
        }
    }

    public static class DebugParseResult extends ParseResult {

        public String originalKey;
        public String originalValue;
        public String referenceKey;

        public DebugParseResult(final String key, final String value) {
            super(key, value);
            this.originalKey = key;
            this.originalValue = value;
        }
    }
}


text:
namespace Maple.Core
{
    /// <summary>
    /// Generic message with user specified content
    /// </summary>
    /// <typeparam name="TContent">Content type to store</typeparam>
    public class GenericMapleMessage<TContent> : MapleMessageBase
    {
        /// <summary>
        /// Contents of the message
        /// </summary>
        public TContent Content { get; protected set; }

        public GenericMapleMessage(object sender, TContent content)
            : base(sender)
        {
            Content = content;
        }
    }
}