text:
<?xml version="1.0"?>
<project name="arduino" default="build">

    <property name="version" value="1.0.6" />
    <property name="revision" value="2" />

    <target name="update">
        <mkdir dir="../../files" />
        <exec executable="git" failonerror="false" dir="../../files">
            <arg value="clone" />
            <arg value="--depth" />
            <arg value="1" />
            <arg value="git@github.com:arduino/Arduino.git" />
        </exec>
        <exec executable="git" failonerror="false" dir="../../files/Arduino">
            <arg value="pull" />
            <arg value="origin" />
            <arg value="master" />
        </exec>
        <exec executable="git" failonerror="false" dir="../../files/Arduino">
            <arg value="checkout" />
            <arg value="${version}" />
        </exec>

    </target>

    <target name="build" depends="update">
        <mkdir dir="build" />
        <mkdir dir="build/arduino" />
        <mkdir dir="build/arduino/api" />
        <mkdir dir="build/arduino/icons" />
        <mkdir dir="build/arduino/examples" />
        <mkdir dir="build/arduino/libraries" />
        <mkdir dir="build/arduino/reference" />
        <mkdir dir="build/arduino/tools" />
        <copy todir="build/arduino/api"> <fileset dir="../../files/Arduino/hardware/arduino/cores/arduino/" includes="**/*"/> </copy>
        <copy todir="build/arduino/api" overwrite="true"> <fileset dir="files" includes="*"/></copy>
        <copy todir="build/arduino/libraries"> <fileset dir="../../files/Arduino/libraries/" includes="**/*"/> </copy>
        <copy todir="build/arduino/examples"> <fileset dir="../../files/Arduino/build/shared/examples/" includes="**/*"/> </copy>
        <copy todir="build/arduino/icons"> <fileset dir="icons/" includes="**/*"/> </copy>
        <copy todir="build/arduino/reference"> <fileset dir="reference/" includes="**/*"/> </copy>

        <copy todir="build/arduino/tools"> <fileset dir="tools/" includes="**/*"/> </copy>
        <copy todir="build/arduino" file="../../files/Arduino/build/shared/lib/keywords.txt" />
        <copy todir="build/arduino" file="core.txt" overwrite="true" />
        <replace file="build/arduino/core.txt" token="%VERSION%" value="${version}" />
        <replace file="build/arduino/core.txt" token="%REVISION%" value="${revision}" />

        <jar basedir="build" destfile="arduino.jar">
            <manifest>
                <attribute name="Version" value="${version}-${revision}" />
                <attribute name="Author" value="Arduino" />
                <attribute name="Compiler" value="avr-gcc" />
                <attribute name="Core" value="arduino" />
                <attribute name="Platform" value="any" />
                <attribute name="Family" value="avr" />
                <attribute name="Description" value="Arduino ${version}" />
            </manifest>
        </jar>
    </target>

    <target name="install" depends="build">
        <move file="arduino.jar" todir="/var/www/uecide/plugins-088/cores" />
    </target>

    <target name="clean">
        <delete dir="build" />
        <delete file="arduino.jar" />
    </target>

</project>


text:
<?xml version="1.0" encoding="UTF-8"?>
<persistence>
	<persistence-unit>
		<database>
			<property name="url" value="" />
		</database>
		<entitys>
			<include src=""/>
			<entity class="">

			</entity>
		</entitys>
	</persistence-unit>
</persistence>

redpajama_set_name: RedPajamaGithub


text:
echo "Sym linking xinit files to git repo"
if [ -e "$HOME/.xinitrc" ]
then
	echo "xinitrc already linked"
else
	ln -s `pwd`/xinitrc $HOME/.xinitrc
fi
echo "Finished linking xinit files"

echo "Sym linking Xresources files to git repo"
if [ -e "$HOME/.Xresources" ]
then
	echo "Xresources already linked"
else
	ln -s `pwd`/Xresources $HOME/.Xresources
fi

echo "Sym linking i3 config files to git repo"
if [ -e "$HOME/.config/i3/config" ]
then
	echo "config already linked"
else
	ln -s `pwd`/config $HOME/.config/i3/config
fi

echo "Sym linking i3-status config files to git repo"
if [ -e "$HOME/.i3status.conf" ]
then
	echo "status already linked"
else
	ln -s `pwd`/i3status.conf $HOME/.i3status.conf
fi
echo "Finished linking i3 files"


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rss version="2.0">
    <channel>
        <title>SLAVIC Films and Conversation Tables</title>
        <link>http://illinois.edu/calendar/list/1578</link>
        <description>Lists film screenings and language conversation tables and other events organized for students by the Slavic department</description>
    </channel>
</rss>


text:
<!DOCTYPE html>

  <meta charset="UTF-8">

  <title>CodePen - A Pen by  Zoran Varmuza</title>

  <title>Important informations from lesson one</title>

The definition of WWW and how it works

The World Wide Web is a system of Internet servers that support specially formatted documents.

The documents are formatted in a markup language called HTML (HyperText Markup Language) that supports links to other documents, as well as graphics, audio, and video files. This means you can jump from one document to another simply by clicking on hot spots. Not all Internet servers are part of the World Wide Web.

 Here are some main parts of the World Wide Web.

1. HTPP is the main protocol of the WEB.

2. Servers - are computers that host files thatmmakes up the WEB.

3.The Internet - is world largest computer network.

4. WEB browser - is a program that runs on your computer to dispaly files found on the WEB.

 The essentials needed to create a HTML document

 Tags, atributes and inline and block elements

1. Tags

Are commands inserted in a document that specifies how the document, or a portion of the document, should be formatted. Tags are used by all format specifications that store documents as text files. This includes SGML and HTML.

2. Attributes

An HTML attribute is a modifier of an HTML element. They are usually added to a HTML start tag, which along with content and end tag comprises most HTML elements.

 3. Inline and Block Elements

Most HTML elements are defined as block level elements or inline elements.

Block level elements normally start (and end) with a new line, when displayed in a browser.Inline elements are normally displayed without line breaks.


text:
class SentenceInputModel:

    word_index_matrix = None
    sentence_lengths = None
    centroid_map = None
    n_centroids = None

    def get_max_words_in_batch(self):
        return self.sentence_lengths.max()


text:
require 'singleton'

module Handcart
  class IpAuthorization
    # A singleton
    attr_accessor :ip_authorization_strategy, :strategy

    include Singleton

    def initialize
      @ip_authorization_strategy = Handcart.ip_authorization_strategy

      # Setup what strategy we're using
      case @ip_authorization_strategy
      when :none
        nil
      when :containment
        @strategy = Handcart::Strategies::ContainmentStrategy.new
      when :inclusion
        @strategy = Handcart::Strategies::InclusionStrategy.new
      else
        nil
      end
    end

  end
end


text:
from flask import Flask
from flask import render_template
import jinja2
import aljazeera
import independent
import npr
import realnews

# Stored as variable so it can be called later without exceeding PEP8 line length-limit (see 'app.jinja-loader' below)
path_to_jinja_templates = 'C:/Users/jaide/OneDrive/Documents/Pro/Web Development/Headliner/templates'

# Create lists to house the content for all feeds. This is done so each feed process doesn't run multiple times.
# This method saves literally minutes of load time every time it runs. Outside Python files are executed every time \
# they're called, so doing this allows us to run each once then call on it when needed.
aljazeera_list = []

independent_world_list = []
independent_uk_list = []
independent_business_list = []

npr_front_list = []
npr_world_list = []
npr_us_list = []
npr_politics_list = []
npr_education_list = []

realnews_list = []

def make_aljazeera_list():
    """ Append Aljazeera contents to the list we created before """
    for article in aljazeera.posts:
        aljazeera_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

def make_independent_lists():
    """ Append Independent contents to the lists we created before """
    for article in independent.world:
        independent_world_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

    for article in independent.uk:
        independent_uk_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

    for article in independent.business:
        independent_business_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

def make_npr_lists():
    """ Append NPR contents to the lists we created before """
    for article in npr.front:
        npr_front_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

    for article in npr.world:
        npr_world_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

    for article in npr.us:
        npr_us_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

    for article in npr.politics:
        npr_politics_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

    for article in npr.education:
        npr_education_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

def make_realnews_list():
    """ Append RealNews contents to list we created before """
    for article in realnews.posts:
        realnews_list.append({
            "title": article['title'],
            "description": article['description'],
            "url": article['url'],
            "thumbnail": article['thumbnail']
        })

# Flask app setup
app = Flask(__name__)
app.config['SERVER_NAME'] = '127.0.0.1:5000'
app.jinja_loader = jinja2.FileSystemLoader(path_to_jinja_templates)

@app.route('/')
def make_cards():
    """ Creates the HTML using the template provided and the list contents """
    with app.app_context():
        return render_template('homepage.html',
                               aljazeera=aljazeera_list,

                               independent_world=independent_world_list,
                               independent_uk=independent_uk_list,
                               independent_business=independent_business_list,

                               npr_front=npr_front_list,
                               npr_world=npr_world_list,
                               npr_us=npr_us_list,
                               npr_politics=npr_politics_list,
                               npr_education=npr_education_list,

                               realnews=realnews_list,

                               font_url="https://fonts.googleapis.com/css?family=Roboto+Condensed",
                               mdl_js="https://code.getmdl.io/1.3.0/material.min.js")

# Create the lists to be fed to Flask app
make_aljazeera_list()
make_independent_lists()
make_npr_lists()
make_realnews_list()

make_cards()

# Keep this at the end or will have resulting 404
app.run(debug=True, use_reloader=False)

# In case services cannot be imported, import sys and use this to update the path:
# sys.path.append('C:/Path/To/Services/Folder')


text:
package com.esri.hadoop.hive;

/**
 * Abstract base class for all accessors (ST_X/Y, IsBoolTests, ...)
 *
 */

public abstract class ST_GeometryAccessor extends ST_Geometry {
}


text:
package dk.statsbiblioteket.doms.ecm.repository.exceptions;

/**
 * This exception is a wrapper for all xml parsing exceptions. If an operation
 * requires that a datastream is parsed as xml, and the datastream does not
 * contain valid xml, this exception is thrown.
 * <br/>
 * Is also thrown when Trippi fails to parse the return from a call to the
 * Resource index
 *
 */
public class FedoraIllegalContentException extends EcmException {

