text:
var page = require('webpage').create(),
  system = require('system'),
  fs = require('fs'),
  width = system.args[ 1 ],
  height = system.args[ 2 ],
  viewportWidth = system.args[ 3 ],
  viewportHeight = system.args[ 4 ],
  marginTop = system.args[ 5 ],
  marginRight = system.args[ 6 ],
  marginBottom = system.args[ 7 ],
  marginLeft = system.args[ 8 ],
  headerHeight = system.args[ 9 ],
  headerFunctionFile = system.args[ 10 ],
  footerHeight = system.args[ 11 ],
  footerFunctionFile = system.args[ 12 ],
  operatingSystem = system.args[ 13 ],
  sourcePath = system.args[ 14 ],
  targetPath = system.args[ 15 ],
  jsWait = +system.args[ 16 ],
  jsInterval = +system.args[ 17 ];

// this function writes the arguments to stdout
var log = function () {
  Array.prototype.slice.call(arguments).map(system.stdout.writeLine);
};

// this function writes the arguments to the stderr
var err = function () {
  Array.prototype.slice.call(arguments).map(system.stderr.writeLine);
};

// this function checks to see if javascript is finished executing on the page
var done = function () {
  return page.evaluate(function () {
    var PageRendered = window.PageRendered;
    return (typeof PageRendered === 'undefined') ||
      (typeof PageRendered === 'boolean' && PageRendered === true) ||
      (typeof PageRendered === 'function' && PageRendered());
  });
};

// this sets a zoom on the page because of the dpi differences between windows and unix
var setZoom = function () {
  if (operatingSystem !== "WINDOWS") {
    try {
      log('Setting zoom on HTML to 0.75');
      page.evaluate(function () {
        document.body.style.zoom = 0.75;
      });
    } catch (error) {
      err('Failed to set zoom on HTML file: ', error);
      phantom.exit(2);
    }
  }
};

// this function renders the page
var renderPage = function () {
  setZoom();

  // render the page
  try {
    log('Rendering PDF to target path: ' + targetPath);
    page.render(targetPath);
  } catch (error) {
    err('Failed to render PDF: ' + error);
    phantom.exit(3);
  }

  phantom.exit(0);
};

page.viewportSize = { width: viewportWidth, height: viewportHeight };

var getFn = function (str) {
  return eval('var fn = ' + str + '; fn');
};

try {
  var headerFunction = getFn(fs.read(headerFunctionFile));
} catch (error) {
  err('Failed to read header function: ' + error);
  phantom.exit(4);
}

try {
  var footerFunction = getFn(fs.read(footerFunctionFile));
} catch (error) {
  err('Failed to read footer function: ' + error);
  phantom.exit(5);
}

var paperSize = {
  width: width,
  height: height,
  margin: {
    top: marginTop,
    right: marginRight,
    bottom: marginBottom,
    left: marginLeft
  },

  header: {
    height: headerHeight,
    contents: phantom.callback(headerFunction)
  },

  footer: {
    height: footerHeight,
    contents: phantom.callback(footerFunction)
  }
};

page.paperSize = paperSize;

// log all the resource requests
page.onResourceRequested = function (requestData, request) {
  log('Loading URL: ' + requestData[ 'url' ]);
};

var waited = 0;
var renderIfDone = function renderIfDone() {
  if (done()) {
    renderPage();
  } else {
    if (waited > jsWait) {
      err('Timed out on JavaScript execution');
      phantom.exit(6);
    }
    log('Waiting an additional ' + jsInterval + 'ms');
    waited += jsInterval;
    setTimeout(renderIfDone, jsInterval);
  }
};

// when finishing loading the resources
// start the timer for js execution to complete
page.onLoadFinished = renderIfDone;

try {
  log('Reading source file: ' + sourcePath);
  page.content = fs.read(sourcePath, { encoding: 'utf-8' });
} catch (error) {
  err('Failed to read source file: ' + error);
  phantom.exit(1);
}


text:
package org.projectfloodlight.openflow.protocol.ver13;

import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.stat.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.oxs.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import com.google.common.collect.ImmutableList;
import java.util.Set;
import io.netty.buffer.ByteBuf;
import com.google.common.hash.PrimitiveSink;
import com.google.common.hash.Funnel;

class OFBsnGentableEntryAddVer13 implements OFBsnGentableEntryAdd {
    private static final Logger logger = LoggerFactory.getLogger(OFBsnGentableEntryAddVer13.class);
    // version: 1.3
    final static byte WIRE_VERSION = 4;
    final static int MINIMUM_LENGTH = 36;

        private final static long DEFAULT_XID = 0x0L;
        private final static U128 DEFAULT_CHECKSUM = U128.ZERO;
        private final static List<OFBsnTlv> DEFAULT_KEY = ImmutableList.<OFBsnTlv>of();
        private final static List<OFBsnTlv> DEFAULT_VALUE = ImmutableList.<OFBsnTlv>of();

    // OF message fields
    private final long xid;
    private final GenTableId tableId;
    private final U128 checksum;
    private final List<OFBsnTlv> key;
    private final List<OFBsnTlv> value;
//

    // package private constructor - used by readers, builders, and factory
    OFBsnGentableEntryAddVer13(long xid, GenTableId tableId, U128 checksum, List<OFBsnTlv> key, List<OFBsnTlv> value) {
        if(tableId == null) {
            throw new NullPointerException("OFBsnGentableEntryAddVer13: property tableId cannot be null");
        }
        if(checksum == null) {
            throw new NullPointerException("OFBsnGentableEntryAddVer13: property checksum cannot be null");
        }
        if(key == null) {
            throw new NullPointerException("OFBsnGentableEntryAddVer13: property key cannot be null");
        }
        if(value == null) {
            throw new NullPointerException("OFBsnGentableEntryAddVer13: property value cannot be null");
        }
        this.xid = xid;
        this.tableId = tableId;
        this.checksum = checksum;
        this.key = key;
        this.value = value;
    }

    // Accessors for OF message fields
    @Override
    public OFVersion getVersion() {
        return OFVersion.OF_13;
    }

    @Override
    public OFType getType() {
        return OFType.EXPERIMENTER;
    }

    @Override
    public long getXid() {
        return xid;
    }

    @Override
    public long getExperimenter() {
        return 0x5c16c7L;
    }

    @Override
    public long getSubtype() {
        return 0x2eL;
    }

    @Override
    public GenTableId getTableId() {
        return tableId;
    }

    @Override
    public U128 getChecksum() {
        return checksum;
    }

