text:
package java.util.zip;

import java.io.FilterInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.EOFException;

/**
 * This class implements a stream filter for uncompressing data in the
 * "deflate" compression format. It is also used as the basis for other
 * decompression filters, such as GZIPInputStream.
 *
 * @see         Inflater
 * @author      David Connelly
 */
public
class InflaterInputStream extends FilterInputStream {
    /**
     * Decompressor for this stream.
     */
    protected Inflater inf;

    /**
     * Input buffer for decompression.
     */
    protected byte[] buf;

    /**
     * Length of input buffer.
     */
    protected int len;

    private boolean closed = false;
    // this flag is set to true after EOF has reached
    private boolean reachEOF = false;

    /**
     * Check to make sure that this stream has not been closed
     */
    private void ensureOpen() throws IOException {
        if (closed) {
            throw new IOException("Stream closed");
        }
    }

    /**
     * Creates a new input stream with the specified decompressor and
     * buffer size.
     * @param in the input stream
     * @param inf the decompressor ("inflater")
     * @param size the input buffer size
     * @exception IllegalArgumentException if {@code size <= 0}
     */
    public InflaterInputStream(InputStream in, Inflater inf, int size) {
        super(in);
        if (in == null || inf == null) {
            throw new NullPointerException();
        } else if (size <= 0) {
            throw new IllegalArgumentException("buffer size <= 0");
        }
        this.inf = inf;
        buf = new byte[size];
    }

    /**
     * Creates a new input stream with the specified decompressor and a
     * default buffer size.
     * @param in the input stream
     * @param inf the decompressor ("inflater")
     */
    public InflaterInputStream(InputStream in, Inflater inf) {
        this(in, inf, 512);
    }

    boolean usesDefaultInflater = false;

    /**
     * Creates a new input stream with a default decompressor and buffer size.
     * @param in the input stream
     */
    public InflaterInputStream(InputStream in) {
        this(in, new Inflater());
        usesDefaultInflater = true;
    }

    private byte[] singleByteBuf = new byte[1];

    /**
     * Reads a byte of uncompressed data. This method will block until
     * enough input is available for decompression.
     * @return the byte read, or -1 if end of compressed input is reached
     * @exception IOException if an I/O error has occurred
     */
    public int read() throws IOException {
        ensureOpen();
        return read(singleByteBuf, 0, 1) == -1 ? -1 : Byte.toUnsignedInt(singleByteBuf[0]);
    }

    /**
     * Reads uncompressed data into an array of bytes. If len is not
     * zero, the method will block until some input can be decompressed; otherwise,
     * no bytes are read and 0 is returned.
     * @param b the buffer into which the data is read
     * @param off the start offset in the destination array b
     * @param len the maximum number of bytes read
     * @return the actual number of bytes read, or -1 if the end of the
     *         compressed input is reached or a preset dictionary is needed
     * @exception  NullPointerException If b is null.
     * @exception  IndexOutOfBoundsException If off is negative,
     * len is negative, or len is greater than
     * b.length - off
     * @exception ZipException if a ZIP format error has occurred
     * @exception IOException if an I/O error has occurred
     */
    public int read(byte[] b, int off, int len) throws IOException {
        ensureOpen();
        if (b == null) {
            throw new NullPointerException();
        } else if (off < 0 || len < 0 || len > b.length - off) {
            throw new IndexOutOfBoundsException();
        } else if (len == 0) {
            return 0;
        }
        try {
            int n;
            while ((n = inf.inflate(b, off, len)) == 0) {
                if (inf.finished() || inf.needsDictionary()) {
                    reachEOF = true;
                    return -1;
                }
                if (inf.needsInput()) {
                    fill();
                }
            }
            return n;
        } catch (DataFormatException e) {
            String s = e.getMessage();
            throw new ZipException(s != null ? s : "Invalid ZLIB data format");
        }
    }

    /**
     * Returns 0 after EOF has been reached, otherwise always return 1.
     *

     * Programs should not count on this method to return the actual number
     * of bytes that could be read without blocking.
     *
     * @return     1 before EOF and 0 after EOF.
     * @exception  IOException  if an I/O error occurs.
     *
     */
    public int available() throws IOException {
        ensureOpen();
        if (reachEOF) {
            return 0;
        } else {
            return 1;
        }
    }

    private byte[] b = new byte[512];

    /**
     * Skips specified number of bytes of uncompressed data.
     * @param n the number of bytes to skip
     * @return the actual number of bytes skipped.
     * @exception IOException if an I/O error has occurred
     * @exception IllegalArgumentException if {@code n < 0}
     */
    public long skip(long n) throws IOException {
        if (n < 0) {
            throw new IllegalArgumentException("negative skip length");
        }
        ensureOpen();
        int max = (int)Math.min(n, Integer.MAX_VALUE);
        int total = 0;
        while (total < max) {
            int len = max - total;
            if (len > b.length) {
                len = b.length;
            }
            len = read(b, 0, len);
            if (len == -1) {
                reachEOF = true;
                break;
            }
            total += len;
        }
        return total;
    }

    /**
     * Closes this input stream and releases any system resources associated
     * with the stream.
     * @exception IOException if an I/O error has occurred
     */
    public void close() throws IOException {
        if (!closed) {
            if (usesDefaultInflater)
                inf.end();
            in.close();
            closed = true;
        }
    }

    /**
     * Fills input buffer with more data to decompress.
     * @exception IOException if an I/O error has occurred
     */
    protected void fill() throws IOException {
        ensureOpen();
        len = in.read(buf, 0, buf.length);
        if (len == -1) {
            throw new EOFException("Unexpected end of ZLIB input stream");
        }
        inf.setInput(buf, 0, len);
    }

    /**
     * Tests if this input stream supports the mark and
     * reset methods. The markSupported
     * method of InflaterInputStream returns
     * false.
     *
     * @return  a boolean indicating if this stream type supports
     *          the mark and reset methods.
     * @see     java.io.InputStream#mark(int)
     * @see     java.io.InputStream#reset()
     */
    public boolean markSupported() {
        return false;
    }

    /**
     * Marks the current position in this input stream.
     *
     *
 The mark method of InflaterInputStream
     * does nothing.
     *
     * @param   readlimit   the maximum limit of bytes that can be read before
     *                      the mark position becomes invalid.
     * @see     java.io.InputStream#reset()
     */
    public synchronized void mark(int readlimit) {
    }

    /**
     * Repositions this stream to the position at the time the
     * mark method was last called on this input stream.
     *
     *
 The method reset for class
     * InflaterInputStream does nothing except throw an
     * IOException.
     *
     * @exception  IOException  if this method is invoked.
     * @see     java.io.InputStream#mark(int)
     * @see     java.io.IOException
     */
    public synchronized void reset() throws IOException {
        throw new IOException("mark/reset not supported");
    }
}


text:
.class public Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;
.super Lcom/fasterxml/jackson/databind/deser/ValueInstantiator;
.source ""

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "JsonLocationInstantiator"
.end annotation

# static fields
.field public static final instance:Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 102
    new-instance v0, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;

    invoke-direct {v0}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;-><init>()V

    sput-object v0, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->instance:Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .line 100
    invoke-direct {p0}, Lcom/fasterxml/jackson/databind/deser/ValueInstantiator;-><init>()V

    return-void
.end method

.method private static final _int(Ljava/lang/Object;)I
    .locals 1

    .line 140
    if-nez p0, :cond_0

    const/4 v0, 0x0

    return v0

    :cond_0
    move-object v0, p0

    check-cast v0, Ljava/lang/Number;

    invoke-virtual {v0}, Ljava/lang/Number;->intValue()I

    move-result v0

    return v0
.end method

.method private static final _long(Ljava/lang/Object;)J
    .locals 2

    .line 137
    if-nez p0, :cond_0

    const-wide/16 v0, 0x0

    return-wide v0

    :cond_0
    move-object v0, p0

    check-cast v0, Ljava/lang/Number;

    invoke-virtual {v0}, Ljava/lang/Number;->longValue()J

    move-result-wide v0

    return-wide v0
.end method

.method private static creatorProp(Ljava/lang/String;Lcom/fasterxml/jackson/databind/JavaType;I)Lcom/fasterxml/jackson/databind/deser/CreatorProperty;
    .locals 10

    .line 126
    new-instance v0, Lcom/fasterxml/jackson/databind/deser/CreatorProperty;

    move-object v1, p0

    move-object v2, p1

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    move v7, p2

    const/4 v8, 0x0

    const/4 v9, 0x1

    invoke-direct/range {v0 .. v9}, Lcom/fasterxml/jackson/databind/deser/CreatorProperty;-><init>(Ljava/lang/String;Lcom/fasterxml/jackson/databind/JavaType;Lcom/fasterxml/jackson/databind/PropertyName;Lcom/fasterxml/jackson/databind/jsontype/TypeDeserializer;Lcom/fasterxml/jackson/databind/util/Annotations;Lcom/fasterxml/jackson/databind/introspect/AnnotatedParameter;ILjava/lang/Object;Z)V

    return-object v0
.end method

# virtual methods
.method public canCreateFromObjectWith()Z
    .locals 1

    .line 110
    const/4 v0, 0x1

    return v0
.end method