    public FedoraIllegalContentException(String s) {
        super(s);

    }

    public FedoraIllegalContentException(String s, Throwable throwable) {
        super(s, throwable);
    }

}


text:
OpenBudget.nodes = (function() {
    var centers = {
        'right': {x:0,y:0},
        'topRight': {x:0,y:0},
        'middle': {x:0,y:0},
        'topMiddle': {x:0,y:0},
        'left': {x:0,y:0},
        'topLeft': {x:0,y:0}
    };

    var totals,
        setupTotals = function() {
            totals = {
                'revenue': {
                    'value': 0,
                    'value2': 0
                },
                'gross_cost': {
                    'value': 0,
                    'value2': 0
                }
            };
        };
    setupTotals();

    var valuesAccessor = function(sType, valueCfg, value2Cfg) {
        var type = valueCfg.type,
            type2 = value2Cfg.type,
            year = valueCfg.year,
            year2 = value2Cfg.year;

        return function(d) {
            var dType = d[sType],
                value = dType && dType[type] ? dType[type][year] || 0 : 0,
                value2 = dType && dType[type2] ? dType[type2][year2] || 0 : 0,
                numbers;

            if(value > 0 || value2 > 0) {
                numbers = {
                    value: value,
                    value2: value2
                };
            }

            return numbers;
        };
    };

    var meta = OpenBudget.data.meta,
        valuesAccessorForNodeType = {
        'revenue': valuesAccessor('revenue', meta.value, meta.value2),
        'gross_cost': valuesAccessor('gross_cost', meta.value, meta.value2)
    };

    var diffPercent = function(value, value2) {
        if(!value2) {
            // ToDo: verify edge cases
            return 100;
        }
        var diff = value - value2;
        return d3.round(diff / (value2 / 100), 2);
    };

    var createNode = function(key, datum, parent) {
        if(!parent) return;

        var type = parent.type,
            depth = parent.depth+1,
            values = valuesAccessorForNodeType[type](datum);
        if(!values) return;

        var node = {
            'name': datum.name,
            'value': values.value,
            'value2': values.value2,
            'diff': diffPercent(values.value, values.value2),
            'type': type,
            'depth': depth,
            'children': []
        };

        if(depth) {
            node.parent = parent;
            node.id = parent.id + '-' + (datum.number || key);
            parent.children.push(node);
        }
        else {
            node.center = centers[type == 'gross_cost' ? 'left' : 'right'];
            node.id = type + '-' + (datum.number || key);

            rootNodes.push(node);

            totals[type].value += values.value;
            totals[type].value2 += values.value2;

            node.name = $.trim(node.name.replace(/^Direktion für/, ''));
        }
        nodes.push(node);

        return node;
    };

    var createNodes = function(key, datum, parents) {
        if(!parents) parents = {
            'revenue': {
                'depth': -1,
                'type': 'revenue'
            },
            'gross_cost': {
                'depth': -1,
                'type': 'gross_cost'
            }
        };
        return {
            'revenue': createNode(key, datum, parents.revenue),
            'gross_cost': createNode(key, datum, parents.gross_cost)
        };
    };

    var rootNodes = [];
    var nodes = [];

    var surplus,
        surplus2,
        surplusNode;

    var radiusScale = d3.scale.sqrt(),
        radiusScaleFactor = 1;

    var stuffForce = d3.layout.force()
        .gravity(-0.01)
        .friction(0.9)
        .alpha(0.01)
        .charge(function(d) { return -Math.pow(d.radius, 2.0) / 16; });
    var stuffForceMinTick = 50;

    var moveTowardsCenter = function(alpha, parentRadius) {
        return function(d) {
            var c = parentRadius, da = 0.13 * alpha;
            d.x += (c - d.x) * da;
            d.y += (c - d.y) * da;
        };
    };

    var valueSort = function(a, b) {
        return b.value - a.value;
    };

    var fn = {
        process: function(data) {
            var recursiveCreate = function(nodes, parents) {
                _.each(nodes, function(node) {
                    key = node.id;
                    nodes = createNodes(key, node, parents);
                    if(node.children) {
                        recursiveCreate(node.children, nodes);
                    }
                });
            };

            recursiveCreate(data);

            surplus = d3.round(totals.revenue.value - totals['gross_cost'].value, 2);
            surplus2 = d3.round(totals.revenue.value2 - totals['gross_cost'].value2, 2);
            var surplusDiff = diffPercent(surplus, surplus2),
                isDeficit = surplus < 0;
            if(isDeficit) {
                surplus *= -1;
                surplus2 *= -1;
            }
            if(surplus2 < 0) {
                surplusDiff = 100;
            }

            surplusNode = {
                'name': isDeficit ? 'Defizit' : 'Überschuss',
                'value': surplus,
                'value2': surplus2,
                'diff': surplusDiff,
                'type': 'surplus',
                'depth': 0,
                'center': centers['middle'],
                'id': 'surplus'
            };
            rootNodes.push(surplusNode);
            nodes.push(surplusNode);
            // console.log(surplus, surplus2);

            var colorScale = d3.scale.linear()
                .domain([-100, 0, 100]).clamp(true)
                .range(['rgb(230,20,20)', 'rgb(255,255,230)', 'rgb(20,230,20)']);
                //.range(['rgb(255,77,77)', 'rgb(255,255,230)', 'rgb(77,255,77)']);

            _.each(nodes, function(d) {
                var rgb = d3.rgb(colorScale(d.diff));
                d.fill = 'rgb('+rgb.r+','+rgb.g+','+rgb.b+')';
                d.stroke = rgb.darker().toString();
            });

            var recursiveSort = function(nodes) {
                nodes.sort(valueSort);
                _.each(nodes, function(value) {
                    if(value.children) {
                        recursiveSort(value.children);
                    }
                });
            };
            recursiveSort(nodes);
        },
        setup: function() {
            var valueAccessor = function(d) {
                return d.value;
            };

            var max = d3.max(nodes, valueAccessor);
            var min = d3.min(nodes, valueAccessor);

            radiusScale.domain([0, d3.max([max, Math.abs(min)])]);
        },
        createCache: function() {
            var ready = function(data) {
                rootNodes = [];
                nodes = [];
                setupTotals();

                fn.process(data);
                fn.setup();
                fn.resize(1920, 1080);

                // this kills your browser
                stuffForceMinTick *= 10;
                var recursiveStuffing = function(nodes) {
                    var aRadiusScaleFactor = 300 / d3.max(nodes, function(d) { return d.unscaledRadius; });
                    _.each(nodes, function(value) {
                        if(value.children) {
                            fn.stuffChildren(value, aRadiusScaleFactor);
                            recursiveStuffing(value.children);
                        }
                    });
                };
                recursiveStuffing(rootNodes);
                stuffForceMinTick /= 10;

                var recursiveCleanup = function(nodes) {
                    _.each(nodes, function(value) {
                        value.parent = undefined;
                        value.center = undefined;
                        if(value.children) {
                            recursiveCleanup(value.children);
                        }
                    });
                };
                recursiveCleanup(rootNodes);

                $('body').append('<textarea></textarea>').find('textarea:last').css({
                    position: 'fixed',
                    'z-index': 99999,
                    top: '0px',
                    left: '0px',
                    width: '100%',
                    height: '100%'
                }).text(JSON.stringify(rootNodes));
            };

            var dataUrl = OpenBudget.data.meta.data_url;
            if(dataUrl) {
                $.ajax({
                    dataType: "json",
                    url: dataUrl,
                    success: ready,
                    cache: false
                });
            }
            else {
                ready(OpenBudget.data.nodes);
            }
        },
        loadFromCache: function(loadCallback) {
            var ready = function(data) {
                rootNodes = data;

                var recursiveReferencing = function(someNodes) {
                    _.each(someNodes, function(value) {
                        if(!value.depth) {
                            value.center = centers[value.type == 'gross_cost' ? 'left' : 'right'];
                            if(value.type == 'surplus') {
                                value.center = centers['middle'];
                            }
                        }
                        if(value.children) {
                            _.each(value.children, function(value2) {
                                value2.parent = value;
                            });
                            recursiveReferencing(value.children);
                        }
                        nodes.push(value);
                    });
                };
                recursiveReferencing(rootNodes);

                fn.setup();
                fn.calculateRadius();

                loadCallback(rootNodes);
            };

            var cacheUrl = OpenBudget.data.meta.cache_url;
            if(cacheUrl) {
                $.ajax({
                    dataType: "json",
                    url: cacheUrl,
                    success: ready,
                    cache: false
                });
            }
            else {
                ready(OpenBudget.data.cache);
            }
        },
        load: function(loadCallback) {
            var ready = function(data) {
                fn.process(data);
                fn.setup();

                loadCallback(rootNodes);
            };

            var dataUrl = OpenBudget.data.meta.data_url;
            if(dataUrl) {
                $.ajax({
                    dataType: "json",
                    url: dataUrl,
                    success: ready,
                    cache: false
                });
            }
            else {
                ready(OpenBudget.data.nodes);
            }
        },
        resize: function(width, height) {
            centers.middle.x = width / 2;
            centers.middle.y = height / 2;
            centers.topMiddle.x = centers.middle.x;
            centers.topMiddle.y = centers.middle.y / 3;
            centers.left.x = width / 4;
            centers.left.y = height / 2;
            centers.topLeft.x = centers.left.x;
            centers.topLeft.y = centers.left.y / 3;
            centers.right.x = width / 4 * 3;
            centers.right.y = height / 2;
            centers.topRight.x = centers.right.x;
            centers.topRight.y = centers.right.y / 3;

            radiusScale.range([0, width / (rootNodes.length / 1.5)]);
            fn.calculateRadius();
        },
        calculateRadius: function() {
            var i = 0,
                nodesLength = nodes.length,
                d,
                r;
            while(i < nodesLength) {
                d = nodes[i];
                r = radiusScale(d.value);
                d.unscaledRadius = r;
                d.radius = r * radiusScaleFactor;
                i += 1;
            }
        },
        setRadiusScaleFactor: function(scaleFactor) {
            radiusScaleFactor = scaleFactor;
        },
        stuffChildren: function(node, scaleFactor) {
            var children = node.children || {},
                childrenLength = children.length,
                nodeRadius = scaleFactor !== undefined ? node.unscaledRadius * scaleFactor : node.radius,
                nodeSize = nodeRadius * 2,
                i, d;

            if(!childrenLength || node.stuffedChildrenRadius) {
                return;
            }

            if(scaleFactor !== undefined) {
                i = 0;
                while(i < childrenLength) {
                    d = children[i];
                    d.radius = d.unscaledRadius * scaleFactor;
                    i += 1;
                }
            }

            stuffForce.size([nodeSize, nodeSize]).nodes(children);

            stuffForce.on('tick', function(e) {
                var i = 0,
                    c = children,
                    cl = childrenLength,
                    f = moveTowardsCenter(e.alpha, nodeRadius),
                    d;

                while(i < cl) {
                    d = c[i];
                    f(d);
                    i += 1;
                }
            }).start();

            var tickI, tickIMax = childrenLength * 6;
            if(tickIMax < stuffForceMinTick) tickIMax = stuffForceMinTick;
            for(tickI = 0; tickI < tickIMax; tickI+=1) stuffForce.tick();
            stuffForce.stop();

            i = 0;
            while(i < childrenLength) {
                d = children[i];
                d.sx = d.x;
                d.sy = d.y;
                d.sr = d.radius;
                i += 1;
            }

            node.stuffedChildrenRadius = nodeRadius;
        },
        centers: centers
    };

    return fn;
})();