    @Override
    public List<OFBsnTlv> getKey() {
        return key;
    }

    @Override
    public List<OFBsnTlv> getValue() {
        return value;
    }

    public OFBsnGentableEntryAdd.Builder createBuilder() {
        return new BuilderWithParent(this);
    }

    static class BuilderWithParent implements OFBsnGentableEntryAdd.Builder {
        final OFBsnGentableEntryAddVer13 parentMessage;

        // OF message fields
        private boolean xidSet;
        private long xid;
        private boolean tableIdSet;
        private GenTableId tableId;
        private boolean checksumSet;
        private U128 checksum;
        private boolean keySet;
        private List<OFBsnTlv> key;
        private boolean valueSet;
        private List<OFBsnTlv> value;

        BuilderWithParent(OFBsnGentableEntryAddVer13 parentMessage) {
            this.parentMessage = parentMessage;
        }

    @Override
    public OFVersion getVersion() {
        return OFVersion.OF_13;
    }

    @Override
    public OFType getType() {
        return OFType.EXPERIMENTER;
    }

    @Override
    public long getXid() {
        return xid;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setXid(long xid) {
        this.xid = xid;
        this.xidSet = true;
        return this;
    }
    @Override
    public long getExperimenter() {
        return 0x5c16c7L;
    }

    @Override
    public long getSubtype() {
        return 0x2eL;
    }

    @Override
    public GenTableId getTableId() {
        return tableId;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setTableId(GenTableId tableId) {
        this.tableId = tableId;
        this.tableIdSet = true;
        return this;
    }
    @Override
    public U128 getChecksum() {
        return checksum;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setChecksum(U128 checksum) {
        this.checksum = checksum;
        this.checksumSet = true;
        return this;
    }
    @Override
    public List<OFBsnTlv> getKey() {
        return key;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setKey(List<OFBsnTlv> key) {
        this.key = key;
        this.keySet = true;
        return this;
    }
    @Override
    public List<OFBsnTlv> getValue() {
        return value;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setValue(List<OFBsnTlv> value) {
        this.value = value;
        this.valueSet = true;
        return this;
    }

        @Override
        public OFBsnGentableEntryAdd build() {
                long xid = this.xidSet ? this.xid : parentMessage.xid;
                GenTableId tableId = this.tableIdSet ? this.tableId : parentMessage.tableId;
                if(tableId == null)
                    throw new NullPointerException("Property tableId must not be null");
                U128 checksum = this.checksumSet ? this.checksum : parentMessage.checksum;
                if(checksum == null)
                    throw new NullPointerException("Property checksum must not be null");
                List<OFBsnTlv> key = this.keySet ? this.key : parentMessage.key;
                if(key == null)
                    throw new NullPointerException("Property key must not be null");
                List<OFBsnTlv> value = this.valueSet ? this.value : parentMessage.value;
                if(value == null)
                    throw new NullPointerException("Property value must not be null");

                //
                return new OFBsnGentableEntryAddVer13(
                    xid,
                    tableId,
                    checksum,
                    key,
                    value
                );
        }

    }

    static class Builder implements OFBsnGentableEntryAdd.Builder {
        // OF message fields
        private boolean xidSet;
        private long xid;
        private boolean tableIdSet;
        private GenTableId tableId;
        private boolean checksumSet;
        private U128 checksum;
        private boolean keySet;
        private List<OFBsnTlv> key;
        private boolean valueSet;
        private List<OFBsnTlv> value;

    @Override
    public OFVersion getVersion() {
        return OFVersion.OF_13;
    }

    @Override
    public OFType getType() {
        return OFType.EXPERIMENTER;
    }

    @Override
    public long getXid() {
        return xid;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setXid(long xid) {
        this.xid = xid;
        this.xidSet = true;
        return this;
    }
    @Override
    public long getExperimenter() {
        return 0x5c16c7L;
    }

    @Override
    public long getSubtype() {
        return 0x2eL;
    }

    @Override
    public GenTableId getTableId() {
        return tableId;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setTableId(GenTableId tableId) {
        this.tableId = tableId;
        this.tableIdSet = true;
        return this;
    }
    @Override
    public U128 getChecksum() {
        return checksum;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setChecksum(U128 checksum) {
        this.checksum = checksum;
        this.checksumSet = true;
        return this;
    }
    @Override
    public List<OFBsnTlv> getKey() {
        return key;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setKey(List<OFBsnTlv> key) {
        this.key = key;
        this.keySet = true;
        return this;
    }
    @Override
    public List<OFBsnTlv> getValue() {
        return value;
    }

    @Override
    public OFBsnGentableEntryAdd.Builder setValue(List<OFBsnTlv> value) {
        this.value = value;
        this.valueSet = true;
        return this;
    }
//
        @Override
        public OFBsnGentableEntryAdd build() {
            long xid = this.xidSet ? this.xid : DEFAULT_XID;
            if(!this.tableIdSet)
                throw new IllegalStateException("Property tableId doesn't have default value -- must be set");
            if(tableId == null)
                throw new NullPointerException("Property tableId must not be null");
            U128 checksum = this.checksumSet ? this.checksum : DEFAULT_CHECKSUM;
            if(checksum == null)
                throw new NullPointerException("Property checksum must not be null");
            List<OFBsnTlv> key = this.keySet ? this.key : DEFAULT_KEY;
            if(key == null)
                throw new NullPointerException("Property key must not be null");
            List<OFBsnTlv> value = this.valueSet ? this.value : DEFAULT_VALUE;
            if(value == null)
                throw new NullPointerException("Property value must not be null");

            return new OFBsnGentableEntryAddVer13(
                    xid,
                    tableId,
                    checksum,
                    key,
                    value
                );
        }

    }

    final static Reader READER = new Reader();
    static class Reader implements OFMessageReader<OFBsnGentableEntryAdd> {
        @Override
        public OFBsnGentableEntryAdd readFrom(ByteBuf bb) throws OFParseError {
            int start = bb.readerIndex();
            // fixed value property version == 4
            byte version = bb.readByte();
            if(version != (byte) 0x4)
                throw new OFParseError("Wrong version: Expected=OFVersion.OF_13(4), got="+version);
            // fixed value property type == 4
            byte type = bb.readByte();
            if(type != (byte) 0x4)
                throw new OFParseError("Wrong type: Expected=OFType.EXPERIMENTER(4), got="+type);
            int length = U16.f(bb.readShort());
            if(length < MINIMUM_LENGTH)
                throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length);
            if(bb.readableBytes() + (bb.readerIndex() - start) < length) {
                // Buffer does not have all data yet
                bb.readerIndex(start);
                return null;
            }
            if(logger.isTraceEnabled())
                logger.trace("readFrom - length={}", length);
            long xid = U32.f(bb.readInt());
            // fixed value property experimenter == 0x5c16c7L
            int experimenter = bb.readInt();
            if(experimenter != 0x5c16c7)
                throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter);
            // fixed value property subtype == 0x2eL
            int subtype = bb.readInt();
            if(subtype != 0x2e)
                throw new OFParseError("Wrong subtype: Expected=0x2eL(0x2eL), got="+subtype);
            GenTableId tableId = GenTableId.read2Bytes(bb);
            int keyLength = U16.f(bb.readShort());
            U128 checksum = U128.read16Bytes(bb);
            List<OFBsnTlv> key = ChannelUtils.readList(bb, keyLength, OFBsnTlvVer13.READER);
            List<OFBsnTlv> value = ChannelUtils.readList(bb, length - (bb.readerIndex() - start), OFBsnTlvVer13.READER);

            OFBsnGentableEntryAddVer13 bsnGentableEntryAddVer13 = new OFBsnGentableEntryAddVer13(
                    xid,
                      tableId,
                      checksum,
                      key,
                      value
                    );
            if(logger.isTraceEnabled())
                logger.trace("readFrom - read={}", bsnGentableEntryAddVer13);
            return bsnGentableEntryAddVer13;
        }
    }

    public void putTo(PrimitiveSink sink) {
        FUNNEL.funnel(this, sink);
    }

    final static OFBsnGentableEntryAddVer13Funnel FUNNEL = new OFBsnGentableEntryAddVer13Funnel();
    static class OFBsnGentableEntryAddVer13Funnel implements Funnel<OFBsnGentableEntryAddVer13> {
        private static final long serialVersionUID = 1L;
        @Override
        public void funnel(OFBsnGentableEntryAddVer13 message, PrimitiveSink sink) {
            // fixed value property version = 4
            sink.putByte((byte) 0x4);
            // fixed value property type = 4
            sink.putByte((byte) 0x4);
            // FIXME: skip funnel of length
            sink.putLong(message.xid);
            // fixed value property experimenter = 0x5c16c7L
            sink.putInt(0x5c16c7);
            // fixed value property subtype = 0x2eL
            sink.putInt(0x2e);
            message.tableId.putTo(sink);
            // FIXME: skip funnel of keyLength
            message.checksum.putTo(sink);
            FunnelUtils.putList(message.key, sink);
            FunnelUtils.putList(message.value, sink);
        }
    }

    public void writeTo(ByteBuf bb) {
        WRITER.write(bb, this);
    }

    final static Writer WRITER = new Writer();
    static class Writer implements OFMessageWriter<OFBsnGentableEntryAddVer13> {
        @Override
        public void write(ByteBuf bb, OFBsnGentableEntryAddVer13 message) {
            int startIndex = bb.writerIndex();
            // fixed value property version = 4
            bb.writeByte((byte) 0x4);
            // fixed value property type = 4
            bb.writeByte((byte) 0x4);
            // length is length of variable message, will be updated at the end
            int lengthIndex = bb.writerIndex();
            bb.writeShort(U16.t(0));

            bb.writeInt(U32.t(message.xid));
            // fixed value property experimenter = 0x5c16c7L
            bb.writeInt(0x5c16c7);
            // fixed value property subtype = 0x2eL
            bb.writeInt(0x2e);
            message.tableId.write2Bytes(bb);
            // keyLength is length indicator for key, will be
            // udpated when key has been written
            int keyLengthIndex = bb.writerIndex();
            bb.writeShort(0);
            message.checksum.write16Bytes(bb);
            int keyStartIndex = bb.writerIndex();
            ChannelUtils.writeList(bb, message.key);
            // update field length member keyLength
            int keyLength = bb.writerIndex() - keyStartIndex;
            bb.setShort(keyLengthIndex, keyLength);
            ChannelUtils.writeList(bb, message.value);

            // update length field
            int length = bb.writerIndex() - startIndex;
            bb.setShort(lengthIndex, length);

        }
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder("OFBsnGentableEntryAddVer13(");
        b.append("xid=").append(xid);
        b.append(", ");
        b.append("tableId=").append(tableId);
        b.append(", ");
        b.append("checksum=").append(checksum);
        b.append(", ");
        b.append("key=").append(key);
        b.append(", ");
        b.append("value=").append(value);
        b.append(")");
        return b.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        OFBsnGentableEntryAddVer13 other = (OFBsnGentableEntryAddVer13) obj;

        if( xid != other.xid)
            return false;
        if (tableId == null) {
            if (other.tableId != null)
                return false;
        } else if (!tableId.equals(other.tableId))
            return false;
        if (checksum == null) {
            if (other.checksum != null)
                return false;
        } else if (!checksum.equals(other.checksum))
            return false;
        if (key == null) {
            if (other.key != null)
                return false;
        } else if (!key.equals(other.key))
            return false;
        if (value == null) {
            if (other.value != null)
                return false;
        } else if (!value.equals(other.value))
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;

        result = prime *  (int) (xid ^ (xid >>> 32));
        result = prime * result + ((tableId == null) ? 0 : tableId.hashCode());
        result = prime * result + ((checksum == null) ? 0 : checksum.hashCode());
        result = prime * result + ((key == null) ? 0 : key.hashCode());
        result = prime * result + ((value == null) ? 0 : value.hashCode());
        return result;
    }

}

redpajama_set_name: RedPajamaGithub


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

import java.util.*;

public class MasterDyeing extends MasterPaintingSkill
{
	@Override
	public String ID()
	{
		return "MasterDyeing";
	}

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

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

	private static final String[] triggerStrings =I(new String[] {"MASTERDYEING", "MASTERDYE", "MDYE", "MDYEING"});
	@Override
	public int classificationCode()
	{
		return Ability.ACODE_COMMON_SKILL|Ability.DOMAIN_ARTISTIC;
	}

	@Override
	public String[] triggerStrings()
	{
		return triggerStrings;
	}

	@Override
	protected boolean canBeDoneSittingDown()
	{
		return true;
	}

	public MasterDyeing()
	{
		super();
		displayText=L("You are dyeing...");
		verb=L("dyeing");
	}

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

	@Override
	protected int canTargetCode()
	{
		return Ability.CAN_ITEMS;
	}

	@Override
	public void unInvoke()
	{
		if(canBeUninvoked())
		{
			if((affected!=null)
			&&(affected instanceof MOB)
			&&(found!=null)
			&&(!aborted)
			&&(!helping))
			{
				final MOB mob=(MOB)affected;
				if(writing.length()==0)
					commonEmote(mob,L("<S-NAME> mess(es) up the dyeing."));
				else
				{
					removePaintJob(found);
					if(!writing.equalsIgnoreCase("remove"))
						this.addPaintJob(found, writing);
				}
			}
		}
		super.unInvoke();
	}

	@Override
	public String getRecipeFilename()
	{
		return "masterdyeing.txt";
	}

	@Override
	public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel)
	{
		if(super.checkStop(mob, commands))
			return true;

		final List<List<String>> recipes = CMLib.utensils().addExtRecipes(mob,ID(),super.loadRecipes(getRecipeFilename()));
		if(CMSecurity.isASysOp(mob) && (CMParms.combine(commands).equalsIgnoreCase("test")))
		{
			doPaintingTest(mob, recipes);
			return false;
		}

		writing=CMParms.combine(commands,0).toLowerCase();
		List<String> finalRecipe = null;
		if(writing.equalsIgnoreCase("list"))
		{
			final StringBuilder colors=new StringBuilder(L("^NDesigns you can choose: "));
			final TreeSet<String> namesUsed = new TreeSet<String>();
			for(final List<String> list : recipes)
			{
				final String name=list.get(RCP_FINALNAME);
				final int level=CMath.s_int(list.get(RCP_LEVEL));
				if((level <= adjustedLevel(mob,asLevel))
				&&(!namesUsed.contains(name)))
				{
					namesUsed.add(name);
					colors.append(name).append("^N, ");
				}
			}
			commonTell(mob,colors.substring(0,colors.length()-2)+"^N.  "+L("Use MASTERDYE COLORS to see what colors you can choose.\n\r"));
			return false;
		}
		else
		if(writing.toLowerCase().startsWith("color"))
		{
			final StringBuilder colors=new StringBuilder(L("^NColors you can choose: "));
			final TreeSet<String> done=new TreeSet<String>();
			for(final Enumeration<Color256> c=CMLib.color().getColors256();c.hasMoreElements();)
			{
				final Color256 C=c.nextElement();
				final int exp=C.getExpertiseNum();
				if(exp<=super.getXLEVELLevel(mob)
				&&(!C.getCmChars().equals("^K"))
				&&(!C.getCmChars().equals("^#000")))
				{
					if(!done.contains(C.getName1()))
					{
						colors.append(C.getCmChars()).append(C.getName1()).append("^N, ");
						done.add(C.getName1());
					}
					if(!done.contains(C.getName2()))
					{
						colors.append(C.getCmChars()).append(C.getName2()).append("^N, ");
						done.add(C.getName2());
					}
				}
			}
			commonTell(mob,colors.substring(0,colors.length()-2)+"^N.\n\r");
			return false;
		}
		if((commands.size()>1)&&(commands.get(1).equalsIgnoreCase("remove")))
		{
			// ok
			writing="remove";
		}
		else
		if(commands.size()<4)
		{
			commonTell(mob,L("You must specify what you want to dye, the design to use, and two or three colors to dye it in, or the word REMOVE, or specify LIST or COLORS."));
			return false;
		}
		else
			writing=commands.get(1);
		final Item target=mob.fetchItem(null,Wearable.FILTER_UNWORNONLY,commands.get(0));
		if((target==null)||(!CMLib.flags().canBeSeenBy(target,mob)))
		{
			commonTell(mob,L("You don't seem to have a '@x1'.",(commands.get(0))));
			return false;
		}
		commands.remove(commands.get(0)); // remove item
		commands.remove(commands.get(0)); // remove design
		final List<Color256> colorsFound = new ArrayList<Color256>();
		final List<String> colorNamesFound = new ArrayList<String>();
		if(!writing.equalsIgnoreCase("remove"))
		{
			final String allColors = CMParms.combine(commands,0);
			String workColors = allColors.toLowerCase();
			while(workColors.length()>0)
			{
				final int numFound=colorsFound.size();
				for(final String cStr : getAllColors256NamesLowercased())
				{
					if(workColors.startsWith(cStr))
					{
						final Color256 C=getAllColors256NamesMap().get(cStr);
						if((C!=null)
						&&(!C.getCmChars().equals("^K"))
						&&(!C.getCmChars().equals("^#000")))
						{
							if(C.getExpertiseNum()<=super.getXLEVELLevel(mob))
							{
								colorNamesFound.add(cStr);
								colorsFound.add(C);
								workColors=workColors.substring(cStr.length()).trim();
							}
						}
						break;
					}
				}
				if(colorsFound.size()==numFound)
				{
					commonTell(mob,L("The first color in '@x1' is unrecognized. Try MASTERDYE COLORS",workColors));
					return false;
				}
			}
			if((colorsFound.size()<2)
			&&(!writing.equalsIgnoreCase("remove")))
			{
				commonTell(mob,L("At least two colors is required."));
				return false;
			}
			if(colorsFound.size()>3)
			{
				commonTell(mob,L("You may not list more than 3 colors."));
				return false;
			}
			if((((target.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_CLOTH)
				&&((target.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_PAPER)
				&&((target.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_LIQUID)
				&&((target.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_VEGETATION)
				&&((target.material()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_LEATHER))
			||(!target.isGeneric()))
			{
				commonTell(mob,L("You can't dye that material."));
				return false;
			}

			for(final List<String> list : recipes)
			{
				final String name=list.get(0);
				final int level=CMath.s_int(list.get(1));
				final int numColors=requiredColorsInRecipe(list.get(RCP_MASK));
				if(name.equalsIgnoreCase(writing)
				&&(level<=adjustedLevel(mob,asLevel))
				&&(numColors==colorsFound.size()))
				{
					finalRecipe=list;
					break;
				}
			}
		}
		if((finalRecipe == null)
		&& (!writing.equalsIgnoreCase("remove")))
		{
			for(final List<String> list : recipes)
			{
				final String name=list.get(0);
				final int level=CMath.s_int(list.get(1));
				if(name.equalsIgnoreCase(writing)
				&&(level<=adjustedLevel(mob,asLevel)))
				{
					commonTell(mob,L("I'm afraid that recipe does not support @x1 colors.",""+colorsFound.size()));
					return false;
				}
			}
		}

		if((finalRecipe == null) && (!writing.equalsIgnoreCase("remove")))
		{
			commonTell(mob,L("You can't dye anything '@x1'. Try MASTERDYEING LIST for a list or use REMOVE as the color.",writing));
			return false;
		}
		if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
			return false;
		String startMsg;
		if(writing.equalsIgnoreCase("remove"))
		{
			writing =  "remove";
			verb=L("removing the color from @x1",target.name());
			startMsg=L("<S-NAME> start(s) un-dyeing @x1.",target.name());
		}
		else
		if(finalRecipe != null)
		{
			writing =  finalRecipe.get(RCP_COLOR);
			for(int i=0;i<colorNamesFound.size();i++)
				writing=CMStrings.replaceAll(writing, "@x"+(i+1), colorNamesFound.get(i));
			verb=L("dyeing @x1 @x2",target.name(),writing);
			startMsg=L("<S-NAME> start(s) dyeing @x1.",target.name());
		}
		else
			startMsg=L("<S-NAME> start(s) dyeing @x1.",target.name());
		displayText=L("You are @x1",verb);
		found=target;
		if(!proficiencyCheck(mob,0,auto))
			writing="";
		int duration=30;
		if(finalRecipe != null)
			duration=CMath.s_int(finalRecipe.get(RCP_TICKS));
		if((target.material()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_LEATHER)
			duration*=2;
		duration=getDuration(duration,mob,1,6);
		final CMMsg msg=CMClass.getMsg(mob,null,this,getActivityMessageType(),startMsg);
		if(mob.location().okMessage(mob,msg))
		{
			mob.location().send(mob,msg);
			final MasterDyeing M=(MasterDyeing)beneficialAffect(mob,mob,asLevel,duration);
			if(M!=null)
			{
				M.colors=colorsFound;
				M.recipe=finalRecipe;
				M.colorsNames=colorNamesFound;
			}
		}
		return true;
	}
}


text:
from __future__ import absolute_import

from sentry import tagstore
from sentry.models import Group, Project, Team, User
from sentry.testutils import TestCase

class SentryManagerTest(TestCase):
    def test_valid_only_message(self):
        event = Group.objects.from_kwargs(1, message='foo')
        self.assertEquals(event.group.last_seen, event.datetime)
        self.assertEquals(event.message, 'foo')
        self.assertEquals(event.project_id, 1)

    def test_add_tags(self):
        event = Group.objects.from_kwargs(1, message='rrr')
        group = event.group
        environment = self.create_environment()

        with self.tasks():
            Group.objects.add_tags(
                group,
                environment,
                tags=[
                    ('foo', 'bar'),
                    ('foo', 'baz'),
                    ('biz', 'boz'),
                ],
            )

        results = sorted(
            tagstore.get_group_tag_values(
                group.project_id,
                group.id,
                environment_id=None,
                key='foo',
            ),
            key=lambda x: x.value,
        )
        assert len(results) == 2
        res = results[0]
        self.assertEquals(res.value, 'bar')
        self.assertEquals(res.times_seen, 1)
        res = results[1]
        self.assertEquals(res.value, 'baz')
        self.assertEquals(res.times_seen, 1)

        results = tagstore.get_group_tag_values(
            group.project_id,
            group.id,
            environment_id=None,
            key='biz'
        )
        assert len(results) == 1
        res = list(results)[0]
        self.assertEquals(res.value, 'boz')
        self.assertEquals(res.times_seen, 1)

class TeamManagerTest(TestCase):
    def test_simple(self):
        user = User.objects.create(username='foo')
        org = self.create_organization()
        team = self.create_team(organization=org, name='Test')
        self.create_member(organization=org, user=user, teams=[team])

        result = Team.objects.get_for_user(
            organization=org,
            user=user,
        )
        assert result == [team]

    def test_invalid_scope(self):
        user = User.objects.create(username='foo')
        org = self.create_organization()
        team = self.create_team(organization=org, name='Test')
        self.create_member(organization=org, user=user, teams=[team])
        result = Team.objects.get_for_user(
            organization=org,
            user=user,
            scope='idontexist',
        )
        assert result == []

    def test_valid_scope(self):
        user = User.objects.create(username='foo')
        org = self.create_organization()
        team = self.create_team(organization=org, name='Test')
        self.create_member(organization=org, user=user, teams=[team])
        result = Team.objects.get_for_user(
            organization=org,
            user=user,
            scope='project:read',
        )
        assert result == [team]

    def test_user_no_access(self):
        user = User.objects.create(username='foo')
        user2 = User.objects.create(username='bar')
        org = self.create_organization()
        team = self.create_team(organization=org, name='Test')
        self.create_member(organization=org, user=user, teams=[team])

        result = Team.objects.get_for_user(
            organization=org,
            user=user2,
        )
        assert result == []

    def test_with_projects(self):
        user = User.objects.create(username='foo')
        org = self.create_organization()
        team = self.create_team(organization=org, name='Test')
        self.create_member(organization=org, user=user, teams=[team])
        project = self.create_project(teams=[team], name='foo')
        project2 = self.create_project(teams=[team], name='bar')
        result = Team.objects.get_for_user(
            organization=org,
            user=user,
            with_projects=True,
        )
        assert result == [(team, [project2, project])]

class ProjectManagerTest(TestCase):
    def test_simple(self):
        user = User.objects.create(username='foo')
        org = self.create_organization()
        team = self.create_team(organization=org, name='Test')
        project = self.create_project(teams=[team], name='foo')
        project2 = self.create_project(teams=[team], name='baz')

        result = Project.objects.get_for_user(
            team=team,
            user=user,
            _skip_team_check=True,
        )
        assert result == [project2, project]

        result = Project.objects.get_for_user(
            team=team,
            user=user,
            _skip_team_check=False,
        )
        assert result == []

        self.create_member(organization=org, user=user, teams=[team])

        # check again after creating member
        result = Project.objects.get_for_user(
            team=team,
            user=user,
            _skip_team_check=True,
        )
        assert result == [project2, project]

        result = Project.objects.get_for_user(
            team=team,
            user=user,
            _skip_team_check=False,
        )
        assert result == [project2, project]

        # test with scope user doesn't have
        result = Project.objects.get_for_user(
            team=team,
            user=user,
            _skip_team_check=False,
            scope='project:write',
        )
        assert result == []

        # check with scope they do have
        result = Project.objects.get_for_user(
            team=team,
            user=user,
            _skip_team_check=False,
            scope='project:read',
        )
        assert result == [project2, project]


text:
import os
"""
Walking through the directory and listing out all its sub directories and folder names

"""

for folderName,subFolderName,fileName in os.walk('/home/zac/Downloads'):
    print('The current folder name is '+folderName)

    for subFolder in subFolderName:
        print('Subfolder of '+folderName + ' is : '+subFolder)

        for files in fileName:
           print('File inside '+folderName+'is :'+files)

print('')


text:
namespace ash::secure_channel {

FakeTimerFactory::FakeTimerFactory() = default;

FakeTimerFactory::~FakeTimerFactory() = default;

std::unique_ptr<base::OneShotTimer> FakeTimerFactory::CreateOneShotTimer() {
  ++num_instances_created_;

  auto fake_one_shot_timer = std::make_unique<FakeOneShotTimer>(
      base::BindOnce(&FakeTimerFactory::OnOneShotTimerDeleted,
                     weak_ptr_factory_.GetWeakPtr()));

  id_for_last_created_one_shot_timer_ = fake_one_shot_timer->id();
  id_to_active_one_shot_timer_map_[fake_one_shot_timer->id()] =
      fake_one_shot_timer.get();

  return fake_one_shot_timer;
}

void FakeTimerFactory::OnOneShotTimerDeleted(
    const base::UnguessableToken& deleted_timer_id) {
  size_t num_deleted = id_to_active_one_shot_timer_map_.erase(deleted_timer_id);
  DCHECK_EQ(1u, num_deleted);
}

}  // namespace ash::secure_channel


text:
package org.apache.nifi.dbcp;

import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.annotation.behavior.DynamicProperty;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.processor.FlowFileFilter;
import org.apache.nifi.processor.exception.ProcessException;
import org.apache.nifi.service.lookup.AbstractSingleAttributeBasedControllerServiceLookup;

import java.sql.Connection;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

import static org.apache.nifi.processor.FlowFileFilter.FlowFileFilterResult.ACCEPT_AND_CONTINUE;
import static org.apache.nifi.processor.FlowFileFilter.FlowFileFilterResult.REJECT_AND_CONTINUE;

@Tags({ "dbcp", "jdbc", "database", "connection", "pooling", "store" })
@CapabilityDescription("Provides a DBCPService that can be used to dynamically select another DBCPService. This service " +
        "requires an attribute named 'database.name' to be passed in when asking for a connection, and will throw an exception " +
        "if the attribute is missing. The value of 'database.name' will be used to select the DBCPService that has been " +
        "registered with that name. This will allow multiple DBCPServices to be defined and registered, and then selected " +
        "dynamically at runtime by tagging flow files with the appropriate 'database.name' attribute.")
@DynamicProperty(name = "The name to register DBCPService", value = "The DBCPService",
        description = "If '"+ DBCPConnectionPoolLookup.DATABASE_NAME_ATTRIBUTE +"' attribute contains " +
                "the name of the dynamic property, then the DBCPService (registered in the value) will be selected.",
        expressionLanguageScope = ExpressionLanguageScope.NONE)
public class DBCPConnectionPoolLookup
        extends AbstractSingleAttributeBasedControllerServiceLookup<DBCPService> implements DBCPService {

    public static final String DATABASE_NAME_ATTRIBUTE = "database.name";

    @Override
    protected String getLookupAttribute() {
        return DATABASE_NAME_ATTRIBUTE;
    }

    @Override
    public Class<DBCPService> getServiceType() {
        return DBCPService.class;
    }

    @Override
    public Connection getConnection() throws ProcessException {
        throw new UnsupportedOperationException("Cannot lookup DBCPConnectionPool without attributes");
    }

    @Override
    public Connection getConnection(Map<String, String> attributes) {
        return lookupService(attributes).getConnection(attributes);
    }

    @Override
    public FlowFileFilter getFlowFileFilter() {
        final AtomicReference<String> ref = new AtomicReference<>();
        return flowFile -> {
            final String flowFileDBName = flowFile.getAttribute(DATABASE_NAME_ATTRIBUTE);
            if (StringUtils.isEmpty(flowFileDBName)) {
                throw new ProcessException("FlowFile attributes must contain an attribute name '" + DATABASE_NAME_ATTRIBUTE + "'");
            }
            final String databaseName = ref.compareAndSet(null, flowFileDBName) ? flowFileDBName : ref.get();
            return flowFileDBName.equals(databaseName) ? ACCEPT_AND_CONTINUE : REJECT_AND_CONTINUE;
        };
    }
}


text:
import Vue from 'vue'
import App from './App'
import store from './store'
import router from './router'
import axios from './http'

import iView from 'iview'
// import 'iview/dist/styles/iview.css'
import '../my-theme/index.less'

Vue.config.productionTip = false

Vue.use(iView)
Vue.prototype.$axios = axios

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})


text:
<?php

require_once 'UberMenuItem.class.php';
require_once 'UberMenu_dummy_item.class.php';
require_once 'UberMenuItemDefault.class.php';
require_once 'UberMenuItemRow.class.php';
require_once 'UberMenuItemColumn.class.php';

add_filter( 'ubermenu_item_object_class' , 'ubermenu_get_item_object_class' , 10 , 4 );
function ubermenu_get_item_object_class( $class , $item , $id , $auto_child = '' ){
	$ubermenu_custom_type = '';

	if( $item->custom_type ){
		$ubermenu_custom_type = $item->custom_type;
	}
	else{
		$ubermenu_custom_type = get_post_meta( $item->db_id , '_ubermenu_custom_item_type' , true );
	}

	switch( $ubermenu_custom_type ){
		case 'row':
			$class = 'UberMenuItemRow';
			break;

		case 'column';
			$class = 'UberMenuItemColumn';
			break;

		case 'divider':
			$class = 'UberMenuItemDivider';
			break;

		default:
			$class = 'UberMenuItemDefault';
			break;

	}

	return $class;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <property name="jnlp.title"    value="JST ContinuouslySelectWords" />
  <property name="jnlp.Name"     value="ContinuouslySelectWords" />
  <property name="jnlp.name"     value="continuouslyselectwords" />
  <property name="jnlp.codebase" value="https://ateraimemo.com/swing/continuouslyselectwords/" />
  <property name="jnlp.homepage" value="https://ateraimemo.com/Swing/ContinuouslySelectWords.html" />
</project>


text:
'use strict';

angular.module('myApp')
    .controller('DeliveryDetailsController', ['$scope', '$http', '$stateParams', '$state', 'UsersService',
        function ($scope, $http, $stateParams, $state, UsersService) {

            if (!$stateParams.delivery) {
                $state.go('deliveries');
            }

            $scope.delivery = angular.copy($stateParams.delivery);
            if ( $scope.delivery.deadline && $scope.delivery.deadline > 0) {
                $scope.delivery.deadline = new Date($scope.delivery.deadline * 1000);
            }

            $scope.title = $scope.delivery.title;

            $scope.comments = [];

            $scope.comment = {
                "comment": '',
                "author": UsersService.getCurrentUser()
            };

            var loadComments = function () {
                $http({
                    method: "GET",
                    url: "http://169.45.106.72:8080/server/webapi/deliveries/" + $scope.delivery._id + '/comments'
                }).then(function successCallback(response) {
                    $scope.comments = angular.fromJson(response.data).items;
                    // to do fill
                }, function errorCallback(response) {
                    console.log(response);
                });
            };

            $scope.addCommentClicked = function () {
                $http({
                    method: "POST",
                    data: $scope.comment,
                    url: "http://169.45.106.72:8080/server/webapi/deliveries/" + $scope.delivery._id + '/comment'
                }).then(function successCallback(response) {
                    $scope.comments.length = 0;
                    loadComments();
                }, function errorCallback(response) {
                    console.log(response);
                });
            };

            $scope.backBtnClicked = function () {
                $state.go($stateParams.origin, { 'departmentId': $stateParams.departmentId, 'projectId': $stateParams.projectId });
            };

            $scope.deliveryStatusChanged = function (newStatus) {
                $http({
                    method: "GET",
                    url: "http://169.45.106.72:8080/server/webapi/deliveries/" + $scope.delivery._id + '/setStatus/' + newStatus
                }).then(function successCallback(response) {
                    $scope.comments.length = 0;
                    loadComments();
                }, function errorCallback(response) {
                    console.log(response);
                });
            }

            $scope.sliderValueChanged = function (newProgress) {
                console.log(newProgress);
            }

            loadComments();
        }
    ]);


text:
@interface User : NSObject

@property (nonatomic, strong) NSString *profile_image_url;

@property (nonatomic, assign) BOOL vip;

@property (nonatomic, strong) NSString *name;

@property (nonatomic, assign) int mbrank;

@property (nonatomic, assign) int mbtype;

@end


text:
'use strict';

// NeedlesBreakage controller
angular.module('needles-breakages').controller('NeedlesBreakagesController', ['$scope', '$stateParams', '$location', 'Authentication', 'NeedlesBreakages',
	function($scope, $stateParams, $location, Authentication, NeedlesBreakages) {
		$scope.authentication = Authentication;

		// Create new NeedlesBreakage
		$scope.create = function() {
			// Create new NeedlesBreakage object
			var needlesbreakage = new NeedlesBreakages ({

        date: this.date,

        shift: this.shift,

        machineCode: this.machineCode,

        employee: this.employee,

        needleType: this.needleType,

        brokenNeedles: this.brokenNeedles,

        remarks: this.remarks,

        created: Date.now

			});

			// Redirect after save
			needlesbreakage.$save(function(response) {
				$location.path('needles-breakages/' + response._id);

				// Clear form fields
				$scope.name = '';
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Remove existing NeedlesBreakage
		$scope.remove = function(needlesbreakage) {
			if ( needlesbreakage ) {
				needlesbreakage.$remove();

				for (var i in $scope.NeedlesBreakages) {
					if ($scope.needlesbreakages [i] === needlesbreakage) {
						$scope.needlesbreakages.splice(i, 1);
					}
				}
			} else {
				$scope.needlesbreakage.$remove(function() {
					$location.path('needles-breakages');
				});
			}
		};

		// Update existing NeedlesBreakage
		$scope.update = function() {
			var needlesbreakage = $scope.needlesbreakage;

			needlesbreakage.$update(function() {
				$location.path('needles-breakages/' + needlesbreakage._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Find a list of NeedlesBreakage
		$scope.find = function() {
			$scope.needlesbreakages = NeedlesBreakages.query();
		};

		// Find existing NeedlesBreakage
		$scope.findOne = function() {

      NeedlesBreakages.get({
				needlesBreakageId: $stateParams.needlesBreakageId
			})
      .$promise.then(function(data) {

        data.date = moment(data.date).format('YYYY-MM-DD');

        $scope.needlesbreakage = data;
      }, function(reason) {
        console.log('Failed: ' + reason);
      });

		};
	}
]);


text: Front-End template instance generator


text:
package org.kairus.kairusTeam;

import org.jbox2d.common.Vec2;
import org.kairus.api.Robot;
import org.kairus.api.Team;
import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;

public class dontGetDQdModule extends RobotModule {

	dontGetDQdModule(int robotNumber, Team team) {
		super(robotNumber, team);
	}

	int goalZoneWidth = 30;
	int goalZoneHeight = 180;

	Vec2 mygoalpos = new Vec2(team.getTeamNumber()==0?0:SCREEN_WIDTH,SCREEN_HEIGHT/2);
	Vec2 goalpos = new Vec2(team.getTeamNumber()==0?SCREEN_WIDTH:0,SCREEN_HEIGHT/2);
	@Override
	int assessUtility(Team team) {
		Robot me = team.getRobots()[robotNumber];
		Vec2 pos = me.getPosition();

		// Y is correct for the goal
		if ((pos.y>(SCREEN_HEIGHT/2)-goalZoneHeight/2) && (pos.y<(SCREEN_HEIGHT/2)+goalZoneHeight/2)){
			if (team.getTeamNumber()==0){
				if (pos.x > SCREEN_WIDTH-goalZoneWidth)
					return 100;
			}else{
				if (pos.x < goalZoneWidth)
					return 100;
			}
		}

		return 0;
	}

	double tolerance = 0;

	double idealX;
	double idealY;
	@Override
	boolean execute(Team team) {
		idealX = mygoalpos.x;
		idealY = mygoalpos.y;
		boolean toReturn = driveToPoint(idealX, idealY, 1, 0, 5, 50);
		idealPosition = null;
		return toReturn;
	}

	@Override
	void render(Graphics g) {
		Robot me = team.getRobots()[robotNumber];
		Vec2 pos = me.getPosition();
		g.setColor(Color.red);
		g.drawLine((float)pos.x, (float)pos.y, (float)idealX, (float)idealY);

		int x = (int) (team.getTeamNumber()==0?(SCREEN_WIDTH-goalZoneWidth):goalZoneWidth);
		int x2 = (int) (team.getTeamNumber()==0?SCREEN_WIDTH:0);
		int y1 = (int) ((SCREEN_HEIGHT/2)-goalZoneHeight/2);
		int y2 = (int) ((SCREEN_HEIGHT/2)+goalZoneHeight/2);
		g.drawLine(x, y1, x2, y1);
		g.drawLine(x, y2, x2, y2);
		g.drawLine(x, y1, x, y2);

	}
}


text:
<?php

namespace KoolKode\Domain;

class PhoneNumber implements \JsonSerializable
{
	protected $number;

	protected $type;

	protected $preferred;

	protected $note;

	public function __construct($number, $type, $preferred = false, $note = '')
	{
		$this->number = (string)$number;
		$this->type = (string)$type;
		$this->preferred = $preferred ? true : false;
		$this->note = (string)$note;
	}

	public function jsonSerialize()
	{
		return [
			'number' => $this->number,
			'type' => $this->type,
			'preferred' => $this->preferred,
			'note' => $this->note
		];
	}

	public function getNumber()
	{
		return $this->number;
	}

	public function getType()
	{
		return $this->type;
	}

	public function isPreferred()
	{
		return $this->preferred;
	}

	public function getNote()
	{
		return $this->note;
	}
}


text:
package ma.glasnost.orika.test.community;

import java.util.Calendar;
import java.util.Date;

import org.junit.Assert;
import ma.glasnost.orika.MapperFacade;
import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.converter.BidirectionalConverter;
import ma.glasnost.orika.impl.DefaultMapperFactory;
import ma.glasnost.orika.metadata.Type;
import ma.glasnost.orika.test.MappingUtil;

import org.junit.Test;

public class Issue14TestCase {

    public static class Product {

        private Date tempCal;

        public Date getTempCal() {
            return tempCal;
        }

        public void setTempCal(Date tempCal) {
            this.tempCal = tempCal;
        }

    }

    public static class ProductDTO {

        private Calendar tempCal;

        public Calendar getTempCal() {
            return tempCal;
        }

        public void setTempCal(Calendar tempCal) {
            this.tempCal = tempCal;
        }

    }

    @Test
    public void testMapDateToCalendar() {

        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.getConverterFactory().registerConverter(new BidirectionalConverter<Date,Calendar>() {

            @Override
            public Calendar convertTo(Date source, Type<Calendar> destinationType) {
                Calendar cal = Calendar.getInstance();
                cal.setTime(source);
                return cal;
            }

            @Override
            public Date convertFrom(Calendar source, Type<Date> destinationType) {
                return source.getTime();
            }

        });
        MapperFacade mapper = factory.getMapperFacade();

        Product p = new Product();
        p.setTempCal(new Date());

        ProductDTO result = mapper.map(p, ProductDTO.class);

        Assert.assertEquals(p.getTempCal(), result.getTempCal().getTime());
    }

    @Test
    public void testMapDateToCalendar_usingBuiltinConverters() {
        MapperFactory factory = new DefaultMapperFactory.Builder()
                .useBuiltinConverters(true).build();
        MapperFacade mapper = factory.getMapperFacade();

        Product p = new Product();
        p.setTempCal(new Date());

        ProductDTO result = mapper.map(p, ProductDTO.class);

        Assert.assertEquals(p.getTempCal(), result.getTempCal().getTime());
    }

}


text:
const cheerio = require('cheerio');
const pick = require('pick-util');

function replaceCodeBlock(html, re, block) {
    return html.replace(re, () => block);
}

module.exports = (html, options) => {
    const results = {};
    const codeBlocks = {
        EJS: { start: '<%', end: '%>' },
        HBS: { start: '{{', end: '}}' }
    };
    const codeBlockLookup = [];
    const encodeCodeBlocks = _html => {
        let __html = _html;
        const blocks = Object.assign(codeBlocks, options.codeBlocks);

        Object.keys(blocks).forEach(key => {
            const re = new RegExp(blocks[key].start + '([\\S\\s]*?)' + blocks[key].end, 'g');

            __html = __html.replace(re, match => {
                codeBlockLookup.push(match);
                return 'EXCS_CODE_BLOCK_' + (codeBlockLookup.length - 1) + '_';
            });
        });
        return __html;
    };
    const decodeCodeBlocks = _html => {
        let index;
        let re;
        let __html = _html;

        for (index = 0; index < codeBlockLookup.length; index++) {
            re = new RegExp('EXCS_CODE_BLOCK_' + index + '_(="")?', 'gi');
            __html = replaceCodeBlock(__html, re, codeBlockLookup[index]);
        }
        return __html;
    };
    const encodeEntities = _html => encodeCodeBlocks(_html);
    const decodeEntities = _html => decodeCodeBlocks(_html);
    let $;

    $ = cheerio.load(encodeEntities(html), Object.assign({
        decodeEntities: false
    }, pick(options, [
        'xmlMode',
        'decodeEntities',
        'lowerCaseTags',
        'lowerCaseAttributeNames',
        'recognizeCDATA',
        'recognizeSelfClosing'
    ])));

    results.hrefs = [];

    $('link').each((index, element) => {
        const $el = $(element);

        if ($el.attr('rel') && $el.attr('rel').toLowerCase() === 'stylesheet') {
            if (options.applyLinkTags) {
                results.hrefs.push($el.attr('href'));
            }
            if (options.removeLinkTags) {
                $el.remove();
            }
        }
    });

    results.html = decodeEntities($.html());

    return results;
};


text:
package system

import (
	"github.com/NavigatingCancer/mirth-api/mirthagent/session"
)

type System struct {
	Session *session.Session
}


text:
from distutils.core import setup

setup(name           = 'smhcluster',
    version          = '0.1.0',
    description      = 'Cluster for Near-Duplicate Detection with Simhash',
    url              = 'http://github.com/seomoz/simhash-cluster',
    author           = 'Dan Lecocq',
    author_email     = 'dan@seomoz.org',
    packages         = ['smhcluster', 'smhcluster.adapters'],
    package_dir      = {
        'smhcluster': 'smhcluster',
        'smhcluster.adapters': 'smhcluster/adapters'
    },
    scripts          = [
        'bin/simhash-master',
        'bin/simhash-slave'
    ],
    dependencies     = [
        'simhash',   # For obvious reasons
        'boto',      # For persistence to S3
        'bottle',    # For the HTTP adapter
        'gevent',    # For non-blocking goodness
        'requests',  # For making real http requests
        'zerorpc'    # For RPC with gevent, zeromq
    ],
    classifiers      = [
        'Programming Language :: Python',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Topic :: Internet :: WWW/HTTP'
    ],
)