.method public createFromObjectWith(Lcom/fasterxml/jackson/databind/DeserializationContext;[Ljava/lang/Object;)Ljava/lang/Object;
    .locals 8

    .line 132
    new-instance v0, Lcom/fasterxml/jackson/core/JsonLocation;

    const/4 v1, 0x0

    aget-object v1, p2, v1

    const/4 v2, 0x1

    aget-object v2, p2, v2

    invoke-static {v2}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->_long(Ljava/lang/Object;)J

    move-result-wide v2

    const/4 v4, 0x2

    aget-object v4, p2, v4

    invoke-static {v4}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->_long(Ljava/lang/Object;)J

    move-result-wide v4

    const/4 v6, 0x3

    aget-object v6, p2, v6

    invoke-static {v6}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->_int(Ljava/lang/Object;)I

    move-result v6

    const/4 v7, 0x4

    aget-object v7, p2, v7

    invoke-static {v7}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->_int(Ljava/lang/Object;)I

    move-result v7

    invoke-direct/range {v0 .. v7}, Lcom/fasterxml/jackson/core/JsonLocation;-><init>(Ljava/lang/Object;JJII)V

    return-object v0
.end method

.method public getFromObjectArguments(Lcom/fasterxml/jackson/databind/DeserializationConfig;)[Lcom/fasterxml/jackson/databind/deser/CreatorProperty;
    .locals 6

    .line 114
    sget-object v0, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/DeserializationConfig;->constructType(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;

    move-result-object v4

    .line 115
    sget-object v0, Ljava/lang/Long;->TYPE:Ljava/lang/Class;

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/DeserializationConfig;->constructType(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;

    move-result-object v5

    .line 116
    const/4 v0, 0x5

    new-array v0, v0, [Lcom/fasterxml/jackson/databind/deser/CreatorProperty;

    const-string v1, "sourceRef"

    const-class v2, Ljava/lang/Object;

    invoke-virtual {p1, v2}, Lcom/fasterxml/jackson/databind/DeserializationConfig;->constructType(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;

    move-result-object v2

    const/4 v3, 0x0

    invoke-static {v1, v2, v3}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->creatorProp(Ljava/lang/String;Lcom/fasterxml/jackson/databind/JavaType;I)Lcom/fasterxml/jackson/databind/deser/CreatorProperty;

    move-result-object v1

    const/4 v2, 0x0

    aput-object v1, v0, v2

    const-string v1, "byteOffset"

    const/4 v2, 0x1

    invoke-static {v1, v5, v2}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->creatorProp(Ljava/lang/String;Lcom/fasterxml/jackson/databind/JavaType;I)Lcom/fasterxml/jackson/databind/deser/CreatorProperty;

    move-result-object v1

    const/4 v2, 0x1

    aput-object v1, v0, v2

    const-string v1, "charOffset"

    const/4 v2, 0x2

    invoke-static {v1, v5, v2}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->creatorProp(Ljava/lang/String;Lcom/fasterxml/jackson/databind/JavaType;I)Lcom/fasterxml/jackson/databind/deser/CreatorProperty;

    move-result-object v1

    const/4 v2, 0x2

    aput-object v1, v0, v2

    const-string v1, "lineNr"

    const/4 v2, 0x3

    invoke-static {v1, v4, v2}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->creatorProp(Ljava/lang/String;Lcom/fasterxml/jackson/databind/JavaType;I)Lcom/fasterxml/jackson/databind/deser/CreatorProperty;

    move-result-object v1

    const/4 v2, 0x3

    aput-object v1, v0, v2

    const-string v1, "columnNr"

    const/4 v2, 0x4

    invoke-static {v1, v4, v2}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->creatorProp(Ljava/lang/String;Lcom/fasterxml/jackson/databind/JavaType;I)Lcom/fasterxml/jackson/databind/deser/CreatorProperty;

    move-result-object v1

    const/4 v2, 0x4

    aput-object v1, v0, v2

    return-object v0
.end method

.method public bridge synthetic getFromObjectArguments(Lcom/fasterxml/jackson/databind/DeserializationConfig;)[Lcom/fasterxml/jackson/databind/deser/SettableBeanProperty;
    .locals 1

    .line 100
    invoke-virtual {p0, p1}, Lcom/fasterxml/jackson/databind/deser/std/JacksonDeserializers$JsonLocationInstantiator;->getFromObjectArguments(Lcom/fasterxml/jackson/databind/DeserializationConfig;)[Lcom/fasterxml/jackson/databind/deser/CreatorProperty;

    move-result-object v0

    return-object v0
.end method

.method public getValueTypeDesc()Ljava/lang/String;
    .locals 1

    .line 106
    const-class v0, Lcom/fasterxml/jackson/core/JsonLocation;

    invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Clean Blog - Sample Post</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/clean-blog.min.css" rel="stylesheet">

    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Start Bootstrap

                        Home

                        About

                        Sample Post

                        Contact

Man must explore, and this is exploration at its greatest

Problems look mighty small from 150 miles up

                        Posted by Start Bootstrap on August 24, 2014

Never in all their history have men been able truly to conceive of the world as one: a single sphere, a globe, having the qualities of a globe, a round earth in which all the directions eventually meet, in which there is no center because every point, or none, is center — an equal earth which all men occupy as equals. The airman's earth, if free men make it, will be truly round: a globe in practice, not in theory.

Science cuts two ways, of course; its products can be used for both good and evil. But there's no turning back from science. The early warnings about technological dangers also come from science.

What was most significant about the lunar voyage was not that man set foot on the Moon but that they set eye on the earth.

A Chinese tale tells of some men sent to harm a young girl who, upon seeing her beauty, become her protectors rather than her violators. That's how I felt seeing the Earth for the first time. I could not help but love and cherish her.

For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us.

The Final Frontier

There can be no thought of finishing for 'aiming for the stars.' Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.

There can be no thought of finishing for 'aiming for the stars.' Both figuratively and literally, it is a task to occupy the generations. And no matter how much progress one makes, there is always the thrill of just beginning.

The dreams of yesterday are the hopes of today and the reality of tomorrow. Science has not yet mastered prophecy. We predict too much for the next year and yet far too little for the next ten.

Spaceflights cannot be stopped. This is not the work of any one man or even a group of men. It is a historical process which mankind is carrying out in accordance with the natural laws of human development.

Reaching for the Stars

As we got further and further away, it [the Earth] diminished in size. Finally it shrank to the size of a marble, the most beautiful you can imagine. That beautiful, warm, living object looked so fragile, so delicate, that if you touched it with a finger it would crumble and fall apart. Seeing this has to change a man.

Space, the final frontier. These are the voyages of the Starship Enterprise. Its five-year mission: to explore strange new worlds, to seek out new life and new civilizations, to boldly go where no man has gone before.

As I stand out here in the wonders of the unknown at Hadley, I sort of realize there's a fundamental truth to our nature, Man must explore, and this is exploration at its greatest.

The Ultimate Destination

For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us.

 As we got further and further away, it [the Earth] diminished in size. Finally it shrank to the size of a marble, the most beautiful you can imagine. That beautiful, warm, living object looked so fragile, so delicate, that if you touched it with a finger it would crumble and fall apart. Seeing this has to change a man.

For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us.

We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win.

If you could see the earth illuminated when you were in a place as dark as night, it would look to you more splendid than the moon.

Placeholder text by Space Ipsum.

Copyright © Your Website 2014


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

using System;
using System.Reflection;
using System.Runtime.Loader;

namespace ALCProxy.Communication
{
    /// <summary>
    /// The server interface we can wrap both in-proc and out-of-proc proxies around, will add more methods here as they are found needed by both versions
    /// </summary>
    public interface IProxyClient
    {
        /// <summary>
        /// Sends a message to the server to proc the method call, and return the result
        /// </summary>
        /// <param name="method">The method information of what needs to be called</param>
        /// <param name="args"></param>
        /// <returns>Whatever the target Method returns. We need to make sure that whatever gets returned is not of a type that is in our target ALC</returns>
        object SendMethod(MethodInfo method, object[] args);
        /// <summary>
        /// Creates the link between the client and the server, while also passing in all the information to the server for setup
        /// </summary>
        /// <param name="alc">The target AssemblyLoadContext</param>
        /// <param name="typeName">Name of the proxied type</param>
        /// <param name="assemblyPath">path of the assembly to the type</param>
        /// <param name="genericTypes">any generics that we need the proxy to work with</param>
        void SetUpServer(AssemblyLoadContext alc, string typeName, AssemblyName assemblyName, object[] constructorParams, Type[] genericTypes);
    }
}


text:
steal('jquery', 'can/util/can.js', 'can/util/array/each.js', "can/util/inserted",function($, can) {
	// _jQuery node list._
	$.extend( can, $, {
		trigger: function( obj, event, args ) {
			if ( obj.trigger ) {
				obj.trigger( event, args );
			} else {
				$.event.trigger( event, args, obj, true );
			}
		},
		addEvent: function(ev, cb){
			$([this]).bind(ev, cb);
			return this;
		},
		removeEvent: function(ev, cb){
			$([this]).unbind(ev, cb);
			return this;
		},
		// jquery caches fragments, we always needs a new one
		buildFragment : function(elems, context){
			var oldFragment = $.buildFragment,
				ret;

			elems = [elems];
			// Set context per 1.8 logic
			context = context || document;
			context = !context.nodeType && context[0] || context;
			context = context.ownerDocument || context;

			ret = oldFragment.call( jQuery, elems, context);

			return ret.cacheable ? $.clone(ret.fragment) : ret.fragment || ret;
		},
		$: $,
		each: can.each
	});

	// Wrap binding functions.
	$.each(['bind','unbind','undelegate','delegate'],function(i,func){
		can[func] = function(){
			var t = this[func] ? this : $([this]);
			t[func].apply(t, arguments);
			return this;
		};
	});

	// Aliases
	can.on = can.bind;
	can.off = can.unbind;

	// Wrap modifier functions.
	$.each(["append","filter","addClass","remove","data","get","has"], function(i,name){
		can[name] = function(wrapped){
			return wrapped[name].apply(wrapped, can.makeArray(arguments).slice(1));
		};
	});

	// Memory safe destruction.
	var oldClean = $.cleanData;

	$.cleanData = function( elems ) {
		$.each( elems, function( i, elem ) {
			if ( elem ) {
				can.trigger(elem,"removed",[],false);
			}
		});
		oldClean(elems);
	};

	var oldDomManip = $.fn.domManip;

	$.fn.domManip = function(args, table, callback){
		return oldDomManip.call(this,args,table, function(elem){
			if(elem.nodeType === 11){
				var elems = can.makeArray(elem.childNodes);
			}
			var ret = callback.apply(this, arguments);
			can.inserted(elems? elems : [elem])
			return ret
		})
	}
	$.event.special.inserted = {};
	$.event.special.removed = {};

	return can;
});


text:
(function () {

    $.ajaxEpSearch = {
        defaults: {
            size:               16,
            colorRow:           false,
            loadingImage:       'loading16_dddddd.gif',
            noImage:            'no16.png',
            yesImage:           'yes16.png'
        }
    };

    $.fn.ajaxEpSearch = function (options) {
        options = $.extend({}, $.ajaxEpSearch.defaults, options);

        $('.epSearch').click(function () {
            var parent = $(this).parent();

            // put the ajax spinner (for non white bg) placeholder while we wait
            parent.empty();
            parent.append($("<img/>").attr({"src": sbRoot + "/images/" + options.loadingImage, "height": options.size, "alt": "", "title": "loading"}));

            $.getJSON($(this).attr('href'), function (data) {
                // if they failed then just put the red X
                if (data.result == 'failure') {
                    img_name = options.noImage;
                    img_result = 'failed';

                // if the snatch was successful then apply the corresponding class and fill in the row appropriately
                } else {
                    img_name = options.yesImage;
                    img_result = 'success';
                    // color the row
                    if (options.colorRow) {
                        parent.parent().removeClass('skipped wanted qual good unaired snatched').addClass('snatched');
                    }
                    // update the status column if it exists
                    parent.siblings('.status_column').html(data.result);
                }

                // put the corresponding image as the result for the the row
                parent.empty();
                parent.append($("<img/>").attr({"src": sbRoot + "/images/" + img_name, "height": options.size, "alt": img_result, "title": img_result}));
            });

            // fon't follow the link
            return false;
        });
    };
})();


text:
class User < ActiveRecord::Base
  has_one   :specific_seller, :class_name => "Seller"
  has_one   :address, :class_name => "Geo::Address"

  is_indexed :fields => ['login', 'email', 'deleted'],
    :include => [{:association_name => 'specific_seller', :field => 'company_name', :as => 'company', :facet => true},
      {:class_name => 'Seller', :field => 'sellers_two.company_name', :as => 'company_two', :facet => true, 'association_sql' => 'LEFT OUTER JOIN sellers AS sellers_two ON users.id = sellers_two.user_id', 'function_sql' => "REPLACE(?, '6', ' replacement ')"}],
    :conditions => "deleted = '0'",
    :delta => {:field => 'created_at'}

  def self.find_all_by_id(*args)
    raise "Wrong finder"
  end

  def self.custom_find(*args)
    method_missing(:find_all_by_id, *args)
  end

end


text:
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;

namespace WpfSourceCopy
{
    class Program
    {
        static void Main(string[] args)
        {
            var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            folder = Path.Combine(folder!, @"..\..\..");
            var presentationBuildTasksCsprojFile =
                Path.Combine(folder, @"..\..\WPF\PresentationBuildTasks\PresentationBuildTasks.csproj");
            var csproj = File.ReadAllText(presentationBuildTasksCsprojFile);

            const string wpfSourceDir = @"E:\程序\ethylene156\God\wpf_3.1\src\Microsoft.DotNet.Wpf\src\";
            string copyFolder = Path.GetFullPath("WpfSourceDir");

            var regex = new Regex(@"\$\(WpfSourceDir\)\\(\S*\.cs)", RegexOptions.Compiled);
            foreach (var line in csproj.Split('\n', StringSplitOptions.RemoveEmptyEntries)
                .Where(temp => !string.IsNullOrEmpty(temp))
                .Select(temp => temp.Replace("\r", ""))
                .Where(temp => !string.IsNullOrEmpty(temp)))
            {
                var match = regex.Match(line);
                if (match.Success)
                {
                    var filePath = match.Groups[1].Value;
                    var file = Path.Combine(wpfSourceDir, filePath);
                    if (File.Exists(file))
                    {
                        var copyFile = Path.Combine(copyFolder, filePath);
                        var directory = Path.GetDirectoryName(copyFile);
                        Directory.CreateDirectory(directory!);
                        File.Copy(file, copyFile);
                    }
                    else
                    {

                    }
                }
            }
        }
    }
}


text:
package org.apache.ivy.ant;

import java.io.File;

import org.apache.ivy.TestHelper;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Path;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

public class IvyCachePathTest {

    private IvyCachePath path;

    private Project project;

    @Before
    public void setUp() {
        TestHelper.createCache();
        project = TestHelper.newProject();
        project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");

        path = new IvyCachePath();
        path.setProject(project);
        System.setProperty("ivy.cache.dir", TestHelper.cache.getAbsolutePath());
    }

    @After
    public void tearDown() {
        TestHelper.cleanCache();
    }

    @Test
    public void testSimple() {
        project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-simple.xml");
        path.setPathid("simple-pathid");
        path.execute();
        Object ref = project.getReference("simple-pathid");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(1, p.size());
        assertEquals(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar")
                .getAbsolutePath(), new File(p.list()[0]).getAbsolutePath());
    }

    @Test
    public void testInline1() {
        // we first resolve another ivy file
        IvyResolve resolve = new IvyResolve();
        resolve.setProject(project);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-latest.xml"));
        resolve.execute();

        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.2", "mod1.2", "jar", "jar").exists());

        // then we resolve a dependency directly
        path.setOrganisation("org1");
        path.setModule("mod1.2");
        path.setRevision("2.0");
        path.setInline(true);
        path.setPathid("simple-pathid");
        path.execute();
        Object ref = project.getReference("simple-pathid");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(1, p.size());
        assertEquals(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar")
                .getAbsolutePath(), new File(p.list()[0]).getAbsolutePath());
    }

    @Test
    public void testInline2() {
        // we first resolve a dependency directly
        path.setOrganisation("org1");
        path.setModule("mod1.2");
        path.setRevision("2.0");
        path.setInline(true);
        path.setPathid("simple-pathid");
        path.execute();
        Object ref = project.getReference("simple-pathid");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(1, p.size());
        assertEquals(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar")
                .getAbsolutePath(), new File(p.list()[0]).getAbsolutePath());

        // we then resolve another ivy file
        IvyResolve resolve = new IvyResolve();
        resolve.setProject(project);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-latest.xml"));
        resolve.execute();

        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.2", "mod1.2", "jar", "jar").exists());
    }

    @Test
    public void testEmptyConf() {
        project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-108.xml");
        path.setPathid("emptyconf-pathid");
        path.setConf("empty");
        path.execute();
        Object ref = project.getReference("emptyconf-pathid");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(0, p.size());
    }

    /**
     * Test must fail with default haltonfailure setting.
     */
    @Test(expected = BuildException.class)
    public void testFailure() {
        project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-failure.xml");
        path.setPathid("failure-pathid");
        path.execute();
    }

    @Test
    public void testHaltOnFailure() {
        project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-failure.xml");
        path.setPathid("haltfailure-pathid");
        path.setHaltonfailure(false);
        path.execute();
    }

    @Test
    public void testWithResolveId() {
        IvyResolve resolve = new IvyResolve();
        resolve.setProject(project);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple.xml"));
        resolve.setResolveId("withResolveId");
        resolve.execute();

        // resolve another ivy file
        resolve = new IvyResolve();
        resolve.setProject(project);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-latest.xml"));
        resolve.execute();

        path.setResolveId("withResolveId");
        path.setPathid("withresolveid-pathid");
        path.execute();

        Object ref = project.getReference("withresolveid-pathid");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(1, p.size());
        assertEquals(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar")
                .getAbsolutePath(), new File(p.list()[0]).getAbsolutePath());
    }

    @Test
    public void testWithResolveIdWithoutResolve() {
        Project otherProject = TestHelper.newProject();
        otherProject.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");

        IvyResolve resolve = new IvyResolve();
        resolve.setProject(otherProject);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple.xml"));
        resolve.setResolveId("withResolveId");
        resolve.execute();

        // resolve another ivy file
        resolve = new IvyResolve();
        resolve.setProject(project);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-latest.xml"));
        resolve.execute();

        path.setResolveId("withResolveId");
        path.setPathid("withresolveid-pathid");
        path.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple.xml"));
        path.execute();

        Object ref = project.getReference("withresolveid-pathid");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(1, p.size());
        assertEquals(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar")
                .getAbsolutePath(), new File(p.list()[0]).getAbsolutePath());
    }

    @Test
    public void testWithResolveIdAndMissingConfs() {
        Project otherProject = TestHelper.newProject();
        otherProject.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");

        IvyResolve resolve = new IvyResolve();
        resolve.setProject(otherProject);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-multiconf.xml"));
        resolve.setResolveId("testWithResolveIdAndMissingConfs");
        resolve.setConf("default");
        resolve.execute();

        // resolve another ivy file
        resolve = new IvyResolve();
        resolve.setProject(project);
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-latest.xml"));
        resolve.execute();

        project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-multiconf.xml");

        path.setResolveId("testWithResolveIdAndMissingConfs");
        path.setPathid("withresolveid-pathid");
        path.setConf("default,compile");
        path.setFile(new File("test/java/org/apache/ivy/ant/ivy-multiconf.xml"));
        path.execute();
    }

    @Test
    public void testUnpack() {
        project.setProperty("ivy.dep.file",
            "test/repositories/1/packaging/module1/ivys/ivy-1.0.xml");
        path.setPathid("testUnpack");
        path.execute();
        Object ref = project.getReference("testUnpack");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(1, p.size());
        assertTrue(new File(p.list()[0]).isDirectory());
    }

    @Test
    public void testOSGi() {
        project.setProperty("ivy.dep.file",
            "test/repositories/1/packaging/module5/ivys/ivy-1.0.xml");
        path.setPathid("testOSGi");
        path.setOsgi(true);
        path.execute();
        Object ref = project.getReference("testOSGi");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(4, p.size());
        File cacheDir = path.getSettings().getDefaultRepositoryCacheBasedir();
        File unpacked = new File(cacheDir, "packaging/module3/jar_unpackeds/module3-1.0");
        assertEquals(new File(unpacked, "lib/ant-antlr.jar"), new File(p.list()[0]));
        assertEquals(new File(unpacked, "lib/ant-apache-bcel.jar"), new File(p.list()[1]));
        assertEquals(new File(unpacked, "lib/ant-apache-bsf.jar"), new File(p.list()[2]));
        assertEquals(new File(unpacked, "lib/ant-apache-log4j.jar"), new File(p.list()[3]));
    }

    @Test
    public void testOSGi2() {
        project.setProperty("ivy.dep.file",
            "test/repositories/1/packaging/module6/ivys/ivy-1.0.xml");
        path.setPathid("testOSGi");
        path.setOsgi(true);
        path.execute();
        Object ref = project.getReference("testOSGi");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(1, p.size());
        File cacheDir = path.getSettings().getDefaultRepositoryCacheBasedir();
        File unpacked = new File(cacheDir, "packaging/module4/jar_unpackeds/module4-1.0");
        assertEquals(unpacked, new File(p.list()[0]));
    }

    @Test
    public void testPackedOSGi() {
        project.setProperty("ivy.dep.file",
            "test/repositories/1/packaging/module8/ivys/ivy-1.0.xml");
        path.setPathid("testOSGi");
        path.setOsgi(true);
        path.execute();
        Object ref = project.getReference("testOSGi");
        assertNotNull(ref);
        assertTrue(ref instanceof Path);
        Path p = (Path) ref;
        assertEquals(4, p.size());
        File cacheDir = path.getSettings().getDefaultRepositoryCacheBasedir();
        File unpacked = new File(cacheDir, "packaging/module7/jar_unpackeds/module7-1.0");
        assertEquals(new File(unpacked, "lib/ant-antlr.jar"), new File(p.list()[0]));
        assertEquals(new File(unpacked, "lib/ant-apache-bcel.jar"), new File(p.list()[1]));
        assertEquals(new File(unpacked, "lib/ant-apache-bsf.jar"), new File(p.list()[2]));
        assertEquals(new File(unpacked, "lib/ant-apache-log4j.jar"), new File(p.list()[3]));
    }

    private File getArchiveFileInCache(String organisation, String module, String revision,
            String artifact, String type, String ext) {
        return TestHelper.getArchiveFileInCache(path.getIvyInstance(), organisation, module,
            revision, artifact, type, ext);
    }
}


text:
<?php
if (!defined('SMF'))
	require_once('SSI.php');

add_integration_function('integrate_pre_include','$sourcedir/og.php');
add_integration_function('integrate_bbc_codes','og_bbc');
add_integration_function('integrate_modify_modifications','og_admin');
add_integration_function('integrate_admin_areas','og_admin_areas');
$smcFunc['db_query']('', "INSERT INTO {db_prefix}scheduled_tasks (time_offset, time_regularity, time_unit, disabled, task) VALUES ('0', '1', 'w', '0', 'og_prune')");
?>


text:
class Solution {
    //Use the dynamic programming, for a given k, we only need to hold the k-1 th row's values.
    //The space complexity should be O(2k) = O(k)
    //Here is the recurrsive formular between a value in kth row and its predecedors:
    /*v[i][k] = v[i-1][k-1] + v[i][k-1]*/
    public List<Integer> getRow(int rowIndex) {
        List<Integer> previousRow = new ArrayList<Integer>();
        List<Integer> currentRow  = new ArrayList<Integer>();
        currentRow.add(1);
        int counter = 1;
        while(counter <= rowIndex){
            //deep copy the last row
            previousRow = currentRow;
            currentRow = new ArrayList<>();
            for(int i = 0; i <= counter; i++){
                int temp = 0;
                if(i-1 > -1){
                    temp += previousRow.get(i-1);
                }
                if(i < previousRow.size()){
                    temp += previousRow.get(i);
                }
                currentRow.add(temp);
            }
            counter++;
        }
        return currentRow;
    }
}


text:
from __future__ import unicode_literals

from django.core.management import BaseCommand, CommandError
from channels import channel_layers, DEFAULT_CHANNEL_LAYER
from channels.log import setup_logger
from channels.worker import Worker

class Command(BaseCommand):

    leave_locale_alone = True

    def add_arguments(self, parser):
        super(Command, self).add_arguments(parser)
        parser.add_argument('--layer', action='store', dest='layer', default=DEFAULT_CHANNEL_LAYER,
            help='Channel layer alias to use, if not the default.')

    def handle(self, *args, **options):
        # Get the backend to use
        self.verbosity = options.get("verbosity", 1)
        self.logger = setup_logger('django.channels', self.verbosity)
        self.channel_layer = channel_layers[options.get("layer", DEFAULT_CHANNEL_LAYER)]
        # Check that handler isn't inmemory
        if self.channel_layer.local_only():
            raise CommandError(
                "You cannot span multiple processes with the in-memory layer. " +
                "Change your settings to use a cross-process channel layer."
            )
        # Check a handler is registered for http reqs
        self.channel_layer.router.check_default()
        # Launch a worker
        self.logger.info("Running worker against channel layer %s", self.channel_layer)
        # Optionally provide an output callback
        callback = None
        if self.verbosity > 1:
            callback = self.consumer_called
        # Run the worker
        try:
            Worker(channel_layer=self.channel_layer, callback=callback).run()
        except KeyboardInterrupt:
            pass

    def consumer_called(self, channel, message):
        self.logger.debug("%s", channel)


text:
namespace base {

using AddDllDirectory = HMODULE (*)(PCWSTR new_directory);

namespace {
// This enum is used to back an UMA histogram, and should therefore be treated
// as append-only.
enum LoadLibraryResult {
  // LoadLibraryExW API/flags are available and the call succeeds.
  SUCCEED = 0,
  // LoadLibraryExW API/flags are availabe to use but the call fails, then
  // LoadLibraryW is used and succeeds.
  FAIL_AND_SUCCEED,
  // LoadLibraryExW API/flags are availabe to use but the call fails, then
  // LoadLibraryW is used but fails as well.
  FAIL_AND_FAIL,
  // LoadLibraryExW API/flags are unavailabe to use, then LoadLibraryW is used
  // and succeeds.
  UNAVAILABLE_AND_SUCCEED,
  // LoadLibraryExW API/flags are unavailabe to use, then LoadLibraryW is used
  // but fails.
  UNAVAILABLE_AND_FAIL,
  // Add new items before this one, always keep this one at the end.
  END
};

// A helper method to log library loading result to UMA.
void LogLibrarayLoadResultToUMA(LoadLibraryResult result) {
  UMA_HISTOGRAM_ENUMERATION("LibraryLoader.LoadNativeLibraryWindows", result,
                            LoadLibraryResult::END);
}

// A helper method to check if AddDllDirectory method is available, thus
// LOAD_LIBRARY_SEARCH_* flags are available on systems.
bool AreSearchFlagsAvailable() {
  // The LOAD_LIBRARY_SEARCH_* flags are available on systems that have
  // KB2533623 installed. To determine whether the flags are available, use
  // GetProcAddress to get the address of the AddDllDirectory,
  // RemoveDllDirectory, or SetDefaultDllDirectories function. If GetProcAddress
  // succeeds, the LOAD_LIBRARY_SEARCH_* flags can be used with LoadLibraryEx.
  // https://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx
  // The LOAD_LIBRARY_SEARCH_* flags are used in the LoadNativeLibraryHelper
  // method.
  auto add_dll_dir_func = reinterpret_cast<AddDllDirectory>(
      GetProcAddress(GetModuleHandle(L"kernel32.dll"), "AddDllDirectory"));
  return !!add_dll_dir_func;
}

// A helper method to encode the library loading result to enum
// LoadLibraryResult.
LoadLibraryResult GetLoadLibraryResult(bool are_search_flags_available,
                                       bool has_load_library_succeeded) {
  LoadLibraryResult result;
  if (are_search_flags_available) {
    if (has_load_library_succeeded)
      result = LoadLibraryResult::FAIL_AND_SUCCEED;
    else
      result = LoadLibraryResult::FAIL_AND_FAIL;
  } else if (has_load_library_succeeded) {
    result = LoadLibraryResult::UNAVAILABLE_AND_SUCCEED;
  } else {
    result = LoadLibraryResult::UNAVAILABLE_AND_FAIL;
  }
  return result;
}

NativeLibrary LoadNativeLibraryHelper(const FilePath& library_path,
                                      NativeLibraryLoadError* error) {
  // LoadLibrary() opens the file off disk.
  ScopedBlockingCall scoped_blocking_call(BlockingType::MAY_BLOCK);

  HMODULE module = nullptr;

  // This variable records the library loading result.
  LoadLibraryResult load_library_result = LoadLibraryResult::SUCCEED;

  bool are_search_flags_available = AreSearchFlagsAvailable();
  if (are_search_flags_available) {
    // LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR flag is needed to search the library
    // directory as the library may have dependencies on DLLs in this
    // directory.
    module = ::LoadLibraryExW(
        library_path.value().c_str(), nullptr,
        LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
    // If LoadLibraryExW succeeds, log this metric and return.
    if (module) {
      LogLibrarayLoadResultToUMA(load_library_result);
      return module;
    }
    // GetLastError() needs to be called immediately after
    // LoadLibraryExW call.
    if (error)
      error->code = GetLastError();
  }

  // If LoadLibraryExW API/flags are unavailable or API call fails, try
  // LoadLibraryW API.
  // TODO(chengx): Currently, if LoadLibraryExW API call fails, LoadLibraryW is
  // still tried. We should strictly prefer the LoadLibraryExW over the
  // LoadLibraryW if LoadLibraryW is statistically showing no extra benefits. If
  // UMA metric shows that FAIL_AND_FAIL is the primary failure mode and/or
  // FAIL_AND_SUCCESS is close to zero, we should remove this fallback.
  // (http://crbug.com/701944)

  // Switch the current directory to the library directory as the library
  // may have dependencies on DLLs in this directory.
  bool restore_directory = false;
  FilePath current_directory;
  if (GetCurrentDirectory(&current_directory)) {
    FilePath plugin_path = library_path.DirName();
    if (!plugin_path.empty()) {
      SetCurrentDirectory(plugin_path);
      restore_directory = true;
    }
  }

  module = ::LoadLibraryW(library_path.value().c_str());

  // GetLastError() needs to be called immediately after LoadLibraryW call.
  if (!module && error)
    error->code = GetLastError();

  if (restore_directory)
    SetCurrentDirectory(current_directory);

  // Get the library loading result and log it to UMA.
  LogLibrarayLoadResultToUMA(
      GetLoadLibraryResult(are_search_flags_available, !!module));

  return module;
}
}  // namespace

std::string NativeLibraryLoadError::ToString() const {
  return StringPrintf("%lu", code);
}

NativeLibrary LoadNativeLibraryWithOptions(const FilePath& library_path,
                                           const NativeLibraryOptions& options,
                                           NativeLibraryLoadError* error) {
  return LoadNativeLibraryHelper(library_path, error);
}

void UnloadNativeLibrary(NativeLibrary library) {
  FreeLibrary(library);
}

void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
                                          StringPiece name) {
  return reinterpret_cast<void*>(GetProcAddress(library, name.data()));
}

std::string GetNativeLibraryName(StringPiece name) {
  DCHECK(IsStringASCII(name));
  return name.as_string() + ".dll";
}

std::string GetLoadableModuleName(StringPiece name) {
  return GetNativeLibraryName(name);
}

}  // namespace base


text:
  golfr is a golf scorecard parser developed in Python.

  The end goal is to be able to upload an image and then extract the handwritten scores for each hole. Eventually, this could be encapsulated by a larger application for developing an online golf profile.
## Getting started ##
  * Clone the repo
    ```bash
    git clone https://github.com/joshshep/golfr.git
    ```
  * Install golfr
    ```bash
    cd golfr
    pip install -r requirements.txt
    python setup.py develop
    ```
  * Run a test
    ```bash
    python tests/test_classify_cells.py
    ```

## Current processing pipeline ##
* find grid points
    * adaptive threshold
    * erode
    * dilate
    * vertical lines
    * horizontal lines
    * intersection
    * dilate
    * centroid
* sort grid points into square corners
* prep resultant square for CNN
    * remove border (partial square)
    * reduce noise (similar to above)
    * crop
    * downsample
* run CNN on samples


text:
 #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif

#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
 #import <Protobuf/GPBProtocolBuffers.h>
#else
 #import "GPBProtocolBuffers.h"
#endif

#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
#endif

// @@protoc_insertion_point(imports)

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

CF_EXTERN_C_BEGIN

NS_ASSUME_NONNULL_BEGIN

#pragma mark - Enum BuyItemAndroidResponse_Status

/// THESE ARE SOMEWHAT SPECULATED, failed may be 2
typedef GPB_ENUM(BuyItemAndroidResponse_Status) {
  /// Value used if any message's field encounters a value that is not defined
  /// by this enum. The message will also have C functions to get/set the rawValue
  /// of the field.
  BuyItemAndroidResponse_Status_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue,
  BuyItemAndroidResponse_Status_Unknown = 0,
  BuyItemAndroidResponse_Status_Success = 1,
};

GPBEnumDescriptor *BuyItemAndroidResponse_Status_EnumDescriptor(void);

/// Checks to see if the given value is defined by the enum or was not known at
/// the time this source was generated.
BOOL BuyItemAndroidResponse_Status_IsValidValue(int32_t value);

#pragma mark - BuyItemAndroidResponseRoot

/// Exposes the extension registry for this file.
///
/// The base class provides:
/// @code
///   + (GPBExtensionRegistry *)extensionRegistry;
/// @endcode
/// which is a @c GPBExtensionRegistry that includes all the extensions defined by
/// this file and all files that it depends on.
@interface BuyItemAndroidResponseRoot : GPBRootObject
@end

#pragma mark - BuyItemAndroidResponse

typedef GPB_ENUM(BuyItemAndroidResponse_FieldNumber) {
  BuyItemAndroidResponse_FieldNumber_Result = 1,
  BuyItemAndroidResponse_FieldNumber_PurchaseToken = 2,
};

@interface BuyItemAndroidResponse : GPBMessage

/// result
@property(nonatomic, readwrite) BuyItemAndroidResponse_Status result;

@property(nonatomic, readwrite, copy, null_resettable) NSString *purchaseToken;

@end

/// Fetches the raw value of a @c BuyItemAndroidResponse's @c result property, even
/// if the value was not defined by the enum at the time the code was generated.
int32_t BuyItemAndroidResponse_Result_RawValue(BuyItemAndroidResponse *message);
/// Sets the raw value of an @c BuyItemAndroidResponse's @c result property, allowing
/// it to be set to a value that was not defined by the enum at the time the code
/// was generated.
void SetBuyItemAndroidResponse_Result_RawValue(BuyItemAndroidResponse *message, int32_t value);

NS_ASSUME_NONNULL_END

CF_EXTERN_C_END

#pragma clang diagnostic pop

// @@protoc_insertion_point(global_scope)


text:
package com.tern.web.routes;

import java.io.IOException;

public class PathScanner
{
    private enum Type {NUMBER, STRING, NAME, SYMBOL, TEXT, END};

    private PeekReader in;
    private StringBuffer out = new StringBuffer();
    private String token;
    private Type type;
    private boolean cached = false;

    public PathScanner(PeekReader in)
    {
        this.in = in;
    }

    public void peek() throws IOException
    {
        if (!cached)
        {
            next();
        }
        cached = true;
    }

    public void read() throws IOException
    {
        if (!cached)
        {
            next();
        }
        cached = false;
    }

    private void next() throws IOException
    {
        nextRun();
    }

    private void nextRun() throws IOException
    {
        out.setLength(0);

        type = null;
        token = null;

        int c = in.peek();
        if (c == -1)
        {
            type = Type.END;
            return;
        }

        clearSpace();
        c = in.peek();

        if (c == -1)
        {
            type = Type.END;
            return;
        }
        else if ("/.(){}[]$%|:*?".indexOf(c) > -1)
        {
            type = Type.SYMBOL;
            out.append((char)in.read());
        }
        else if (Character.isDigit(c))
        {
            type = Type.NUMBER;
            parseNumber();
        }
        else if (Character.isLetter(c) || c == '_' || c == '.')
        {
            type = Type.NAME;
            parseName();
        }
        else
        {
            error("Invalid character `" + (char)c + "'");
        }
    }

    public void error(String text) throws IOException
    {
        throw new IOException("Line " + in.line() + ": " + text);
    }

    private void clearSpace() throws IOException
    {
        int c = in.peek();
        while (Character.isWhitespace(c))
        {
            in.read();
            c = in.peek();
        }
    }

    private void parseName() throws IOException
    {
        int c = in.peek();
        while (Character.isLetterOrDigit(c) || c == '_' || c == ':' || c == '.')
        {
            out.append((char)in.read());
            c = in.peek();
        }
    }

    private void parseNumber() throws IOException
    {
        int c = in.peek();
        while (Character.isDigit(c) || c == '_')
        {
            out.append((char)in.read());
            c = in.peek();
        }
    }

    public String getToken()
    {
        if (token == null)
        {
            token = out.toString();
        }
        return token;
    }

    public boolean isNumber()
    {
        return type == Type.NUMBER;
    }

    public boolean isName()
    {
        return type == Type.NAME;
    }

    public boolean isEnd()
    {
        return type == Type.END;
    }

    public boolean isSymbol(String text)
    {
        return type == Type.SYMBOL && getToken().equals(text);
    }

    public int line()
    {
        return in.line();
    }
}


text:
GO?=go
SUDO?=
RM?=--rm

.PHONY: test clean

test: .test.uptodate
	./test.bash

.test.uptodate: runsvinit zombie run-zombie Dockerfile
	$(SUDO) docker build -t zombietest .
	touch $@

runsvinit: ../*.go
	env GOOS=linux GOARCH=amd64 $(GO) build -o $@ github.com/peterbourgon/runsvinit

zombie: .build.uptodate
	$(SUDO) docker run $(RM) -v $(shell pwd):/mount zombietest-build cc -Wall -Werror -o /mount/zombie /zombie.c

.build.uptodate: build/zombie.c build/Dockerfile
	$(SUDO) docker build -t zombietest-build build/
	touch $@

clean:
	rm -rf .test.uptodate .build.uptodate runsvinit zombie
	$(SUDO) docker stop zombietest zombietest-build >/dev/null 2>&1 || true
	$(SUDO) docker rm zombietest zombietest-build >/dev/null 2>&1 || true


text:
package org.apache.axis2.jaxrs;

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

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HEAD;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.lang.reflect.Method;
import java.lang.annotation.Annotation;

public class JAXRSUtils {
    private static Log log = LogFactory.getLog(JAXRSModel.class);

    /**
      * returns a jaxrs class model reading class level annotation given the service class
      * @param serviceClass
      * @return
      */
    public static JAXRSModel getClassModel(Class serviceClass) {
        JAXRSModel model = new JAXRSModel();
        Annotation[] annotation = serviceClass.getAnnotations();
        for (Annotation a : annotation) {
            if (a != null) {
                if (a instanceof Produces) {
                    addProducesToClassModel((Produces) a, model);
                } else if (a instanceof Consumes) {
                    addConsumesToClassModel((Consumes) a, model);
                } else if (a instanceof Path) {
                    addPathToClassModel((Path) a, model);
                } else {
                    System.out.println("Could not identify the Annotation....");
                }

            }

        }

        return model;
    }

    /**
      * given a jaxrs class model & java method , construct a jaxrs model associated with
      * method , reading the method level annotations.
      * @param classModel
      * @param serviceMethod
      * @return
      */
    public static JAXRSModel getMethodModel(JAXRSModel classModel, Method serviceMethod) {
        JAXRSModel model=new JAXRSModel();
        addProducesToMethodModel(classModel,model);
        addConsumesToMethodModel(classModel,model);
        addPathToMethodModel(classModel,model);
        Annotation[] annotation=serviceMethod.getAnnotations();
        for(Annotation a:annotation){
           if(a!=null){
               if(a instanceof Produces){
                    addProducesToMethodModel((Produces)a,model);
               }else if(a instanceof Consumes){
                  addConsumesToMethodModel((Consumes)a,model);
               }else if(a instanceof Path){
                  addPathToMethodModel((Path)a,model);
               } else{
                  addHTTPMethodToMethodModel(a,model);
               }

           }
        }
        return model;
    }

    /**
      * add value of the produces annotation to the given jaxrs-class model.method breaks the
      * input String & convert it to a String[] before adding.
      * @param produces
      * @param classModel
      */
    private static void addProducesToClassModel(Produces produces, JAXRSModel classModel) {

        String[] array = null;
        String value = null;
        array = produces.value();
        for (String s : array) {
            if (value == null) {
                value = s;
            } else {
                value = value + "," + s;
            }
        }

        classModel.setProduces(value);

    }

    /**
      * add value of the consumes annotaiton to the given jaxrs-class model. breaks the input String
      * & convert it to a string[] before adding.
      * @param consumes
      * @param classModel
      */
    private static void addConsumesToClassModel(Consumes consumes, JAXRSModel classModel) {

        String[] array = null;
        String value = null;
        array = consumes.value();
        for (String s : array) {
            if (value == null) {
                value = s;
            } else {
                value = value + "," + s;
            }
        }
        classModel.setConsumes(value);

    }

    /**
      * adding value of the path annotation to the class model
      * @param path
      * @param classModel
      */
    private static void addPathToClassModel(Path path, JAXRSModel classModel) {

        String value = null;
        value = path.value();
        if(value!=null){
            if(value.startsWith("/")){
                value=value.substring(1);
            }
            if(value.endsWith("/")){
               value= value.substring(0,(value.length()-1));
            }
        }

        classModel.setPath(value);

    }
   private static void addProducesToMethodModel(Produces produces,JAXRSModel methodModel){

       String value = null;
       for (String s : produces.value()) {
           if (value != null) {
               value = value + s;
           } else {
               value = s;
           }
           methodModel.setProduces(value);
       }

   }

   private static void addProducesToMethodModel(JAXRSModel classModel,JAXRSModel methodModel){
           String value=classModel.getProduces();
       if(value!=null){
           methodModel.setProduces(value);
       }
   }

    private static void addConsumesToMethodModel(Consumes consumes,JAXRSModel methodModel){
        String value = null;
        for (String s : consumes.value()) {
            if (value != null) {
                value = value + s;
            } else {
                value = s;
            }
            methodModel.setConsumes(value);
        }

    }

    /**
      * copies class level Consumes value to method level model
      * @param classModel
      * @param methodModel
      */
   private static void addConsumesToMethodModel(JAXRSModel classModel,JAXRSModel methodModel){
         String value=classModel.getConsumes();
       if(value!=null){
           methodModel.setConsumes(value);
       }
   }

    /**
     * add value of the HTTPMethod to the jaxrs-method model. axis2 only supports POST,GET,PUT,DELETE.
      * it doesnt support HEAD. if HEAD is given it resolves to the default method (POST)
      * @param annotation
      * @param methodModel
      */

    private static void addHTTPMethodToMethodModel(Annotation annotation,JAXRSModel methodModel){

            if (annotation instanceof POST) {
                methodModel.setHTTPMethod(Constants.Configuration.HTTP_METHOD_POST);
            } else if (annotation instanceof GET) {
                methodModel.setHTTPMethod(Constants.Configuration.HTTP_METHOD_GET);
            } else if (annotation instanceof PUT) {
               methodModel.setHTTPMethod(Constants.Configuration.HTTP_METHOD_PUT);
            } else if (annotation instanceof DELETE) {
                methodModel.setHTTPMethod(Constants.Configuration.HTTP_METHOD_DELETE);
            }  else if (annotation instanceof HEAD) {
                 log.warn("HTTP Method HEAD is not supported by AXIS2");
            }

    }

    /**
      * add http location to jaxrs method model. if service level location is already available
      * it concatanates two.
      * @param path
      * @param methodModel
      */
  private static void addPathToMethodModel(Path path,JAXRSModel methodModel){
          String value = path.value();
            if(value!=null){
            if(value.startsWith("/")){
                value=value.substring(1);
            }
            if(value.endsWith("/")){
               value= value.substring(0,(value.length()-1));
            }
        }
            if (methodModel.getPath()!=null ) {

                     methodModel.setPath(methodModel.getPath() +"/"+ value);
            } else{

                methodModel.setPath(value);
            }
  }

    /**
      * this copies the class service level path to method level
      * @param classModel
      * @param methodModel
      */
  private static  void addPathToMethodModel(JAXRSModel classModel,JAXRSModel methodModel){
       String value=classModel.getPath();
      if(value!=null){
          methodModel.setPath(value);
      }
  }

}


text:
package org.jbehave.mojo;

import static org.apache.commons.lang.ArrayUtils.isNotEmpty;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.ExecutorService;

import org.apache.maven.plugin.AbstractMojo;
import org.jbehave.core.ConfigurableEmbedder;
import org.jbehave.core.InjectableEmbedder;
import org.jbehave.core.embedder.Embedder;
import org.jbehave.core.embedder.EmbedderClassLoader;
import org.jbehave.core.embedder.EmbedderControls;
import org.jbehave.core.embedder.EmbedderMonitor;
import org.jbehave.core.embedder.MetaFilter;
import org.jbehave.core.embedder.NullEmbedderMonitor;
import org.jbehave.core.embedder.UnmodifiableEmbedderControls;
import org.jbehave.core.embedder.executors.ExecutorServiceFactory;
import org.jbehave.core.failures.BatchFailures;
import org.jbehave.core.io.StoryFinder;
import org.jbehave.core.junit.AnnotatedEmbedderRunner;
import org.jbehave.core.model.Meta;
import org.jbehave.core.model.Scenario;
import org.jbehave.core.model.Story;
import org.jbehave.core.model.StoryDuration;
import org.jbehave.core.model.StoryMaps;
import org.jbehave.core.reporters.ReportsCount;

/**
 * Abstract mojo that holds all the configuration parameters to specify and load
 * stories.
 *
 * @requiresDependencyResolution test
 */
public abstract class AbstractEmbedderMojo extends AbstractMojo {

    static final String TEST_SCOPE = "test";

    /**
     * @parameter expression="${project.build.sourceDirectory}"
     * @required
     */
    String sourceDirectory;

    /**
     * @parameter expression="${project.build.testSourceDirectory}"
     * @required
     */
    String testSourceDirectory;

    /**
     * @parameter expression="${project.build.outputDirectory}"
     * @required
     */
    String outputDirectory;

    /**
     * @parameter expression="${project.build.testOutputDirectory}"
     * @required
     */
    String testOutputDirectory;

    /**
     * The scope of the mojo classpath, either "compile" or "test"
     *
     * @parameter default-value="compile"
     */
    String scope;

    /**
     * Include filters, relative to the root source directory determined by the
     * scope
     *
     * @parameter
     */
    List<String> includes;

    /**
     * Exclude filters, relative to the root source directory determined by the
     * scope
     *
     * @parameter
     */
    List<String> excludes;

    /**
     * Compile classpath.
     *
     * @parameter expression="${project.compileClasspathElements}"
     * @required
     * @readonly
     */
    List<String> compileClasspathElements;

    /**
     * Test classpath.
     *
     * @parameter expression="${project.testClasspathElements}"
     * @required
     * @readonly
     */
    List<String> testClasspathElements;

    /**
     * The boolean flag to skip stories
     *
     * @parameter default-value="false"
     */
    boolean skip = false;

    /**
     * The boolean flag to run in batch mode
     *
     * @parameter default-value="false"
     */
    boolean batch = false;

    /**
     * The boolean flag to ignore failure in stories
     *
     * @parameter default-value="false"
     */
    boolean ignoreFailureInStories = false;

    /**
     * The boolean flag to ignore failure in view
     *
     * @parameter default-value="false"
     */
    boolean ignoreFailureInView = false;

    /**
     * The boolean flag to generate view after stories are run
     *
     * @parameter default-value="true"
     */
    boolean generateViewAfterStories = true;

    /**
     * The boolean flag to output failures in verbose mode
     *
     * @parameter default-value="false"
     */
    boolean verboseFailures = false;

    /**
     * The boolean flag to output filtering in verbose mode
     *
     * @parameter default-value="false"
     */
    boolean verboseFiltering = false;

    /**
     * The story timeouts
     *
     * @parameter
     */
    String storyTimeouts;

    /**
     * The story timeout in secs
     *
     * @parameter
     * @deprecated Use storyTimeouts
     */
    long storyTimeoutInSecs;

    /**
     * The story timeout in secs by path
     *
     * @parameter
     * @deprecated Use storyTimeouts
     */
    String storyTimeoutInSecsByPath;

    /**
     * The boolean flag to fail on story timeout
     *
     * @parameter default-value="false"
     */
    boolean failOnStoryTimeout = false;

    /**
     * The number of threads
     *
     * @parameter default-value="1"
     */
    int threads = 1;

    /**
     * The embedder class
     *
     * @parameter default-value="org.jbehave.core.embedder.Embedder"
     */
    String embedderClass = Embedder.class.getName();

    /**
     * The implementation class of the {@link ExecutorServiceFactory}
     *
     * @parameter
     */
    String executorsClass;

    /**
     * The class that is injected with the embedder
     *
     * @parameter
     */
    String injectableEmbedderClass;

    /**
     * The annotated embedder runner class
     *
     * @parameter default-value="org.jbehave.core.junit.AnnotatedEmbedderRunner"
     * @deprecated Obsolete
     */
    String annotatedEmbedderRunnerClass = AnnotatedEmbedderRunner.class.getName();

    /**
     * Used to find story paths and class names
     *
     * @parameter
     */
    String storyFinderClass = StoryFinder.class.getName();

    /**
     * The meta filter
     *
     * @parameter
     */
    String[] metaFilters;

    /**
     * The system properties
     *
     * @parameter
     */
    Properties systemProperties = new Properties();

    /**
     * The class loader
     */
    private EmbedderClassLoader classLoader;

    /**
     * Determines if the scope of the mojo classpath is "test"
     *
     * @return A boolean true if test scoped
     */
    boolean isTestScope() {
        return TEST_SCOPE.equals(scope);
    }

    String searchDirectory() {
        if (isTestScope()) {
            return testSourceDirectory;
        }
        return sourceDirectory;
    }

    String outputDirectory() {
        if (isTestScope()) {
            return testOutputDirectory;
        }
        return outputDirectory;
    }

    URL codeLocation() {
        String outputDirectory = outputDirectory();
        try {
            return outputDirectory != null ? new File(outputDirectory).toURI().toURL() : null;
        } catch (MalformedURLException e) {
            throw new IllegalArgumentException("Failed to create code location from " + outputDirectory, e);
        }
    }

    /**
     * Returns the EmbedderClassLoader with the classpath element of the
     * selected scope.
     *
     * @return An EmbedderClassLoader
     */
    protected EmbedderClassLoader classLoader() {
        if (classLoader == null) {
            classLoader = new EmbedderClassLoader(classpathElements());
        }
        return classLoader;
    }

    List<String> classpathElements() {
        List<String> classpathElements = compileClasspathElements;
        if (isTestScope()) {
            classpathElements = testClasspathElements;
        }
        return classpathElements;
    }

    /**
     * Finds story paths, using the {@link #newStoryFinder()}, in the
     * {@link #searchDirectory()} given specified {@link #includes} and
     * {@link #excludes}.
     *
     * @return A List of story paths found
     */
    protected List<String> storyPaths() {
        getLog().debug("Searching for story paths including " + includes + " and excluding " + excludes);
        List<String> storyPaths = newStoryFinder().findPaths(searchDirectory(), includes, excludes);
        getLog().info("Found story paths: " + storyPaths);
        return storyPaths;
    }

    /**
     * Finds class names, using the {@link #newStoryFinder()}, in the
     * {@link #searchDirectory()} given specified {@link #includes} and
     * {@link #excludes}.
     *
     * @return A List of class names found
     */
    protected List<String> classNames() {
        getLog().debug("Searching for class names including " + includes + " and excluding " + excludes);
        List<String> classNames = newStoryFinder().findClassNames(searchDirectory(), includes, excludes);
        getLog().info("Found class names: " + classNames);
        return classNames;
    }

    /**
     * Creates an instance of StoryFinder, using the {@link #storyFinderClass}
     *
     * @return A StoryFinder
     */
    protected StoryFinder newStoryFinder() {
        return classLoader().newInstance(StoryFinder.class, storyFinderClass);
    }

    /**
     * Creates an instance of Embedder, either using
     * {@link #injectableEmbedderClass} (if set) or defaulting to
     * {@link #embedderClass}.
     *
     * @return An Embedder
     */
    protected Embedder newEmbedder() {
        Embedder embedder = null;
        EmbedderClassLoader classLoader = classLoader();
        if (injectableEmbedderClass != null) {
            embedder = classLoader.newInstance(InjectableEmbedder.class, injectableEmbedderClass).injectedEmbedder();
        } else {
            embedder = classLoader.newInstance(Embedder.class, embedderClass);
        }

        URL codeLocation = codeLocation();
        if (codeLocation != null) {
            embedder.configuration().storyReporterBuilder().withCodeLocation(codeLocation);
        }

        embedder.useClassLoader(classLoader);
        embedder.useEmbedderControls(embedderControls());
        if ( executorsClass != null ){
            ExecutorServiceFactory executorServiceFactory = classLoader.newInstance(ExecutorServiceFactory.class, executorsClass);
            embedder.useExecutorService(executorServiceFactory.create(embedder.embedderControls()));
        }
        embedder.useEmbedderMonitor(embedderMonitor());
        if (isNotEmpty(metaFilters)) {
            List<String> filters = new ArrayList<String>();
            for (String filter : metaFilters) {
                if (filter != null) {
                    filters.add(filter);
                }
            }
            embedder.useMetaFilters(filters);
        }
        if (!systemProperties.isEmpty()) {
            embedder.useSystemProperties(systemProperties);
        }
        return embedder;
    }

    protected EmbedderMonitor embedderMonitor() {
        return new MavenEmbedderMonitor();
    }

    protected EmbedderControls embedderControls() {
        EmbedderControls embedderControls = new EmbedderControls().doBatch(batch).doSkip(skip)
                .doGenerateViewAfterStories(generateViewAfterStories).doIgnoreFailureInStories(ignoreFailureInStories)
                .doIgnoreFailureInView(ignoreFailureInView).doVerboseFailures(verboseFailures)
                .doVerboseFiltering(verboseFiltering)
                .doFailOnStoryTimeout(failOnStoryTimeout).useThreads(threads);
        if ( storyTimeoutInSecs != 0 ){
        	embedderControls.useStoryTimeoutInSecs(storyTimeoutInSecs);
        }
        if ( storyTimeoutInSecsByPath != null ){
        	embedderControls.useStoryTimeoutInSecsByPath(storyTimeoutInSecsByPath);
        }
        if ( storyTimeouts != null ){
        	embedderControls.useStoryTimeouts(storyTimeouts);
        }
		return new UnmodifiableEmbedderControls(embedderControls);
    }

    protected class MavenEmbedderMonitor extends NullEmbedderMonitor {

        public void batchFailed(BatchFailures failures) {
            getLog().warn("Failed to run batch " + failures);
        }

        public void beforeOrAfterStoriesFailed() {
            getLog().warn("Failed to run before or after stories steps");
        }

        public void embeddableFailed(String name, Throwable cause) {
            getLog().warn("Failed to run embeddable " + name, cause);
        }

        public void embeddableNotConfigurable(String name) {
            getLog().warn("Embeddable " + name + " must be an instance of " + ConfigurableEmbedder.class);
        }

        public void embeddablesSkipped(List<String> classNames) {
            getLog().info("Skipped embeddables " + classNames);
        }

        public void metaNotAllowed(Meta meta, MetaFilter filter) {
            getLog().debug(meta + " excluded by filter '" + filter.asString() + "'");
        }

        public void runningEmbeddable(String name) {
            getLog().info("Running embeddable " + name);
        }

        public void runningStory(String path) {
            getLog().info("Running story " + path);
        }

        public void storyFailed(String path, Throwable cause) {
            getLog().warn("Failed to run story " + path, cause);
        }

        public void storiesSkipped(List<String> storyPaths) {
            getLog().info("Skipped stories " + storyPaths);
        }

        public void storiesNotAllowed(List<Story> stories, MetaFilter filter, boolean verbose) {
            StringBuffer sb = new StringBuffer();
            sb.append(stories.size() + " stories excluded by filter: " + filter.asString() + "\n");
            if (verbose) {
                for (Story story : stories) {
                    sb.append(story.getPath()).append("\n");
                }
            }
            getLog().info(sb.toString());
        }

    	public void scenarioNotAllowed(Scenario scenario, MetaFilter filter) {
            StringBuffer sb = new StringBuffer();
            sb.append("Scenario '"+scenario.getTitle()+"' excluded by filter: " + filter.asString() + "\n");
            getLog().info(sb.toString());
    	}

        public void runningWithAnnotatedEmbedderRunner(String className) {
            getLog().info("Running with AnnotatedEmbedderRunner '" + className + "'");
        }

        public void annotatedInstanceNotOfType(Object annotatedInstance, Class<?> type) {
            getLog().warn("Annotated instance " + annotatedInstance + " not of type " + type);
        }

        public void generatingReportsView(File outputDirectory, List<String> formats, Properties viewProperties) {
            getLog().info(
                    "Generating reports view to '" + outputDirectory + "' using formats '" + formats + "'"
                            + " and view properties '" + viewProperties + "'");
        }

        public void reportsViewGenerationFailed(File outputDirectory, List<String> formats, Properties viewProperties,
                Throwable cause) {
            String message = "Failed to generate reports view to '" + outputDirectory + "' using formats '" + formats
                    + "'" + " and view properties '" + viewProperties + "'";
            getLog().warn(message, cause);
        }

        public void reportsViewGenerated(ReportsCount count) {
            getLog().info(
                    "Reports view generated with " + count.getStories() + " stories (of which "
                            + count.getStoriesPending() + " pending) containing " + count.getScenarios()
                            + " scenarios (of which " + count.getScenariosPending() + " pending)");
            if (count.getStoriesNotAllowed() > 0 || count.getScenariosNotAllowed() > 0) {
                getLog().info(
                        "Meta filters excluded " + count.getStoriesNotAllowed() + " stories and  "
                                + count.getScenariosNotAllowed() + " scenarios");
            }
        }

        public void reportsViewFailures(ReportsCount count) {
            getLog().warn("Failures in reports view: " + count.getScenariosFailed() + " scenarios failed");
        }

        public void reportsViewNotGenerated() {
            getLog().info("Reports view not generated");
        }

        public void mappingStory(String storyPath, List<String> metaFilters) {
            getLog().info("Mapping story " + storyPath + " with meta filters " + metaFilters);
        }

        public void generatingMapsView(File outputDirectory, StoryMaps storyMaps, Properties viewProperties) {
            getLog().info(
                    "Generating maps view to '" + outputDirectory + "' using story maps '" + storyMaps + "'"
                            + " and view properties '" + viewProperties + "'");
        }

        public void mapsViewGenerationFailed(File outputDirectory, StoryMaps storyMaps, Properties viewProperties,
                Throwable cause) {
            getLog().warn(
                    "Failed to generate maps view to '" + outputDirectory + "' using story maps '" + storyMaps + "'"
                            + " and view properties '" + viewProperties + "'", cause);
        }

        public void generatingNavigatorView(File outputDirectory, Properties viewProperties) {
            getLog().info(
                    "Generating navigator view to '" + outputDirectory + "' using view properties '" + viewProperties
                            + "'");
        }

        public void navigatorViewGenerationFailed(File outputDirectory, Properties viewProperties, Throwable cause) {
            getLog().warn(
                    "Failed to generate navigator view to '" + outputDirectory + "' using view properties '"
                            + viewProperties + "'", cause);
        }

        public void navigatorViewNotGenerated() {
            getLog().warn(
                    "Navigator view not generated, as the CrossReference has not been declared in the StoryReporterBuilder");
        }

        public void processingSystemProperties(Properties properties) {
            getLog().info("Processing system properties " + properties);
        }

        public void systemPropertySet(String name, String value) {
            getLog().info("System property '" + name + "' set to '" + value + "'");
        }

        public void storyTimeout(Story story, StoryDuration storyDuration) {
            getLog().warn(
                    "Story " + story.getPath() + " duration of " + storyDuration.getDurationInSecs()
                            + " seconds has exceeded timeout of " + storyDuration.getTimeoutInSecs() + " seconds");
        }

        public void usingThreads(int threads) {
            getLog().info("Using " + threads + " threads");
        }

        public void usingExecutorService(ExecutorService executorService) {
            getLog().info("Using executor service " + executorService);
        }

        public void usingControls(EmbedderControls embedderControls) {
            getLog().info("Using controls " + embedderControls);
        }

        public void invalidTimeoutFormat(String path) {
        	getLog().warn("Failed to set specific story timeout for story " + path + " because 'storyTimeoutInSecsByPath' has incorrect format");
        	getLog().warn("'storyTimeoutInSecsByPath' must be a CSV of regex expressions matching story paths. E.g. \"*/long/*.story:5000,*/short/*.story:200\"");
    	}

    	public void usingTimeout(String path, long timeout) {
        	getLog().info("Using timeout for story " + path + " of "+timeout+" secs.");
    	}

        @Override
        public String toString() {
            return this.getClass().getSimpleName();
        }

    }
}


text:
MailHog SMTP Protocol [![GoDoc](https://godoc.org/github.com/mailhog/smtp?status.svg)](https://godoc.org/github.com/mailhog/smtp) [![Build Status](https://travis-ci.org/mailhog/smtp.svg?branch=master)](https://travis-ci.org/mailhog/smtp)
=========

`github.com/mailhog/smtp` implements an SMTP server state machine.

It attempts to encapsulate as much of the SMTP protocol (plus its extensions) as possible
without compromising configurability or requiring specific backend implementations.

  * ESMTP server implementing [RFC5321](http://tools.ietf.org/html/rfc5321)
  * Support for:
    * AUTH [RFC4954](http://tools.ietf.org/html/rfc4954)
    * PIPELINING [RFC2920](http://tools.ietf.org/html/rfc2920)
    * STARTTLS [RFC3207](http://tools.ietf.org/html/rfc3207)

```go
proto := NewProtocol()
reply := proto.Start()
reply = proto.ProcessCommand("EHLO localhost")
// ...
```

See [MailHog-Server](https://github.com/mailhog/MailHog-Server) and [MailHog-MTA](https://github.com/mailhog/MailHog-MTA) for example implementations.

### Commands and replies

Interaction with the state machine is via:
* the `Parse` function
* the `ProcessCommand` and `ProcessData` functions

You can mix the use of all three functions as necessary.

#### Parse

`Parse` should be used on a raw text stream. It looks for an end of line (`\r\n`), and if found, processes a single command. Any unprocessed data is returned.

If any unprocessed data is returned, `Parse` should be
called again to process then next command.

```go
text := "EHLO localhost\r\nMAIL FROM:<test>\r\nDATA\r\nTest\r\n.\r\n"

var reply *smtp.Reply
for {
  text, reply = proto.Parse(text)
  if len(text) == 0 {
    break
  }
}
```

#### ProcessCommand and ProcessData

`ProcessCommand` should be used for an already parsed command (i.e., a complete
SMTP "line" excluding the line ending).

`ProcessData` should be used if the protocol is in `DATA` state.

```go
reply = proto.ProcessCommand("EHLO localhost")
reply = proto.ProcessCommand("MAIL FROM:<test>")
reply = proto.ProcessCommand("DATA")
reply = proto.ProcessData("Test\r\n.\r\n")
```

### Hooks

The state machine provides hooks to manipulate its behaviour.

See [![GoDoc](https://godoc.org/github.com/mailhog/smtp?status.svg)](https://godoc.org/github.com/mailhog/smtp) for more information.

| Hook                               | Description
| ---------------------------------- | -----------
| LogHandler                         | Called for every log message
| MessageReceivedHandler             | Called for each message received
| ValidateSenderHandler              | Called after MAIL FROM
| ValidateRecipientHandler           | Called after RCPT TO
| ValidateAuthenticationHandler      | Called after AUTH
| SMTPVerbFilter                     | Called for every SMTP command processed
| TLSHandler                         | Callback mashup called after STARTTLS
| GetAuthenticationMechanismsHandler | Called for each EHLO command

### Behaviour flags

The state machine also exports variables to control its behaviour:

See [![GoDoc](https://godoc.org/github.com/mailhog/smtp?status.svg)](https://godoc.org/github.com/mailhog/smtp) for more information.

| Variable               | Description
| ---------------------- | -----------
| RejectBrokenRCPTSyntax | Reject non-conforming RCPT syntax
| RejectBrokenMAILSyntax | Reject non-conforming MAIL syntax
| RequireTLS             | Require STARTTLS before other commands
| MaximumRecipients      | Maximum recipients per message
| MaximumLineLength      | Maximum length of SMTP line

### Licence

Copyright © 2014-2015, Ian Kent (http://iankent.uk)

Released under MIT license, see [LICENSE](LICENSE.md) for details.


text:
<?xml version="1.0" encoding="UTF-8"?>
<Alpha xmlns="http://www.example.net/alpha" xmlns:nsb="http://www.example.net/iso19139"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.example.net/alpha xsd/alpha.xsd">
    <uriProperty>urn:uuid:191985c0-098c-11e1-be50-0800200c9a66</uriProperty>
    <betaProp>
        <nsb:Beta>
            <nsb:strProperty>String value</nsb:strProperty>
            <nsb:gammaProp>
                <Gamma xmlns="http://www.example.net/gamma">
                    <intProperty>20111107</intProperty>
                    <boolProperty>FALSE</boolProperty>
                </Gamma>
            </nsb:gammaProp>
        </nsb:Beta>
    </betaProp>
</Alpha>


text:
namespace gfx {

class PlatformFontMac : public PlatformFont {
 public:
  PlatformFontMac();
  explicit PlatformFontMac(NativeFont native_font);
  PlatformFontMac(const std::string& font_name,
                  int font_size);

  PlatformFontMac(sk_sp<SkTypeface> typeface,
                  int font_size_pixels,
                  const base::Optional<FontRenderParams>& params);

  // Overridden from PlatformFont:
  Font DeriveFont(int size_delta,
                  int style,
                  Font::Weight weight) const override;
  int GetHeight() override;
  Font::Weight GetWeight() const override;
  int GetBaseline() override;
  int GetCapHeight() override;
  int GetExpectedTextWidth(int length) override;
  int GetStyle() const override;
  const std::string& GetFontName() const override;
  std::string GetActualFontName() const override;
  int GetFontSize() const override;
  const FontRenderParams& GetFontRenderParams() override;
  NativeFont GetNativeFont() const override;
  sk_sp<SkTypeface> GetNativeSkTypeface() const override;

 private:
  PlatformFontMac(const std::string& font_name,
                  int font_size,
                  int font_style,
                  Font::Weight font_weight);

  PlatformFontMac(NativeFont font,
                  const std::string& font_name,
                  int font_size,
                  int font_style,
                  Font::Weight font_weight);

  ~PlatformFontMac() override;

  // Calculates and caches the font metrics and inits |render_params_|.
  void CalculateMetricsAndInitRenderParams();

  // The NSFont instance for this object. If this object was constructed from an
  // NSFont instance, this holds that NSFont instance. Otherwise this NSFont
  // instance is constructed from the name, size, and style. If there is no
  // active font that matched those criteria a default font is used.
  base::scoped_nsobject<NSFont> native_font_;

  // The name/size/style trio that specify the font. Initialized in the
  // constructors.
  const std::string font_name_;  // Corresponds to -[NSFont fontFamily].
  const int font_size_;
  const int font_style_;
  const Font::Weight font_weight_;

  // Cached metrics, generated in CalculateMetrics().
  int height_;
  int ascent_;
  int cap_height_;

  // Cached average width, generated in GetExpectedTextWidth().
  float average_width_ = 0.0;

  // Details about how the font should be rendered.
  FontRenderParams render_params_;

  DISALLOW_COPY_AND_ASSIGN(PlatformFontMac);
};

}  // namespace gfx

#endif  // UI_GFX_PLATFORM_FONT_MAC_H_


text:
/*
 * 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 org.jdbi.v3.stringtemplate4;

import java.util.List;

import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.rule.H2DatabaseRule;
import org.jdbi.v3.sqlobject.SqlObjectPlugin;
import org.jdbi.v3.sqlobject.customizer.Define;
import org.jdbi.v3.sqlobject.statement.SqlQuery;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class TestConditionalStringTemplateLocator {

    @Rule
    public H2DatabaseRule dbRule = new H2DatabaseRule().withSomething().withPlugin(new SqlObjectPlugin());

    @Before
    public void setUp() {
        Handle handle = dbRule.getSharedHandle();
        handle.execute("insert into something (id, name) values (1, 'Martin')");
        handle.execute("insert into something (id, name) values (3, 'David')");
        handle.execute("insert into something (id, name) values (2, 'Joe')");
    }

    @Test
    public void testLocateFindAndSortByName() {
        List<Integer> ids = dbRule.getSharedHandle().attach(Dao.class).findLocated(true, "name");
        assertThat(ids).containsExactly(3, 2, 1);
    }

    @Test
    public void testLocateFindWithoutSorting() {
        List<Integer> ids = dbRule.getSharedHandle().attach(Dao.class).findLocated(false, "");
        assertThat(ids).containsExactly(1, 2, 3);
    }

    @Test
    public void testInlineFindAndSortByName() {
        List<Integer> ids = dbRule.getSharedHandle().attach(Dao.class).findInline(true, "name");
        assertThat(ids).containsExactly(3, 2, 1);
    }

    @Test
    public void testInlineFindWithoutSorting() {
        List<Integer> ids = dbRule.getSharedHandle().attach(Dao.class).findInline(false, "");
        assertThat(ids).containsExactly(1, 2, 3);
    }

    public interface Dao {
        @SqlQuery
        @UseStringTemplateSqlLocator
        List<Integer> findLocated(@Define("sort") boolean sort, @Define("sortBy") String sortBy);

        @SqlQuery("select id from something order by <if(sort)> <sortBy>, <endif> id")
        @UseStringTemplateEngine
        List<Integer> findInline(@Define("sort") boolean sort, @Define("sortBy") String sortBy);
    }
}


text:
  Léogeats est
       un village
       localisé dans le département de Gironde en Aquitaine. Elle totalisait 652 habitants en 2008.

Si vous pensez venir habiter à Léogeats, vous pourrez facilement trouver une maison à vendre.

À proximité de Léogeats sont positionnées géographiquement les villes de
Sauternes localisée à 3 km, 679 habitants,
Budos à 2 km, 676 habitants,
Balizac à 6 km, 376 habitants,
Noaillan située à 3 km, 1 350 habitants,
Fargues située à 6 km, 1 526 habitants,
Pujols-sur-Ciron localisée à 5 km, 713 habitants,
 entre autres. De plus, Léogeats est située à seulement dix km de Langon.

À Léogeats, la valorisation moyenne à la vente d'un appartement s'évalue à zero € du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 1 585 € du m². À la location la valeur moyenne se situe à 4,67 € du m² mensuel.

La ville offre quelques  aménagements, elle propose entre autres une boucle de randonnée.

Le nombre de logements, à Léogeats, se décomposait en 2011 en quatre appartements et 324 maisons soit
 un marché plutôt équilibré.


text:
'use strict';

angular.module('ubcCourseApp')
  .controller('ProfessorsCtrl', function($scope, DataService) {
    DataService.getPopularProfessors().success(function(courses) {
      $scope.display = _.map(courses, function(v) {
        v.title = v.name + ' — ' + v.departments.join(', ');
        v.id = v.name;
        return v;
      });
    });
  });


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
C. F. P. von Martius, Fl. bras. 15(2):279. 1876

#### Original name
null

### Remarks
null


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bot. Jb. 23: 287 (1896)

#### Original name
Hypoxylon moriforme var. moriforme Henn., 1896

### Remarks
null


text:
import React from 'react';
import { shallow } from 'enzyme';
import each from 'jest-each';

import createMarker from 'react-content-marker';

import pythonFormattingVariable from './pythonFormattingVariable';

describe('pythonFormattingVariable', () => {
    each([
        ['%%', '100%% correct'],
        ['%s', 'There were %s'],
        ['%(number)d', 'There were %(number)d cows'],
        ['%(cows.number)d', 'There were %(cows.number)d cows'],
        ['%(number of cows)d', 'There were %(number of cows)d cows'],
        ['%(number)03d', 'There were %(number)03d cows'],
        ['%(number)*d', 'There were %(number)*d cows'],
        ['%(number)3.1d', 'There were %(number)3.1d cows'],
        ['%(number)Ld', 'There were %(number)Ld cows'],
        ['%s', 'path/to/file_%s.png'],
        ['%s', 'path/to/%sfile.png'],
    ]).it('marks `%s` in `%s`', (mark, content) => {
        const Marker = createMarker([pythonFormattingVariable]);
        const wrapper = shallow(<Marker>{content}</Marker>);
        expect(wrapper.find('mark')).toHaveLength(1);
        expect(wrapper.find('mark').text()).toEqual(mark);
    });

    each([
        ['10 % complete'],
        // We used to match '%(number) 3d' here, but don't anymore to avoid
        // false positives.
        // See https://bugzilla.mozilla.org/show_bug.cgi?id=1251186
        ['There were %(number) 3d cows'],
    ]).it('does not mark anything in `%s`', (content) => {
        const Marker = createMarker([pythonFormattingVariable]);
        const wrapper = shallow(<Marker>{content}</Marker>);
        expect(wrapper.find('mark')).toHaveLength(0);
    });
});