text:
import * as AddInstructions from './instructions/AddInstructions'
import * as AddCarryInstructions from './instructions/AddCarryInstructions'
import * as AndInstructions from './instructions/AndInstructions'
import * as CompInstructions from './instructions/CompInstructions'
import * as CallInstructions from './instructions/CallInstructions'
import * as DecInstructions from './instructions/DecInstructions'
import * as HaltInstruction from './instructions/HaltInstruction'
import * as IncInstructions from './instructions/IncInstructions'
import * as JumpInstructions from './instructions/JumpInstructions'
import * as LoadInstructions from './instructions/LoadInstructions'
import * as NopInstruction from './instructions/NopInstruction'
import * as OutInstructions from './instructions/OutInstructions'
import * as OrInstructions from './instructions/OrInstructions'
import * as PopInstructions from './instructions/PopInstructions'
import * as PushInstructions from './instructions/PushInstructions'
import * as ReturnInstructions from './instructions/ReturnInstructions'
import * as RotateLeftCarryInstructions from './instructions/RotateLeftCarryInstructions'
import * as RotateRightCarryInstructions from './instructions/RotateRightCarryInstructions'
import * as ShiftLeftInstructions from './instructions/ShiftLeftInstructions'
import * as ShiftRightInstructions from './instructions/ShiftRightInstructions'
import * as SubInstructions from './instructions/SubInstructions'
import * as SubCarryInstructions from './instructions/SubCarryInstructions'
import * as XorInstructions from './instructions/XorInstructions'

import Statement from './Statement'

export const INSTRUCTION_GROUPS = [
    AddInstructions,
    AddCarryInstructions,
    AndInstructions,
    CallInstructions,
    CompInstructions,
    DecInstructions,
    HaltInstruction,
    IncInstructions,
    JumpInstructions,
    LoadInstructions,
    NopInstruction,
    OutInstructions,
    OrInstructions,
    PopInstructions,
    PushInstructions,
    ReturnInstructions,
    RotateLeftCarryInstructions,
    RotateRightCarryInstructions,
    ShiftLeftInstructions,
    ShiftRightInstructions,
    SubInstructions,
    SubCarryInstructions,
    XorInstructions
]

export const INSTRUCTIONS = [].concat(...INSTRUCTION_GROUPS.map((instructionGroup) => instructionGroup.instructions))

const instructionsByName = new Map()
const instructionsByOpcode = []

INSTRUCTIONS.forEach(instruction => {
    const name = instruction.name
    let variants = instructionsByName.get(name)

    if (!variants) {
        variants = []
        instructionsByName.set(name, variants)
    }
    variants.push(instruction)

    let opcodes = instructionsByOpcode
    if (instruction.opcodes.length > 1) {
        opcodes = instructionsByOpcode[instruction.opcodes[0]]
        if (!opcodes) {
            opcodes = []
            instructionsByOpcode[instruction.opcodes[0]] = opcodes
        }
    }
    if (typeof instruction.postfix !== 'number') {
        opcodes[instruction.opcodes[instruction.opcodes.length - 1]] = instruction
    } else {
        let subOpcodes = opcodes[instruction.opcodes[instruction.opcodes.length - 1]]
        if (!subOpcodes) {
            subOpcodes = []
            opcodes[instruction.opcodes[instruction.opcodes.length - 1]] = subOpcodes
        }
        subOpcodes[instruction.postfix] = instruction
    }
})

export function process(state) {
    const pcMem = state.getMemory(state.registers.PC, 4)

    if (pcMem.length > 0) {
        let instruction = instructionsByOpcode[pcMem[0]]

        if (instruction instanceof Array) {
            if (pcMem.length > 1) {
                instruction = instruction[pcMem[1]]
            } else {
                instruction = null
            }
        }
        if (instruction instanceof Array) {
            if (pcMem.length > 3) {
                instruction = instruction[pcMem[3]]
            } else {
                instruction = null
            }
        }
        if (instruction) {
            return instruction.process(state, pcMem)
        }
    }

    return null
}

export function createBlankStatement() {
    return Statement.create({
        type: 'blank',
        assembler: '  ',
        opcodes: () => [],
        size: 0
    })
}

export function createErrorStatement(line) {
    return Statement.create({
        type: 'error',
        assembler: line,
        opcodes: () => [],
        size: 0
    })
}

export function createLabelStatement(label) {
    return Statement.create({
        type: 'sourcelabel',
        assembler: `${label}:`,
        opcodes: () => [],
        updateLabel: (offset, labels) => labels.setAddress(label, offset),
        size: 0
    })
}

export function createCommentStatement(comment) {
    return Statement.create({
        type: 'comment',
        assembler: `#${comment}`,
        opcodes: () => [],
        size: 0
    })
}

export function createDataStatement(dataSource) {
    const trimmed = dataSource.trim()
    let data

    if (trimmed.startsWith('0x')) {
        data = trimmed.slice(2).split(' ').map((str) => parseInt(str, 16) & 0xff)
    } else if (trimmed.startsWith('0b')) {
        data = trimmed.slice(2).split(' ').map((str) => parseInt(str, 2) & 0xff)
    } else if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
        data = [...JSON.parse(trimmed)].map((c) => c.charCodeAt(0)).concat(0)
    } else {
        data = trimmed.split(' ').map((str) => parseInt(str, 10) & 0xff)
    }
    return Statement.create({
        type: 'data',
        assembler: `= ${trimmed}`,
        opcodes: () => data,
        size: data.length
    })
}

export function createInstructionStatement(elements) {
    if (!elements instanceof Array || elements.length === 0) {
        return null
    }
    const variants = instructionsByName.get(elements[0].toUpperCase())

    if (!variants) {
        return null
    }

    const matchingVariant = variants.find((variant) => {
        const args = variant.args
        return args.length === elements.length - 1 &&
            args.every((pattern, index) => pattern.matches(elements[index + 1]))
    })

    if (matchingVariant) {
        const params = matchingVariant.args.map((pattern, i) => pattern.extractValue(elements[i + 1]))
        return matchingVariant.createStatement(params)
    }
    return null
}

export function parseLine(line) {
    const trimmed = line.trim()
    if (trimmed.length === 0) {
        return createBlankStatement()
    }
    if (trimmed.startsWith('.') && trimmed.endsWith(':')) {
        return createLabelStatement(trimmed.substr(0, trimmed.length - 1))
    }
    if (trimmed.startsWith('#')) {
        return createCommentStatement(trimmed.slice(1))
    }
    if (trimmed.startsWith('=')) {
        return createDataStatement(trimmed.slice(1))
    }
    const instruction = createInstructionStatement(line.trim().replace(/<\-|,/, ' ').split(/\s+/))

    if (instruction) {
        return instruction
    }

    return createErrorStatement(line)
}


text:
#ifndef _CLSMITH_CLVARIABLE_H_
#define _CLSMITH_CLVARIABLE_H_

#include "Variable.h"
#include "Expression.h"
#include "FunctionInvocation.h"

#include <set>

namespace CLSmith {
namespace CLVariable {

/* To be called once the whole random program is generated;
 * It traverses it and identifies all variables that are actually used in
 * expressions; it then removes any variables that are declared, but not
 * referenced anywhere
 * TODO maybe leave in some variables or add a chance of clearing a variable
 ***/
void ParseUnusedVars(void);

namespace Helpers {
/* This contains helper functions for the methods in the main namespace;
 * they should not be called from anywhere else (consider them private)
 ***/

/* Given an Expression, returns all variables referenced in it
 ***/
void GetVarsFromExpr(std::set<const Variable*>* expr_vars, const Expression* expr);

/* Stores var inside accesses, where var is referenced in block b;
 * This performs some additional checks regarding var, such as its scope
 * (currently, we ignore global and parameter variables; might revise the
 * decision about globals); the int key of the map refers to the block id
 * (stm_id) where the given variable is declared, not where it is referenced
 ***/
void RecordVar(std::set<const Variable*>* accesses, const Variable* var);

/* Records any pointer variables used for initialising variables
 ***/
void RecordVarInitialisation(std::set<const Variable*>* accesses, Block* b);

/* Records all the variables in vars by calling RecordVar() multiple times
 ***/
void RecordMultipleVars(std::set<const Variable*>* accesses, std::set<const Variable*>* vars);

} // namespace Helpers
} // namespace CLVariable
} // namespace CLSmith

#endif  //  _CLSMITH_CLVARIABLE_H_


text:
package com.takwolf.android.lock9;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Pair;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;

/**
 *
Android-Lock9View

 *
九宫格锁屏视图组件,提供一个九宫格手势屏锁视图功能。

 *
手势处理和连线绘制都有组件内部完成,你只需要绑定这个组件并设置手势完成后的回调对象即可。

 *
请使用 setCallBack(CallBack callBack) 函数设置回调对象。

 *
需要注意的是,不论如何设置,组件的高度永远等于宽度。

 * @author TakWolf (takwolf@foxmail.com)
 */
public class Lock9View extends ViewGroup {

    private Paint paint;
    private Bitmap bitmap;
    private Canvas canvas;

    private List<Pair<NodeView, NodeView>> lineList;
    private NodeView currentNode;

    private StringBuilder pwdSb;
    private CallBack callBack;

    private Drawable nodeSrc;
    private Drawable nodeOnSrc;

    public Lock9View(Context context) {
        this(context, null);
    }

    public Lock9View(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public Lock9View(Context context, AttributeSet attrs, int defStyleAttr) {
        this(context, attrs, defStyleAttr, 0);
    }

    public Lock9View(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr); // TODO api 21
        initFromAttributes(attrs, defStyleAttr);
    }

    private void initFromAttributes(AttributeSet attrs, int defStyleAttr) {
        final TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.Lock9View, defStyleAttr, 0);

        nodeSrc = a.getDrawable(R.styleable.Lock9View_nodeSrc);
        nodeOnSrc = a.getDrawable(R.styleable.Lock9View_nodeOnSrc);
        int lineColor = Color.argb(0, 0, 0, 0);
        lineColor = a.getColor(R.styleable.Lock9View_lineColor, lineColor);
        float lineWidth = 20.0f;
        lineWidth = a.getDimension(R.styleable.Lock9View_lineWidth, lineWidth);

        a.recycle();

        paint = new Paint(Paint.DITHER_FLAG);
        paint.setStyle(Style.STROKE);
        paint.setStrokeWidth(lineWidth);
        paint.setColor(lineColor);
        paint.setAntiAlias(true);

        DisplayMetrics dm = getResources().getDisplayMetrics(); // bitmap的宽度是屏幕宽度,足够使用
        bitmap = Bitmap.createBitmap(dm.widthPixels, dm.widthPixels, Bitmap.Config.ARGB_8888);
        canvas = new Canvas();
        canvas.setBitmap(bitmap);

        for (int n = 0; n < 9; n++) {
            NodeView node = new NodeView(getContext(), n + 1);
            addView(node);
        }
        lineList = new ArrayList<Pair<NodeView,NodeView>>();
        pwdSb = new StringBuilder();

        // 清除FLAG,否则 onDraw() 不会调用,原因是 ViewGroup 默认透明背景不需要调用 onDraw()
        setWillNotDraw(false);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        setMeasuredDimension(widthMeasureSpec, widthMeasureSpec); // 我们让高度等于宽度
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        if (!changed) {
            return;
        }
        int width = right - left;
        int nodeWidth = width / 3;
        int nodePadding = nodeWidth / 6;
        for (int n = 0; n < 9; n++) {
            NodeView node = (NodeView) getChildAt(n);
            int row = n / 3;
            int col = n % 3;
            int l = col * nodeWidth + nodePadding;
            int t = row * nodeWidth + nodePadding;
            int r = col * nodeWidth + nodeWidth - nodePadding;
            int b = row * nodeWidth + nodeWidth - nodePadding;
            node.layout(l, t, r, b);
        }
    }

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.drawBitmap(bitmap, 0, 0, null);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
            case MotionEvent.ACTION_MOVE:
                NodeView nodeAt = getNodeAt(event.getX(), event.getY());
                if (nodeAt == null && currentNode == null) { // 不需要画线,之前没接触点,当前也没接触点
                    return true;
                } else { // 需要画线
                    clearScreenAndDrawList(); // 清除所有图像,如果已有线,则重新绘制
                    if (currentNode == null) { // 第一个点 nodeAt不为null
                        currentNode = nodeAt;
                        currentNode.setHighLighted(true);
                        pwdSb.append(currentNode.getNum());
                    }
                    else if (nodeAt == null || nodeAt.isHighLighted()) { // 已经有点了,当前并未碰触新点
                        // 以currentNode中心和当前触摸点开始画线
                        canvas.drawLine(currentNode.getCenterX(), currentNode.getCenterY(), event.getX(), event.getY(), paint);
                    } else { // 移动到新点
                        canvas.drawLine(currentNode.getCenterX(), currentNode.getCenterY(), nodeAt.getCenterX(), nodeAt.getCenterY(), paint);// 画线
                        nodeAt.setHighLighted(true);
                        Pair<NodeView, NodeView> pair = new Pair<NodeView, NodeView>(currentNode, nodeAt);
                        lineList.add(pair);
                        // 赋值当前的node
                        currentNode = nodeAt;
                        pwdSb.append(currentNode.getNum());
                    }
                    // 通知onDraw重绘
                    invalidate();
                }
                return true;
            case MotionEvent.ACTION_UP:
                // 还没有触摸到点
                if (pwdSb.length() <= 0) {
                    return super.onTouchEvent(event);
                }
                // 回调结果
                if (callBack != null) {
                    callBack.onFinish(pwdSb.toString());
                    pwdSb.setLength(0); // 清空
                }
                // 清空保存点的集合
                currentNode = null;
                lineList.clear();
                clearScreenAndDrawList();
                // 清除高亮
                for (int n = 0; n < getChildCount(); n++) {
                    NodeView node = (NodeView) getChildAt(n);
                    node.setHighLighted(false);
                }
                // 通知onDraw重绘
                invalidate();
                return true;
        }
        return super.onTouchEvent(event);
    }

    /**
     * 清掉屏幕上所有的线,然后画出集合里面的线
     */
    private void clearScreenAndDrawList() {
        canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
        for (Pair<NodeView, NodeView> pair : lineList) {
            canvas.drawLine(pair.first.getCenterX(), pair.first.getCenterY(), pair.second.getCenterX(), pair.second.getCenterY(), paint);
        }
    }

    /**
     * 获取Node,返回null表示当前手指在两个Node之间
     */
    private NodeView getNodeAt(float x, float y) {
        for (int n = 0; n < getChildCount(); n++) {
            NodeView node = (NodeView) getChildAt(n);
            if (!(x >= node.getLeft() && x < node.getRight())) {
                continue;
            }
            if (!(y >= node.getTop() && y < node.getBottom())) {
                continue;
            }
            return node;
        }
        return null;
    }

    /**
     * 设置手势结果的回调监听器
     * @param callBack
     */
    public void setCallBack(CallBack callBack) {
        this.callBack = callBack;
    }

    /**
     * 节点描述类
     */
    public class NodeView extends View {

        private int num;
        private boolean highLighted;

        private NodeView(Context context) {
            super(context);
        }

        public NodeView(Context context, int num) {
            this(context);
            this.num = num;
            highLighted = false;
            if (nodeSrc == null) {
                setBackgroundResource(0);
            } else {
                setBackgroundDrawable(nodeSrc);
            }
        }

        public boolean isHighLighted() {
            return highLighted;
        }

        public void setHighLighted(boolean highLighted) {
            this.highLighted = highLighted;
            if (highLighted) {
                if (nodeOnSrc == null) {
                    setBackgroundResource(0);
                } else {
                    setBackgroundDrawable(nodeOnSrc);
                }
            } else {
                if (nodeSrc == null) {
                    setBackgroundResource(0);
                } else {
                    setBackgroundDrawable(nodeSrc);
                }
            }
        }

        public int getCenterX() {
            return (getLeft() + getRight()) / 2;
        }

        public int getCenterY() {
            return (getTop() + getBottom()) / 2;
        }

        public int getNum() {
            return num;
        }

        public void setNum(int num) {
            this.num = num;
        }

    }

    /**
     * 结果回调监听器接口
     */
    public interface CallBack {

        public void onFinish(String password);

    }

}


text:
Permissão negada!

A página que você está tentando acessar está indisponível porque você não tem permissão para acessá-la. Por favor, contate o administrador do sistema.

<?php if(isset($_SERVER['HTTP_REFERER'])) { ?>
	<a href="<?= $_SERVER['HTTP_REFERER'] ?>" class="btn btn-sm btn-primary"> Voltar<?php
} ?>
<a href="<?= base_url('login/sair') ?>" class="btn btn-sm btn-danger"> Sair


text:
namespace chromeos {

// Authenticates supervised users against the cryptohome.
//
// Typical flow:
// AuthenticateToMount() calls a Cryptohome to perform offline login,
// AuthenticateToCreate() calls a Cryptohome to create new cryptohome.
class SupervisedUserAuthenticator
    : public base::RefCountedThreadSafe<SupervisedUserAuthenticator> {
 public:
  enum AuthState {
    CONTINUE,      // State indeterminate; try again when more info available.
    NO_MOUNT,      // No cryptohome exist for user.
    FAILED_MOUNT,  // Failed to mount existing cryptohome - login failed.
    FAILED_TPM,    // Failed to mount/create cryptohome because of TPM error.
    SUCCESS,       // Login succeeded .
  };

  class AuthAttempt {
   public:
    AuthAttempt(const std::string& username,
                const std::string& password,
                bool add_key_attempt);
    ~AuthAttempt();

    // Copy |cryptohome_code| and |cryptohome_outcome| into this object,
    // so we can have a copy we're sure to own, and can make available
    // on the IO thread.  Must be called from the IO thread.
    void RecordCryptohomeStatus(bool cryptohome_outcome,
                                cryptohome::MountError cryptohome_code);

    // Copy |hash| into this object so we can have a copy we're sure to own
    // and can make available on the IO thread.
    // Must be called from the IO thread.
    void RecordHash(const std::string& hash);

    bool cryptohome_complete();
    bool cryptohome_outcome();
    bool hash_obtained();
    std::string hash();
    cryptohome::MountError cryptohome_code();

    const std::string username;
    const std::string password;
    const bool add_key;

   private:
    bool cryptohome_complete_;
    bool cryptohome_outcome_;
    bool hash_obtained_;
    std::string hash_;

    cryptohome::MountError cryptohome_code_;
    DISALLOW_COPY_AND_ASSIGN(AuthAttempt);
  };

  class AuthStatusConsumer {
   public:
    virtual ~AuthStatusConsumer() {}
    // The current login attempt has ended in failure, with error.
    virtual void OnAuthenticationFailure(AuthState state) = 0;
    // The current login attempt has ended succesfully.
    virtual void OnMountSuccess(const std::string& mount_hash) = 0;
    // The current add key attempt has ended succesfully.
    virtual void OnAddKeySuccess() = 0;
  };

  explicit SupervisedUserAuthenticator(AuthStatusConsumer* consumer);

  void AuthenticateToMount(const std::string& username,
                           const std::string& password);

  void AuthenticateToCreate(const std::string& username,
                            const std::string& password);

  void AddMasterKey(const std::string& username,
                    const std::string& password,
                    const std::string& master_key);
  void Resolve();

 private:
  friend class base::RefCountedThreadSafe<SupervisedUserAuthenticator>;

  ~SupervisedUserAuthenticator();

  AuthState ResolveState();
  AuthState ResolveCryptohomeFailureState();
  AuthState ResolveCryptohomeSuccessState();
  void OnAuthenticationSuccess(const std::string& mount_hash, bool add_key);
  void OnAuthenticationFailure(AuthState state);

  scoped_ptr<AuthAttempt> current_state_;
  AuthStatusConsumer* consumer_;

  DISALLOW_COPY_AND_ASSIGN(SupervisedUserAuthenticator);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_SUPERVISED_USER_AUTHENTICATOR_H_


text:
'use strict';

/**
 * @summary The result of listing the certificates in the account.
 */
class CertificateListResult extends Array {
  /**
   * Create a CertificateListResult.
   * @member {string} [odatanextLink]
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of CertificateListResult
   *
   * @returns {object} metadata of CertificateListResult
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CertificateListResult',
      type: {
        name: 'Composite',
        className: 'CertificateListResult',
        modelProperties: {
          value: {
            required: false,
            serializedName: '',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'CertificateElementType',
                  type: {
                    name: 'Composite',
                    className: 'Certificate'
                  }
              }
            }
          },
          odatanextLink: {
            required: false,
            serializedName: 'odata\\.nextLink',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = CertificateListResult;


text:
Readage
===========

## Animated message

Readage is a simple program that will makes your message animated.

## Demo
Click here for a live demo.

### To Use

Open `message.js`

```javascript
var i =0;
function start(){
	$(".element").typed({
		strings: [
		"Oh. Hello there.^2000",
		"I'm Christo.^3000",
		"I code Readage.^2000",
		"Readage is a program that will make your message animated.^2000",
		"This is me.^2000",
		"I also tweet.^2000",
		"Mostly random and creative things.^2000",
		":)^2000",
	"I also have another blog^2000",
	"Sadly enough, ^2000 I'm also on Facebook.^2000",
	"I think that's all. ^2000 Wait. ^2000 One more thing...^2000",
	"Don't stalk. ^2000 Just ask and drop me an email.^2000"
```
Change them to your message.
## License

Readage is released under the MIT license.

## Donations

I made this in my spare time, and it's hosted on GitHub (which means I don't have any hosting costs), but if you enjoyed the theme and feel like buying me coffee, you can donate at my BTC address: 1E7ZaTc7UNNcncjVjvXf8ArbsDDy9rNWzD. Thank you very much!:smile:


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@android:color/transparent"
                android:orientation="vertical" >

    <SurfaceView
        android:id="@+id/capture_preview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <RelativeLayout
        android:id="@+id/capture_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <ImageView
            android:contentDescription="@string/app_name"
            android:id="@+id/capture_mask_top"
            android:layout_width="match_parent"
            android:layout_height="120dp"
            android:layout_alignParentTop="true"
            android:background="@color/color_161A21" />

        <RelativeLayout
            android:id="@+id/capture_crop_view"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:layout_below="@id/capture_mask_top"
            android:layout_centerHorizontal="true"
            android:background="@mipmap/qr_code_bg" >

            <ImageView
                android:contentDescription="@string/app_name"
                android:id="@+id/capture_scan_line"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_marginBottom="5dp"
                android:layout_marginTop="5dp"
                android:src="@mipmap/scan_line" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/capture_mask_bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_below="@id/capture_crop_view"
            android:background="@color/color_161A21">
            <TextView
                android:id="@+id/describe_tv"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="@dimen/dp_34"
                android:textSize="@dimen/sp_14"
                android:textColor="@color/color_ffffff"/>
            <TextView
                android:id="@id/select_album"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="@dimen/dp_150"
                android:padding="@dimen/dp_10"
                android:textSize="@dimen/sp_14"
                android:textColor="@color/color_00c400"/>

        </RelativeLayout>

        <ImageView
            android:contentDescription="@string/app_name"
            android:id="@+id/capture_mask_left"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_above="@id/capture_mask_bottom"
            android:layout_alignParentLeft="true"
            android:layout_below="@id/capture_mask_top"
            android:layout_toLeftOf="@id/capture_crop_view"
            android:background="@color/color_161A21" />

        <ImageView
            android:contentDescription="@string/app_name"
            android:id="@+id/capture_mask_right"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_above="@id/capture_mask_bottom"
            android:layout_alignParentRight="true"
            android:layout_below="@id/capture_mask_top"
            android:layout_toRightOf="@id/capture_crop_view"
            android:background="@color/color_161A21" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/dp_52">

        <ImageView
            android:contentDescription="@string/app_name"
            android:id="@id/left_img"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:paddingLeft="@dimen/dp_10"
            android:paddingRight="@dimen/dp_10"
            android:src="@mipmap/back_white"/>
        <TextView
            android:id="@+id/title_tv"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/color_ffffff"
            android:textSize="@dimen/sp_18"
            android:layout_centerInParent="true" />
        <ImageView
            android:contentDescription="@string/app_name"
            android:id="@id/right_img"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:paddingLeft="@dimen/dp_20"
            android:paddingRight="@dimen/dp_10"
            android:layout_alignParentRight="true"
            android:src="@mipmap/camera2x"
            android:visibility="gone"/>
    </RelativeLayout>

</RelativeLayout>


text:
package reactor.core.publisher;

import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import reactor.core.CoreSubscriber;
import reactor.core.Scannable;
import reactor.util.annotation.Nullable;

/**
 *
 * {@link InnerProducer} is a {@link reactor.core.Scannable} {@link Subscription} that produces
 * data to an {@link #actual()} {@link Subscriber}
 *
 * @param <O> output operator produced type
 *
 * @author Stephane Maldini
 */
interface InnerProducer<O>
		extends Scannable, Subscription {

	CoreSubscriber<? super O> actual();

	@Override
	@Nullable
	default Object scanUnsafe(Attr key){
		if (key == Attr.ACTUAL) {
			return actual();
		}
		return null;
	}

}


text:
package com.contrastsecurity.cassandra.migration.resolver.java;

import com.contrastsecurity.cassandra.migration.CassandraMigrationException;
import com.contrastsecurity.cassandra.migration.api.JavaMigration;
import com.contrastsecurity.cassandra.migration.resolver.MigrationExecutor;
import com.datastax.driver.core.Session;

/**
 * Adapter for executing migrations implementing JavaMigration.
 */
public class JavaMigrationExecutor implements MigrationExecutor {
    /**
     * The JavaMigration to execute.
     */
    private final JavaMigration javaMigration;

    /**
     * Creates a new JdbcMigrationExecutor.
     *
     * @param javaMigration The JdbcMigration to execute.
     */
    public JavaMigrationExecutor(JavaMigration javaMigration) {
        this.javaMigration = javaMigration;
    }

    @Override
    public void execute(Session session) {
        try {
            javaMigration.migrate(session);
        } catch (Exception e) {
            throw new CassandraMigrationException("Migration failed !", e);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using JSIL.Translator;

namespace JSIL.Tests {
    public class ParsedTypeInformation {
        public readonly string Name;
        public readonly UInt32 TypeId;
        public readonly bool IsSingleton;
        public readonly UInt32? ParentTypeId;
        public ParsedTypeInformation ParentType;
        public readonly string[] Traits;

        public ParsedTypeInformation (
            string name,
            UInt32 typeId, bool isSingleton, UInt32? parentTypeId,
            string[] traits
        ) {
            Name = name;
            TypeId = typeId;
            IsSingleton = isSingleton;
            ParentTypeId = parentTypeId;
            Traits = traits;
        }

        public ParsedTypeInformation (
            string name,
            UInt32 typeId, bool isSingleton
        ) {
            Name = name;
            TypeId = typeId;
            IsSingleton = isSingleton;
            ParentTypeId = null;
            ParentType = null;
            Traits = null;
        }

        public override string ToString () {
            return ToString(true);
        }

        public string ToString (bool shortForm) {
            string result;

            if (shortForm) {
                result = String.Format(
                    "{0} {2}0x{1:X8}{3}",
                    Name ?? "?", TypeId,
                    IsSingleton ? "<" : "[",
                    IsSingleton ? ">" : "]"
                );
            } else {
                result = String.Format(
                    "{0} {4}0x{1:X8}{5} Parent=({2}) Traits={{{3}}}",
                    Name ?? "?", TypeId, ParentType, String.Join(", ", Traits ?? new string[0]),
                    IsSingleton ? "<" : "[",
                    IsSingleton ? ">" : "]"
                );
            }

            return result;
        }
    }

    public class PerformanceAnalysisData {
        private static readonly Regex TaggedObjectIndexToNameMapping = new Regex(
            @"//(\W*)TAGGED_OBJECT_(?'index'[0-9]*)='(?'name'[^']*)'", RegexOptions.ExplicitCapture
        );
        private static readonly Regex FunctionPrologue = new Regex(
            @"Main(\W*)\#(?'function_index'[0-9]*)(\W*)TAGGED_OBJECT_(?'object_index'[0-9]*)(\W*)\(line", RegexOptions.ExplicitCapture
        );
        private static readonly Regex TaggedObjectType = new Regex(
            @"\#(?'function_index'[ 0-9]+):([ 0-9]+):([ 0-9]+)getgname(.*)" +
            "\"\\$\\$ObjectToTag\"" +
            @"(\W*)typeset(\W*)([ 0-9]+):(\W*)(void|object\[([0-9]*)\](\W*)(?'class_token'[\[\<])0x(?'type_id'([0-9A-F]+))[\]\>])",
            RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase
        );
        private static readonly Regex TypeInfoPrologue = new Regex(
            @"(?'class_token'[\[\<])0x(?'type_id'[0-9A-F]+)[\]\>](\W*):(\W*)(\(null\)|((?'parent_class_token'[\[\<])0x(?'parent_type_id'[0-9A-F]+)[\]\>]))(\W*)(?'traits'[^{]+)\{",
            RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase
        );

        public readonly Dictionary<UInt32, String> TaggedObjectTypesByID;
        public readonly Dictionary<String, UInt32> TaggedObjectTypeIDsByName;
        public readonly Dictionary<UInt32, ParsedTypeInformation> TypeInformationByID;
        public readonly string Output;
        public readonly string RawStdErr;
        public readonly string RawTypeInformation;

        public PerformanceAnalysisData (ComparisonTest test, Func<Configuration> makeConfiguration = null) {
            string trailingOutput;
            string stderr;
            string tempS;
            long tempL;

            Output = test.RunJavascript(
                null, out tempS, out tempL, out tempL, out stderr, out trailingOutput,
                makeConfiguration: makeConfiguration
            );

            var singletonTypeIDs = new HashSet<UInt32>();
            TaggedObjectTypesByID = ParseTaggedObjectTypes(stderr, trailingOutput, singletonTypeIDs);
            TypeInformationByID = ParseTypeInformation(trailingOutput, TaggedObjectTypesByID, singletonTypeIDs);

            TaggedObjectTypeIDsByName = new Dictionary<string, uint>(TaggedObjectTypesByID.Count);
            foreach (var kvp in TaggedObjectTypesByID) {
                if (!TaggedObjectTypeIDsByName.ContainsKey(kvp.Value))
                    TaggedObjectTypeIDsByName.Add(kvp.Value, kvp.Key);
            }

            RawStdErr = stderr;
            RawTypeInformation = trailingOutput;
        }

        public ParsedTypeInformation this[string name] {
            get {
                return TypeInformationByID[TaggedObjectTypeIDsByName[name]];
            }
        }

        private Dictionary<UInt32, string> ParseTaggedObjectTypes (string stderr, string trailingOutput, HashSet<UInt32> singletonTypeIDs) {
            var taggedObjectIndexesToNames = new Dictionary<int, string>();
            foreach (Match match in TaggedObjectIndexToNameMapping.Matches(stderr))
                taggedObjectIndexesToNames.Add(int.Parse(match.Groups["index"].Value), match.Groups["name"].Value);

            var functionIndicesToTaggedObjectIndexes = new Dictionary<int, int>();
            foreach (Match match in FunctionPrologue.Matches(trailingOutput))
                functionIndicesToTaggedObjectIndexes.Add(int.Parse(match.Groups["function_index"].Value), int.Parse(match.Groups["object_index"].Value));

            var result = new Dictionary<UInt32, string>();
            foreach (Match match in TaggedObjectType.Matches(trailingOutput)) {
                var functionIndex = int.Parse(match.Groups["function_index"].Value);
                var taggedObjectIndex = functionIndicesToTaggedObjectIndexes[functionIndex];

                if (match.Groups["type_id"].Success) {
                    var typeId = UInt32.Parse(match.Groups["type_id"].Value, NumberStyles.HexNumber);

                    if (!result.ContainsKey(typeId))
                        result.Add(
                            typeId, taggedObjectIndexesToNames[taggedObjectIndex]
                        );

                    if (match.Groups["class_token"].Value == "<")
                        singletonTypeIDs.Add(typeId);
                } else {
                    // Inexplicably this object has no type.
                    result.Add(0xFFFFFFFF, taggedObjectIndexesToNames[taggedObjectIndex]);
                }
            }

            if (taggedObjectIndexesToNames.Count != result.Count) {
                foreach (var kvp in taggedObjectIndexesToNames) {
                    if (!functionIndicesToTaggedObjectIndexes.Any(
                            (kvp2) => kvp2.Value == kvp.Key
                        ))
                        Console.Error.WriteLine("Never got function index for '{0}'", kvp.Value);

                    if (!result.Any(
                            (kvp2) => kvp2.Value == kvp.Value
                        ))
                        Console.Error.WriteLine("Never got type id for '{0}'", kvp.Value);
                }
            }

            return result;
        }

        private Dictionary<UInt32, ParsedTypeInformation> ParseTypeInformation (string trailingOutput, Dictionary<UInt32, string> taggedObjectTypes, HashSet<UInt32> singletonTypeIDs) {
            var result = new Dictionary<UInt32, ParsedTypeInformation>();

            foreach (Match match in TypeInfoPrologue.Matches(trailingOutput)) {
                UInt32? parentTypeId = null;

                var typeId = UInt32.Parse(match.Groups["type_id"].Value, NumberStyles.HexNumber);
                var typeIsSingleton = match.Groups["class_token"].Value == "<";

                if (match.Groups["parent_class_token"].Success)
                    parentTypeId = UInt32.Parse(match.Groups["parent_type_id"].Value, NumberStyles.HexNumber);

                var traits = match.Groups["traits"].Value.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                string typeName;
                if (!taggedObjectTypes.TryGetValue(typeId, out typeName))
                    typeName = null;

                result.Add(typeId, new ParsedTypeInformation(
                    typeName, typeId, typeIsSingleton, parentTypeId, traits
                ));
            }

            foreach (var kvp in result) {
                if (!kvp.Value.ParentTypeId.HasValue)
                    continue;

                ParsedTypeInformation parentType;
                if (!result.TryGetValue(kvp.Value.ParentTypeId.Value, out parentType))
                    parentType = null;

                kvp.Value.ParentType = parentType;
            }

            // If js.exe didn't dump type information for this type, infer the singleton status from the other data we got
            //  and add an object for it. Not sure why this happens.

            foreach (var kvp in taggedObjectTypes) {
                if (!result.ContainsKey(kvp.Key))
                    result.Add(kvp.Key, new ParsedTypeInformation(kvp.Value, kvp.Key, singletonTypeIDs.Contains(kvp.Key)));
            }

            return result;
        }

        public void Dump (TextWriter output, bool dumpRaw = false) {
            bool errors = false;

            foreach (var kvp in TaggedObjectTypesByID) {
                if (TypeInformationByID.ContainsKey(kvp.Key)) {
                    output.WriteLine(TypeInformationByID[kvp.Key].ToString(false));
                } else {
                    output.WriteLine("No type info for {0} ({1:X8})", kvp.Value, kvp.Key);
                    errors = true;
                }
            }

            if (errors || dumpRaw) {
                output.WriteLine("// Stderr follows:");
                output.Write(RawStdErr);
                output.WriteLine("// Raw type information follows:");
                output.Write(RawTypeInformation);
            }
        }
    }
}


text:
//
// This file is part of - WebExtras
// Copyright (C) 2016 Mihir Mone
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using Newtonsoft.Json;

namespace WebExtras.Core
{
  /// <summary>
  ///   Reference Article http://www.codeproject.com/KB/tips/SerializedObjectCloner.aspx
  ///   Provides a method for performing a deep copy of an object.
  ///   Binary Serialization is used to perform the copy.
  /// </summary>
  [Serializable]
  public static class ObjectExtensions
  {
    /// <summary>
    ///   Perform a deep Copy of the object. Note that the object to be cloned
    ///   must be seriablizable i.e it and all it's children must be decorated
    ///   the the [Serialize] decorator
    /// </summary>
    /// <typeparam name="T">The type of object being copied.</typeparam>
    /// <param name="source">The object instance to copy.</param>
    /// <returns>The copied object.</returns>
    public static T DeepClone<T>(this T source)
    {
      if (!typeof(T).IsSerializable)
      {
        throw new ArgumentException("The type must be serializable.", "source");
      }

      // Don't serialize a null object, simply return the default for that object
      if (ReferenceEquals(source, null))
      {
        return default(T);
      }

      IFormatter formatter = new BinaryFormatter();
      Stream stream = new MemoryStream();
      using (stream)
      {
        formatter.Serialize(stream, source);
        stream.Seek(0, SeekOrigin.Begin);
        return (T) formatter.Deserialize(stream);
      }
    }

    /// <summary>
    ///   Convert current object to it's JSON representation
    /// </summary>
    /// <param name="source">Current object</param>
    /// <returns>JSON object</returns>
    public static string ToJson(this object source)
    {
      return ToJson(source, WebExtrasSettings.JsonSerializerSettings);
    }

    /// <summary>
    ///   Convert current object to it's JSON representation
    /// </summary>
    /// <param name="source">Current object</param>
    /// <param name="settings">JSON serialisation settings</param>
    /// <returns>JSON object</returns>
    public static string ToJson(this object source, JsonSerializerSettings settings)
    {
      return JsonConvert.SerializeObject(source, settings);
    }
  }
}


text:
from django.conf import settings
from django.db import migrations

class Migration(migrations.Migration):
    atomic = False

    dependencies = [
        ('pgroonga', '0002_html_escape_subject'),
    ]

    database_setting = settings.DATABASES["default"]
    operations = [
        migrations.RunSQL([("""
DO $$BEGIN
EXECUTE format('ALTER ROLE %%I SET search_path TO %%L,public', %(USER)s, %(SCHEMA)s);

SET search_path = %(SCHEMA)s,public;

DROP INDEX zerver_message_search_pgroonga;
END$$
""", database_setting), """

CREATE INDEX CONCURRENTLY zerver_message_search_pgroonga ON zerver_message
  USING pgroonga(search_pgroonga pgroonga_text_full_text_search_ops_v2);
"""],
                          [("""
DO $$BEGIN
EXECUTE format('ALTER ROLE %%I SET search_path TO %%L,public,pgroonga,pg_catalog', %(USER)s, %(SCHEMA)s);

SET search_path = %(SCHEMA)s,public,pgroonga,pg_catalog;

DROP INDEX zerver_message_search_pgroonga;
END$$
""", database_setting), """

CREATE INDEX CONCURRENTLY zerver_message_search_pgroonga ON zerver_message
  USING pgroonga(search_pgroonga pgroonga.text_full_text_search_ops);
        """]),
    ]


text:
#pragma once
#include <aws/ecs/ECS_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ecs/model/Setting.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace ECS
{
namespace Model
{
  class AWS_ECS_API ListAccountSettingsResult
  {
  public:
    ListAccountSettingsResult();
    ListAccountSettingsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    ListAccountSettingsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The account settings for the resource.

     */
    inline const Aws::Vector<Setting>& GetSettings() const{ return m_settings; }

    /**
     *
The account settings for the resource.

     */
    inline void SetSettings(const Aws::Vector<Setting>& value) { m_settings = value; }

    /**
     *
The account settings for the resource.

     */
    inline void SetSettings(Aws::Vector<Setting>&& value) { m_settings = std::move(value); }

    /**
     *
The account settings for the resource.

     */
    inline ListAccountSettingsResult& WithSettings(const Aws::Vector<Setting>& value) { SetSettings(value); return *this;}

    /**
     *
The account settings for the resource.

     */
    inline ListAccountSettingsResult& WithSettings(Aws::Vector<Setting>&& value) { SetSettings(std::move(value)); return *this;}

    /**
     *
The account settings for the resource.

     */
    inline ListAccountSettingsResult& AddSettings(const Setting& value) { m_settings.push_back(value); return *this; }

    /**
     *
The account settings for the resource.

     */
    inline ListAccountSettingsResult& AddSettings(Setting&& value) { m_settings.push_back(std::move(value)); return *this; }

    /**
     *
The nextToken value to include in a future
     * ListAccountSettings request. When the results of a
     * ListAccountSettings request exceed maxResults, this
     * value can be used to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
The nextToken value to include in a future
     * ListAccountSettings request. When the results of a
     * ListAccountSettings request exceed maxResults, this
     * value can be used to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }

    /**
     *
The nextToken value to include in a future
     * ListAccountSettings request. When the results of a
     * ListAccountSettings request exceed maxResults, this
     * value can be used to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }

    /**
     *
The nextToken value to include in a future
     * ListAccountSettings request. When the results of a
     * ListAccountSettings request exceed maxResults, this
     * value can be used to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline void SetNextToken(const char* value) { m_nextToken.assign(value); }

    /**
     *
The nextToken value to include in a future
     * ListAccountSettings request. When the results of a
     * ListAccountSettings request exceed maxResults, this
     * value can be used to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline ListAccountSettingsResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
The nextToken value to include in a future
     * ListAccountSettings request. When the results of a
     * ListAccountSettings request exceed maxResults, this
     * value can be used to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline ListAccountSettingsResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
The nextToken value to include in a future
     * ListAccountSettings request. When the results of a
     * ListAccountSettings request exceed maxResults, this
     * value can be used to retrieve the next page of results. This value is
     * null when there are no more results to return.

     */
    inline ListAccountSettingsResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:

    Aws::Vector<Setting> m_settings;

    Aws::String m_nextToken;
  };

} // namespace Model
} // namespace ECS
} // namespace Aws


text:
/* ###
 * IP: GHIDRA
 *
 * 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.
 */
package ghidra.app.util.html;

import java.awt.Color;

public class EmptyDataTypeLine extends DataTypeLine implements PlaceHolderLine {
	public EmptyDataTypeLine() {
		super("", "", "", null);
	}

	@Override
	public ValidatableLine copy() {
		return new EmptyDataTypeLine();
	}

	@Override
	public void updateColor(ValidatableLine otherValidatableLine, Color invalidColor) {
		if (invalidColor == null) {
			throw new NullPointerException("Color cannot be null");
		}

		if (otherValidatableLine == null || (otherValidatableLine instanceof EmptyDataTypeLine)) {
			return;
		}

		// since we are the empty line, the other line is all a mismatch
		otherValidatableLine.setTextColor(invalidColor);
	}

	boolean matches(DataTypeLine otherLine) {
		return false;
	}

	@Override
	boolean matchesName(String otherName) {
		return false;
	}

	@Override
	boolean matchesType(String otherType) {
		return false;
	}

	@Override
	boolean matchesComment(String otherComment) {
		return false;
	}

	@Override
	public boolean isValidated() {
		return true;
	}

	@Override
	public String toString() {
		return "<Empty Line>";
	}
}


text:
require 'spec_helper'

describe Profile do
  it { should belong_to :citizen }

  describe "#name" do
    let(:citizen) { FactoryGirl.create(:citizen) }

    it "returns the full name of the citizen" do
      citizen.name.should == "Erkki Esimerkki"
    end
  end
end


text:
class AddBitbucketAccessTokenToUsers < ActiveRecord::Migration
  def change
    add_column :users, :encrypted_bitbucket_access_token, :string
    add_column :users, :encrypted_bitbucket_access_token_salt, :string
    add_column :users, :encrypted_bitbucket_access_token_iv, :string
    add_column :users, :encrypted_bitbucket_access_token_secret, :string
    add_column :users, :encrypted_bitbucket_access_token_secret_salt, :string
    add_column :users, :encrypted_bitbucket_access_token_secret_iv, :string
  end
end


text:
export default function compareArrays(a, b, precision) {

	if (a === b) {
		return true
	} else if (a.length !== b.length) {
		return false
	} else {
		precision = precision === undefined ? 1 : precision
		var step = ~~(a.length / (a.length * precision))
		for (var i = 0, l = a.length; i<l; i+=step) if (a[i] !== b[i]) return false
		return true
	}

}


text:
var express = require('express');
var router = express.Router();

//TODO: where should this go?
// defines the order, labels, and urls for the header nav
var navInfo = [
  {name: 'Home', url: '/'},
  {name: 'Projects', url: '/projects'},
  {name: 'Contact', url: '/contact'},
  {name: 'About', url: '/about'}
];

function renderHelper(url, template) {
  var nav = [];
  for(var i = 0; i < navInfo.length; i++) {
    nav.push({info: navInfo[i], active: url === navInfo[i].url});
  }

  return function(req, res) {
    res.render(template, {nav: nav});
  };
}

router.get('/', renderHelper('/', 'index'));

router.get('/projects', renderHelper('/projects', 'projects'));

router.get('/contact', renderHelper('/contact', 'contact'));

router.get('/about', renderHelper('/about', 'about'));

module.exports = router;


text:
package org.anddev.andengine.entity.layer.tiled.tmx;

import org.anddev.andengine.entity.layer.tiled.tmx.util.constants.TMXConstants;
import org.anddev.andengine.entity.layer.tiled.tmx.util.exception.TMXParseException;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.opengl.texture.TextureFactory;
import org.anddev.andengine.opengl.texture.TextureManager;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.Texture.TextureFormat;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.opengl.texture.region.TextureRegionFactory;
import org.anddev.andengine.opengl.texture.source.AssetTextureSource;
import org.anddev.andengine.opengl.texture.source.decorator.ColorKeyTextureSourceDecorator;
import org.anddev.andengine.opengl.texture.source.decorator.shape.RectangleTextureSourceDecoratorShape;
import org.anddev.andengine.util.SAXUtils;
import org.xml.sax.Attributes;

import android.content.Context;
import android.graphics.Color;
import android.util.SparseArray;

/**
 * @author Nicolas Gramlich
 * @since 19:03:24 - 20.07.2010
 */
public class TMXTileSet implements TMXConstants {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Fields
	// ===========================================================

	private final int mFirstGlobalTileID;
	private final String mName;
	private final int mTileWidth;
	private final int mTileHeight;

	private String mImageSource;
	private Texture mTexture;
	private final TextureOptions mTextureOptions;

	private int mTilesHorizontal;
	@SuppressWarnings("unused")
	private int mTilesVertical;

	private final int mSpacing;
	private final int mMargin;

	private final SparseArray<TMXProperties<TMXTileProperty>> mTMXTileProperties = new SparseArray<TMXProperties<TMXTileProperty>>();
	// ===========================================================
	// Constructors
	// ===========================================================

	TMXTileSet(final Attributes pAttributes, final TextureOptions pTextureOptions) {
		this(SAXUtils.getIntAttribute(pAttributes, TAG_TILESET_ATTRIBUTE_FIRSTGID, 1), pAttributes, pTextureOptions);
	}

	TMXTileSet(final int pFirstGlobalTileID, final Attributes pAttributes, final TextureOptions pTextureOptions) {
		this.mFirstGlobalTileID = SAXUtils.getIntAttribute(pAttributes, TAG_TILESET_ATTRIBUTE_FIRSTGID, 1);
		this.mName = pAttributes.getValue("", TAG_TILESET_ATTRIBUTE_NAME);
		this.mTileWidth = SAXUtils.getIntAttributeOrThrow(pAttributes, TAG_TILESET_ATTRIBUTE_TILEWIDTH);
		this.mTileHeight = SAXUtils.getIntAttributeOrThrow(pAttributes, TAG_TILESET_ATTRIBUTE_TILEHEIGHT);
		this.mSpacing = SAXUtils.getIntAttribute(pAttributes, TAG_TILESET_ATTRIBUTE_SPACING, 0);
		this.mMargin = SAXUtils.getIntAttribute(pAttributes, TAG_TILESET_ATTRIBUTE_MARGIN, 0);

		this.mTextureOptions = pTextureOptions;
	}

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	public final int getFirstGlobalTileID() {
		return this.mFirstGlobalTileID;
	}

	public final String getName() {
		return this.mName;
	}

	public final int getTileWidth() {
		return this.mTileWidth;
	}

	public final int getTileHeight() {
		return this.mTileHeight;
	}

	public Texture getTexture() {
		return this.mTexture;
	}

	public void setImageSource(final Context pContext, final TextureManager pTextureManager, final Attributes pAttributes) throws TMXParseException {
		this.mImageSource = pAttributes.getValue("", TAG_IMAGE_ATTRIBUTE_SOURCE);

		final AssetTextureSource assetTextureSource = new AssetTextureSource(pContext, this.mImageSource);
		this.mTilesHorizontal = TMXTileSet.determineCount(assetTextureSource.getWidth(), this.mTileWidth, this.mMargin, this.mSpacing);
		this.mTilesVertical = TMXTileSet.determineCount(assetTextureSource.getHeight(), this.mTileHeight, this.mMargin, this.mSpacing);
		this.mTexture = TextureFactory.createForTextureSourceSize(TextureFormat.RGBA_8888, assetTextureSource, this.mTextureOptions); // TODO Make TextureFormat variable

		final String transparentColor = SAXUtils.getAttribute(pAttributes, TAG_IMAGE_ATTRIBUTE_TRANS, null);
		if(transparentColor == null) {
			TextureRegionFactory.createFromSource(this.mTexture, assetTextureSource, 0, 0);
		} else {
			try{
				final int color = Color.parseColor((transparentColor.charAt(0) == '#') ? transparentColor : "#" + transparentColor);
				TextureRegionFactory.createFromSource(this.mTexture, new ColorKeyTextureSourceDecorator(assetTextureSource, RectangleTextureSourceDecoratorShape.getDefaultInstance(), color), 0, 0);
			} catch (final IllegalArgumentException e) {
				throw new TMXParseException("Illegal value: '" + transparentColor + "' for attribute 'trans' supplied!", e);
			}
		}
		pTextureManager.loadTexture(this.mTexture);
	}

	public String getImageSource() {
		return this.mImageSource;
	}

	public SparseArray<TMXProperties<TMXTileProperty>> getTMXTileProperties() {
		return this.mTMXTileProperties;
	}

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	// ===========================================================
	// Methods
	// ===========================================================

	public TMXProperties<TMXTileProperty> getTMXTilePropertiesFromGlobalTileID(final int pGlobalTileID) {
		final int localTileID = pGlobalTileID - this.mFirstGlobalTileID;
		return this.mTMXTileProperties.get(localTileID);
	}

	public void addTMXTileProperty(final int pLocalTileID, final TMXTileProperty pTMXTileProperty) {
		final TMXProperties<TMXTileProperty> existingProperties = this.mTMXTileProperties.get(pLocalTileID);
		if(existingProperties != null) {
			existingProperties.add(pTMXTileProperty);
		} else {
			final TMXProperties<TMXTileProperty> newProperties = new TMXProperties<TMXTileProperty>();
			newProperties.add(pTMXTileProperty);
			this.mTMXTileProperties.put(pLocalTileID, newProperties);
		}
	}

	public TextureRegion getTextureRegionFromGlobalTileID(final int pGlobalTileID) {
		final int localTileID = pGlobalTileID - this.mFirstGlobalTileID;
		final int tileColumn = localTileID % this.mTilesHorizontal;
		final int tileRow = localTileID / this.mTilesHorizontal;

		final int texturePositionX = this.mMargin + (this.mSpacing + this.mTileWidth) * tileColumn;
		final int texturePositionY = this.mMargin + (this.mSpacing + this.mTileHeight) * tileRow;

		return new TextureRegion(this.mTexture, texturePositionX, texturePositionY, this.mTileWidth, this.mTileHeight);
	}

	private static int determineCount(final int pTotalExtent, final int pTileExtent, final int pMargin, final int pSpacing) {
		int count = 0;
		int remainingExtent = pTotalExtent;

		remainingExtent -= pMargin * 2;

		while(remainingExtent > 0) {
			remainingExtent -= pTileExtent;
			remainingExtent -= pSpacing;
			count++;
		}

		return count;
	}

	// ===========================================================
	// Inner and Anonymous Classes
	// ===========================================================
}


text:
void foo(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5,obsoleted=10.7), availability(ios,introduced=3.2,deprecated=4.1)));

// RUN: c-index-test -test-load-source all %s > %t
// RUN: FileCheck -check-prefix=CHECK-1 %s < %t
// RUN: FileCheck -check-prefix=CHECK-2 %s < %t
// CHECK-1: (ios, introduced=3.2, deprecated=4.1)
// CHECK-2: (macosx, introduced=10.4, deprecated=10.5, obsoleted=10.7)


text:
from pyspark.resource.requests import TaskResourceRequest, TaskResourceRequests, \
    ExecutorResourceRequests, ExecutorResourceRequest

class ResourceProfile(object):

    """
    Resource profile to associate with an RDD. A :class:`pyspark.resource.ResourceProfile`
    allows the user to specify executor and task requirements for an RDD that will get
    applied during a stage. This allows the user to change the resource requirements between
    stages. This is meant to be immutable so user cannot change it after building.

    .. versionadded:: 3.1.0

    Notes
    -----
    This API is evolving.
    """

    def __init__(self, _java_resource_profile=None, _exec_req={}, _task_req={}):
        if _java_resource_profile is not None:
            self._java_resource_profile = _java_resource_profile
        else:
            self._java_resource_profile = None
            self._executor_resource_requests = _exec_req
            self._task_resource_requests = _task_req

    @property
    def id(self):
        if self._java_resource_profile is not None:
            return self._java_resource_profile.id()
        else:
            raise RuntimeError("SparkContext must be created to get the id, get the id "
                               "after adding the ResourceProfile to an RDD")

    @property
    def taskResources(self):
        if self._java_resource_profile is not None:
            taskRes = self._java_resource_profile.taskResourcesJMap()
            result = {}
            for k, v in taskRes.items():
                result[k] = TaskResourceRequest(v.resourceName(), v.amount())
            return result
        else:
            return self._task_resource_requests

    @property
    def executorResources(self):
        if self._java_resource_profile is not None:
            execRes = self._java_resource_profile.executorResourcesJMap()
            result = {}
            for k, v in execRes.items():
                result[k] = ExecutorResourceRequest(v.resourceName(), v.amount(),
                                                    v.discoveryScript(), v.vendor())
            return result
        else:
            return self._executor_resource_requests

class ResourceProfileBuilder(object):

    """
    Resource profile Builder to build a resource profile to associate with an RDD.
    A ResourceProfile allows the user to specify executor and task requirements for
    an RDD that will get applied during a stage. This allows the user to change the
    resource requirements between stages.

    .. versionadded:: 3.1.0

    Notes
    -----
    This API is evolving.
    """

    def __init__(self):
        from pyspark.context import SparkContext
        _jvm = SparkContext._jvm
        if _jvm is not None:
            self._jvm = _jvm
            self._java_resource_profile_builder = \
                _jvm.org.apache.spark.resource.ResourceProfileBuilder()
        else:
            self._jvm = None
            self._java_resource_profile_builder = None
            self._executor_resource_requests = {}
            self._task_resource_requests = {}

    def require(self, resourceRequest):
        if isinstance(resourceRequest, TaskResourceRequests):
            if self._java_resource_profile_builder is not None:
                if resourceRequest._java_task_resource_requests is not None:
                    self._java_resource_profile_builder.require(
                        resourceRequest._java_task_resource_requests)
                else:
                    taskReqs = TaskResourceRequests(self._jvm, resourceRequest.requests)
                    self._java_resource_profile_builder.require(
                        taskReqs._java_task_resource_requests)
            else:
                self._task_resource_requests.update(resourceRequest.requests)
        else:
            if self._java_resource_profile_builder is not None:
                if resourceRequest._java_executor_resource_requests is not None:
                    self._java_resource_profile_builder.require(
                        resourceRequest._java_executor_resource_requests)
                else:
                    execReqs = ExecutorResourceRequests(self._jvm, resourceRequest.requests)
                    self._java_resource_profile_builder.require(
                        execReqs._java_executor_resource_requests)
            else:
                self._executor_resource_requests.update(resourceRequest.requests)
        return self

    def clearExecutorResourceRequests(self):
        if self._java_resource_profile_builder is not None:
            self._java_resource_profile_builder.clearExecutorResourceRequests()
        else:
            self._executor_resource_requests = {}

    def clearTaskResourceRequests(self):
        if self._java_resource_profile_builder is not None:
            self._java_resource_profile_builder.clearTaskResourceRequests()
        else:
            self._task_resource_requests = {}

    @property
    def taskResources(self):
        if self._java_resource_profile_builder is not None:
            taskRes = self._java_resource_profile_builder.taskResourcesJMap()
            result = {}
            for k, v in taskRes.items():
                result[k] = TaskResourceRequest(v.resourceName(), v.amount())
            return result
        else:
            return self._task_resource_requests

    @property
    def executorResources(self):
        if self._java_resource_profile_builder is not None:
            result = {}
            execRes = self._java_resource_profile_builder.executorResourcesJMap()
            for k, v in execRes.items():
                result[k] = ExecutorResourceRequest(v.resourceName(), v.amount(),
                                                    v.discoveryScript(), v.vendor())
            return result
        else:
            return self._executor_resource_requests

    @property
    def build(self):
        if self._java_resource_profile_builder is not None:
            jresourceProfile = self._java_resource_profile_builder.build()
            return ResourceProfile(_java_resource_profile=jresourceProfile)
        else:
            return ResourceProfile(_exec_req=self._executor_resource_requests,
                                   _task_req=self._task_resource_requests)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hefezopf.Fundament.Schema {
    /// <summary>
    /// Basetype for object that have a schema.
    /// </summary>
    public class HZDBSchemaOwned
        : HZNamed {
        /// <summary>
        /// Initializes a new instance of the <see cref="HZDBSchemaOwned"/> class.
        /// </summary>
        public HZDBSchemaOwned() {
        }

        /// <summary>
        /// Gets or sets the schema.
        /// </summary>
        public string Schema { get; set; }
    }
}


text:
package org.freud.java.matcher;

import org.hamcrest.Description;
import org.hamcrest.Matcher;

public final class FreudDsl {
    private FreudDsl() {
        // static utility
    }

    public static <T> Matcher<T> trueMatcher() {
        return new FreudExtendedMatcher<T>() {

            @Override
            protected boolean matchesSafely(final T item) {
                return true;
            }

            @Override
            public void describeTo(final Description description) {
                description.appendText("TRUE");
            }
        };
    }

    public static <T> FreudExtendedMatcher<T> no(final Matcher<T> matcher) {
        return new FreudExtendedMatcher<T>() {
            @Override
            public boolean matchesSafely(final T item) {
                return !matcher.matches(item);
            }

            @Override
            public void describeTo(final Description description) {
                description.appendText("NO (");
                matcher.describeTo(description);
                description.appendText(")");
            }
        };
    }

    public static <T> FreudExtendedMatcher<T> and(final Matcher<T> matcher1, final Matcher<T> matcher2) {
        return new FreudExtendedMatcher<T>() {
            @Override
            public boolean matchesSafely(final T item) {
                return matcher1.matches(item) && matcher2.matches(item);
            }

            @Override
            public void describeTo(final Description description) {
                description.appendText("(");
                matcher1.describeTo(description);
                description.appendText(") AND (");
                matcher2.describeTo(description);
                description.appendText(")");
            }
        };
    }

    public static <T> FreudExtendedMatcher<T> or(final Matcher<T> matcher1, final Matcher<T> matcher2) {
        return new FreudExtendedMatcher<T>() {
            @Override
            public boolean matchesSafely(final T item) {
                return matcher1.matches(item) || matcher2.matches(item);
            }

            @Override
            public void describeTo(final Description description) {
                description.appendText("(");
                matcher1.describeTo(description);
                description.appendText(") OR (");
                matcher2.describeTo(description);
                description.appendText(")");
            }
        };
    }
}